Layer js


OpenLayers.Layer - OpenLayers OpenLayers.LayerSummaryOpenLayers.LayerPropertiesid{String}name{String}div{DOMElement}opacity{Float} The layer’s opacity. alwaysInRange{Boolean} If a layer’s display should not be scale-based, this should be set to true. ConstantsRESOLUTION_PROPERTIES{Array} The properties that are used for calculating resolutions information.Propertiesevents{OpenLayers.Events}map{OpenLayers.Map} This variable is set when the layer is added to the map, via the accessor function setMap().isBaseLayer{Boolean} Whether or not the layer is a base layer. alpha{Boolean} The layer’s images have an alpha channel. displayInLayerSwitcher{Boolean} Display the layer’s name in the layer switcher. visibility{Boolean} The layer should be displayed in the map. attribution{String} Attribution string, displayed when an OpenLayers.Control.Attribution has been added to the map.inRange{Boolean} The current map resolution is within the layer’s min/max range. options{Object} An optional object whose properties will be set on the layer. eventListeners{Object} If set as an option at construction, the eventListeners object will be registered with OpenLayers.Events.on. gutter{Integer} Determines the width (in pixels) of the gutter around image tiles to ignore. projection{OpenLayers.Projection} or {String} Specifies the projection of the layer. units{String} The layer map units. scales{Array} An array of map scales in descending order. resolutions{Array} A list of map resolutions (map units per pixel) in descending order. maxExtent{<OpenLayers.Bounds>|Array} If provided as an array, the array should consist of four values (left, bottom, right, top). minExtent{<OpenLayers.Bounds>|Array} If provided as an array, the array should consist of four values (left, bottom, right, top). maxResolution{Float} Default max is 360 deg / 256 px, which corresponds to zoom level 0 on gmaps. minResolution{Float}numZoomLevels{Integer}minScale{Float}maxScale{Float}displayOutsideMaxExtent{Boolean} Request map tiles that are completely outside of the max extent for this layer. wrapDateLine{Boolean} Wraps the world at the international dateline, so the map can be panned infinitely in longitudinal direction. metadata{Object} This object can be used to store additional information on a layer object.ConstructorOpenLayers.LayerFunctionsdestroyDestroy is a destructor: this is to alleviate cyclic references which the Javascript garbage cleaner can not take care of on its own.clonegetOptionsExtracts an object from the layer with the properties that were set as options, but updates them with the values currently set on the instance.setNameSets the new layer name for this layer. addOptionsonMapResizeThis function can be implemented by subclassesredrawRedraws the layer. moveTomoveByPxMove the layer based on pixel vector. setMapSet the map property for the layer. afterAddCalled at the end of the map.addLayer sequence. removeMapJust as setMap() allows each layer the possibility to take a personalized action on being added to the map, removeMap() allows each layer to take a personalized action on being removed from it. getImageSizesetTileSizeSet the tile size based on the map size. getVisibility{Boolean} The layer should be displayed (if in range).setVisibilitySet the visibility flag for the layer and hide/show & redraw accordingly. displayHide or show the Layer. calculateInRange{Boolean} The layer is displayable at the current map’s current resolution. setIsBaseLayerinitResolutionsThis method’s responsibility is to set up the ‘resolutions’ array for the layer -- this array is what the layer will use to interface between the zoom levels of the map and the resolution display of the layer.resolutionsFromScalesDerive resolutions from scales.calculateResolutionsCalculate resolutions based on the provided properties.getResolution{Float} The currently selected resolution of the map, taken from the resolutions array, indexed by current zoom level.getExtent{OpenLayers.Bounds} A Bounds object which represents the lon/lat bounds of the current viewPort.getZoomForExtentgetDataExtentCalculates the max extent which includes all of the data for the layer. getResolutionForZoomgetZoomForResolutiongetLonLatFromViewPortPxgetViewPortPxFromLonLatReturns a pixel location given a map location. setOpacitySets the opacity for the entire layer (all images)getZIndex{Integer} the z-index of this layersetZIndexadjustBoundsThis function will take a bounds, and if wrapDateLine option is set on the layer, it will return a bounds which is wrapped around the world. Properties id{String} name{String} div{DOMElement} opacity{Float} The layer’s opacity.  Float number between 0.0 and 1.0.  Default is 1. alwaysInRange{Boolean} If a layer’s display should not be scale-based, this should be set to true.  This will cause the layer, as an overlay, to always be ‘active’, by always returning true from the calculateInRange() function.If not explicitly specified for a layer, its value will be determined on startup in initResolutions() based on whether or not any scale-specific properties have been set as options on the layer.  If no scale-specific options have been set on the layer, we assume that it should always be in range.See #987 for more info. Constants RESOLUTION_PROPERTIES{Array} The properties that are used for calculating resolutions information. Properties events{OpenLayers.Events}Register a listener for a particular event with the following syntaxlayer.events.register(type, obj, listener);Listeners will be called with a reference to an event object.  The properties of this event depends on exactly what happened.All event objects have at least the following propertiesobject{Object} A reference to layer.events.object.element{DOMElement} A reference to layer.events.element.Supported map event typesloadstartTriggered when layer loading starts.loadendTriggered when layer loading ends.visibilitychangedTriggered when layer visibility is changed.moveTriggered when layer moves (triggered with every mousemove during a drag).moveendTriggered when layer is done moving, object passed as argument has a zoomChanged boolean property which tells that the zoom has changed.addedTriggered after the layer is added to a map.  Listeners will receive an object with a map property referencing the map and a layer property referencing the layer.removedTriggered after the layer is removed from the map.  Listeners will receive an object with a map property referencing the map and a layer property referencing the layer. map{OpenLayers.Map} This variable is set when the layer is added to the map, via the accessor function setMap(). isBaseLayer{Boolean} Whether or not the layer is a base layer.  This should be set individually by all subclasses.  Default is false alpha{Boolean} The layer’s images have an alpha channel.  Default is false. displayInLayerSwitcher{Boolean} Display the layer’s name in the layer switcher.  Default is true. visibility{Boolean} The layer should be displayed in the map.  Default is true. attribution{String} Attribution string, displayed when an OpenLayers.Control.Attribution has been added to the map. inRange{Boolean} The current map resolution is within the layer’s min/max range.  This is set in OpenLayers.Map.setCenter whenever the zoom changes. options{Object} An optional object whose properties will be set on the layer.  Any of the layer properties can be set as a property of the options object and sent to the constructor when the layer is created. eventListeners{Object} If set as an option at construction, the eventListeners object will be registered with OpenLayers.Events.on.  Object structure must be a listeners object as shown in the example for the events.on method. gutter{Integer} Determines the width (in pixels) of the gutter around image tiles to ignore.  By setting this property to a non-zero value, images will be requested that are wider and taller than the tile size by a value of 2 x gutter.  This allows artifacts of rendering at tile edges to be ignored.  Set a gutter value that is equal to half the size of the widest symbol that needs to be displayed.  Defaults to zero.  Non-tiled layers always have zero gutter. projection{OpenLayers.Projection} or {String} Specifies the projection of the layer.  Can be set in the layer options.  If not specified in the layer options, it is set to the default projection specified in the map, when the layer is added to the map.  Projection along with default maxExtent and resolutions are set automatically with commercial baselayers in EPSG:3857, such as Google, Bing and OpenStreetMap, and do not need to be specified.  Otherwise, if specifying projection, also set maxExtent, maxResolution or resolutions as appropriate.  When using vector layers with strategies, layer projection should be set to the projection of the source data if that is different from the map default.Can be either a string or an OpenLayers.Projection object; if a string is passed, will be converted to an object when the layer is added to the map. units{String} The layer map units.  Defaults to null.  Possible values are ‘degrees’ (or ‘dd’), ‘m’, ‘ft’, ‘km’, ‘mi’, ‘inches’.  Normally taken from the projection.  Only required if both map and layers do not define a projection, or if they define a projection which does not define units. scales{Array} An array of map scales in descending order.  The values in the array correspond to the map scale denominator.  Note that these values only make sense if the display (monitor) resolution of the client is correctly guessed by whomever is configuring the application.  In addition, the units property must also be set.  Use resolutions instead wherever possible. resolutions{Array} A list of map resolutions (map units per pixel) in descending order.  If this is not set in the layer constructor, it will be set based on other resolution related properties (maxExtent, maxResolution, maxScale, etc.). maxExtent{<OpenLayers.Bounds>|Array} If provided as an array, the array should consist of four values (left, bottom, right, top).  The maximum extent for the layer.  Defaults to null.The center of these bounds will not stray outside of the viewport extent during panning.  In addition, if displayOutsideMaxExtent is set to false, data will not be requested that falls completely outside of these bounds. minExtent{<OpenLayers.Bounds>|Array} If provided as an array, the array should consist of four values (left, bottom, right, top).  The minimum extent for the layer.  Defaults to null. maxResolution{Float} Default max is 360 deg / 256 px, which corresponds to zoom level 0 on gmaps.  Specify a different value in the layer options if you are not using the default OpenLayers.Map.tileSize and displaying the whole world. minResolution{Float} numZoomLevels{Integer} minScale{Float} maxScale{Float} displayOutsideMaxExtent{Boolean} Request map tiles that are completely outside of the max extent for this layer.  Defaults to false. wrapDateLine{Boolean} Wraps the world at the international dateline, so the map can be panned infinitely in longitudinal direction.  Only use this on the base layer, and only if the layer’s maxExtent equals the world bounds.  #487 for more info. metadata{Object} This object can be used to store additional information on a layer object. Constructor OpenLayers.LayerParametersname{String} The layer nameoptions{Object} Hashtable of extra options to tag onto the layer Functions destroydestroy: function(setNewBaseLayer)Destroy is a destructor: this is to alleviate cyclic references which the Javascript garbage cleaner can not take care of on its own.ParameterssetNewBaseLayer{Boolean} Set a new base layer when this layer has been destroyed.  Default is true. cloneclone: function (obj)Parametersobj{OpenLayers.Layer} The layer to be clonedReturns{OpenLayers.Layer} An exact clone of this OpenLayers.Layer getOptionsgetOptions: function()Extracts an object from the layer with the properties that were set as options, but updates them with the values currently set on the instance.Returns{Object} the options of the layer, representing the current state. setNamesetName: function(newName)Sets the new layer name for this layer.  Can trigger a changelayer event on the map.ParametersnewName{String} The new name. addOptionsaddOptions: function (newOptions,reinitialize)ParametersnewOptions{Object}reinitialize{Boolean} If set to true, and if resolution options of the current baseLayer were changed, the map will be recentered to make sure that it is displayed with a valid resolution, and a changebaselayer event will be triggered. onMapResizeonMapResize: function()This function can be implemented by subclasses redrawredraw: function()Redraws the layer.  Returns true if the layer was redrawn, false if not.Returns{Boolean} The layer was redrawn. moveTomoveTo:function(bounds,zoomChanged,dragging)Parametersbounds{OpenLayers.Bounds}zoomChanged{Boolean} Tells when zoom has changed, as layers have to do some init work in that case.dragging{Boolean} moveByPxmoveByPx: function(dx,dy)Move the layer based on pixel vector.  To be implemented by subclasses.Parametersdx{Number} The x coord of the displacement vector.dy{Number} The y coord of the displacement vector. setMapsetMap: function(map)Set the map property for the layer.  This is done through an accessor so that subclasses can override this and take special action once they have their map variable set.Here we take care to bring over any of the necessary default properties from the map.Parametersmap{OpenLayers.Map} afterAddafterAdd: function()Called at the end of the map.addLayer sequence.  At this point, the map will have a base layer.  To be overridden by subclasses. removeMapremoveMap: function(map)Just as setMap() allows each layer the possibility to take a personalized action on being added to the map, removeMap() allows each layer to take a personalized action on being removed from it.  For now, this will be mostly unused, except for the EventPane layer, which needs this hook so that it can remove the special invisible pane.Parametersmap{OpenLayers.Map} getImageSizegetImageSize: function(bounds)Parametersbounds{OpenLayers.Bounds} optional tile bounds, can be used by subclasses that have to deal with different tile sizes at the layer extent edges (e.g.  Zoomify)Returns{OpenLayers.Size} The size that the image should be, taking into account gutters. setTileSizesetTileSize: function(size)Set the tile size based on the map size.  This also sets layer.imageSize or use by Tile.Image.Parameterssize{OpenLayers.Size} getVisibilitygetVisibility: function()Returns{Boolean} The layer should be displayed (if in range). setVisibilitysetVisibility: function(visibility)Set the visibility flag for the layer and hide/show & redraw accordingly.  Fire event unless otherwise specifiedNote that visibility is no longer simply whether or not the layer’s style.display is set to “block”.  Now we store a ‘visibility’ state property on the layer class, this allows us to remember whether or not we desire for a layer to be visible.  In the case where the map’s resolution is out of the layer’s range, this desire may be subverted.Parametersvisibility{Boolean} Whether or not to display the layer (if in range) displaydisplay: function(display)Hide or show the Layer.  This is designed to be used internally, and is not generally the way to enable or disable the layer.  For that, use the setVisibility function instead..Parametersdisplay{Boolean} calculateInRangecalculateInRange: function()Returns{Boolean} The layer is displayable at the current map’s current resolution.  Note that if ‘alwaysInRange’ is true for the layer, this function will always return true. setIsBaseLayersetIsBaseLayer: function(isBaseLayer)ParametersisBaseLayer{Boolean} initResolutionsinitResolutions: function()This method’s responsibility is to set up the ‘resolutions’ array for the layer -- this array is what the layer will use to interface between the zoom levels of the map and the resolution display of the layer.The user has several options that determine how the array is set up.For a detailed explanation, see the following wiki from the openlayers.org homepage: http://trac.openlayers.org/wiki/SettingZoomLevels resolutionsFromScalesresolutionsFromScales: function(scales)Derive resolutions from scales.Parametersscales{Array(Number)} ScalesReturns {Array(Number)} Resolutions calculateResolutionscalculateResolutions: function(props)Calculate resolutions based on the provided properties.Parametersprops{Object} PropertiesReturns{Array({Number})} Array of resolutions. getResolutiongetResolution: function()Returns{Float} The currently selected resolution of the map, taken from the resolutions array, indexed by current zoom level. getExtentgetExtent: function()Returns{OpenLayers.Bounds} A Bounds object which represents the lon/lat bounds of the current viewPort. getZoomForExtentgetZoomForExtent: function(extent,closest)Parametersextent{OpenLayers.Bounds}closest{Boolean} Find the zoom level that most closely fits the specified bounds.  Note that this may result in a zoom that does not exactly contain the entire extent.  Default is false.Returns{Integer} The index of the zoomLevel (entry in the resolutions array) for the passed-in extent.  We do this by calculating the ideal resolution for the given extent (based on the map size) and then calling getZoomForResolution(), passing along the ‘closest’ parameter. getDataExtentgetDataExtent: function ()Calculates the max extent which includes all of the data for the layer.  This function is to be implemented by subclasses.Returns{OpenLayers.Bounds} getResolutionForZoomgetResolutionForZoom: function(zoom)Parameterszoom{Float}Returns{Float} A suitable resolution for the specified zoom. getZoomForResolutiongetZoomForResolution: function(resolution,closest)Parametersresolution{Float}closest{Boolean} Find the zoom level that corresponds to the absolute closest resolution, which may result in a zoom whose corresponding resolution is actually smaller than we would have desired (if this is being called from a getZoomForExtent() call, then this means that the returned zoom index might not actually contain the entire extent specified... but it’ll be close).  Default is false.Returns{Integer} The index of the zoomLevel (entry in the resolutions array) that corresponds to the best fit resolution given the passed in value and the ‘closest’ specification. getLonLatFromViewPortPxgetLonLatFromViewPortPx: function (viewPortPx)ParametersviewPortPx{<OpenLayers.Pixel>|Object} An OpenLayers.Pixel or an object with a ‘x’ and ‘y’ properties.Returns{OpenLayers.LonLat} An OpenLayers.LonLat which is the passed-in view port OpenLayers.Pixel, translated into lon/lat by the layer. getViewPortPxFromLonLatgetViewPortPxFromLonLat: function (lonlat,resolution)Returns a pixel location given a map location.  This method will return fractional pixel values.Parameterslonlat{<OpenLayers.LonLat>|Object} An OpenLayers.LonLat or an object with a ‘lon’ and ‘lat’ properties.Returns{OpenLayers.Pixel} An OpenLayers.Pixel which is the passed-in lonlat translated into view port pixels. setOpacitysetOpacity: function(opacity)Sets the opacity for the entire layer (all images)Parametersopacity{Float} getZIndexgetZIndex: function ()Returns{Integer} the z-index of this layer setZIndexsetZIndex: function (zIndex)ParameterszIndex{Integer} adjustBoundsadjustBounds: function (bounds)This function will take a bounds, and if wrapDateLine option is set on the layer, it will return a bounds which is wrapped around the world.  We do not wrap for bounds which cross the maxExtent.left/right, only bounds which are entirely to the left or entirely to the right.Parametersbounds{OpenLayers.Bounds} 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 OpenLayers.Map are interactive maps embedded in a web page. The attribution control adds attribution from layers to the map display. on: function(object)Convenience method for registering listeners with a common scope. Methods for coordinate transforms between coordinate systems. Contains convenience functions for string manipulation.destroy: function(setNewBaseLayer)Destroy is a destructor: this is to alleviate cyclic references which the Javascript garbage cleaner can not take care of on its own.clone: function (obj)getOptions: function()Extracts an object from the layer with the properties that were set as options, but updates them with the values currently set on the instance.setName: function(newName)Sets the new layer name for this layer. addOptions: function (newOptions,reinitialize)onMapResize: function()This function can be implemented by subclassesredraw: function()Redraws the layer. moveTo:function(bounds,zoomChanged,dragging)moveByPx: function(dx,dy)Move the layer based on pixel vector. setMap: function(map)Set the map property for the layer. afterAdd: function()Called at the end of the map.addLayer sequence. removeMap: function(map)Just as setMap() allows each layer the possibility to take a personalized action on being added to the map, removeMap() allows each layer to take a personalized action on being removed from it. getImageSize: function(bounds)setTileSize: function(size)Set the tile size based on the map size. getVisibility: function(){Boolean} The layer should be displayed (if in range).setVisibility: function(visibility)Set the visibility flag for the layer and hide/show & redraw accordingly. display: function(display)Hide or show the Layer. calculateInRange: function(){Boolean} The layer is displayable at the current map’s current resolution. setIsBaseLayer: function(isBaseLayer)initResolutions: function()This method’s responsibility is to set up the ‘resolutions’ array for the layer -- this array is what the layer will use to interface between the zoom levels of the map and the resolution display of the layer.resolutionsFromScales: function(scales)Derive resolutions from scales.calculateResolutions: function(props)Calculate resolutions based on the provided properties.getResolution: function(){Float} The currently selected resolution of the map, taken from the resolutions array, indexed by current zoom level.getExtent: function(){OpenLayers.Bounds} A Bounds object which represents the lon/lat bounds of the current viewPort.Instances of this class represent bounding boxes. getZoomForExtent: function(extent,closest)getDataExtent: function ()Calculates the max extent which includes all of the data for the layer. getResolutionForZoom: function(zoom)getZoomForResolution: function(resolution,closest)getLonLatFromViewPortPx: function (viewPortPx)getViewPortPxFromLonLat: function (lonlat,resolution)Returns a pixel location given a map location. setOpacity: function(opacity)Sets the opacity for the entire layer (all images)getZIndex: function (){Integer} the z-index of this layersetZIndex: function (zIndex)adjustBounds: function (bounds)This function will take a bounds, and if wrapDateLine option is set on the layer, it will return a bounds which is wrapped around the world. setCenter: function(lonlat,zoom,dragging,forceZoomChange)Set the map center (and optionally, the zoom level).{Array} A list of map resolutions (map units per pixel) in descending order. {Boolean} Request map tiles that are completely outside of the max extent for this layer. {OpenLayers.Size} Set in the map options to override the default tile size for this map.{Object} An optional object whose properties will be set on the layer. Instances of this class represent a width/height pairThis class represents a longitude and latitude pairThis class represents a screen coordinate, in x and y coordinates Close

Wyszukiwarka

Podobne podstrony:
Layer js
Util js
layer scroller
js zegarek na www
Animation js
Format js
Map js
layer
livehelp js
Tile js
PHP JS readme
Style js
b js
Rule js
js 6
help?llon js source
js 4
Format js

więcej podobnych podstron