Namespaces
Type Definitions
-
olx.AnimationOptions{Object}
-
Properties:
Name Type Argument Description centerol.Coordinate | undefined <optional>
The center of the view at the end of the animation.
zoomnumber | undefined <optional>
The zoom level of the view at the end of the animation. This takes precedence over
resolution.resolutionnumber | undefined <optional>
The resolution of the view at the end of the animation. If
zoomis also provided, this option will be ignored.rotationnumber | undefined <optional>
The rotation of the view at the end of the animation.
anchorol.Coordinate | undefined <optional>
Optional anchor to remained fixed during a rotation or resolution animation.
durationnumber | undefined <optional>
The duration of the animation in milliseconds (defaults to
1000).easingundefined | function <optional>
The easing function used during the animation (defaults to
ol.easing.inAndOut). The function will be called for each frame with a number representing a fraction of the animation's duration. The function should return a number between 0 and 1 representing the progress toward the destination state. -
olx.AtPixelOptions{Object}
-
Object literal with options for the
ol.Map#forEachFeatureAtPixelandol.Map#hasFeatureAtPixelmethods.Properties:
Name Type Argument Description layerFilterfunction | undefined <optional>
Layer filter function. The filter function will receive one argument, the
layer-candidateand it should return a boolean value. Only layers which are visible and for which this function returnstruewill be tested for features. By default, all visible layers will be tested.hitTolerancenumber | undefined <optional>
Hit-detection tolerance in pixels. Pixels inside the radius around the given position will be checked for features. This only works for the canvas renderer and not for WebGL. Default is
0. -
olx.AttributionOptions{Object}
-
Properties:
Name Type Description htmlstring HTML markup for this attribution. Required.
-
olx.CollectionOptions{Object}
-
Properties:
Name Type Argument Description uniqueboolean | undefined <optional>
Disallow the same item from being added to the collection twice. Default is false.
-
olx.DeviceOrientationOptions{Object}
-
Properties:
Name Type Argument Description trackingboolean | undefined <optional>
Start tracking. Default is
false. -
olx.FrameState{Object}
-
Properties:
Name Type Description pixelRationumber Required.
timenumber Required.
viewStateolx.ViewState Required.
-
olx.GeolocationOptions{Object}
-
Properties:
Name Type Argument Description trackingboolean | undefined <optional>
Start Tracking. Default is
false.trackingOptionsGeolocationPositionOptions | undefined <optional>
Tracking options. See http://www.w3.org/TR/geolocation-API/#position_options_interface.
projectionol.ProjectionLike The projection the position is reported in.
-
olx.GraticuleOptions{Object}
-
Properties:
Name Type Argument Description mapol.PluggableMap | undefined <optional>
Reference to an
ol.Mapobject.maxLinesnumber | undefined <optional>
The maximum number of meridians and parallels from the center of the map. The default value is 100, which means that at most 200 meridians and 200 parallels will be displayed. The default value is appropriate for conformal projections like Spherical Mercator. If you increase the value more lines will be drawn and the drawing performance will decrease.
strokeStyleol.style.Stroke | undefined <optional>
The stroke style to use for drawing the graticule. If not provided, the lines will be drawn with
rgba(0,0,0,0.2), a not fully opaque black.targetSizenumber | undefined <optional>
The target size of the graticule cells, in pixels. Default value is 100 pixels.
showLabelsboolean | undefined <optional>
Render a label with the respective latitude/longitude for each graticule line. Default is false.
lonLabelFormatterundefined | function <optional>
Label formatter for longitudes. This function is called with the longitude as argument, and should return a formatted string representing the longitude. By default, labels are formatted as degrees, minutes, seconds and hemisphere.
latLabelFormatterundefined | function <optional>
Label formatter for latitudes. This function is called with the latitude as argument, and should return a formatted string representing the latitude. By default, labels are formatted as degrees, minutes, seconds and hemisphere.
lonLabelPositionnumber | undefined <optional>
Longitude label position in fractions (0..1) of view extent. 0 means at the bottom of the viewport, 1 means at the top. Default is 0.
latLabelPositionnumber | undefined <optional>
Latitude label position in fractions (0..1) of view extent. 0 means at the left of the viewport, 1 means at the right. Default is 1.
lonLabelStyleol.style.Text | undefined <optional>
Longitude label text style. The default is
new ol.style.Text({ font: '12px Calibri,sans-serif', textBaseline: 'bottom', fill: new ol.style.Fill({ color: 'rgba(0,0,0,1)' }), stroke: new ol.style.Stroke({ color: 'rgba(255,255,255,1)', width: 3 }) });Note that the default's
textBaselineconfiguration will not work well forlonLabelPositionconfigurations that position labels close to the top of the viewport.latLabelStyleol.style.Text | undefined <optional>
Latitude label text style. The default is
new ol.style.Text({ font: '12px Calibri,sans-serif', textAlign: 'end', fill: new ol.style.Fill({ color: 'rgba(0,0,0,1)' }), stroke: new ol.style.Stroke({ color: 'rgba(255,255,255,1)', width: 3 }) });Note that the default's
textAlignconfiguration will not work well forlatLabelPositionconfigurations that position labels close to the left of the viewport. -
olx.LayerRendererPlugin{Object}
-
Properties:
Name Type Description handlesfunction Determine if this renderer handles the provided layer. Required.
createfunction Create a layer renderer. Required.
-
olx.LogoOptions{Object}
-
Object literal with config options for the map logo.
Properties:
Name Type Description hrefstring Link url for the logo. Will be followed when the logo is clicked. Required.
srcstring Image src for the logo. Required.
-
olx.MapOptions{Object}
-
Object literal with config options for the map.
Properties:
Name Type Argument Description controlsol.Collection.<ol.control.Control> | Array.<ol.control.Control> | undefined <optional>
Controls initially added to the map. If not specified,
ol.control.defaults()is used.pixelRationumber | undefined <optional>
The ratio between physical pixels and device-independent pixels (dips) on the device. If
undefinedthen it gets set by usingwindow.devicePixelRatio.interactionsol.Collection.<ol.interaction.Interaction> | Array.<ol.interaction.Interaction> | undefined <optional>
Interactions that are initially added to the map. If not specified,
ol.interaction.defaults()is used.keyboardEventTargetElement | Document | string | undefined <optional>
The element to listen to keyboard events on. This determines when the
KeyboardPanandKeyboardZoominteractions trigger. For example, if this option is set todocumentthe keyboard interactions will always trigger. If this option is not specified, the element the library listens to keyboard events on is the map target (i.e. the user-provided div for the map). If this is notdocumentthe target element needs to be focused for key events to be emitted, requiring that the target element has atabindexattribute.layersArray.<ol.layer.Base> | ol.Collection.<ol.layer.Base> | undefined <optional>
Layers. If this is not defined, a map with no layers will be rendered. Note that layers are rendered in the order supplied, so if you want, for example, a vector layer to appear on top of a tile layer, it must come after the tile layer.
loadTilesWhileAnimatingboolean | undefined <optional>
When set to true, tiles will be loaded during animations. This may improve the user experience, but can also make animations stutter on devices with slow memory. Default is
false.loadTilesWhileInteractingboolean | undefined <optional>
When set to true, tiles will be loaded while interacting with the map. This may improve the user experience, but can also make map panning and zooming choppy on devices with slow memory. Default is
false.logoboolean | string | olx.LogoOptions | Element | undefined <optional>
The map logo. A logo to be displayed on the map at all times. If a string is provided, it will be set as the image source of the logo. If an object is provided, the
srcproperty should be the URL for an image and thehrefproperty should be a URL for creating a link. If an element is provided, the element will be used. To disable the map logo, set the option tofalse. By default, the OpenLayers logo is shown.moveTolerancenumber | undefined <optional>
The minimum distance in pixels the cursor must move to be detected as a map move event instead of a click. Increasing this value can make it easier to click on the map. Default is
1.overlaysol.Collection.<ol.Overlay> | Array.<ol.Overlay> | undefined <optional>
Overlays initially added to the map. By default, no overlays are added.
rendererol.renderer.Type | Array.<ol.renderer.Type> | undefined <optional>
Renderer. By default, Canvas and WebGL renderers are tested for support in that order, and the first supported used. Specify a
ol.renderer.Typehere to use a specific renderer. Note that the Canvas renderer fully supports vector data, but WebGL can only render Point geometries.targetElement | string | undefined <optional>
The container for the map, either the element itself or the
idof the element. If not specified at construction time,ol.Map#setTargetmust be called for the map to be rendered.viewol.View | undefined <optional>
The map's view. No layer sources will be fetched unless this is specified at construction time or through
ol.Map#setView. -
olx.MapRendererPlugin{Object}
-
Properties:
Name Type Description handlesfunction Determine if this renderer handles the provided layer. Required.
createfunction Create the map renderer. Required.
-
olx.OverlayOptions{Object}
-
Object literal with config options for the overlay.
Properties:
Name Type Argument Description idnumber | string | undefined <optional>
Set the overlay id. The overlay id can be used with the
ol.Map#getOverlayByIdmethod.elementElement | undefined <optional>
The overlay element.
offsetArray.<number> | undefined <optional>
Offsets in pixels used when positioning the overlay. The first element in the array is the horizontal offset. A positive value shifts the overlay right. The second element in the array is the vertical offset. A positive value shifts the overlay down. Default is
[0, 0].positionol.Coordinate | undefined <optional>
The overlay position in map projection.
positioningol.OverlayPositioning | string | undefined <optional>
Defines how the overlay is actually positioned with respect to its
positionproperty. Possible values are'bottom-left','bottom-center','bottom-right','center-left','center-center','center-right','top-left','top-center', and'top-right'. Default is'top-left'.stopEventboolean | undefined <optional>
Whether event propagation to the map viewport should be stopped. Default is
true. Iftruethe overlay is placed in the same container as that of the controls (CSS class nameol-overlaycontainer-stopevent); iffalseit is placed in the container with CSS class nameol-overlaycontainer.insertFirstboolean | undefined <optional>
Whether the overlay is inserted first in the overlay container, or appended. Default is
true. If the overlay is placed in the same container as that of the controls (see thestopEventoption) you will probably setinsertFirsttotrueso the overlay is displayed below the controls.autoPanboolean | undefined <optional>
If set to
truethe map is panned when callingsetPosition, so that the overlay is entirely visible in the current viewport. The default isfalse.autoPanAnimationolx.OverlayPanOptions | undefined <optional>
The animation options used to pan the overlay into view. This animation is only used when
autoPanis enabled. Adurationandeasingmay be provided to customize the animation.autoPanMarginnumber | undefined <optional>
The margin (in pixels) between the overlay and the borders of the map when autopanning. The default is
20.classNamestring | undefined <optional>
CSS class name. Default is
ol-overlay-container ol-selectable. -
olx.OverlayPanOptions{Object}
-
Properties:
Name Type Description durationnumber | undefined The duration of the animation in milliseconds. Default is
1000.easingundefined | function The easing function to use. Can be an
ol.easingor a custom function. Default isol.easing.inAndOut. -
olx.ProjectionOptions{Object}
-
Object literal with config options for the projection.
Properties:
Name Type Argument Description codestring The SRS identifier code, e.g.
EPSG:4326. Required.unitsol.proj.Units | string | undefined <optional>
Units. Required unless a proj4 projection is defined for
code.extentol.Extent | undefined <optional>
The validity extent for the SRS.
axisOrientationstring | undefined <optional>
The axis orientation as specified in Proj4. The default is
enu.globalboolean | undefined <optional>
Whether the projection is valid for the whole globe. Default is
false.metersPerUnitnumber | undefined <optional>
The meters per unit for the SRS. If not provided, the
unitsare used to get the meters per unit from theol.proj.METERS_PER_UNITlookup table.worldExtentol.Extent | undefined <optional>
The world extent for the SRS.
getPointResolutionfunction | undefined <optional>
Function to determine resolution at a point. The function is called with a
{number}view resolution and an{ol.Coordinate}as arguments, and returns the{number}resolution at the passed coordinate. If this isundefined, the defaultol.proj#getPointResolutionfunction will be used. -
olx.SphereMetricOptions{Object}
-
Object literal with options for the
ol.Sphere.getLengthorol.Sphere.getAreafunctions.Properties:
Name Type Argument Description projectionol.ProjectionLike | undefined <optional>
Projection of the geometry. By default, the geometry is assumed to be in EPSG:3857 (Web Mercator).
radiusnumber | undefined <optional>
Sphere radius. By default, the radius of the earth is used (Clarke 1866 Authalic Sphere).
-
olx.TileOptions{Object}
-
Options for tile constructors.
Properties:
Name Type Description transitionnumber | undefined A duration for tile opacity transitions. By default, tiles will render with an opacity transition that lasts 250 ms. To change the duration, pass a number in milliseconds. A duration of 0 disables the opacity transition.
-
olx.ViewOptions{Object}
-
Object literal with config options for the view.
Properties:
Name Type Argument Description centerol.Coordinate | undefined <optional>
The initial center for the view. The coordinate system for the center is specified with the
projectionoption. Default isundefined, and layer sources will not be fetched if this is not set.constrainRotationboolean | number | undefined <optional>
Rotation constraint.
falsemeans no constraint.truemeans no constraint, but snap to zero near zero. A number constrains the rotation to that number of values. For example,4will constrain the rotation to 0, 90, 180, and 270 degrees. The default istrue.enableRotationboolean | undefined <optional>
Enable rotation. Default is
true. Iffalsea rotation constraint that always sets the rotation to zero is used. TheconstrainRotationoption has no effect ifenableRotationisfalse.extentol.Extent | undefined <optional>
The extent that constrains the center, in other words, center cannot be set outside this extent. Default is
undefined.maxResolutionnumber | undefined <optional>
The maximum resolution used to determine the resolution constraint. It is used together with
minResolution(ormaxZoom) andzoomFactor. If unspecified it is calculated in such a way that the projection's validity extent fits in a 256x256 px tile. If the projection is Spherical Mercator (the default) thenmaxResolutiondefaults to40075016.68557849 / 256 = 156543.03392804097.minResolutionnumber | undefined <optional>
The minimum resolution used to determine the resolution constraint. It is used together with
maxResolution(orminZoom) andzoomFactor. If unspecified it is calculated assuming 29 zoom levels (with a factor of 2). If the projection is Spherical Mercator (the default) thenminResolutiondefaults to40075016.68557849 / 256 / Math.pow(2, 28) = 0.0005831682455839253.maxZoomnumber | undefined <optional>
The maximum zoom level used to determine the resolution constraint. It is used together with
minZoom(ormaxResolution) andzoomFactor. Default is28. Note that ifminResolutionis also provided, it is given precedence overmaxZoom.minZoomnumber | undefined <optional>
The minimum zoom level used to determine the resolution constraint. It is used together with
maxZoom(orminResolution) andzoomFactor. Default is0. Note that ifmaxResolutionis also provided, it is given precedence overminZoom.projectionol.ProjectionLike The projection. Default is
EPSG:3857(Spherical Mercator).resolutionnumber | undefined <optional>
The initial resolution for the view. The units are
projectionunits per pixel (e.g. meters per pixel). An alternative to setting this is to setzoom. Default isundefined, and layer sources will not be fetched if neither this norzoomare defined.resolutionsArray.<number> | undefined <optional>
Resolutions to determine the resolution constraint. If set the
maxResolution,minResolution,minZoom,maxZoom, andzoomFactoroptions are ignored.rotationnumber | undefined <optional>
The initial rotation for the view in radians (positive rotation clockwise). Default is
0.zoomnumber | undefined <optional>
Only used if
resolutionis not defined. Zoom level used to calculate the initial resolution for the view. The initial resolution is determined using theol.View#constrainResolutionmethod.zoomFactornumber | undefined <optional>
The zoom factor used to determine the resolution constraint. Default is
2. -
olx.ViewState{Object}
-
Properties:
Name Type Description centerol.Coordinate Required.
projectionol.proj.Projection Required.
resolutionnumber Required.
rotationnumber Required.
zoomnumber The current zoom level. Required.
OpenLayers