Select to view content in your preferred language

visibleArea.envelope returns extent with no spatial reference

610
2
12-18-2012 10:14 AM
MattCooper
Regular Contributor
Hello,

I'm attempting to pass an extent to a spatial query for a feature layer and running into an issue.  If I try and grab the current map extent like this:
self.mapView.visibleArea.envelope


The extent returned has no spatial reference.  The mapView spatial reference is set and returns 102100.  Any ideas why visibleArea.envelope wouldn't pick up the map spatial reference?

If I just pull an extent from:
featureLayer.fullEnvelope  

The query will then be successful and obviously returns all the features. 

Any suggestions?  Thanks!
Matt
0 Kudos
2 Replies
NimeshJarecha
Esri Regular Contributor
The self.mapView.visibleArea.envelope should have spatial reference. Could you please let me know at what point in code you are trying to use map's envelope? Means, as soon as map loads? As soon as feature layer loads?

Also, for testing purpose try using self.mapView.envelope (deprecated property) to see if that works?

Regards,
Nimesh
0 Kudos
MattCooper
Regular Contributor
This is occuring in response to a button tap.  Map and all layers have already been loaded at this point.  I ended up switching to "ServiceFullEnvelope" and it appears to be doing what I need now.  I suppose I probably should just switch to an attribute query since my goal was to simply get a featureset of all features in the layer.

Thanks,
Matt
0 Kudos