<esri:ElementLayer><esri:ElementLayer.Children><local:DragDropScatterView esri:ElementLayer.Envelope="-19949487.9573175,-20100080.1372686,20125528.7282505,20131479.5822274" x:Name="ScatterLayer" Background="Transparent" Height="Auto" Width="Auto" ItemContainerStyle="{StaticResource ScatterItemStyle}" /> </esri:ElementLayer.Children></esri:ElementLayer>
Did you set a fixed width/height on the ScatterView control prior to dropping it inside a ViewBox ?
The position of the items being managed in device-independent units, the only way to keep the geographical position of the items is to include the scatter view (with a fixed size) inside a Viewbox.
So the display of the scatter view is stretched while zooming in or out but its size doesn�??t change and the items keep their geographical position.
The counterpart is that the items scale up and down while zooming since their size in device independent units doesn�??t change but they scale because the viewbox scales.
The solution might be to wire up an handler to the map Extent_Changed event and to change the scatterviewitems size dynamically depending on the map scale.
But to keep the content of the scatter item unchanged while changing the scatter item size, I guess you have to encapsulate each item inside a viewbox.
In short:
- Surround the scatter view by a viewbox that is inserted in the element layer with a fixed size.
- Surround by a viewbox each scatter view item that doesn�??t have to scale while zooming
- On map extent changed event, loop on all scatter view items containing a viewbox and change the items size by a size depending of the map scale.
Hope this helps.
The position of the items being managed in device-independent units, the only way to keep the geographical position of the items is to include the scatter view (with a fixed size) inside a Viewbox.
So the display of the scatter view is stretched while zooming in or out but its size doesn�??t change and the items keep their geographical position.
The counterpart is that the items scale up and down while zooming since their size in device independent units doesn�??t change but they scale because the viewbox scales.
The solution might be to wire up an handler to the map Extent_Changed event and to change the scatterviewitems size dynamically depending on the map scale.
But to keep the content of the scatter item unchanged while changing the scatter item size, I guess you have to encapsulate each item inside a viewbox.
In short:
- Surround the scatter view by a viewbox that is inserted in the element layer with a fixed size.
- Surround by a viewbox each scatter view item that doesn�??t have to scale while zooming
- On map extent changed event, loop on all scatter view items containing a viewbox and change the items size by a size depending of the map scale.
Hope this helps.
Thanks again for your suggestion! One question: If I surround each ScatterViewItem with a viewbox, they are no longer ScatterViewItems, and hence it will not be possible to place them on the ScatterView. Is this correct, or did I misunderstand something?