tag:blogger.com,1999:blog-179325926611299376.post4033344253986276717..comments2023-09-16T13:46:11.986+01:00Comments on Open Maps: Using Leaflet with a databaseChris Hillhttp://www.blogger.com/profile/02951528269028953589noreply@blogger.comBlogger32125tag:blogger.com,1999:blog-179325926611299376.post-80397392018260742162021-04-18T16:57:05.804+01:002021-04-18T16:57:05.804+01:00do you have a more modern version of this?do you have a more modern version of this?Anonymoushttps://www.blogger.com/profile/15279500253370683850noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-59676513320774971642017-02-02T15:31:13.269+00:002017-02-02T15:31:13.269+00:00I have no knowledge of code igniter. You are welco...I have no knowledge of code igniter. You are welcome to use the code here to try to work with any framework or library, but I can't help you.Chris Hillhttps://www.blogger.com/profile/02951528269028953589noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-87640654014519392592017-02-02T15:28:22.130+00:002017-02-02T15:28:22.130+00:00how can i convert this into code igniter sir?how can i convert this into code igniter sir?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-60394053696995222502017-01-28T20:53:01.425+00:002017-01-28T20:53:01.425+00:00I don't know what happened but after I clear t...I don't know what happened but after I clear the cookies of my browser, everything seems to work well now. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-17957307098597440552017-01-28T19:49:48.910+00:002017-01-28T19:49:48.910+00:00Then you are not using your code. Use a debug tool...Then you are not using your code. Use a debug tool to check what your code is really running. All the major browsers have debug, I especially like Firefox and Chrome.<br /><br />This code does still work, but Leaflet has changed a lot since I wrote this. Make sure you check the latest documentation too.Chris Hillhttps://www.blogger.com/profile/02951528269028953589noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-27726234808661065772017-01-28T19:45:29.584+00:002017-01-28T19:45:29.584+00:00I've already changed the code var start = new ...I've already changed the code var start = new L.LatLng(10.3157, 123.8854); but it still pointing to this location 53.7610,-0.3529. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-6289509057050838842017-01-28T19:38:03.201+00:002017-01-28T19:38:03.201+00:00The line var start = new L.LatLng .... sets the lo...The line var start = new L.LatLng .... sets the location You need to change the latitude and longitude to the place you want to centre on.Chris Hillhttps://www.blogger.com/profile/02951528269028953589noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-86847894150288888322016-09-30T10:54:38.579+01:002016-09-30T10:54:38.579+01:00Dear Anonymous,
The missing file cpntains my DB us...Dear Anonymous,<br />The missing file cpntains my DB user and password, that's why it's missing.<br /><br />I would take your critcism more seriously if it was not anonymous. Throwing harsh comments rather than asking questions is a great way to remain a beginner. If you have specific questions please ask and I'll try to answer them.<br />Chris Hillhttps://www.blogger.com/profile/02951528269028953589noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-20762646011103985232016-09-30T10:47:50.085+01:002016-09-30T10:47:50.085+01:00None of this worked for me due to missing files li...None of this worked for me due to missing files like the db.php.. missing variable includes like a variable $idb.. I assume this is aimed at experienced programmers.<br /><br />If you are new to coding like me and looking for complete examples, dont bother with it. <br /><br />Still can't figure out why guys dont provide the full code when they are showing examples.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-34596098828136638682016-04-20T09:11:35.579+01:002016-04-20T09:11:35.579+01:00Thank you very much for this article. Helps me a l...Thank you very much for this article. Helps me a lot with my first project. Having all the example code in github to try out with my data and server is priceless.Anonymoushttps://www.blogger.com/profile/12445522996768346794noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-6172477132740540032016-02-18T11:38:08.856+00:002016-02-18T11:38:08.856+00:00Hello Chris , congratulations on your script .
Min...Hello Chris , congratulations on your script .<br />Mine is not working . I do not understand why.<br /><br />I have a database with many records and it is impossible to load them all together .<br />I want to load and view only the markers in the map I see, Load the marker when I move the map .<br /><br />How can I do to load data from a mysql database ?<br /><br />it is important and I can not do it .<br /><br />THANK YOU<br />AntonioANTONIOnoreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-65963922050346269542016-02-11T23:37:47.412+00:002016-02-11T23:37:47.412+00:00How can I add data attibutes to the icons? I'm...How can I add data attibutes to the icons? I'm trying to have them like this:<br /><br /><br />data-toggle = 'modal';<br />data-target = '< ? php echo $someID; ?>';<br /><br />Thanks!HuitZiloPhttps://www.blogger.com/profile/06887910732284040580noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-25850571731185467772014-09-13T09:10:50.404+01:002014-09-13T09:10:50.404+01:00No way. I can't see any misspelled.
So sorry t...No way. I can't see any misspelled.<br />So sorry this is my first js project. Sure i'm missing something very basic.<br />Do you see something wrong?<br />javascript:<br />....function askForPlaques() {<br /> var data='bbox=' + map.getBounds().toBBoxString();<br /> $.ajax({<br /> url: 'ajax/ajxplaques.php',<br /> dataType: 'json',<br /> data: data,<br /> success: showPlaques<br /> });<br />}<br /><br />function showPlaques(ajxresponse) {<br /> lyrPlq.clearLayers();<br /> lyrPlq.addData(ajxresponse);<br />// map.spin(false);<br />}<br />.....<br /><br />ajax:<br />.....map.on('moveend', whenMapMoves);<br /> <br /> askForPlaques();<br />}<br /><br />function whenMapMoves(e) {<br /> askForPlaques();<br />}<br /><br />function askForPlaques() {<br /> var data='bbox=' + map.getBounds().toBBoxString();<br /> $.ajax({<br /> url: 'ajax/ajxplaques.php',<br /> dataType: 'json',<br /> data: data,<br /> success: showPlaques<br /> });<br />}<br /><br />function showPlaques(ajxresponse) {<br /> lyrPlq.clearLayers();<br /> lyrPlq.addData(ajxresponse);<br />// map.spin(false);<br />}<br /><br />Thanks.<br />Joanhttps://www.blogger.com/profile/16527031931582678603noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-33304811583239330212014-09-10T17:52:10.409+01:002014-09-10T17:52:10.409+01:00@Joan
That error is caused because the AJAX call i...@Joan<br />That error is caused because the AJAX call in your JavaScript did not include the bbox= parameter (or maybe it was mis-spelled).<br /><br />I <b>highly</b> recommend a javascript debugger such as FireBug in FireFox. That lets you see the AJAX calls that get made and the returned data or any errors.Chris Hillhttps://www.blogger.com/profile/02951528269028953589noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-11493705132247155192014-09-10T15:42:55.389+01:002014-09-10T15:42:55.389+01:00Hi Chris. Sorry for boring yo again. I can't s...Hi Chris. Sorry for boring yo again. I can't see where is the problem.<br />I get the map working fine without filtering the data table but when include "top, bottom, left, right" filter I get an error with "bbox" data:<br />{"resp":4,"dberror":0,"msg":"missing bounding box"}.<br />I can't understand because didn't touch nothing in example3.js.<br />Any Idea?<br />Can I ask the bounding box directly from ajxplaques? I guess not but can not imagine what happen. <br />Can I ask bbox whit the name of js variable "data"?<br />ThanksJoanhttps://www.blogger.com/profile/16527031931582678603noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-25698221392749671192014-09-09T12:19:15.961+01:002014-09-09T12:19:15.961+01:00Solved.
Working with he info in your reply me, I ...Solved. <br />Working with he info in your reply me, I see you place the array for coordinates like this: long[0], lat[1].<br />I just change the order and works.<br />Thanks for reply. It is very useful code.Joanhttps://www.blogger.com/profile/16527031931582678603noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-20961821859233849592014-09-08T13:17:19.729+01:002014-09-08T13:17:19.729+01:00@Joan Pescador:
The usual reason for markers appea...@Joan Pescador:<br />The usual reason for markers appearing in completely strange places is because the longitude & latitude are the wrong way round. <br /><br />If you get the geojson returned you can copy it into http://geojsonlint.com/ which will help you check your geojson, including the coordinate order.<br /><br />If your coordinates are not true lon & lat they can be transformed with proj4js in the browser http://trac.osgeo.org/proj4js/ but I would do that work in the server.<br /><br />HTH Chris Hillhttps://www.blogger.com/profile/02951528269028953589noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-17644463410484322252014-09-08T13:05:07.521+01:002014-09-08T13:05:07.521+01:00Do you know how to change the coordenates format i...Do you know how to change the coordenates format in your code? Thanks,Joanhttps://www.blogger.com/profile/16527031931582678603noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-20035323462843501542014-09-08T12:56:21.016+01:002014-09-08T12:56:21.016+01:00Very helpful code mate. Anyway, I'm getting un...Very helpful code mate. Anyway, I'm getting unexpectec problem placing well known coordenates in USA. It's appear in Antartida?? <br />My table is working fine in another map.<br />Maybe something about bbox? <br />Any Idea?<br />Thanks anyway.<br />JoanJoanhttps://www.blogger.com/profile/16527031931582678603noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-311289579184503322014-08-21T18:22:33.626+01:002014-08-21T18:22:33.626+01:00Copy all From Github to server, create DB, create ...Copy all From Github to server, create DB, create db.php with params : $dbname='name'<br />$dbuser='user'<br />$dbpass='pass'. But map is blankAnonymoushttps://www.blogger.com/profile/06235907793411455886noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-88228492628100401992014-07-04T17:47:34.711+01:002014-07-04T17:47:34.711+01:00I resolved a configuration error. PHP is working f...I resolved a configuration error. PHP is working fine now but data is still not displaying on map. Only other issue I see is a 404 on network request to get jquery-1.10.2.min.map<br /><br />Same issue when I tried on different server. Is this the updated source?: https://github.com/chillly/plaques<br /><br />I'll look into it further when I get time later.<br /><br />Thanks againNick Whitehttps://www.blogger.com/profile/03894931578668005762noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-31978962776886744502014-07-03T20:00:57.981+01:002014-07-03T20:00:57.981+01:00A 404 means the script cannot be found. Is the scr...A 404 means the script cannot be found. Is the script present in the directory called ajax in the directory that the example3.htm file is called from? Is PHP installed on your server? Chris Hillhttps://www.blogger.com/profile/02951528269028953589noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-23098498237376683072014-07-03T19:04:12.895+01:002014-07-03T19:04:12.895+01:00Thanks for this. It looks great.
I installed from...Thanks for this. It looks great.<br /><br />I installed from github and can successfully site. Examples run fine but example 3 cannot load points from php. Inspection shows bbox is calculating properly but it simply can't retrieve ../ajax/ajxplaques.php (404 not found). The file names and directories have not changed or moved. <br /><br />Any idea why the javascript can't locate the php file?Nick Whitehttps://www.blogger.com/profile/03894931578668005762noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-22312949049681104712014-06-12T13:10:33.327+01:002014-06-12T13:10:33.327+01:00The Github link has zip download as an option.The Github link has zip download as an option.Chris Hillhttps://www.blogger.com/profile/02951528269028953589noreply@blogger.comtag:blogger.com,1999:blog-179325926611299376.post-3657929672155906692014-06-12T12:52:28.955+01:002014-06-12T12:52:28.955+01:00what about .zip with sources? :)what about .zip with sources? :)Anonymousnoreply@blogger.com