jonase

Map: Geometry cannot be converted

Discussion created by jonase on Jan 24, 2013
Latest reply on Mar 5, 2017 by TimSparq
When using WMTSLayer in v3.3 I can't set the initial extent. Using the "center" option gives the same result.

I am getting this really weird log entry in the console:

[HTML]Map: Geometry (wkid: 4326) cannot be converted to spatial reference of the map (wkid: 4326)[/HTML]

Here is my code:

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);
});


I guess this must be a bug. The problem is not present in v2.8, which I am currently updating from.

Outcomes