Select to view content in your preferred language

Zooming to Available features.

1989
3
Jump to solution
07-17-2012 02:01 AM
by Anonymous User
Not applicable
Original User: ohdev83

Hello,
I have a combobox which i use to filter features depending on a field value.

Im using the Where property of the Featurelayer to filter features, after that i call the Update method.

now i want to zoom/set the view to the available results of the where property, any way to do that?

I tried the following:
layer.Where = where;
Map.Extent = layer.FullExtent;
layer.Update();

it works sometimes but after the next filtering operation and it zooms on the previous filtering extent, not on the current.

Any help about this?

Silverlight 5, c#, featurelayer, zoom to extent, where clause, arcgis Server 10
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: dbroux

I tried the following:
layer.Where = where;
Map.Extent = layer.FullExtent;
layer.Update();


You set the Map.Extent too early.
The FullExtent of the layer is updated only after the layer itself has been updated.

So it should work by setting the Map.Extent in an Layer.UpdateCompleted handler.

View solution in original post

0 Kudos
3 Replies
by Anonymous User
Not applicable
Original User: dbroux

I tried the following:
layer.Where = where;
Map.Extent = layer.FullExtent;
layer.Update();


You set the Map.Extent too early.
The FullExtent of the layer is updated only after the layer itself has been updated.

So it should work by setting the Map.Extent in an Layer.UpdateCompleted handler.
0 Kudos
by Anonymous User
Not applicable
Original User: ohdev83

You set the Map.Extent too early.
The FullExtent of the layer is updated only after the layer itself has been updated.

So it should work by setting the Map.Extent in an Layer.UpdateCompleted handler.


Thanks dominique!

i will try this tomorrow and let you know of the result, but even before trying, im almost sure it will work!

thanks again.
0 Kudos
by Anonymous User
Not applicable
Original User: ohdev83

Dear dominique,

thank you, the solution worked fine :).
0 Kudos