Type Definitions
-
olx.source.BingMapsOptions{Object}
-
Properties:
Name Type Argument Description cacheSizenumber | undefined <optional>
Cache size. Default is
2048.hidpiboolean | undefined <optional>
If
truehidpi tiles will be requested. Default isfalse.culturestring | undefined <optional>
Culture code. Default is
en-us.keystring Bing Maps API key. Get yours at http://www.bingmapsportal.com/. Required.
imagerySetstring Type of imagery. Required.
maxZoomnumber | undefined <optional>
Max zoom. Default is what's advertized by the BingMaps service (
21currently).reprojectionErrorThresholdnumber | undefined <optional>
Maximum allowed reprojection error (in pixels). Default is
0.5. Higher values can increase reprojection performance, but decrease precision.tileLoadFunctionol.TileLoadFunctionType | undefined <optional>
Optional function to load a tile given a URL. The default is
function(imageTile, src) { imageTile.getImage().src = src; };wrapXboolean | undefined <optional>
Whether to wrap the world horizontally. Default is
true.transitionnumber | undefined <optional>
Duration of the opacity transition for rendering. To disable the opacity transition, pass
transition: 0. -
olx.source.CartoDBOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
cacheSizenumber | undefined <optional>
Cache size. Default is
2048.crossOriginnull | string | undefined <optional>
The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.logostring | olx.LogoOptions | undefined <optional>
Logo.
projectionol.ProjectionLike Projection. Default is
EPSG:3857.maxZoomnumber | undefined <optional>
Optional max zoom level. Default is
18.minZoomnumber | undefined <optional>
Minimum zoom.
wrapXboolean | undefined <optional>
Whether to wrap the world horizontally. Default is
true.configObject | undefined <optional>
If using anonymous maps, the CartoDB config to use. See http://docs.cartodb.com/cartodb-platform/maps-api/anonymous-maps/ for more detail. If using named maps, a key-value lookup with the template parameters. See http://docs.cartodb.com/cartodb-platform/maps-api/named-maps/ for more detail.
mapstring | undefined <optional>
If using named maps, this will be the name of the template to load. See http://docs.cartodb.com/cartodb-platform/maps-api/named-maps/ for more detail.
accountstring CartoDB account name Required.
-
olx.source.ClusterOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
distancenumber | undefined <optional>
Minimum distance in pixels between clusters. Default is
20.extentol.Extent | undefined <optional>
Extent.
geometryFunctionundefined | function <optional>
Function that takes an
ol.Featureas argument and returns anol.geom.Pointas cluster calculation point for the feature. When a feature should not be considered for clustering, the function should returnnull. The default, which works when the underyling source contains point features only, isfunction(feature) { return feature.getGeometry(); }See
ol.geom.Polygon#getInteriorPointfor a way to get a cluster calculation point for polygons.formatol.format.Feature | undefined <optional>
Format.
logostring | undefined <optional>
Logo.
projectionol.ProjectionLike Projection.
sourceol.source.Vector Source. Required.
wrapXboolean | undefined <optional>
WrapX. Default is true
-
olx.source.ImageArcGISRestOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
crossOriginnull | string | undefined <optional>
The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.hidpiboolean | undefined <optional>
Use the
ol.Map#pixelRatiovalue when requesting the image from the remote server. Default istrue.logostring | olx.LogoOptions | undefined <optional>
Logo.
imageLoadFunctionol.ImageLoadFunctionType | undefined <optional>
Optional function to load an image given a URL.
paramsObject.<string, *> | undefined <optional>
ArcGIS Rest parameters. This field is optional. Service defaults will be used for any fields not specified.
FORMATisPNG32by default.FisIMAGEby default.TRANSPARENTistrueby default.BBOX,SIZE,BBOXSR, andIMAGESRwill be set dynamically. SetLAYERS` to override the default service layer visibility. See http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Map/02r3000000v7000000/ for further reference.projectionol.ProjectionLike Projection.
rationumber | undefined <optional>
Ratio.
1means image requests are the size of the map viewport,2means twice the size of the map viewport, and so on. Default is1.5.resolutionsArray.<number> | undefined <optional>
Resolutions. If specified, requests will be made for these resolutions only.
urlstring | undefined <optional>
ArcGIS Rest service URL for a Map Service or Image Service. The url should include /MapServer or /ImageServer.
-
olx.source.ImageCanvasOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
canvasFunctionol.CanvasFunctionType Canvas function. The function returning the canvas element used by the source as an image. The arguments passed to the function are:
{ol.Extent}the image extent,{number}the image resolution,{number}the device pixel ratio,{ol.Size}the image size, and{ol.proj.Projection}the image projection. The canvas returned by this function is cached by the source. If the value returned by the function is later changed thendispatchChangeEventshould be called on the source for the source to invalidate the current cached image. Required.logostring | olx.LogoOptions | undefined <optional>
Logo.
projectionol.ProjectionLike Projection.
rationumber | undefined <optional>
Ratio. 1 means canvases are the size of the map viewport, 2 means twice the width and height of the map viewport, and so on. Must be
1or higher. Default is1.5.resolutionsArray.<number> | undefined <optional>
Resolutions. If specified, new canvases will be created for these resolutions only.
stateol.source.State | undefined <optional>
Source state.
-
olx.source.ImageMapGuideOptions{Object}
-
Properties:
Name Type Argument Description urlstring | undefined <optional>
The mapagent url.
displayDpinumber | undefined <optional>
The display resolution. Default is
96.metersPerUnitnumber | undefined <optional>
The meters-per-unit value. Default is
1.hidpiboolean | undefined <optional>
Use the
ol.Map#pixelRatiovalue when requesting the image from the remote server. Default istrue.useOverlayboolean | undefined <optional>
If
true, will useGETDYNAMICMAPOVERLAYIMAGE.projectionol.ProjectionLike Projection.
rationumber | undefined <optional>
Ratio.
1means image requests are the size of the map viewport,2means twice the width and height of the map viewport, and so on. Must be1or higher. Default is1.resolutionsArray.<number> | undefined <optional>
Resolutions. If specified, requests will be made for these resolutions only.
imageLoadFunctionol.ImageLoadFunctionType | undefined <optional>
Optional function to load an image given a URL.
paramsObject | undefined <optional>
Additional parameters.
-
olx.source.ImageStaticOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
crossOriginnull | string | undefined <optional>
The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.imageExtentol.Extent Extent of the image in map coordinates. This is the [left, bottom, right, top] map coordinates of your image. Required.
imageLoadFunctionol.ImageLoadFunctionType | undefined <optional>
Optional function to load an image given a URL.
logostring | olx.LogoOptions | undefined <optional>
Optional logo.
projectionol.ProjectionLike Projection.
imageSizeol.Size | undefined <optional>
Size of the image in pixels. Usually the image size is auto-detected, so this only needs to be set if auto-detection fails for some reason.
urlstring Image URL. Required.
-
olx.source.ImageVectorOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
logostring | olx.LogoOptions | undefined <optional>
Logo.
projectionol.ProjectionLike Projection.
rationumber | undefined <optional>
Ratio. 1 means canvases are the size of the map viewport, 2 means twice the width and height of the map viewport, and so on. Must be
1or higher. Default is1.5.renderBuffernumber | undefined <optional>
The buffer around the viewport extent used by the renderer when getting features from the vector source for the rendering or hit-detection. Recommended value: the size of the largest symbol, line width or label. Default is 100 pixels.
resolutionsArray.<number> | undefined <optional>
Resolutions. If specified, new canvases will be created for these resolutions only.
sourceol.source.Vector The vector source from which the vector features drawn in canvas elements are read. Required.
styleol.style.Style | Array.<ol.style.Style> | ol.StyleFunction | undefined <optional>
Style to use when rendering features to the canvas.
-
olx.source.ImageWMSOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
crossOriginnull | string | undefined <optional>
The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.hidpiboolean | undefined <optional>
Use the
ol.Map#pixelRatiovalue when requesting the image from the remote server. Default istrue.serverTypeol.source.WMSServerType | string | undefined <optional>
The type of the remote WMS server:
mapserver,geoserverorqgis. Only needed ifhidpiistrue. Default isundefined.imageLoadFunctionol.ImageLoadFunctionType | undefined <optional>
Optional function to load an image given a URL.
logostring | olx.LogoOptions | undefined <optional>
Logo.
paramsObject.<string, *> WMS request parameters. At least a
LAYERSparam is required.STYLESis''by default.VERSIONis1.3.0by default.WIDTH,HEIGHT,BBOXandCRS(SRSfor WMS version < 1.3.0) will be set dynamically. Required.projectionol.ProjectionLike Projection.
rationumber | undefined <optional>
Ratio.
1means image requests are the size of the map viewport,2means twice the width and height of the map viewport, and so on. Must be1or higher. Default is1.5.resolutionsArray.<number> | undefined <optional>
Resolutions. If specified, requests will be made for these resolutions only.
urlstring | undefined <optional>
WMS service URL.
-
olx.source.MapQuestOptions{Object}
-
Properties:
Name Type Description cacheSizenumber | undefined Cache size. Default is
2048.layerstring Layer. Possible values are
osm,sat, andhyb. Required.reprojectionErrorThresholdnumber | undefined Maximum allowed reprojection error (in pixels). Default is
0.5. Higher values can increase reprojection performance, but decrease precision.tileLoadFunctionol.TileLoadFunctionType | undefined Optional function to load a tile given a URL. The default is
function(imageTile, src) { imageTile.getImage().src = src; };urlstring | undefined URL template. Must include
{x},{y}or{-y}, and{z}placeholders. -
olx.source.OSMOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
cacheSizenumber | undefined <optional>
Cache size. Default is
2048.crossOriginnull | string | undefined <optional>
The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.Default is
anonymous.maxZoomnumber | undefined <optional>
Max zoom. Default is
19.opaqueboolean | undefined <optional>
Whether the layer is opaque. Default is
true.reprojectionErrorThresholdnumber | undefined <optional>
Maximum allowed reprojection error (in pixels). Default is
0.5. Higher values can increase reprojection performance, but decrease precision.tileLoadFunctionol.TileLoadFunctionType | undefined <optional>
Optional function to load a tile given a URL. The default is
function(imageTile, src) { imageTile.getImage().src = src; };urlstring | undefined <optional>
URL template. Must include
{x},{y}or{-y}, and{z}placeholders. Default ishttps://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png.wrapXboolean | undefined <optional>
Whether to wrap the world horizontally. Default is
true. -
olx.source.RasterOptions{Object}
-
Properties:
Name Type Argument Description sourcesArray.<ol.source.Source> Input sources. Required.
operationol.RasterOperation | undefined <optional>
Raster operation. The operation will be called with data from input sources and the output will be assigned to the raster source.
libObject | undefined <optional>
Functions that will be made available to operations run in a worker.
threadsnumber | undefined <optional>
By default, operations will be run in a single worker thread. To avoid using workers altogether, set
threads: 0. For pixel operations, operations can be run in multiple worker threads. Note that there is additional overhead in transferring data to multiple workers, and that depending on the user's system, it may not be possible to parallelize the work.operationTypeol.source.RasterOperationType | undefined <optional>
Operation type. Supported values are
'pixel'and'image'. By default,'pixel'operations are assumed, and operations will be called with an array of pixels from input sources. If set to'image', operations will be called with an array of ImageData objects from input sources. -
olx.source.StamenOptions{Object}
-
Properties:
Name Type Argument Description cacheSizenumber | undefined <optional>
Cache size. Default is
2048.layerstring Layer. Required.
minZoomnumber | undefined <optional>
Minimum zoom.
maxZoomnumber | undefined <optional>
Maximum zoom.
opaqueboolean | undefined <optional>
Whether the layer is opaque.
reprojectionErrorThresholdnumber | undefined <optional>
Maximum allowed reprojection error (in pixels). Default is
0.5. Higher values can increase reprojection performance, but decrease precision.tileLoadFunctionol.TileLoadFunctionType | undefined <optional>
Optional function to load a tile given a URL. The default is
function(imageTile, src) { imageTile.getImage().src = src; };urlstring | undefined <optional>
URL template. Must include
{x},{y}or{-y}, and{z}placeholders.wrapXboolean | undefined <optional>
Whether to wrap the world horizontally. Default is
true. -
olx.source.TileArcGISRestOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
cacheSizenumber | undefined <optional>
Cache size. Default is
2048.crossOriginnull | string | undefined <optional>
The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.paramsObject.<string, *> | undefined <optional>
ArcGIS Rest parameters. This field is optional. Service defaults will be used for any fields not specified.
FORMATisPNG32by default.FisIMAGEby default.TRANSPARENTistrueby default.BBOX,SIZE,BBOXSR, andIMAGESRwill be set dynamically. SetLAYERS` to override the default service layer visibility. See http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Map/02r3000000v7000000/ for further reference.logostring | olx.LogoOptions | undefined <optional>
Logo.
tileGridol.tilegrid.TileGrid | undefined <optional>
Tile grid. Base this on the resolutions, tilesize and extent supported by the server. If this is not defined, a default grid will be used: if there is a projection extent, the grid will be based on that; if not, a grid based on a global extent with origin at 0,0 will be used.
projectionol.ProjectionLike Projection.
reprojectionErrorThresholdnumber | undefined <optional>
Maximum allowed reprojection error (in pixels). Default is
0.5. Higher values can increase reprojection performance, but decrease precision.tileLoadFunctionol.TileLoadFunctionType | undefined <optional>
Optional function to load a tile given a URL. The default is
function(imageTile, src) { imageTile.getImage().src = src; };urlstring | undefined <optional>
ArcGIS Rest service URL for a Map Service or Image Service. The url should include /MapServer or /ImageServer.
wrapXboolean | undefined <optional>
Whether to wrap the world horizontally. Default is
true.transitionnumber | undefined <optional>
Duration of the opacity transition for rendering. To disable the opacity transition, pass
transition: 0.urlsArray.<string> | undefined <optional>
ArcGIS Rest service urls. Use this instead of
urlwhen the ArcGIS Service supports multiple urls for export requests. -
olx.source.TileDebugOptions{Object}
-
Properties:
Name Type Argument Description projectionol.ProjectionLike Projection.
tileGridol.tilegrid.TileGrid | undefined <optional>
Tile grid.
wrapXboolean | undefined <optional>
Whether to wrap the world horizontally. Default is
true. -
olx.source.TileImageOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
cacheSizenumber | undefined <optional>
Cache size. Default is
2048.crossOriginnull | string | undefined <optional>
The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.logostring | olx.LogoOptions | undefined <optional>
Logo.
opaqueboolean | undefined <optional>
Whether the layer is opaque.
projectionol.ProjectionLike Projection.
reprojectionErrorThresholdnumber | undefined <optional>
Maximum allowed reprojection error (in pixels). Default is
0.5. Higher values can increase reprojection performance, but decrease precision.stateol.source.State | undefined <optional>
Source state.
tileClassfunction | undefined <optional>
Class used to instantiate image tiles. Default is
ol.ImageTile.tileGridol.tilegrid.TileGrid | undefined <optional>
Tile grid.
tileLoadFunctionol.TileLoadFunctionType | undefined <optional>
Optional function to load a tile given a URL. The default is
function(imageTile, src) { imageTile.getImage().src = src; };tilePixelRationumber | undefined <optional>
The pixel ratio used by the tile service. For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px by 512px images (for retina/hidpi devices) then
tilePixelRatioshould be set to2. Default is1.tileUrlFunctionol.TileUrlFunctionType | undefined <optional>
Optional function to get tile URL given a tile coordinate and the projection.
urlstring | undefined <optional>
URL template. Must include
{x},{y}or{-y}, and{z}placeholders. A{?-?}template pattern, for examplesubdomain{a-f}.domain.com, may be used instead of defining each one separately in theurlsoption.urlsArray.<string> | undefined <optional>
An array of URL templates.
wrapXboolean | undefined <optional>
Whether to wrap the world horizontally. The default,
undefined, is to request out-of-bounds tiles from the server. When set tofalse, only one world will be rendered. When set totrue, tiles will be requested for one world only, but they will be wrapped horizontally to render multiple worlds.transitionnumber | undefined <optional>
Duration of the opacity transition for rendering. To disable the opacity transition, pass
transition: 0. -
olx.source.TileJSONOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Optional attributions for the source. If provided, these will be used instead of any attribution data advertised by the server. If not provided, any attributions advertised by the server will be used.
cacheSizenumber | undefined <optional>
Cache size. Default is
2048.crossOriginnull | string | undefined <optional>
The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.jsonpboolean | undefined <optional>
Use JSONP with callback to load the TileJSON. Useful when the server does not support CORS. Default is
false.reprojectionErrorThresholdnumber | undefined <optional>
Maximum allowed reprojection error (in pixels). Default is
0.5. Higher values can increase reprojection performance, but decrease precision.tileJSONTileJSON | undefined <optional>
TileJSON configuration for this source. If not provided,
urlmust be configured.tileLoadFunctionol.TileLoadFunctionType | undefined <optional>
Optional function to load a tile given a URL. The default is
function(imageTile, src) { imageTile.getImage().src = src; };urlstring | undefined <optional>
URL to the TileJSON file. If not provided,
tileJSONmust be configured.wrapXboolean | undefined <optional>
Whether to wrap the world horizontally. Default is
true.transitionnumber | undefined <optional>
Duration of the opacity transition for rendering. To disable the opacity transition, pass
transition: 0. -
olx.source.TileUTFGridOptions{Object}
-
Properties:
Name Type Argument Description jsonpboolean | undefined <optional>
Use JSONP with callback to load the TileJSON. Useful when the server does not support CORS. Default is
false.preemptiveboolean | undefined <optional>
If
truethe TileUTFGrid source loads the tiles based on their "visibility". This improves the speed of response, but increases traffic. Note that if set tofalse, you need to passtrueasopt_requestto theforDataAtCoordinateAndResolutionmethod otherwise no data will ever be loaded. Default istrue.tileJSONTileJSON | undefined <optional>
TileJSON configuration for this source. If not provided,
urlmust be configured.urlstring | undefined <optional>
TileJSON endpoint that provides the configuration for this source. Request will be made through JSONP. If not provided,
tileJSONmust be configured. -
olx.source.TileWMSOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
cacheSizenumber | undefined <optional>
Cache size. Default is
2048.paramsObject.<string, *> WMS request parameters. At least a
LAYERSparam is required.STYLESis''by default.VERSIONis1.3.0by default.WIDTH,HEIGHT,BBOXandCRS(SRSfor WMS version < 1.3.0) will be set dynamically. Required.crossOriginnull | string | undefined <optional>
The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.gutternumber | undefined <optional>
The size 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. Defaults to zero. Using a non-zero value allows artifacts of rendering at tile edges to be ignored. If you control the WMS service it is recommended to address "artifacts at tile edges" issues by properly configuring the WMS service. For example, MapServer has atile_map_edge_bufferconfiguration parameter for this. See http://mapserver.org/output/tile_mode.html.hidpiboolean | undefined <optional>
Use the
ol.Map#pixelRatiovalue when requesting the image from the remote server. Default istrue.logostring | olx.LogoOptions | undefined <optional>
Logo.
tileClassfunction | undefined <optional>
Class used to instantiate image tiles. Default is
ol.ImageTile.tileGridol.tilegrid.TileGrid | undefined <optional>
Tile grid. Base this on the resolutions, tilesize and extent supported by the server. If this is not defined, a default grid will be used: if there is a projection extent, the grid will be based on that; if not, a grid based on a global extent with origin at 0,0 will be used.
projectionol.ProjectionLike Projection.
reprojectionErrorThresholdnumber | undefined <optional>
Maximum allowed reprojection error (in pixels). Default is
0.5. Higher values can increase reprojection performance, but decrease precision.serverTypeol.source.WMSServerType | string | undefined <optional>
The type of the remote WMS server. Currently only used when
hidpiistrue. Default isundefined.tileLoadFunctionol.TileLoadFunctionType | undefined <optional>
Optional function to load a tile given a URL. The default is
function(imageTile, src) { imageTile.getImage().src = src; };urlstring | undefined <optional>
WMS service URL.
urlsArray.<string> | undefined <optional>
WMS service urls. Use this instead of
urlwhen the WMS supports multiple urls for GetMap requests.wrapXboolean | undefined <optional>
Whether to wrap the world horizontally. When set to
false, only one world will be rendered. Whentrue, tiles will be requested for one world only, but they will be wrapped horizontally to render multiple worlds. The default istrue.transitionnumber | undefined <optional>
Duration of the opacity transition for rendering. To disable the opacity transition, pass
transition: 0. -
olx.source.VectorOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
featuresArray.<ol.Feature> | ol.Collection.<ol.Feature> | undefined <optional>
Features. If provided as
ol.Collection, the features in the source and the collection will stay in sync.formatol.format.Feature | undefined <optional>
The feature format used by the XHR feature loader when
urlis set. Required ifurlis set, otherwise ignored. Default isundefined.loaderol.FeatureLoader | undefined <optional>
The loader function used to load features, from a remote source for example. If this is not set and
urlis set, the source will create and use an XHR feature loader.Example:
var vectorSource = new ol.source.Vector({ format: new ol.format.GeoJSON(), loader: function(extent, resolution, projection) { var proj = projection.getCode(); var url = 'https://ahocevar.com/geoserver/wfs?service=WFS&' + 'version=1.1.0&request=GetFeature&typename=osm:water_areas&' + 'outputFormat=application/json&srsname=' + proj + '&' + 'bbox=' + extent.join(',') + ',' + proj; var xhr = new XMLHttpRequest(); xhr.open('GET', url); var onError = function() { vectorSource.removeLoadedExtent(extent); } xhr.onerror = onError; xhr.onload = function() { if (xhr.status == 200) { vectorSource.addFeatures( vectorSource.getFormat().readFeatures(xhr.responseText)); } else { onError(); } } xhr.send(); }, strategy: ol.loadingstrategy.bbox });logostring | olx.LogoOptions | undefined <optional>
Logo.
overlapsboolean | undefined <optional>
This source may have overlapping geometries. Default is
true. Setting this tofalse(e.g. for sources with polygons that represent administrative boundaries or TopoJSON sources) allows the renderer to optimise fill and stroke operations.strategyol.LoadingStrategy | undefined <optional>
The loading strategy to use. By default an
ol.loadingstrategy.allstrategy is used, a one-off strategy which loads all features at once.urlstring | ol.FeatureUrlFunction | undefined <optional>
Setting this option instructs the source to load features using an XHR loader (see
ol.featureloader.xhr). Use astringand anol.loadingstrategy.allfor a one-off download of all features from the given URL. Use aol.FeatureUrlFunctionto generate the url with other loading strategies. Requiresformatto be set as well. When default XHR feature loader is provided, the features will be transformed from the data projection to the view projection during parsing. If your remote data source does not advertise its projection properly, this transformation will be incorrect. For some formats, the default projection (usually EPSG:4326) can be overridden by setting the defaultDataProjection constructor option on the format. Note that if a source contains non-feature data, such as a GeoJSON geometry or a KML NetworkLink, these will be ignored. Use a custom loader to load these.useSpatialIndexboolean | undefined <optional>
By default, an RTree is used as spatial index. When features are removed and added frequently, and the total number of features is low, setting this to
falsemay improve performance.Note that
ol.source.Vector#getFeaturesInExtent,ol.source.Vector#getClosestFeatureToCoordinateandol.source.Vector#getExtentcannot be used whenuseSpatialIndexis set tofalse, andol.source.Vector#forEachFeatureInExtentwill loop through all features.When set to
false, the features will be maintained in anol.Collection, which can be retrieved throughol.source.Vector#getFeaturesCollection.The default is
true.wrapXboolean | undefined <optional>
Wrap the world horizontally. Default is
true. For vector editing across the -180° and 180° meridians to work properly, this should be set tofalse. The resulting geometry coordinates will then exceed the world bounds. -
olx.source.VectorTileOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
cacheSizenumber | undefined <optional>
Cache size. Default is
128.formatol.format.Feature | undefined <optional>
Feature format for tiles. Used and required by the default
tileLoadFunction.logostring | olx.LogoOptions | undefined <optional>
Logo.
overlapsboolean | undefined <optional>
This source may have overlapping geometries. Default is
true. Setting this tofalse(e.g. for sources with polygons that represent administrative boundaries or TopoJSON sources) allows the renderer to optimise fill and stroke operations.projectionol.ProjectionLike Projection.
stateol.source.State | undefined <optional>
Source state.
tileClassfunction | undefined <optional>
Class used to instantiate vector tiles. Default is
ol.VectorTile.tileGridol.tilegrid.TileGrid | undefined <optional>
Tile grid.
tileLoadFunctionol.TileLoadFunctionType | undefined <optional>
Optional function to load a tile given a URL. Could look like this:
function(tile, url) { tile.setLoader(function() { var data = // ... fetch data var format = tile.getFormat(); tile.setFeatures(format.readFeatures(data, { // uncomment the line below for ol.format.MVT only extent: tile.getExtent(), featureProjection: map.getView().getProjection() })); }; });tileUrlFunctionol.TileUrlFunctionType | undefined <optional>
Optional function to get tile URL given a tile coordinate and the projection.
urlstring | undefined <optional>
URL template. Must include
{x},{y}or{-y}, and{z}placeholders. A{?-?}template pattern, for examplesubdomain{a-f}.domain.com, may be used instead of defining each one separately in theurlsoption.urlsArray.<string> | undefined <optional>
An array of URL templates.
wrapXboolean | undefined <optional>
Whether to wrap the world horizontally. When set to
false, only one world will be rendered. When set totrue, tiles will be wrapped horizontally to render multiple worlds. Default istrue.transitionnumber | undefined <optional>
Duration of the opacity transition for rendering. To disable the opacity transition, pass
transition: 0. -
olx.source.WMTSOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
cacheSizenumber | undefined <optional>
Cache size. Default is
2048.crossOriginstring | null | undefined <optional>
The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.logostring | olx.LogoOptions | undefined <optional>
Logo.
tileGridol.tilegrid.WMTS Tile grid. Required.
projectionol.ProjectionLike Projection.
reprojectionErrorThresholdnumber | undefined <optional>
Maximum allowed reprojection error (in pixels). Default is
0.5. Higher values can increase reprojection performance, but decrease precision.requestEncodingol.source.WMTSRequestEncoding | string | undefined <optional>
Request encoding. Default is
KVP.layerstring Layer name as advertised in the WMTS capabilities. Required.
stylestring Style name as advertised in the WMTS capabilities. Required.
tileClassfunction | undefined <optional>
Class used to instantiate image tiles. Default is
ol.ImageTile.tilePixelRationumber | undefined <optional>
The pixel ratio used by the tile service. For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px by 512px images (for retina/hidpi devices) then
tilePixelRatioshould be set to2. Default is1.versionstring | undefined <optional>
WMTS version. Default is
1.0.0.formatstring | undefined <optional>
Image format. Default is
image/jpeg.matrixSetstring Matrix set. Required.
dimensionsObject | undefined <optional>
Additional "dimensions" for tile requests. This is an object with properties named like the advertised WMTS dimensions.
urlstring | undefined <optional>
A URL for the service. For the RESTful request encoding, this is a URL template. For KVP encoding, it is normal URL. A
{?-?}template pattern, for examplesubdomain{a-f}.domain.com, may be used instead of defining each one separately in theurlsoption.tileLoadFunctionol.TileLoadFunctionType | undefined <optional>
Optional function to load a tile given a URL. The default is
function(imageTile, src) { imageTile.getImage().src = src; };urlsArray.<string> | undefined <optional>
An array of URLs. Requests will be distributed among the URLs in this array.
wrapXboolean | undefined <optional>
Whether to wrap the world horizontally. Default is
false.transitionnumber | undefined <optional>
Duration of the opacity transition for rendering. To disable the opacity transition, pass
transition: 0. -
olx.source.XYZOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
cacheSizenumber | undefined <optional>
Cache size. Default is
2048.crossOriginnull | string | undefined <optional>
The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.logostring | olx.LogoOptions | undefined <optional>
Logo.
opaqueboolean | undefined <optional>
Whether the layer is opaque.
projectionol.ProjectionLike Projection. Default is
EPSG:3857.reprojectionErrorThresholdnumber | undefined <optional>
Maximum allowed reprojection error (in pixels). Default is
0.5. Higher values can increase reprojection performance, but decrease precision.maxZoomnumber | undefined <optional>
Optional max zoom level. Default is
18.minZoomnumber | undefined <optional>
Optional min zoom level. Default is
0.tileGridol.tilegrid.TileGrid | undefined <optional>
Tile grid.
tileLoadFunctionol.TileLoadFunctionType | undefined <optional>
Optional function to load a tile given a URL. The default is
function(imageTile, src) { imageTile.getImage().src = src; };tilePixelRationumber | undefined <optional>
The pixel ratio used by the tile service. For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px by 512px images (for retina/hidpi devices) then
tilePixelRatioshould be set to2. Default is1.tileSizenumber | ol.Size | undefined <optional>
The tile size used by the tile service. Default is
[256, 256]pixels.tileUrlFunctionol.TileUrlFunctionType | undefined <optional>
Optional function to get tile URL given a tile coordinate and the projection. Required if url or urls are not provided.
urlstring | undefined <optional>
URL template. Must include
{x},{y}or{-y}, and{z}placeholders. A{?-?}template pattern, for examplesubdomain{a-f}.domain.com, may be used instead of defining each one separately in theurlsoption.urlsArray.<string> | undefined <optional>
An array of URL templates.
wrapXboolean | undefined <optional>
Whether to wrap the world horizontally. Default is
true.transitionnumber | undefined <optional>
Duration of the opacity transition for rendering. To disable the opacity transition, pass
transition: 0. -
olx.source.ZoomifyOptions{Object}
-
Properties:
Name Type Argument Description attributionsol.AttributionLike | undefined <optional>
Attributions.
cacheSizenumber | undefined <optional>
Cache size. Default is
2048.crossOriginnull | string | undefined <optional>
The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.logostring | olx.LogoOptions | undefined <optional>
Logo.
projectionol.ProjectionLike | undefined <optional>
Projection.
reprojectionErrorThresholdnumber | undefined <optional>
Maximum allowed reprojection error (in pixels). Default is
0.5. Higher values can increase reprojection performance, but decrease precision.urlstring URL template or base URL of the Zoomify service. A base URL is the fixed part of the URL, excluding the tile group, z, x, and y folder structure, e.g.
http://my.zoomify.info/IMAGE.TIF/. A URL template must include{TileGroup},{x},{y}, and{z}placeholders, e.g.http://my.zoomify.info/IMAGE.TIF/{TileGroup}/{z}-{x}-{y}.jpg. Internet Imaging Protocol (IIP) with JTL extension can be also used with{tileIndex}and{z}placeholders, e.g.http://my.zoomify.info?FIF=IMAGE.TIF&JTL={z},{tileIndex}. A{?-?}template pattern, for examplesubdomain{a-f}.domain.com, may be used instead of defining each one separately in theurlsoption. Required.tierSizeCalculationstring | undefined <optional>
Tier size calculation method:
defaultortruncated.sizeol.Size Size of the image. Required.
extentol.Extent | undefined <optional>
Extent for the TileGrid that is created. Default sets the TileGrid in the fourth quadrant, meaning extent is
[0, -height, width, 0]. To change the extent to the first quadrant (the default for OpenLayers 2) set the extent as[0, 0, width, height].transitionnumber | undefined <optional>
Duration of the opacity transition for rendering. To disable the opacity transition, pass
transition: 0.tileSizenumber | undefined <optional>
Tile size. Same tile size is used for all zoom levels. Default value is
OpenLayers.DEFAULT_TILE_SIZE.
OpenLayers