OpenLayers.Renderer - OpenLayers
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.SummaryOpenLayers.RendererThis is the base class for all renderers.Propertiescontainer{DOMElement}root{DOMElement}extent{OpenLayers.Bounds}locked{Boolean} If the renderer is currently in a state where many things are changing, the ‘locked’ property is set to true. size{OpenLayers.Size}resolution{Float} cache of current map resolutionmap{OpenLayers.Map} Reference to the map -- this is set in Vector’s setMap()featureDx{Number} Feature offset in x direction. ConstructorOpenLayers.RendererFunctionsdestroysupportedThis should be overridden by specific subclassessetExtentSet the visible part of the layer.setSizeSets the size of the drawing surface.getResolutionUses cached copy of resolution if available to minimize computingdrawFeatureDraw the feature. calculateFeatureDx{Number} Calculates the feature offset in x direction. drawGeometryDraw a geometry. drawTextFunction for drawing text labels. removeTextFunction for removing text labels. clearClear all vectors from the renderer. getFeatureIdFromEventReturns a feature id from an event on the renderer. eraseFeaturesThis is called by the layer to erase featureseraseGeometryRemove a geometry from the renderer (by id). moveRootmoves this renderer’s root to a (different) renderer. getRenderLayerIdGets the layer that this renderer’s output appears on. applyDefaultSymbolizerConstantsOpenLayers.Renderer.defaultSymbolizer{Object} Properties from this symbolizer will be applied to symbolizers with missing properties. OpenLayers.Renderer.symbolCoordinate arrays for well known (named) symbols.
Properties
container{DOMElement}
root{DOMElement}
extent{OpenLayers.Bounds}
locked{Boolean} If the renderer is currently in a state where many things are changing, the ‘locked’ property is set to true. This means that renderers can expect at least one more drawFeature event to be called with the ‘locked’ property set to ‘true’: In some renderers, this might make sense to use as a ‘only update local information’ flag.
size{OpenLayers.Size}
resolution{Float} cache of current map resolution
map{OpenLayers.Map} Reference to the map -- this is set in Vector’s setMap()
featureDx{Number} Feature offset in x direction. Will be calculated for and applied to the current feature while rendering (see calculateFeatureDx).
Constructor
OpenLayers.RendererParameterscontainerID{String}options{Object} options for this renderer. See sublcasses for supported options.
Functions
destroydestroy: function()
supportedsupported: function()This should be overridden by specific subclassesReturns{Boolean} Whether or not the browser supports the renderer class
setExtentsetExtent: function(extent,resolutionChanged)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. We nullify the resolution cache (this.resolution) if resolutionChanged is set to true - this way it will be re-computed on the next getResolution() request.Parametersextent{OpenLayers.Bounds}resolutionChanged{Boolean}Returns{Boolean} true to notify the layer that the new extent does not exceed the coordinate range, and the features will not need to be redrawn. False otherwise.
setSizesetSize: function(size)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.Parameterssize{OpenLayers.Size}
getResolutiongetResolution: function()Uses cached copy of resolution if available to minimize computingReturns{Float} The current map’s resolution
drawFeaturedrawFeature: function(feature,style)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().Parametersfeature{OpenLayers.Feature.Vector}style{<Object>}Returns{Boolean} true if the feature has been drawn completely, false if not, undefined if the feature had no geometry
calculateFeatureDxcalculateFeatureDx: function(bounds,worldBounds){Number} Calculates the feature offset in x direction. Looking at the center of the feature bounds and the renderer extent, we calculate how many world widths the two are away from each other. This distance is used to shift the feature as close as possible to the center of the current enderer extent, which ensures that the feature is visible in the current viewport.Parametersbounds{OpenLayers.Bounds} Bounds of the featureworldBounds{OpenLayers.Bounds} Bounds of the world
drawGeometrydrawGeometry: function(geometry,style,featureId)Draw a geometry. This should only be called from the renderer itself. Use layer.drawFeature() from outside the renderer. virtual functionParametersgeometry{OpenLayers.Geometry}style{Object}featureId{String}
drawTextdrawText: function(featureId,style,location)Function for drawing text labels. This method is only called by the renderer itself.ParametersfeatureId{String} style -location{OpenLayers.Geometry.Point}
removeTextremoveText: function(featureId)Function for removing text labels. This method is only called by the renderer itself.ParametersfeatureId{String}
clearclear: function()Clear all vectors from the renderer. virtual function.
getFeatureIdFromEventgetFeatureIdFromEvent: function(evt)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.Parametersevt{OpenLayers.Event}Returns{String} A feature id or undefined.
eraseFeatureseraseFeatures: function(features)This is called by the layer to erase featuresParametersfeatures{Array(OpenLayers.Feature.Vector)}
eraseGeometryeraseGeometry: function(geometry,featureId)Remove a geometry from the renderer (by id). virtual function.Parametersgeometry{OpenLayers.Geometry}featureId{String}
moveRootmoveRoot: function(renderer)moves this renderer’s root to a (different) renderer. To be implemented by subclasses that require a common renderer root for feature selection.Parametersrenderer{OpenLayers.Renderer} target renderer for the moved root
getRenderLayerIdgetRenderLayerId: function()Gets the layer that this renderer’s output appears on. If moveRoot was used, this will be different from the id of the layer containing the features rendered by this renderer.Returns{String} the id of the output layer.
applyDefaultSymbolizerapplyDefaultSymbolizer: function(symbolizer)Parameterssymbolizer{Object}Returns{Object}
Constants
OpenLayers.Renderer.defaultSymbolizer{Object} Properties from this symbolizer will be applied to symbolizers with missing properties. This can also be used to set a global symbolizer default in OpenLayers. To be SLD 1.x compliant, add the following code before rendering any vector features:OpenLayers.Renderer.defaultSymbolizer = {
fillColor: "#808080",
fillOpacity: 1,
strokeColor: "#000000",
strokeOpacity: 1,
strokeWidth: 1,
pointRadius: 3,
graphicName: "square"
};
OpenLayers.Renderer.symbolCoordinate arrays for well known (named) symbols.
Generated by Natural Docs
OpenLayersJavaScript Mapping LibraryOpenLayersOpenLayersBaseTypesBase TypesBoundsClassDateElementLonLatPixelSizeControlControlControlArgParserAttributionButtonCacheReadCacheWriteDragFeatureDragPanDrawFeatureEditingToolbarGeolocateGetFeatureGraticuleKeyboardDefaultsLayerSwitcherMeasureModifyFeatureMousePositionNavigationNavigationHistoryNavToolbarOverviewMapPanPanelPanPanelPanZoomPanZoomBarPermalinkPinchZoomScaleScaleLineSelectFeatureSLDSelectSnappingSplitTouchNavigationTransformFeatureUTFGridWMSGetFeatureInfoWMTSGetFeatureInfoZoomZoomBoxZoomInZoomOutZoomPanelZoomToMaxExtentFeatureFeatureVectorFilterFilterComparisonFeatureIdFunctionLogicalSpatialFormatFormatArcXMLArcXML.FeaturesAtomContextCQLCSWGetDomainCSWGetDomain.v2_0_2CSWGetRecordsCSWGetRecords.v2_0_2FilterFilterv1v1_0_0v1_1_0GMLGMLBasev2v3SLDSLDSLD/v1_0_0_GeoServerv1v1_0_0GeoJSONGeoRSSGPXJSONKMLOGCExceptionReportOSMOWSCommonOWSCommonv1v1_0_0v1_1_0OWSContextOWSContext.v0_3_1QueryStringFilterSOSCapabilitiesSOSCapabilities.v1_0_0SOSGetFeatureOfInterestSOSGetObservationTextVersionedOGCWCSGetCoverage version 1.1.0WFSWFSCapabilitiesWFSCapabilitiesv1v1_0_0v1_1_0WFSTWFSTv1v1_0_0v1_1_0WMCWMCv1v1_0_0v1_1_0WMSCapabilitiesWMSCapabilitiesv1v1_1v1_1_0v1_1_1v1_3v1_3_0WMSCapabilities/v1_1_1_WMSCWMSDescribeLayerWMSDescribeLayerv1_1WFSDescribeFeatureTypeWKTWMSGetFeatureInfoWMTSCapabilitiesWMTSCapabilities.v1_0_0WPSCapabilitiesWPSCapabilities.v1_0_0WPSDescribeProcessWPSExecute version 1.0.0XLSXLS.v1XLS.v1_1_0XMLGeometryGeometryCollectionCurveLinearRingLineStringMultiLineStringMultiPointMultiPolygonPointPolygonHandlerHandlerBoxClickDragFeatureHoverKeyboardMouseWheelPathPinchPointPolygonRegularPolygonLangLangarbe-taraskbgbrcacs-CZda-DKdeenen-CAeselfifrfurglgswhrhsbhuiaidioisitjakmkshltndsnbnlnnocplptpt-BRrusksv-SEtevizh-CNzh-TWLayerLayerLayerArcGISCache.jsArcGIS93RestArcIMSBingBoxesEventPaneFixedZoomLevelsGeoRSSGoogleGoogle.v3GridHTTPRequestImageKaMapKaMapCacheMapGuideMapServerMarkersPointGridPointTrackSphericalMercatorTextTileCacheTMSVectorVector.RootContainerWMSWMTSWorldWindXYZZoomifyOSMUTFGridMarkerMarkerBoxPopupPopupAnchoredAnchoredBubbleFramedFramedCloudProtocolProtocolProtocolCSWCSW.v2_0_2HTTPScriptSOS.DEFAULTSSOS.v1_0_0WFSWFSv1v1_0_0v1_1_0RendererRendererCanvasElementsIndexerSVGVMLRequestRequestXMLHttpRequestStrategyStrategyBBOXClusterFilterFixedPagingRefreshSaveSymbolizerSymbolizerLinePointPolygonRasterTextTileTileImageImage.IFrameUTFGridDeprecatedOpenLayersConsoleEventsIconKineticMapProjectionRuleSingleFile.jsStyleStyle2StyleMapTweenUtilSphericalAnimationEvents.buttonclickIndexEverythingClassesConstantsFunctionsPropertiesFilesConstructorEverythingClassesConstantsConstructorFilesFunctionsProperties
Instances of this class represent bounding boxes. Instances of this class represent a width/height pairInstances of OpenLayers.Map are interactive maps embedded in a web page. destroy: function()supported: function()This should be overridden by specific subclassessetExtent: function(extent,resolutionChanged)Set the visible part of the layer.setSize: function(size)Sets the size of the drawing surface.getResolution: function()Uses cached copy of resolution if available to minimize computingdrawFeature: function(feature,style)Draw the feature. calculateFeatureDx: function(bounds,worldBounds){Number} Calculates the feature offset in x direction. drawGeometry: function(geometry,style,featureId)Draw a geometry. drawText: function(featureId,style,location)Function for drawing text labels. removeText: function(featureId)Function for removing text labels. clear: function()Clear all vectors from the renderer. getFeatureIdFromEvent: function(evt)Returns a feature id from an event on the renderer. eraseFeatures: function(features)This is called by the layer to erase featureseraseGeometry: function(geometry,featureId)Remove a geometry from the renderer (by id). moveRoot: function(renderer)moves this renderer’s root to a (different) renderer. getRenderLayerId: function()Gets the layer that this renderer’s output appears on. applyDefaultSymbolizer: function(symbolizer)Contains convenience functions for string manipulation.Vector features use the OpenLayers.Geometry classes as geometry description. A Geometry is a description of a geographic object. Point geometry class.Utility functions for event handling.
Close