sebacruz
7/15/2010 - 3:53 PM

gistfile1.txt

<div id="the-map"></div>

<script type="text/javascript" charset="utf-8">
	google.load("maps", "2.x");
	
	var map = new GMap2(document.getElementById('the-map'));
	var icon = new GIcon(G_DEFAULT_ICON);
	var center = new GLatLng(0, 0);
	var bounds = new GLatLngBounds();
	var points = [
		new GLatLng(-34.57488888607004, -58.41701030731201), // Plaza intendente Seeber
		new GLatLng(-34.572450676145266, -58.41585159301758), // Rosedal 1
		new GLatLng(-34.57110786333385, -58.41902732849121), // Rosedal 2
		new GLatLng(-34.56965901466167, -58.41186046600342), // Planetario
		new GLatLng(-34.55474500754979, -58.43434810638428), // Bosques de palermo
	];

	icon.image = 'http://mandaleunmensajeatuex.com/assets/img/pointer-small.png';
	icon.iconSize = new GSize(30, 30);
	icon.shadow = '';
	icon.iconAnchor = new GPoint(15, 15);
	var markerOptions = { icon: icon };
	
	map.setCenter(center, 10);
	for (var i = 0; i < points.length; i++) {
		var marker = new GMarker(points[i], markerOptions);
		bounds.extend(points[i]);
		map.addOverlay(marker);
	}

	var zoom = map.getBoundsZoomLevel(bounds);
	map.setZoom(zoom);

	var lat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) / 2;
	var lng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) / 2;
	map.setCenter(new GLatLng(lat, lng));
</script>