How to use WMTS from Swisstopo with ArcGISDynamicMapServiceLayer?

4228
0
02-11-2015 05:24 AM
UrsRichard
New Contributor II

I'd like to use a ArcGISDynamicMapServiceLayer and a WMTS_layer from Swisstopo (http://wmts.geo.admin.ch). When I'm loading the  ArcGISDynamicMapServiceLayer first the WMTS Layer will not be loaded. I think there is something about the different LOD's. How can this be solved?

var map;

  require(["esri/map", "esri/layers/WMTSLayer", "dojo/domReady!"], function(Map, WMTSLayer) {

  var extent = new esri.geometry.Extent(595171.7678435356, 200875.0317500635, 702328.2321564644, 294124.9682499365, new esri.SpatialReference({

  "wkid": 21781

  }));

  map = new Map("map", {

  //basemap: "topo",

  //center: [7.537513, 47.208331], // longitude, latitude

  // zoom: 13

  extent: extent

  });

  esri.config.defaults.io.proxyUrl = "../proxy/PHP/proxy.php";

  // esriConfig.defaults.io.alwaysUseProxy = false;

  var layerinfo = new esri.layers.WMTSLayerInfo({

  identifier: 'ch.swisstopo.pixelkarte-grau'

  });

  var options = {

  id: 'swisstopo',

  layerInfo: layerinfo

  };

  var wmts = new WMTSLayer("http://wmts.geo.admin.ch", options);

  var luftbild = new esri.layers.ArcGISTiledMapServiceLayer("https://quality.ag.ch/geoportal/rest/services/base_ortho2013_full/MapServer", {

  id: 'luftbild'

  });

  var giselan = new esri.layers.ArcGISDynamicMapServiceLayer("https://www.ag.ch/geoportal/rest/services/lwag_giselan_app/MapServer", {

  id: 'giselan'

  });

  map.on("load", function(map){

  var i = 10;

  });

  map.addLayer(luftbild);

  map.addLayer(wmts);

  // map.addLayer(giselan);

  });

0 Kudos
0 Replies