GLG Toolkit, JavaScript Library  Version 4.2
GlgGISRequestObserver Class Reference

Detailed Description

A GIS request observer object used as a parameter of the GlgObject::RequestGISZoom, GlgObject::RequestGISMap and GlgObject::SetScrollbarObserver methods.

Public Member Functions

boolean AdjustRequest (GlgGISRequestData request_data)
 
boolean RequestAdjustment ()
 
void RequestUpdate (GlgObject gis_object, GlgGISRequestStatus status)
 

Static Public Member Functions

static GlgGISRequestObserver CreateGlgGISRequestObserver (function request_update_func, function request_adjustment_func, function adjust_request_func)
 

Member Function Documentation

◆ AdjustRequest()

boolean AdjustRequest ( GlgGISRequestData  request_data)

If RequestAdjustment returns true, this method is invoked before proceeding with the request to perform any desired adjustments to the request parameters. This may be used to adjust parameters of the request created by the RequestGISZoom method before the request is used to generate a new map image. The method must return true if any request paramets were modified.

Parameters
request_dataGIS parameters of the request.

◆ CreateGlgGISRequestObserver()

static GlgGISRequestObserver CreateGlgGISRequestObserver ( function  request_update_func,
function  request_adjustment_func,
function  adjust_request_func 
)
static

Constructor. Creates a GIS request observer that can be used as a parameter of the GlgObject::RequestGISZoom, GlgObject::RequestGISMap and GlgObject::SetScrollbarObserver methods. The static method is invoked on the GLG Toolkit handle obtaned via a "new GlgToolkit()" call at the application start-up.

Parameters
request_update_funcA function to be invoked with the status of the GIS request when the GIS request becomes ready or is aborted. The function's type signature must match the type signature of the RequestUpdate method.
request_adjustment_funcA function that determines if the request needs to be adjusted before proceeding. If it returns true, adjust_request_func will be invoked to perform any desired adjustments to the request parameters. The function's type signature must match the type signature of the RequestAdjustment method.
adjust_request_funcA function to be invoked to adjust request parameters before proceeding, if necessary. The function's type signature must match the type signature of the AdjustRequest method.
Returns
An opaque internal object representing GlgGISRequestObserver.

◆ RequestAdjustment()

boolean RequestAdjustment ( )

This method is invoked before proceeding with the request to determine if any adjustments need to be done. If this method returns true, the AdjustRequest method will be invoked to adjust request parameters before proceeding. For example, a map projection or displayed GIS layers may need to be changed dependingon the map zoom factor.

◆ RequestUpdate()

void RequestUpdate ( GlgObject  gis_object,
GlgGISRequestStatus  status 
)

This method is invoked with the status of the GIS request when the GIS request becomes ready or is aborted.

Parameters
gis_objectThe GIS object of the request.
statusThe reason this observer method is invoked, may be one of the following constants (defined in the GlgObject class for Java or the GlgGISRequestStatus enum for C#): GIS_ABORT_ON_GIS_CHANGE - aborted by the change in the GIS object's parameters GIS_ABORT_ON_NEW_REQUEST - aborted by a new GIS request GIS_ABORT_OF_ZOOM_MODE - ZoomTo request was aborted by the application GIS_ABORT_ON_LOAD_ERROR - aborted due the map image generation errors GIS_ABORT_ON_RESET - aborted due to the GIS object reset GIS_ABORT_BY_API - aborted by the AbortGISRequest API method. GIS_REQUEST_READY - the GIS request is ready to be installed using the InstallGISRequest method.