This Control provides behavior associated with UTFGrid Layers. These ‘hit grids’ provide underlying feature attributes without calling the server (again). This control allows Mousemove, Hovering and Click events to trigger callbacks that use the attributes in whatever way you need.
The most common example may be a UTFGrid layer containing feature attributes that are displayed in a div as you mouseover.
var world_utfgrid = new OpenLayers.Layer.UTFGrid( 'UTFGrid Layer', "http://tiles/world_utfgrid/${z}/${x}/${y}.json" ); map.addLayer(world_utfgrid); var control = new OpenLayers.Control.UTFGrid({ layers: [world_utfgrid], handlerMode: 'move', callback: function(infoLookup) { // do something with returned data } })
OpenLayers.
|
This Control provides behavior associated with UTFGrid Layers. |
Properties | |
autoActivate | {Boolean} Activate the control when it is added to a map. |
Layers | List of layers to consider. |
handlerMode | Defaults to ‘click’. |
Functions | |
setHandler | sets this.handlerMode and calls resetHandler() |
Constructor | |
<OpenLayers.
|
|
Functions | |
callback | Function to be called when a mouse event corresponds with a location that includes data in one of the configured UTFGrid layers. |
List of layers to consider. Must be Layer.UTFGrids `null` is the default indicating all UTFGrid Layers are queried. {Array} OpenLayers.Layer.UTFGrid
callback: function( infoLookup )
Function to be called when a mouse event corresponds with a location that includes data in one of the configured UTFGrid layers.
infoLookup | {Object} Keys of this object are layer indexes and can be used to resolve a layer in the map.layers array. The structure of the property values depend on the data included in the underlying UTFGrid and may be any valid JSON type. |
sets this.handlerMode and calls resetHandler()
setHandler: function( hm )
Function to be called when a mouse event corresponds with a location that includes data in one of the configured UTFGrid layers.
callback: function( infoLookup )