OpenLayers JavaScript Mapping Library |
OpenLayers. Layer. VectorInstances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources. Create a new image layer with the OpenLayers.Layer.Vector constructor. Inherits fromSummary
featuresArray({OpenLayers.Feature.Vector}) selectedFeaturesArray({OpenLayers.Feature.Vector}) OpenLayers. Layer. VectorCreate a new vector layer Parameters
Returns{OpenLayers.Layer.Vector} A new vector layer setMap
The layer has been added to the map. If there is no renderer set, the layer can’t be used. Remove it. Otherwise, give the renderer a reference to the map and set its size. Parameters
moveTo
Reset the vector layer’s div so that it once again is lined up with the map. Notify the renderer of the change of extent, and in the case of a change of zoom level (resolution), have the renderer redraw features. If the layer has not yet been drawn, cycle through the layer’s features and draw each one. Parameters
addFeatures
Add Features to the layer. Parameters
drawFeature
Draw (or redraw) a feature on the layer. If the optional style argument is included, this style will be used. If no style is included, the feature’s style will be used. If the feature doesn’t have a style, the layer’s style will be used. Parameters
eraseFeatures
Erase features from the layer. Parameters
getFeatureFromEvent
Given an event, return a feature if the event occurred over one. Otherwise, return null. Parameters
Returns{OpenLayers.Feature.Vector} A feature if one was under the event. getFeatureById
Given a feature id, return the feature if it exists in the features array Parameters
Returns{OpenLayers.Feature.Vector} A feature corresponding to the given featureId onFeatureInsert
method called after a feature is inserted. Does nothing by default. Override this if you need to do something on feature updates. Paarameters
preFeatureInsert
method called before a feature is inserted. Does nothing by default. Override this if you need to do something when features are first added to the layer, but before they are drawn, such as adjust the style. Parameters
|
Destroy this layer
destroy: function()
Iterates through the available renderer implementations and selects and assigns the first one whose “supported()” function returns true.
assignRenderer: function()
Let the user know their browser isn’t supported.
displayError: function()
The layer has been added to the map.
setMap: function( map )
Notify the renderer of the change in size.
onMapResize: function()
Reset the vector layer’s div so that it once again is lined up with the map.
moveTo: function( bounds, zoomChanged, dragging )
Add Features to the layer.
addFeatures: function( features )
removeFeatures: function( features )
Destroy all features on the layer and empty the selected features array.
destroyFeatures: function ()
Draw (or redraw) a feature on the layer.
drawFeature: function( feature, style )
Erase features from the layer.
eraseFeatures: function( features )
Given an event, return a feature if the event occurred over one.
getFeatureFromEvent: function( evt )
Given a feature id, return the feature if it exists in the features array
getFeatureById: function( featureId )
method called after a feature is inserted.
onFeatureInsert: function( feature )
method called before a feature is inserted.
preFeatureInsert: function( feature )