Unlike the controls on a map, overlay on a map is a DOM element that is bound to a coordinate of a longitude and latitude and can be moved along with the scaling and dragging of the map. The gmarker, gpolyline, and ginfowindow defined in the map API document belong to the overlay layer. The following describes how to use gmarker. Others are similar. For details, refer to the Google map API documentation.
First look at the followingCode(For more information, seeMyapp2.htmlAndJS/GMAP. js)
VaR marker = new gmarker (rpoint );
Map. addoverlay (Marker );
Marker. openinfowindowhtml ("Welcome to view" + STR + "map ");
A custom gmarker object is defined and initialized. For the implementation method of this class gmarker, refer to the Google map API documentation.
In addition, in order to implement the overlay layer, a special example of string processing is provided, that isMyapp1.html. You can run the command to view the effect.