GLG Toolkit, C# Class Library  Version 4.6

This group contains methods for handling asynchronous GIS map loading requests. More...

Detailed Description

This group contains methods for handling asynchronous GIS map loading requests.

Functions

void AbortGISRequest (String resource_name)
 Aborts a GIS object's asynchronous map loading request in progress, if any. More...
 
GlgGISRequestObserver GetGISRequestInfo (String resource_name)
 Obtains information about an asynchronous map loading request in progress for the GIS object the method is invoked on. More...
 
bool InstallGISRequest (String resource_name)
 Installs a new map received by the GIS request in the GIS object. More...
 
bool RequestGISMap (String resource_name, double extent_x, double extent_y, double center_x, double center_y, double angle, GlgProjectionType projection, String layers, GlgGISRequestFlags flags, GlgGISRequestObserver request_observer)
 Initiates an asynchronous GIS map loading request. More...
 
bool RequestGISZoom (String resource_name, char type, double value, GlgGISRequestObserver request_observer)
 Initiates an asynchronous GIS zooming or panning request compatible with the SetZoom method interface. More...
 
GlgGISRequestObserver SetScrollbarObserver (String resource_name, GlgGISRequestObserver request_observer)
 Controls the the way integrated scrollbars work for the GIS object. More...
 

Function Documentation

◆ AbortGISRequest()

void AbortGISRequest ( String  resource_name)

Aborts a GIS object's asynchronous map loading request in progress, if any.

Parameters
resource_nameA resource path of a child GIS object, or null to abort an asynchronous map loading request for the GIS object the method is invoked on. The resource path is relative to the invoking object.

◆ GetGISRequestInfo()

GlgGISRequestObserver GetGISRequestInfo ( String  resource_name)

Obtains information about an asynchronous map loading request in progress for the GIS object the method is invoked on.

Parameters
resource_nameA resource path of a child GIS object, or null to query the GIS object the method is invoked on. The resource path is relative to the invoking object.
Returns
The request observer of a map loading request in progress, or null if the GIS object has no pending GIS requests.

◆ InstallGISRequest()

bool InstallGISRequest ( String  resource_name)

Installs a new map received by the GIS request in the GIS object.

This method may be invoked only from inside of a request observer's RequestUpdate method invoked with the GIS_REQUEST_READY status.

Parameters
resource_nameA resource path of a child GIS object, or null to use the GIS object the method is invoked on. The resource path is relative to the invoking object.
Returns
Success or failure status.

The DEMOS_C#/AirTrafficExt/GlgAirTrafficDemoExt.cs in the GLG installation directory proides an example of using the method to install the received map.

◆ RequestGISMap()

bool RequestGISMap ( String  resource_name,
double  extent_x,
double  extent_y,
double  center_x,
double  center_y,
double  angle,
GlgProjectionType  projection,
String  layers,
GlgGISRequestFlags  flags,
GlgGISRequestObserver  request_observer 
)

Initiates an asynchronous GIS map loading request.

The easiest way to change a map displayed inside a GIS object is by changing the GIS object's parameters to specify a new map area, a new map projection or new map layers. If a synchronous map loading mode is used, the application will freeze while the new map is being loaded. If an asynchronous map loading mode is used, dynamic symbols on the map are displayed at the new map positions right away, but without the background map, with the new map appearing when it is received from the server. Both of these modes are undesirable, and an asynchronous GIS request offers a solution.

Instead of changing GIS parameters, an application can issue an asynchronous GIS map request that requests a new map from the map server. While the request is being loaded, the application continues to update dynamic icons on the map in its current state, and switches to the new map when the new map is received. This avoids displaying no map while the new map is being loaded.

The RequestGISMap method is used to issue an asynchronous GIS map request by specifying parameters of the new map. The method's request_observer parameter specifies a request observer that will be invoked when the map is ready. When the new map image is either ready or aborted, the request observer's RequestUpdate method will be invoked with the status information. The observer can install a successfully prepared request via the InstallGISRequest method, or do nothing to cancel the request. See GlgGISRequestObserver for more information.

The method aborts any asynchronous map loading request in progress for the GIS object the method is invoked on.

