Last active
March 19, 2016 03:44
-
-
Save heltonbiker/0dfd3dbd46030b9102a2 to your computer and use it in GitHub Desktop.
Google and Bing maps side-by-side
This file contains hidden or 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
<title>Virtual Earth Maps vs Google Maps</title> | |
<script charset="UTF-8" type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&mkt=en-us"></script> | |
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAARck2s7GwjD-5_5hS-TFv3hRR0nObJ3x1X4rMexYPx3kuaSeOkRR_VVH0-hifN8CcO99Sww7GbVOOYQ | |
" type="text/javascript"></script> | |
<script type='text/javascript'> | |
var gmap = false; | |
var vemap = false; | |
function init(){ | |
init_ve(); | |
init_google(); | |
} | |
function init_ve(){ | |
vemap = new VEMap("ve_div"); | |
vemap.SetDashboardSize(VEDashboardSize.Small); | |
vemap.LoadMap(new VELatLong(38.7167, -9.1333), 10); | |
vemap.SetMapStyle(VEMapStyle.Aerial); | |
vemap.AttachEvent("onchangeview", function(){ | |
var vecenter = vemap.GetCenter(); | |
var vezoom = vemap.GetZoomLevel(); | |
gmap.setCenter(new GLatLng(vecenter.Latitude,vecenter.Longitude), vezoom); | |
}); | |
} | |
function init_google() { | |
gmap = new GMap2(document.getElementById('google_div')); | |
gmap.setCenter(new GLatLng(38.7167, -9.1333), 10); | |
gmap.enableScrollWheelZoom(); | |
//gmap.enableContinuousZoom(); | |
gmap.setUIToDefault(); | |
gmap.setMapType(G_SATELLITE_MAP); | |
GEvent.addListener(gmap, 'moveend', function(){ | |
var gzoom = gmap.getZoom(); | |
var gcenter = gmap.getCenter(); | |
vemap.SetCenterAndZoom(new VELatLong(gcenter.lat(),gcenter.lng()),gzoom) | |
}); | |
} | |
</script> | |
</head> | |
<body onload='init();'> | |
<div id="ve_div" style='position:absolute;width:49%; height:500px; float:left'></div> | |
<div id="google_div" style='width:49%; height:500px; float:right'></div> | |
</body> | |
</html> | |
<!-- Hosting24 Analytics Code --> | |
<script type="text/javascript" src="http://stats.hosting24.com/count.php"></script> | |
<!-- End Of Analytics Code --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment