Snippi
A super awesome snippet tool.
- 1.
//Google maps api
- 2.
//-----------------------------------------------
- 3.
function initialize() {
- 4.
- 5.
var point1 = new google.maps.LatLng(40.416691,-3.700345); //change lat lng to 1st point to map
- 6.
- 7.
var point2 = new google.maps.LatLng(35.416691,-4.700345); //change lat lng to 2nd point to map
- 8.
- 9.
var myMapOptions1 = {
- 10.
scrollwheel:true,
- 11.
zoom: 10, // change zoom level
- 12.
center: point1,
- 13.
mapTypeControl: true,
- 14.
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
- 15.
navigationControl: true,
- 16.
navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
- 17.
mapTypeId: google.maps.MapTypeId.ROADMAP
- 18.
};
- 19.
- 20.
var myMapOptions2 = {
- 21.
scrollwheel:true,
- 22.
zoom: 8, // change zoom level
- 23.
center: point2,
- 24.
mapTypeControl: true,
- 25.
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
- 26.
navigationControl: true,
- 27.
navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
- 28.
mapTypeId: google.maps.MapTypeId.ROADMAP
- 29.
};
- 30.
- 31.
var map1 = new google.maps.Map(document.getElementById('map1'),myMapOptions1);
- 32.
var map2 = new google.maps.Map(document.getElementById('map2'),myMapOptions2);
- 33.
- 34.
var image = new google.maps.MarkerImage(
- 35.
'./images/gmap/gmap_marker.png',
- 36.
new google.maps.Size(64.0, 64.0),
- 37.
new google.maps.Point(0, 0),
- 38.
new google.maps.Point(32.0, 32.0)
- 39.
);
- 40.
- 41.
var shadow = new google.maps.MarkerImage(
- 42.
'./images/gmap/shadow-marker.png',
- 43.
new google.maps.Size(97.0, 64.0),
- 44.
new google.maps.Point(0, 0),
- 45.
new google.maps.Point(32.0, 32.0)
- 46.
);
- 47.
- 48.
var shape = {
- 49.
coord: [165,8,166,9,166,10,166,11,166,12,166,13,166,14,166,15,166,16,166,17,166,18,166,19,166,20,166,21,166,22,166,23,166,24,166,25,166,26,166,27,166,28,166,29,166,30,166,31,166,32,166,33,166,34,166,35,166,36,166,37,166,38,166,39,166,40,165,41,95,42,95,43,94,44,93,45,93,46,92,47,91,48,90,49,90,50,89,51,86,51,85,50,84,49,84,48,83,47,82,46,82,45,81,44,80,43,80,42,7,41,6,40,6,39,6,38,6,37,6,36,6,35,6,34,6,33,6,32,6,31,6,30,6,29,6,28,6,27,6,26,6,25,6,24,6,23,6,22,6,21,6,20,6,19,6,18,6,17,6,16,6,15,6,14,6,13,6,12,6,11,6,10,6,9,7,8,165,8],
- 50.
type: 'poly'
- 51.
};
- 52.
- 53.
var marker1 = new google.maps.Marker({
- 54.
draggable: false,
- 55.
raiseOnDrag: false,
- 56.
icon: image,
- 57.
shadow: shadow,
- 58.
shape: shape,
- 59.
map: map1,
- 60.
position: point
- 61.
});
- 62.
- 63.
var marker2 = new google.maps.Marker({
- 64.
draggable: false,
- 65.
raiseOnDrag: false,
- 66.
icon: image,
- 67.
shadow: shadow,
- 68.
shape: shape,
- 69.
map: map2,
- 70.
position: point
- 71.
});
- 72.
- 73.
}