Parameters
resource_nameA resource path of a child viewport with the GIS zoom mode, or null to use the viewport the method is invoked on. The resource path is relative to the invoking object.
extent_xSpecifies a new GIS x extent.
extent_ySpecifies a new GIS y extent.
center_xSpecifies a new GIS x center.
center_ySpecifies a new GIS y center.
angleSpecifies a new GIS angle.
projectionSpecifies a new GIS projection.
layersSpecifies a new GIS layer string.
flagsControls which GIS object's parameters will be updated and is formed as a bitwise OR the following flags:
request_observerSpecifies an observer whose RequestUpdate method will be invoked with status updates. See GlgGISRequestObserver for more information.
Returns
Success or failure status.

The DEMOS_C#/AirTrafficExt/GlgAirTrafficDemoExt.cs in the GLG installation directory proides an example of using the method to load a new map.

◆ RequestGISZoom()

bool RequestGISZoom ( String  resource_name,
char  type,
double  value,
GlgGISRequestObserver  request_observer 
)

Initiates an asynchronous GIS zooming or panning request compatible with the SetZoom method interface.

The easiest way to zoom or scroll a map displayed inside a GIS object is by using the SetZoom method, which changes the GIS object's parameters to perform the requested zoom or pan operation. If a synchronous map loading mode is used, the application will freeze while the new map is being loaded. If an asynchronous map loading mode is used, dynamic symbols on the map are displayed in the new map zoom state right away, but without the background map, with the new map appearing when it is received from the server. Both of these modes are undesirable, and an asynchronous GIS request offers a solution.

Instead of using SetZoom, an application can issue an asynchronous GIS map request that requests a new zoomed or scrolled map from the map server. While the request is being loaded, the application continues to update dynamic icons on the map in its current state, and switches to the new map when the new map is received. This avoids displaying no map while the new map is being loaded.

The RequestGISZoom method is used to issue an asynchronous GIS map request in a way compatible with the SetZoom method, which allows to use the same zoom or pan parameters to request asynchronous GIS zoom or pan request.

The method uses an addition request_observer parameter that specified a request observer that will be invoked when the map is ready. When the new map image is either ready or aborted, the request observer's RequestUpdate method will be invoked with the status information. The observer can install a successfully prepared request via the InstallGISRequest method, or do nothing to cancel the request. See GlgGISRequestObserver for more information.

The method aborts any asynchronous map loading request in progress for the GIS object the method is invoked on.

Parameters
resource_nameA resource path of a child viewport with the GIS zoom mode, or null to use the viewport the method is invoked on. The resource path is relative to the invoking object.
typeA char value that specifies the type of the zoom or pan operation to perform. For example, 'i' may be used to zoom in.
See the type parameter of the SetZoom method for a list of possible values.
valueSpecifies the amount to zoom or pan by. See the value parameter of the SetZoom method for more information.
request_observerSpecifies an observer whose RequestUpdate method will be invoked with status updates. See GlgGISRequestObserver for more information.
Returns
Success or failure status.

The DEMOS_C#/AirTrafficExt/GlgAirTrafficDemoExt.cs in the GLG installation directory proides an example of using the method to zoom and pan the map.

◆ SetScrollbarObserver()

GlgGISRequestObserver SetScrollbarObserver ( String  resource_name,
GlgGISRequestObserver  request_observer 
)

Controls the the way integrated scrollbars work for the GIS object.

Parameters
resource_nameA resource path of a child GIS object, or null to set scrollbar observer of the GIS object the method is invoked on. The resource path is relative to the invoking object.
request_observerSpecifies a request observer:
  • If a non-null observer is specified, integrated scrollbars will use an asynchronous request to scroll the map. The observer's RequestUpdate method will be invoked with status updates.
  • If null is specified, the new map will be loaded without the use of an asynchronous request.
Returns
The previous scrollbar request observer, or null if the GIS object didn't use scrollbar request observers.

The DEMOS_C#/AirTrafficExt/GlgAirTrafficDemoExt.cs in the GLG installation directory proides an example of using scrollbar observers to load a new map when the map is scrolled using the integrated scrollbars.

See GlgGISRequestObserver for more information.