test map




Adresses sur le site function initialize() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(37.4419, -122.1419), 13); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); // Create our "cafe" marker icon var cafeIcon = new GIcon(); cafeIcon.image = "http://www.fabricegueroux.com/docs/mappy.png"; // We don't need to specify iconSize and shadowSize unless we // wish to change the default dimensions of the image cafeIcon.iconAnchor = new GPoint(6, 20); // Set up our GMarkerOptions object markerOptions = { icon:cafeIcon }; // Add 10 markers to the map at random locations var bounds = map.getBounds(); var southWest = bounds.getSouthWest(); var northEast = bounds.getNorthEast(); var lngSpan = northEast.lng() - southWest.lng(); var latSpan = northEast.lat() - southWest.lat(); for (var i = 0; i < 10; i++) { var latlng = new GLatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random()); map.addOverlay(new GMarker(latlng, markerOptions)); } } }