-
Notifications
You must be signed in to change notification settings - Fork 4
/
ol_test.html
85 lines (73 loc) · 2.73 KB
/
ol_test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers: Spherical Mercator</title>
<style type="text/css">
/* avoid pink tiles */
.olImageLoadError {
background-color: transparent !important;
}
body {
margin:0px;
}
.smallmap {
position:absolute;
width:100%;
height:100%;
}
</style>
<script src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'></script>
<script src="http://openlayers.org/api/OpenLayers.js"></script>
<script type="text/javascript">
// make map available for easy debugging
var map;
// increase reload attempts
OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
function init(){
var options = {
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
units: "m",
numZoomLevels: 18,
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
20037508, 20037508.34),
center: new OpenLayers.LonLat(4.90,52.35),
zoom: 9
};
map = new OpenLayers.Map('map', options);
// create Virtual Earth layers
var veroad = new OpenLayers.Layer.VirtualEarth(
"Virtual Earth Roads",
{'type': VEMapStyle.Road, 'sphericalMercator': true}
);
var veaer = new OpenLayers.Layer.VirtualEarth(
"Virtual Earth Aerial",
{'type': VEMapStyle.Aerial, 'sphericalMercator': true}
);
var vehyb = new OpenLayers.Layer.VirtualEarth(
"Virtual Earth Hybrid",
{'type': VEMapStyle.Hybrid, 'sphericalMercator': true}
);
// create OSM layer
var mapnik = new OpenLayers.Layer.OSM();
// create OAM layer
var binganalyze = new OpenLayers.Layer.XYZ(
"Bing Analyzer",
"http://lima.schaaltreinen.nl/mvexel/bingimageanalyzer/tile.php/1.0.0/binganalyzer/${z}/${x}/${y}.png",
{
sphericalMercator: true,
isBaseLayer: false
}
);
map.addLayers([veroad, veaer, vehyb, binganalyze, mapnik]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.Permalink());
map.addControl(new OpenLayers.Control.MousePosition());
if (!map.getCenter()) {map.zoomToMaxExtent()}
}
</script>
</head>
<body onload="init()">
<div id="map" class="smallmap"></div>
</body>
</html>