-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
97 lines (85 loc) · 3.34 KB
/
index.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
#map {
width: 100%;
height: 99%;
border: 1px solid black;
}
body {
padding:0px;
margin:2px
}
#labs {
position:absolute;
bottom:15px;
left:7px;
font-size:smaller;
z-index: 5000;
}
</style>
<link rel="stylesheet" href="http://openlayers.org/en/v3.12.1/css/ol.css" type="text/css">
<script src="http://openlayers.org/en/v3.12.1/build/ol.js"></script>
<!--<script src="http://openlayers.org/api/OpenLayers.js"></script> -->
<script type="text/javascript">
<!--
var map, layer;
layer = new ol.layer.Tile({
source: new ol.source.XYZ({
url: 'MD/1937/{z}/{x}/{-y}.png'
})
});
function init(){
map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.XYZ({
url: 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
attributions: [new ol.Attribution({ html: ['© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://cartodb.com/attributions">CartoDB</a>'] })]
})
}),
layer
],
view: new ol.View({
center: ol.proj.transform([-76.616863, 39.303330], 'EPSG:4326', 'EPSG:900913'),
zoom: 11
})
});
layer.setOpacity(0.5);
}
// function init(){
// map = new OpenLayers.Map( 'map');
// // layer = new OpenLayers.Layer.WMS( "VMap0",
// // "tilecache.cgi?", {layers: 'basic', format: 'image/png' } );
// // map.addLayer(layer);
// layer = new OpenLayers.Layer.OSM("OpenCycleMap",
// ["http://a.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
// "http://b.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
// "http://c.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png"]);
// map.addLayer(layer);
// var tiles = new OpenLayers.Layer.XYZ("Local tiles", "MD/1937/${z}/${x}/${y}.png", {
// isBaseLayer: false,
// projection: new OpenLayers.Projection("EPSG:900913"),
// zoomOffset: 3,
// maxExtent: [-76.79196868374696,39.15385942143586,-76.44425270171035, 39.43975952121895],
// tileOrigin: new OpenLayers.LonLat(-76.79196868374696,39.15385942143586)
// });
// // var tiles = new OpenLayers.Layer.TMS("Local tiles", "MD/1937/tilemapresource.xml", {
// // layername: "basic",
// // type: "png",
// // projection: new OpenLayers.Projection("EPSG:900913"),
// // tileOrigin: new OpenLayers.LonLat(-76.79196868374696,39.15385942143586)
// // });
// map.addLayer(tiles);
// map.addControl(new OpenLayers.Control.Permalink());
// if (!map.getCenter()) map.zoomToMaxExtent();
// }
// -->
</script>
</head>
<body onload="init()">
<div id="map">
</div>
</body>
</html>