git-svn-id: http://svn.openlayers.org/trunk/openlayers@11158 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
67 lines
2.3 KiB
HTML
67 lines
2.3 KiB
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
|
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
<title>OpenLayers Virtual Earth Example</title>
|
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
|
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
<script src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'></script>
|
|
|
|
<script src="../lib/OpenLayers.js"></script>
|
|
<script type="text/javascript">
|
|
|
|
var map, velayer, layer;
|
|
|
|
function init(){
|
|
map = new OpenLayers.Map('map', {
|
|
controls: [new OpenLayers.Control.Navigation()],
|
|
panMethod: OpenLayers.Easing.Linear.easeOut,
|
|
panDuration: 10
|
|
});
|
|
|
|
velayer = new OpenLayers.Layer.VirtualEarth("VE", {
|
|
minZoomLevel: 2,
|
|
maxZoomLevel: 6,
|
|
type: VEMapStyle.Road
|
|
});
|
|
map.addLayer(velayer);
|
|
|
|
map.setCenter(new OpenLayers.LonLat(25, 25), 0);
|
|
|
|
map.addControl( new OpenLayers.Control.PanZoomBar() );
|
|
|
|
markers = new OpenLayers.Layer.Markers("markers");
|
|
map.addLayer(markers);
|
|
|
|
for(var i=0;i<100;i++){
|
|
var lat= Math.floor(Math.random()*50);
|
|
var lon= Math.floor(Math.random()*50);
|
|
var lonLat=new OpenLayers.LonLat(lon,lat);
|
|
var marker=new OpenLayers.Marker(lonLat);
|
|
markers.addMarker(marker);
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
<body onload="init()">
|
|
<h1 id="title">Virtual Earth Example</h1>
|
|
|
|
<div id="tags">
|
|
panning, virtual earth, panzoom, panmethod, panduration
|
|
</div>
|
|
|
|
<p id="shortdesc">
|
|
When using the PanZoom buttons with VirtualEarth, some 'drift' is
|
|
possible in markers. This page demonstrates how to use the
|
|
panMethod and panDuration properties to change the OpenLayers
|
|
settings to match VirtualEarth.
|
|
</p>
|
|
|
|
<div id="map" class="smallmap"></div>
|
|
</body>
|
|
</html>
|
|
|
|
|