Files
openlayers/examples/ve.html
crschmidt 7da6a3540e Merge the excellent documentation work done during foss4g into trunk. Many
thanks to all the contributors who helped put this together. 
I'm not exactly sure of what's going to happen with this, but for now,
at http://openlayers.org/dev/doc/examples.html you can see links to all the
examples *with descriptions*. Hooray!


git-svn-id: http://svn.openlayers.org/trunk/openlayers@5362 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-12-08 14:21:53 +00:00

76 lines
2.3 KiB
HTML

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Virtual Earth Example</title>
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<script src='http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js'></script>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 5;
var lat = 40;
var zoom = 15;
var map, velayer, layer;
function init(){
map = new OpenLayers.Map( 'map' ,
{controls:[new OpenLayers.Control.MouseDefaults()]});
velayer = new OpenLayers.Layer.VirtualEarth( "VE",
{ minZoomLevel: 4, maxZoomLevel: 6, 'type': VEMapStyle.Aerial});
map.addLayer(velayer);
var twms = new OpenLayers.Layer.WMS( "World Map",
"http://world.freemap.in/cgi-bin/mapserv?",
{ map: '/www/freemap.in/world/map/factbooktrans.map',
transparent:'true',
layers: 'factbook',
'format':'png'},
{'reproject': true});
map.addLayer(twms);
markers = new OpenLayers.Layer.Markers("markers");
map.addLayer(markers);
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
map.addControl( new OpenLayers.Control.LayerSwitcher() );
map.addControl( new OpenLayers.Control.PanZoomBar() );
}
function add() {
marker = new OpenLayers.Marker(new OpenLayers.LonLat(2, 41));
markers.addMarker(marker);
}
function remove() {
markers.removeMarker(marker);
}
</script>
</head>
<body onload="init()">
<h1 id="title">Virtual Earth Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrates the use of a Virtual Earth base layer.
</p>
<div id="map"></div>
<input type="button" onClick="javascript:add()"value="Add the marker from the map">
<input type="button" onClick="javascript:remove()" value="Remove the marker from the map">
<div id="docs">This example demonstrates the ability to add VirtualEarth and the and remove markers.</div>
</body>
</html>