So I am pulling parcels, running a query, and trying to center the map to the parcels from the query.
I am getting this error:
Map: Geometry (wkid: 26912) cannot be converted to spatial reference of the map (wkid: 102100)
The coordinates I get from the query are ridiculous, an example is [4109465.94230973, 270652.7635476563]. They display fine when I enable the layer, though. It is only when I do a query that things get weird.
and this is all of my code dealing with the parcels
$(document).on('click', '#parcel_submit', function(){ parcelId = $('#parcel_input').val(); //get the parcel to search for from the text box queryTask = new esri.tasks.QueryTask("https://mapserv.utah.gov/arcgis/rest/services/Parcels/MapServer/27"); //initialize query query = new esri.tasks.Query(); query.returnGeometry = true; query.outFields = ["OBJECTID", "PARCEL_ID"]; query.where = "PARCEL_ID = '" + parcelId + "';"; //only look for the desired parcel queryTask.execute(query,showResults); }); function showResults(featureSet){ var features = featureSet.features; //all of the parcels matching the search. There should only be one var parcel = features[0]; //get the first parcel var geometry = parcel.geometry.getCentroid(); //get the center of the parcel var point = esri.geometry.Point(geometry.y, geometry.x) //create a point map.centerAndZoom(geometry, 16); //it is centering at some crazy coordinates in the hundreds of thousands. console.log(features, parcel, geometry, point); };
Thanks in advance.
Bit of honesty, I hardly know the basics since this project was assigned out of nowhere 😕 I apologize if this question is dumb