Google Maps API map application example sharing, mapsapi
Effect (tested in new Firefox version ):
Code:
<! DOCTYPE>
<Html>
<Head>
<Meta http-equiv = "content-type" content = "text/html; charset = UTF-8">
<Title> Google Map </title>
<Script type = "text/javascript" src = "http://maps.google.com/maps/api/js? Sensor = false "> </script>
<Script type = "text/javascript">
Function init ()
{
// Obtain the current location
Navigator. geolocation. getCurrentPosition (function (position)
{
Var coords = position. coords;
// Set the map parameters and set the longitude and latitude of the current position to the center point
Var latlng = new google. maps. LatLng (coords. latitude, coords. longpolling );
Var myOptions =
{
// Magnification
Zoom: 14,
// Mark coordinates
Center: latlng,
// Map type
MapTypeId: google. maps. MapTypeId. ROADMAP
};
Var map1;
// Display the map
Map1 = new google. maps. Map (document. getElementById ('map'), myOptions );
// Create a tag
Var marker = new google. maps. Marker (
{
Position: latlng,
Map: map1
});
// Set the annotation window and attach the annotation text
Var infowindow = new google. maps. InfoWindow (
{
Content: "current location"
});
// Open the annotation window
Infowindow. open (map1, marker );
});
}
</Script>
</Head>
<Body onload = "init ()">
<Div id = "map"> </div>
</Body>
</Html>
Google Maps JavaScript API v3 (reference): https://developers.google.com/maps/documentation/javascript/basics
Baidu map API reference documents: http://developer.baidu.com/map/jsmobile.htm
The best example of some php applications on Google Maps API
This is a query area shown by GOOGLE. <iframe width = "300" height = "180" frameborder = "0" scrolling = "no" marginheight = "0" marginwidth = "0 "src =" canonical "> </iframe> if you go to GOOGLE map to display the location you are querying, the code is OK, or you can change the code above.
Android uses google maps api
You use the MapView export class for your own map application. If you want to have bubbles, you also need to use Overlay related items in Google apis to draw layers, google's built-in Maps are implemented.