I need to have the same spatial reference between the MapView and my feature layer because I am performing a queryTask and then using the popup to zoom to the feature. The query result feature is in State Plane, and the Map and MapView are in Web Mercator because I am using an esri basemap. The zoom to in the popup doesn't work, and the popup won't display on the queried feature.
1. I assumed the search results would be projected to the map.spatialReference because I set up the outSpatialReference. But my result features were still in State Plane
2. Next, I tried to set the initialViewProperties to State Plane in the map. I get an error saying the wkid is null or undefined
3. Then, I tried to set the spatialReference in the MapView. I get an error saying the wkid is null or undefined
4. Finally, I tried to project my search results on the fly from State Plane to Web Mercator. I get no errors, but the feature is still in State Plane from what I can tell by selecting a point from the path in my polyline and showing the x,y
values when I display the popup.
Here is my require statement: