Mapping markers
This page describes how to create a marker & mapping them.
If you want to a point on the map, you may put a marker.
Using a marker, you can put on the map anywhere and describe a point of location.
code
<script type='text/javascript'>
var mapCanvas;
function intialize() {
//Create a map
mapCanvas = new google.maps.Map(document.getElementById("map_canvas"));
mapCanvas.setCenter(new google.maps.LatLng(38.196424,-147.130884));
mapCanvas.setZoom(2);
mapCanvas.setMapTypeId(google.maps.MapTypeId.ROADMAP);
//marker1 : New York, USA
var marker1 = new google.maps.Marker();
marker1.setPosition(new google.maps.LatLng(40.714353, -74.005973));
marker1.setMap(mapCanvas);
//marker2 : Tokyo, Japan
var marker2 = new google.maps.Marker({
position : new google.maps.LatLng(35.678494,139.744205),
map: mapCanvas
});
}
google.maps.event.addDomListener(window, "load", intialize);
</script>
Description
|
Here is key point:
|
||
|
Adds just only three lines to code, you may show a marker on the map.



