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; 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.