Overriding feature spatial reference in Identify
Closed this issue · 2 comments
cmv-app/viewer/js/gis/dijit/Identify.js
Line 408 in f2bf2f5
This line was causing issues for us when using Identify on feature graphics that had a different spatial reference than the map. Removing this line has fixed the issue -- Can anyone confirm that this line is no longer needed?
@apatriz Here's the original discussion that led to that line being changed. I have not head of issue with that existing code since that time. Quite frankly, I forgot about it completely. 😄
Can you provide a working example of the issue you ran into so I can review, test and comment?
@tmcgee thanks for the response. Upon further inspection, there was another error in our code leading to incorrect spatial refs being set on features in a feature collection saved to portal. The feature collection had a layer definition with a spatial ref of 3857, whereas the features were saved with 4326.
Fixing this also solved the issue.
In any case, here are the steps to reproduce:
- create a FeatureLayer from a feature collection where the feature geometries are in a different spatial extent than the map
- add the FeatureLayer to the map
- perform an Identify on any feature graphic -> the line in question will override the graphic spatial ref
- zoom in/out (to trigger a redraw) -> the graphic will disappear