Instances of OpenLayers.Tile.UTFGrid are used to manage UTFGrids. This is an unusual tile type in that it doesn’t have a rendered image; only a ‘hit grid’ that can be used to look up feature attributes.
See the OpenLayers.Tile.UTFGrid constructor for details on constructing a new instance.
OpenLayers. | Instances of OpenLayers.Tile.UTFGrid are used to manage UTFGrids. |
Properties | |
url | {String} The URL of the UTFGrid file being requested. |
utfgridResolution | {Number} Ratio of the pixel width to the width of a UTFGrid data point. |
json | {Object} Stores the parsed JSON tile data structure. |
format | {OpenLayers.Format.JSON} Parser instance used to parse JSON for cross browser support. |
Constructor | |
OpenLayers. | Constructor for a new OpenLayers.Tile.UTFGrid instance. |
Functions | |
destroy | Clean up. |
draw | Check that a tile should be drawn, and draw it. |
abortLoading | Cancel a pending request. |
getFeatureInfo | Get feature information associated with a pixel offset. |
getFeatureId | Get the identifier for the feature associated with a pixel offset. |
indexFromCharCode | Given a character code for one of the UTFGrid “grid” characters, resolve the integer index for the feature id in the UTFGrid “keys” array. |
parseData | Parse the JSON from a request |
clear | Delete data stored with this tile. |
{String} The URL of the UTFGrid file being requested. Provided by the getURL method.
Constructor for a new OpenLayers.Tile.UTFGrid instance.
layer | {OpenLayers.Layer} layer that the tile will go in. |
position | {OpenLayers.Pixel} |
bounds | {OpenLayers.Bounds} |
url | {String} Deprecated. Remove me in 3.0. |
size | {OpenLayers.Size} |
options | {Object} |
getFeatureInfo: function( i, j )
Get feature information associated with a pixel offset. If the pixel offset corresponds to a feature, the returned object will have id and data properties. Otherwise, null will be returned.
i | {Number} X-axis pixel offset (from top left of tile) |
j | {Number} Y-axis pixel offset (from top left of tile) |
{Object} Object with feature id and data properties corresponding to the given pixel offset.
getFeatureId: function( i, j )
Get the identifier for the feature associated with a pixel offset.
i | {Number} X-axis pixel offset (from top left of tile) |
j | {Number} Y-axis pixel offset (from top left of tile) |
{Object} The feature identifier corresponding to the given pixel offset. Returns null if pixel doesn’t correspond to a feature.
Clean up.
destroy: function()
Check that a tile should be drawn, and draw it.
draw: function()
Cancel a pending request.
abortLoading: function()
Get feature information associated with a pixel offset.
getFeatureInfo: function( i, j )
Get the identifier for the feature associated with a pixel offset.
getFeatureId: function( i, j )
Given a character code for one of the UTFGrid “grid” characters, resolve the integer index for the feature id in the UTFGrid “keys” array.
indexFromCharCode: function( charCode )
Parse the JSON from a request
parseData: function( str )
Delete data stored with this tile.
clear: function()
Determine the URL for a tile given the tile bounds.
getURL: function ( bounds )