Namespace ria.ol

Utility functions for OpenLayers

Method Summary
Method Attributes Method Name and Description
ria.ol.addClickHandler(map, callbacks, options)
Adds a click handler to the given OpenLayers map.
ria.ol.defaultMapOptions(srsName)
Creates a default options object that can be passed to an OpenLayers map.
Method Detail
<static> {Object} ria.ol.addClickHandler(map, callbacks, options)
Adds a click handler to the given OpenLayers map.
Parameters:
map
an OpenLayers map
callbacks
an object with callback functions to call when a map click occurs. Upon invocation of a callback function, an event object will be passed to it that carries an xy property. That value can then be converted to the geographic location corresponding to the click event. The two supported callback names are click and dblclick.
options
an options object to customize the click handler. It supports any properties that can be set on an OpenLayers.Handler.Click. If no options are specified, a handler for single-click events will be added.
Returns:
{Object} the control that captures the click events. This method automatically adds the control to the given map. To remove it again, call OpenLayers.Map.removeControl() and pass it the object returned from this method.

<static> ria.ol.defaultMapOptions(srsName)
Creates a default options object that can be passed to an OpenLayers map. The returned object will contain the projection, the maximum extent, the restricted extent (which is set to the maximum extent), the coordinate system units as well as the maximum resolution.
Parameters:
srsName
the name of the coordinate system to use.