How to call a map in 51ditu through an API

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.