Map: Geometry (wkid: 102658) cannot be converted to spatial reference of the map (wki

1117
3
05-13-2014 07:24 AM
JoseSanchez
Occasional Contributor III
Hi all

when I try to add a grpahic to my map I get the following error message:

function showResults(results) {
    //symbology for graphics
    var markerSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 10, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 1), new dojo.Color([0, 255, 0, 0.25]));
    var lineSymbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASH, new dojo.Color([255, 0, 0]), 1);
    var polygonSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_NONE, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([255, 0, 0]), 2), new dojo.Color([255, 255, 0, 0.25]));

    //find results return an array of findResult.

    if (map.graphics) {
        map.graphics.clear();
    }
//    var dataForGrid = [];
    var g;
    //Build an array of attribute information and add each found graphic to the map
    dojo.forEach(results, function (result) {
        var graphic = result.feature;
        // dataForGrid.push([result.layerName, result.foundFieldName, result.value]);
        switch (graphic.geometry.type) {
            case "point":
                graphic.setSymbol(markerSymbol);
                break;
            case "polyline":
                graphic.setSymbol(lineSymbol);
                break;
            case "polygon":
                graphic.setSymbol(polygonSymbol);
                break;
        }

        g = graphic;

       

        var zoom2 = 0.08;
        map.centerAndZoom(g.geometry, zoom2);


        map.graphics.add(g);

    });


}

0 Kudos
3 Replies
MelitaKennedy
Esri Notable Contributor
I don't use this API. However, WKID ESRI:102658 was replaced with EPSG:2236 a while ago. What happens if you try that one instead?

(Either number should work, so there may be another issue)

Melita
0 Kudos
JoseSanchez
Occasional Contributor III
Hi Melita,

With ArcGIS Online I created a webmap and downloaded the Basic Viewer source code. I am calling the webmap  from my source code. The web map has only a layer from a  local map service created in ArcGIS Server 10.2 in a local server.


This is the local map service spatial reference found typing:
http://..../arcgis/rest/services/Stations/MapServer


Spatial Reference: 102658  (2236)

Spatial Reference: 102658  (2236)


Single Fused Map Cache: false

Initial Extent:

    XMin: 712960.4940819422
    YMin: 367612.53819423367
    XMax: 1019065.4144157815
    YMax: 594470.2958194235
    Spatial Reference: 102658  (2236)

Full Extent:

    XMin: 797538.3331276643
    YMin: 379608.7253847002
    XMax: 960101.7590398886
    YMax: 603134.0456329477
    Spatial Reference: 102658  (2236)

Units: esriFeet

0 Kudos