Create an icon
Map.js
$ (document). Ready (function ()
{
if (gbrowseriscompatible ()) {
var map = new GMap2 (document.getElementById ("map"));
Map.addcontrol (New Gsmallmapcontrol ());
Map.addcontrol (New Gmaptypecontrol ());
Map.setcenter (New Glatlng (36.94,106.08), 4);
Create a small icon
var icon = new Gicon ();
Icon Picture
Icon.image = "Png/mm_20_red.png";
Icon Shadow picture
Icon.shadow = "Png/mm_20_shadow.png";
Icon size
Icon.iconsize = new Gsize (12, 20);
Shadow Size
Icon.shadowsize = new Gsize (22, 20);
Icon Anchor Point
Icon.iconanchor = new Gpoint (6, 20);
Information Floating window Anchor point
Icon.infowindowanchor = new Gpoint (5, 1);
Add 10 tags randomly
var bounds = Map.getbounds ();
var southwest = Bounds.getsouthwest ();
var northeast = Bounds.getnortheast ();
var Lngspan = northeast.lng ()-southwest.lng ();
var Latspan = Northeast.lat ()-Southwest.lat ();
for (var i = 0; i < i++) {
var point = new Glatlng (Southwest.lat () + Latspan * Math.random (),
SOUTHWEST.LNG () + Lngspan * math.random ());
Map.addoverlay (Point, Icon) (new Gmarker);
}
$ (window). Unload (function () {
$('.'). Unbind ();
Gunload ();
});
}else
{
Alert (' You are using a browser that does not support Google map! ');
}
});