"Map: Geometry (wkid: GEOGCS["Longitude / Latitude (WGS 84)",DATUM["WGS 84",SPHEROID["WGS 84",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Decimal_Degree",0.0174532925199433]]) cannot be converted to spatial reference of the map (wkid: 4326)"
var extent = esri.graphicsExtent(result.featureSet.features); console.log(extent) map.setExtent(extent.expand(1.5, true);
Solved! Go to Solution.
require([ "esri/geometry/Extent", "esri/SpatialReference", ... ], function(Extent, SpatialReference, ... ) { var sr = new SpatialReference({"wkid": 4326}); var extent = new Extent(-122.68,45.53,-122.45,45.60, sr); ... });
require([ "esri/geometry/Extent", "esri/SpatialReference", ... ], function(Extent, SpatialReference, ... ) { var sr = new SpatialReference({"wkid": 4326}); var extent = new Extent(-122.68,45.53,-122.45,45.60, sr); ... });
It might be your spatial Reference object. Recreate the spatialReference object before creating your extent object to see if that changes anything.require([ "esri/geometry/Extent", "esri/SpatialReference", ... ], function(Extent, SpatialReference, ... ) { var sr = new SpatialReference({"wkid": 4326}); var extent = new Extent(-122.68,45.53,-122.45,45.60, sr); ... });
If that doesn't fix the issue, can you generate a really quick sample using http://jsfiddle.net ?
Thanks!
That fix it. Thank you very much! I just dont understand why the spatialReference was broken somewhere during the features creation.