Select to view content in your preferred language

Detemine if FeatureLayer is visible in current extent.

2941
6
09-22-2011 11:26 AM
SanajyJadhav
Deactivated User
Hi,

I have subscribed to the map extent changed event.I want to check if my feature layer is visible or not in this extent.

How could I do that? I looked into the FeatureLayer members and could not find any thing that would indicate its visibility.

Any help is appreciated.

-
Sanjay.
0 Kudos
6 Replies
derekswingley1
Deactivated User
What are you trying to do?

If you want to manually figure out if a feature layer's extent overlaps with the current map extent, use the feature layer's fullExtent property. You can test if the feature layer's extent intersects with the map's extent.
0 Kudos
SanajyJadhav
Deactivated User
Derek,

Thanks for getting back to me.

Here is what I want to do.

We have scale dependent visibility set for our feature layer ( say Building).So, this layers is added multiple times to the map.It starts to show up from scale 9028,4514,2257 and so on.

If this layer is in its visibility scale range but has been turned off from TOC and if user tries to query it, then in this case, I want to restrict user.

So,when user clicks Fire Query button, I want to check if the Building layer is on or off.If it is off, query won't get fired.

Hope I am clear enough.

-Thanks,
Sanjay.
0 Kudos
derekswingley1
Deactivated User
I understand. What I posted previously still applies. In addition to testing if extents intersect, I'd also check each layer's visible property before doing a query.
0 Kudos
SanajyJadhav
Deactivated User
Thanks Derek.

I was looking into FeatureLayer class's property.It looks like I have to use Layer base class and use its visible property.

About extent stuff. Since FeatureLayer is added to map, its extent would always intersect map's extent.So, how extent intersection is gonna work for me?Please correct me if I am wrong.Do not mind but I am very much new to this API.I find it very difficult to program with this API.You know, things are easy with SL api.

-
Sanjay.
0 Kudos
derekswingley1
Deactivated User
It looks like I have to use Layer base class and use its visible property.

Each instance of FeatureLayer does indeed have a visible property.


Since FeatureLayer is added to map, its extent would always intersect map's extent.So, how extent intersection is gonna work for me?Please correct me if I am wrong.

Why would a FeatureLayer's extent always intersect the map's current extent?
0 Kudos
SanajyJadhav
Deactivated User
Thanks Derek.

Somehow I overlooked this visible property of the FeatureLayer.It should solve my issue now.
Appreciate your help.

-
Sanjay.
0 Kudos