var map; require(["esri/map", "esri/layers/wmts", "dojo/parser", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!"], function (myMap, wmts, parser) { parser.parse(); esri.config.defaults.io.proxyUrl = "proxy/proxy.ashx"; map = new esri.Map("map", { extent: new esri.geometry.Extent(-166.27, -95.74, 166.67, 5.54, new esri.SpatialReference({ "wkid": 4326 })) }); var layerInfo = new esri.layers.WMTSLayerInfo({ identifier: "world", tileMatrixSet: "EPSG:4326", format: "gif" }); var options = { serviceMode: "KVP", layerInfo: layerInfo }; var wmtsLayer = new esri.layers.WMTSLayer("http://v2.suite.opengeo.org/geoserver/gwc/service/wmts",options); map.addLayer(wmtsLayer); });
new SpatialReference({wkid: "2056"})
new SpatialReference({wkid: 2056})
For anyone still having this issue (I was in 3.18), this appears to be the fix. It's not a "bug" per se, just that the wkid you pass to the SpatialReference constructor must be a number, not a string. If you are getting your wkid from a configuration file, consider using dojo/number.parse() to convert it to a number.
I happened upon the post below, which worked for me as a way to do this with a non-WMTS layer that was in a different projection: