i want to put my marker pin for this code:
var map = new GMap2(document.getElementById("map-canvas"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(<?=$lat;?>,<?=$lng;?>), 6);
var point = new GLatLng(<?=$lat;?>,<?=$lng;?>);
var marker = createMarker(point,'Welcome:<b></b><br>Second Info Window with an image<br><img src="http://localhost/gps/user_photo/" width=80 height=80>')
map.addOverlay(marker);
function createMarker(point,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
how can i do that?????
The Google Maps V3 API (Make sure you use only that - you seem to use the V2 API!) has a good documentation - make sure you bookmark this, you'll need it.
There are lots of JavaScript samples. Here is an example for building a custom marker.
Also check out the Demo Gallery for advanced applications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With