File: test.html

package info (click to toggle)
mapproxy 1.9.0-2~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 6,148 kB
  • sloc: python: 33,246; xml: 6,257; makefile: 194
file content (43 lines) | stat: -rw-r--r-- 1,295 bytes parent folder | download | duplicates (7)
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>