यहाँ एक बहुत ही बुनियादी उदाहरण है:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps?file=api&v=2&"
type="text/javascript"></script>
</head>
<body>
<div id="map" style="width: 500px; height: 400px;"></div>
<script type="text/javascript">
var locations = [
['Bondi Beach', -33.890542, 151.274856],
['Coogee Beach', -33.923036, 151.259052],
['Cronulla Beach', -34.028249, 151.157507],
['Manly Beach', -33.800128, 151.282085],
['Maroubra Beach', -33.950198, 151.259302]
];
var map = new GMap2(document.getElementById('map'));
var i;
map.setCenter(new GLatLng(-33.92, 151.25), 10);
for (i = 0; i < locations.length; i++) {
map.addOverlay(
new GMarker(new GLatLng(locations[i][1], locations[i][2]))
);
}
</script>
</body>
</html>
स्क्रीनशॉट: Stackoverflow टॉमी को
स्रोत
2010-09-16 01:38:57
आपका स्वागत है। वैध प्रतिक्रिया प्राप्त करने के लिए, आपको हमें बहुत अधिक जानकारी देना होगा, और शायद अधिक विशिष्ट होने के लिए प्रश्न को संकीर्ण करना होगा। अच्छे प्रश्न पूछने के तरीके पर एक संदर्भित लेख यहां दिया गया है: http://www.catb.org/esr/faqs/smart-questions.html – Chadwick