I am creating a web page which shows the Google map using JavaScript. How can I put an image on that map as a icon. Here is what I have:
<script language="javascript">
var lat=1067;
var lon=-110;
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(lat, lon), 13);
}
}
function map(position) {
lat = position.coords.latitude;
lon = position.coords.longitude;
load();
}
function get_location() {
navigator.geolocation.getCurrentPosition(map);
}
</script>
</head>
<body onload="load()" onunload="GUnload()">
<input type ="Button" size = "50" onclick = "get_location();">Search</input>
<div id="map" style="width: 1200px; height: 600px"></div>
Icons in Google Maps are part of the “Overlay” section in the documentation. Here is a link to the relevant portion of the documents.
In short: