Created
March 11, 2013 19:31
-
-
Save fredoust/5136960 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<script type="text/javascript"> | |
var map | |
var zoomMap | |
var mapType | |
var markersArray = []; | |
var infosArray = []; | |
function initialize() { | |
zoomMap = 11 | |
mapType = google.maps.MapTypeId.ROADMAP | |
var centre = new google.maps.LatLng(48, 2); | |
var myOptions = { | |
zoom:zoomMap, | |
disableDefaultUI: true, | |
mapTypeId: mapType, | |
center: centre | |
} | |
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); | |
} | |
function changeMapType(){ | |
if(mapType == google.maps.MapTypeId.ROADMAP) | |
{ | |
mapType = google.maps.MapTypeId.SATELLITE | |
map.setMapTypeId(mapType) | |
}else{ | |
mapType = google.maps.MapTypeId.ROADMAP | |
map.setMapTypeId(mapType) | |
} | |
} | |
function showAndroidToast(toast) { | |
AndroidFunction.showToast(toast); | |
} | |
function addMarker(latitude, longitude, id) | |
{ | |
var myLatlng = new google.maps.LatLng(latitude,longitude); | |
var img; | |
img="http://www.bradfieldhallfarm.co.uk/mappin.jpg" //"/images/map_pin.png"; | |
var marker = new google.maps.Marker({ | |
position: myLatlng, | |
map: map, | |
animation: google.maps.Animation.DROP, | |
icon:img | |
}); | |
markersArray.push(marker); | |
var myWindowOptions = { | |
content:'test' | |
}; | |
var myInfoWindow = new google.maps.InfoWindow(myWindowOptions); | |
google.maps.event.addListener(marker, 'click', function() { | |
//myInfoWindow.open(map,marker); | |
showAndroidToast("test!! "+id); | |
}); | |
} | |
function zoomOut(){ | |
zoomMap = zoomMap-1 | |
map.setZoom(zoomMap) | |
} | |
function zoomIn(){ | |
zoomMap = zoomMap+1 | |
map.setZoom(zoomMap) | |
} | |
function moveCenter(x,y){ | |
var darwin = new google.maps.LatLng(x, y); | |
map.setCenter(darwin); | |
} | |
</script> | |
</head> | |
<body onload="initialize()" leftmargin="0px" topmargin="0px" marginwidth="0px" marginheight="0px"> | |
<div id="map_canvas" style="width:100%; height:100%"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment