OpenLayers JavaScript Mapping Library |
OpenLayers. RendererThis is the base class for all renderers. This is based on a merger code written by Paul Spencer and Bertil Chapuis. It is largely composed of virtual functions that are to be implemented in technology-specific subclasses, but there is some generic code too. The functions that are implemented here merely deal with the maintenance of the size and extent variables, as well as the cached ‘resolution’ value. A note to the user that all subclasses should use getResolution() instead of directly accessing this.resolution in order to correctly use the cacheing system. Summary
map{OpenLayers.Map} Reference to the map -- this is set in Vector’s setMap() setExtent
Set the visible part of the layer. Resolution has probably changed, so we nullify the resolution cache (this.resolution) -- this way it will be re-computed when next it is needed. Parameters
setSize
Sets the size of the drawing surface. Resolution has probably changed, so we nullify the resolution cache (this.resolution) -- this way it will be re-computed when next it is needed. Parameters
drawFeature
Draw the feature. The optional style argument can be used to override the feature’s own style. This method should only be called from layer.drawFeature(). Parameters
drawGeometry
Draw a geometry. This should only be called from the renderer itself. Use layer.drawFeature() from outside the renderer. virtual function Parameters
getFeatureIdFromEvent
Returns a feature id from an event on the renderer. How this happens is specific to the renderer. This should be called from layer.getFeatureFromEvent(). Virtual function. Parameters
Returns{String} A feature id or null. eraseFeatures
This is called by the layer to erase features Parameters
eraseGeometry
Remove a geometry from the renderer (by id). virtual function. Parameters
|
destroy: function()
This should be overridden by specific subclasses
supported: function()
Set the visible part of the layer.
setExtent: function( extent )
Sets the size of the drawing surface.
setSize: function( size )
Uses cached copy of resolution if available to minimize computing
getResolution: function()
Draw the feature.
drawFeature: function( feature, style )
Draw a geometry.
drawGeometry: function( geometry, style, featureId )
Clear all vectors from the renderer.
clear: function()
Returns a feature id from an event on the renderer.
getFeatureIdFromEvent: function( evt )
This is called by the layer to erase features
eraseFeatures: function( features )
Remove a geometry from the renderer (by id).
eraseGeometry: function( geometry )