ViewArea changed event

Topics: General
Apr 4, 2016 at 5:16 PM

I am working on a navigation application on Windows Forms.

Some custom polygons and markers retrieved from database are shown on the map but as their number is huge, i am trying to implement a mechanism to show only those objects that are contained by current view area. So, i need to refresh the objects when the current view area is changed. (And do a spatial query to retrieve those objects included in Current View Area bounds)

How can i determine if the view area is changed?

I know that OnPositionChanged and OnMapDrag events are fired when the ViewArea changes but those events are fired multiple times during the drag. I need to determine when the ViewArea changed once and for all. It is ok if the user right clicks and drags several times, but if the user right clicks and drags the map once, i need to catch an event which fires only once, when the event finishes.

I hope i made it clear :) Thanks.
Apr 9, 2016 at 1:19 PM
Edited Apr 9, 2016 at 1:24 PM
Try creating your own ViewArea and call it when needed. This may help you get started:
PointLatLng w = gMapControl1.FromLocalToLatLng(gMapControl1.Width, gMapControl1.Height);
I found your post because I was having problems with ViewArea. I posted the problem here:
Jul 18 at 9:24 AM
My problem is not about getting the Viewport polygon.

What i want to do is to determine when to load the objects from the database after the viewport changes. I found "OnTileLoadComplete" event and i am using it now but if there's better practice, i would like to know it ..

Thank you.