Today I studied map tagging. In fact, it is to look at how to call the api provided by 51ditu and apply it in PHP. Today I studied map tagging. In fact, it is to look at how to call the api provided by 51ditu and apply it in PHP.
Its api description: http://api.51ditu.com/
Help document: http://api.51ditu.com/docs/index.html
The following is a simple demonstration. you can mark what you want from the background and read it from the foreground.
It is easier to copy and paste files from a website.
First. In http://api.51ditu.com/docs/ezmarkerapi.html
Here I have read the introduction of JS as mentioned above. you can set this city. in the above example, select from the drop-down list and read the actual application from the database.
Second. He put the read latitude and longitude in the text box. the actual use should be to save the data to the database in advance through ajax.
Function setMap (point, zoom)
{
Document. getElementById ("x"). value = point. getlongpolling ();
Document. getElementById ("y"). value = point. getLatitude ();
Document. getElementById ("z"). value = zoom;
// Add the code to save it to the database through ajax. if jquery is used
$. Get ('map. php', {x: point. getlongdistance (), y: point. getLatitude ()}, function (msg ){
Alert (msg );
});
// You only need to write the code inserted into the database in map. php.
} |
OK, you can store the location in the database. below is the reading
Third, use http://api.51ditu.com/docs/mapsapi.htmlhere for reading
How to add an information window based on latitude and longitude
Since it has been saved to the database, read it here.
For more usage, see the help file for this website based on specific requirements.