Click or drag to resize

Map Viewport Concept

This page explains the relation between the viewport events of the map and the strategies to display data depending on the current map section.

When the user or application triggers a navigation action like zooming or panning and the map uses animations, the viewport properties can be used to query the visible map section before, while and after the transition to the new map section.

This page contains the following sections:

Viewport Events and Map Properties

The viewport events of the map can be used to optimize fetching data and overlays. An event always signals that there has been executed an action which changed some properties of the map. To always know about the change action, the map stores the current state of the properties and the target state of the properties. In the following, the "current properties" are discussed which store the state at this time and the "final properties" which store the target state. In the sections below, sample properties can be found for which current and final states are stored. These properties also have "current" or "final" in their names.

  • ViewportBeginChanged - Fired before the transition starts. The "final properties" already contain the anticipated viewport properties.
  • ViewportWhileChanged - Fired while the transition starts. The "current properties" converge to the "final properties".
  • ViewportEndChanged - Fired after the transition is completed. The "current properties" are equal to the "final properties".

The distinction between "current" and "final" properties together with the viewport events allows fine-tuning the interactivity of the layering. An example is the UntiledLayer, which catches the ViewportBeginChanged event and queries the anticipated overlay while the animation is in progress using the FinalEnvelope property.

View Port Changed
Viewport Events and Properties
Map

The standard fields of the IMap type always contain the properties for the end of an animation. To query the properties while the map is animated, there are additional properties:

Properties querying the current state during an animation:

Properties querying the final state at the end of an animation:

Map View

The MapView also supports the concept of a current and a final viewport. It has the same events as the IMap interface and uses pairs of properties for the current and the final map viewport.

Map Canvas

The MapCanvas has a reference to the map view parent object to query the viewport state of the map view. The Update(UpdateMode) method is called whenever a viewport event is triggered. The UpdateMode indicates the type of the event.

See Also