diff options
author | Dave Whiteland <dave@mysociety.org> | 2013-02-06 15:08:23 +0000 |
---|---|---|
committer | Dave Whiteland <dave@mysociety.org> | 2013-02-06 15:08:23 +0000 |
commit | 0f24a44cd6e8b056db482cb91c85768b6d1e7d1d (patch) | |
tree | 09a90f38574ee62754f3c8ac077152ed99a38296 /web/js/map-wmts-zurich.js | |
parent | c061769ba72f420e2f2c6064fa526648e57339f1 (diff) | |
parent | 5b2e18389734751165d2eeb21a3b3f2e8d2e8755 (diff) |
Merge remote branch 'origin/master' into oxfordshire-header
Diffstat (limited to 'web/js/map-wmts-zurich.js')
-rw-r--r-- | web/js/map-wmts-zurich.js | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/web/js/map-wmts-zurich.js b/web/js/map-wmts-zurich.js index 8ecca50a1..682c62f39 100644 --- a/web/js/map-wmts-zurich.js +++ b/web/js/map-wmts-zurich.js @@ -2,16 +2,22 @@ * Maps for FMZ using Zurich council's WMTS tile server */ +$(function(){ + $('#map_layer_toggle').toggle(function(){ + $(this).text('Luftbild'); + fixmystreet.map.setBaseLayer(fixmystreet.map.layers[1]); + }, function(){ + $(this).text('Stadtplan'); + fixmystreet.map.setBaseLayer(fixmystreet.map.layers[0]); + }); +}); + /* * set_map_config() is called on dom ready in map-OpenLayers.js * to setup the way the map should operate. */ function set_map_config(perm) { // This stuff is copied from js/map-bing-ol.js - var permalink_id; - if ($('#map_permalink').length) { - permalink_id = 'map_permalink'; - } var nav_opts = { zoomWheelEnabled: false }; if (fixmystreet.page == 'around' && $('html').hasClass('mobile')) { @@ -22,10 +28,11 @@ fixmystreet.controls = [ new OpenLayers.Control.Attribution(), new OpenLayers.Control.ArgParser(), - fixmystreet.nav_control, - new OpenLayers.Control.Permalink(permalink_id), - new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) + fixmystreet.nav_control ]; + if ( fixmystreet.page != 'report' || !$('html').hasClass('mobile') ) { + fixmystreet.controls.push( new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ); + } fixmystreet.map_type = OpenLayers.Layer.WMTS; @@ -33,22 +40,22 @@ OpenLayers.DOTS_PER_INCH = 96; fixmystreet.map_options = { - projection: new OpenLayers.Projection("EPSG:21781"), maxExtent: new OpenLayers.Bounds(676000, 241000, 690000, 255000), units: 'm', - scales: [ '250000', '125000', '64000', '32000', '16000', '8000', '4000', '2000', '1000', '500'] + scales: [ '64000', '32000', '16000', '8000', '4000', '2000', '1000', '500' ] }; - fixmystreet.layer_options = { - name: "Luftbild", - layer: "Luftbild", + var layer_options = { + projection: new OpenLayers.Projection("EPSG:21781"), + name: "Hybrid", + layer: "Hybrid", matrixSet: "nativeTileMatrixSet", requestEncoding: "REST", - url: "http://www.wmts.stadt-zuerich.ch/Luftbild/MapServer/WMTS/tile/", + url: "http://www.wmts.stadt-zuerich.ch/Hybrid/MapServer/WMTS/tile/", style: "default", matrixIds: [ - { identifier: "0", matrixHeight: 2, matrixWidth: 2, scaleDenominator: 250000, supportedCRS: "urn:ogc:def:crs:EPSG::21781", tileHeight: 256, tileWidth: 256, topLeftCorner: { lat: 30814423, lon: -29386322 } }, - { identifier: "1", matrixHeight: 3, matrixWidth: 3, scaleDenominator: 125000, supportedCRS: "urn:ogc:def:crs:EPSG::21781", tileHeight: 256, tileWidth: 256, topLeftCorner: { lat: 30814423, lon: -29386322 } }, + //{ identifier: "0", matrixHeight: 2, matrixWidth: 2, scaleDenominator: 250000, supportedCRS: "urn:ogc:def:crs:EPSG::21781", tileHeight: 256, tileWidth: 256, topLeftCorner: { lat: 30814423, lon: -29386322 } }, + //{ identifier: "1", matrixHeight: 3, matrixWidth: 3, scaleDenominator: 125000, supportedCRS: "urn:ogc:def:crs:EPSG::21781", tileHeight: 256, tileWidth: 256, topLeftCorner: { lat: 30814423, lon: -29386322 } }, { identifier: "2", matrixHeight: 4, matrixWidth: 5, scaleDenominator: 64000, supportedCRS: "urn:ogc:def:crs:EPSG::21781", tileHeight: 256, tileWidth: 256, topLeftCorner: { lat: 30814423, lon: -29386322 } }, { identifier: "3", matrixHeight: 7, matrixWidth: 8, scaleDenominator: 32000, supportedCRS: "urn:ogc:def:crs:EPSG::21781", tileHeight: 256, tileWidth: 256, topLeftCorner: { lat: 30814423, lon: -29386322 } }, { identifier: "4", matrixHeight: 14, matrixWidth: 14, scaleDenominator: 16000, supportedCRS: "urn:ogc:def:crs:EPSG::21781", tileHeight: 256, tileWidth: 256, topLeftCorner: { lat: 30814423, lon: -29386322 } }, @@ -59,10 +66,19 @@ { identifier: "9", matrixHeight: 415, matrixWidth: 414, scaleDenominator: 500, supportedCRS: "urn:ogc:def:crs:EPSG::21781", tileHeight: 256, tileWidth: 256, topLeftCorner: { lat: 30814423, lon: -29386322 } } ] }; + fixmystreet.layer_options = [ + layer_options, OpenLayers.Util.applyDefaults({ + name: "Stadtplan", + layer: "Stadtplan", + url: "http://www.wmts.stadt-zuerich.ch/Stadtplan/MapServer/WMTS/tile/" + }, layer_options) + ]; // Give main code a new bbox_strategy that translates between // lat/lon and our swiss coordinates fixmystreet.bbox_strategy = new OpenLayers.Strategy.ZurichBBOX({ratio: 1}); + + fixmystreet.area_format = { fillColor: 'none', strokeWidth: 4, strokeColor: 'black' }; } OpenLayers.Strategy.ZurichBBOX = OpenLayers.Class(OpenLayers.Strategy.BBOX, { |