forked from mapproxy/mapproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
43 lines (33 loc) · 1.26 KB
/
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
<html>
<body onload="init();">
<div style="width:500px; height:300px; background-color: #ddd; " id='map'>
</div>
<script src="http://openlayers.org/api/OpenLayers.js"></script>
<script type="text/javascript">
var map;
function init(){
map = new OpenLayers.Map('map', {
projection: new OpenLayers.Projection("EPSG:900913")
});
var base_layer = new OpenLayers.Layer.OSM();
var overlay_layer = new OpenLayers.Layer.TMS(
'TMS street_layer',
'http://127.0.0.1:8080/tiles/',
{layername: 'street_layer_EPSG900913',
type: 'png', isBaseLayer: false}
);
// var overlay_layer = new OpenLayers.Layer.TMS('TMS street_layer', 'http://x.osm.omniscale.net/proxy/tiles/',
// {layername: 'osm_roads_EPSG900913', type: 'png',
// isBaseLayer: false
// });
var overlay_layer = new OpenLayers.Layer.OSM("OSM osm_layer",
"http://x.osm.omniscale.net/proxy/tiles/osm_roads_EPSG900913/${z}/${x}/${y}.png?origin=nw",
{isBaseLayer: false, tileOptions: {crossOriginKeyword: null}}
);
map.addLayer(base_layer);
map.addLayer(overlay_layer);
map.zoomToMaxExtent();
};
</script>
</body>
</html>