NOTE: choose the suitable paper orientation in your browser's printing options. You can print this page or return to the viewer.

OpenLayersExt.Control.WhatIsThis

A custom OLE control for giving information on or around a point on an OpenLayersExt.Map.

Functional Description

WhatIsThis is an OLE control that gives information on, or nearby, a given point on the map. This control is added by default to OLE maps, and can be activated by users by clicking on it's icon in the maps control panel. Once activated, a user can choose to click on a given point on the map. Once the point has been chosen, a request is made to retrieve information on objects (streets, buildings, etc.) around the given point or within a configurable range of tolerance.

The information is displayed in a FramedB5MapMarker popup that gives a list of the available objects. Each listed object comes along with a button for showing and hiding the objects gml representation on the map.

Using the Control

This control is added to the map object just as any other standard OpenLayers Control would be added. The official OpenLayers website offers more general information on the use of OpenLayers controls:

  map.addControl( new OpenLayersExt.Control.WhatIsThis() );

Once the control has been added to the map, users will be able to activate the control by clicking on its icon in the map's control panel.

Accessing the information and sequence of events

The WhatIsThis control makes a single request per click in order to retrieve the information.

The sequence of events is as follows:

  1. The WhatIsThis control is added to the map.

  2. When a user clicks on the WhatIsThis icon in the control panel, the control is activated. The control is deactivated when the icon is clicked again or another control is chosen.

  3. When WhatIsThis is active and a user clicks on the map, a request is made to the server to retrieve information on geometric objects around the given point.

  4. When the response arrives, the WhatIsThis control displays the information in a popup, listing all available objects

  5. Each listed object presents a button for toggling the view of its GML representation over the map.
  6. When a user clicks on another point, the previous information, if any, is erased and another request is made (Back to step 3).