How can I use PHP to call the google Map api? And display the vertices expressed by longitude and latitude in the database on map?

Source: Internet
Author: User
How can I use PHP to call googlemapapi? And display the longitude and latitude points in the database on the map ?? As the question. It is best to write more details. thank you !, Where & nbsp; 23.1150614, 113.4082905 & nbsp; is the longitude and latitude of the position. & Lt ;! DOCTYPE & nbsp; html & nbsp; PUBLIC & nbsp; "-// how to use PHP to call the google map api? And display the longitude and latitude points in the database on the map ??
As the question. It is best to write more details. thank you!
------ Solution --------------------
Where 23.1150614 and 113.4082905 are the longitude and latitude of the position.







Google Map api test




Script

Function show_small_map ()
{
If (GBrowserIsCompatible ())
{
Var map = new GMap2 (document. getElementById ("res_map "));
Function createMarker (latlng)
{
Var marker = new GMarker (latlng );
Return marker;
}
Map. setCenter (new GLatLng (23.1150614, 113.4082905), 16 );
Var smc = new GSmallZoomControl3D;
Map. addControl (smc );
Var latlng = new GLatLng (23.1150614, 113.4082905 );
Map. addOverlay (createMarker (latlng ));
 
}
}
Show_small_map ();
Script




This key must be applied to Google
Key = ABQIAAAAHDyarwhqc8qoi6Hi4Fw2ABS7hG4ulivpH-Zy5ZAv91XflKVwfhRT3BrS_8CE9kMWp7UXsEngXSYF3A

Key not required for local testing
------ Solution --------------------
Reference:
Reference: top-level ~~~
Now we can add an identifier to the map. The question is, how can we add all corresponding points in the database? The value in the database cannot be referenced in the script !!!
PHP code? 123456789101112131415161718192021222324252627282930313233343536373839404142434445464 ......



Read the database to understand the basics of dynamic language
------ Solution --------------------
In fact, the best way is to read data from the database, write it into an external KML file, and load it with JS.
This is not clear in just a few words, code or something. it is best to study it on your own. The key is to really understand it.
Reference https://developers.google.com/maps/documentation/javascript/layers
------ Solution --------------------
Demo: http://gmaps-samples.googlecode.com/svn/trunk/ggeoxml/ggeoxml_loader.html
Kml: http://kml.lover.googlepages.com/my-vacation-photos.kml

Study the source code yourself.

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.