This Layer reads from UTFGrid tiled data sources. Since UTFGrids are essentially JSON-based ASCII art with attached attributes, they are not visibly rendered. In order to use them in the map, you must add a OpenLayers.Control.UTFGrid control as well.
var world_utfgrid = new OpenLayers.Layer.UTFGrid({ url: "/tiles/world_utfgrid/${z}/${x}/${y}.json", utfgridResolution: 4, displayInLayerSwitcher: false ); map.addLayer(world_utfgrid); var control = new OpenLayers.Control.UTFGrid({ layers: [world_utfgrid], handlerMode: 'move', callback: function(dataLookup) { // do something with returned data } })
OpenLayers.
|
This Layer reads from UTFGrid tiled data sources. |
Properties | |
isBaseLayer | Default is false, as UTFGrids are designed to be a transparent overlay layer. |
projection | {OpenLayers.Projection} Source projection for the UTFGrids. |
url | {String} URL tempate for UTFGrid tiles. |
utfgridResolution | {Number} Ratio of the pixel width to the width of a UTFGrid data point. |
Constructor | |
OpenLayers.
|
Create a new UTFGrid layer. |
Functions and Properties | |
clone | Create a clone of this layer |
getFeatureInfo | Get details about a feature associated with a map location. |
getFeatureId | Get the identifier for the feature associated with a map location. |
{OpenLayers.Projection} Source projection for the UTFGrids. Default is “EPSG:900913”.
{Number} Ratio of the pixel width to the width of a UTFGrid data point. If an entry in the grid represents a 4x4 block of pixels, the utfgridResolution would be 4. Default is 2 (specified in OpenLayers.Tile.UTFGrid).
Create a new UTFGrid layer.
config | {Object} Configuration properties for the layer. |
url | {String} The url template for UTFGrid tiles. See the url property. |
clone: function ( obj )
Create a clone of this layer
obj | {Object} Only used by a subclass of this layer. |
{OpenLayers.Layer.UTFGrid} An exact clone of this OpenLayers.Layer.UTFGrid
Get details about a feature associated with a map location. The object returned will have id and data properties. If the given location doesn’t correspond to a feature, null will be returned.
location | {OpenLayers.LonLat} map location |
{Object} Object representing the feature id and UTFGrid data corresponding to the given map location. Returns null if the given location doesn’t hit a feature.
getFeatureId: function( location )
Get the identifier for the feature associated with a map location.
location | {OpenLayers.LonLat} map location |
{String} The feature identifier corresponding to the given map location. Returns null if the location doesn’t hit a feature.
Create a clone of this layer
clone: function ( obj )
Get the identifier for the feature associated with a map location.
getFeatureId: function( location )