Merge pull request #8166 from tschaub/types

Updated type annotations
This commit is contained in:
Tim Schaub
2018-05-08 05:45:09 -07:00
committed by GitHub
101 changed files with 346 additions and 394 deletions

View File

@@ -6,7 +6,7 @@ docs: >
This example shows how to use an ArcGIS REST MapService as tiles.
This source type supports Map and Image Services. For cached ArcGIS
services, better performance is available by using
<code>ol.source.XYZ</code> instead.
<code>ol/source/XYZ</code> instead.
tags: arcgis, tile, tilelayer"
---
<div id="map" class="map"></div>

View File

@@ -3,7 +3,7 @@ layout: example.html
title: Bing Maps
shortdesc: Example of a Bing Maps layer.
docs: >
<p>When the Bing Maps tile service doesn't have tiles for a given resolution and region it returns "placeholder" tiles indicating that. Zoom the map beyond level 19 to see the "placeholder" tiles. If you want OpenLayers to display stretched tiles in place of "placeholder" tiles beyond zoom level 19 then set <code>maxZoom</code> to <code>19</code> in the options passed to <code>ol.source.BingMaps</code>.</p>
<p>When the Bing Maps tile service doesn't have tiles for a given resolution and region it returns "placeholder" tiles indicating that. Zoom the map beyond level 19 to see the "placeholder" tiles. If you want OpenLayers to display stretched tiles in place of "placeholder" tiles beyond zoom level 19 then set <code>maxZoom</code> to <code>19</code> in the options passed to <code>ol/source/BingMaps</code>.</p>
tags: "bing, bing-maps"
cloak:
- key: As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5

View File

@@ -114,7 +114,7 @@ const resetBlendModeFromSelect = function(evt) {
/**
* Bind the pre- and postcompose handlers to the passed layer.
*
* @param {ol.layer.Vector} layer The layer to bind the handlers to.
* @param {module:ol/layer/Vector} layer The layer to bind the handlers to.
*/
const bindLayerListeners = function(layer) {
layer.on('precompose', setBlendModeFromSelect);
@@ -125,7 +125,7 @@ const bindLayerListeners = function(layer) {
/**
* Unind the pre- and postcompose handlers to the passed layers.
*
* @param {ol.layer.Vector} layer The layer to unbind the handlers from.
* @param {module:ol/layer/Vector} layer The layer to unbind the handlers from.
*/
const unbindLayerListeners = function(layer) {
layer.un('precompose', setBlendModeFromSelect);

View File

@@ -4,7 +4,7 @@ title: Box Selection
shortdesc: Using a DragBox interaction to select features.
docs: >
<p>This example shows how to use a <code>DragBox</code> interaction to select features. Selected features are added
to the feature overlay of a select interaction (<code>ol.interaction.Select</code>) for highlighting.</p>
to the feature overlay of a select interaction (<code>ol/interaction/Select</code>) for highlighting.</p>
<p>Use <code>Ctrl+Drag</code> (<code>Command+Drag</code> on Mac) to draw boxes.</p>
tags: "DragBox, feature, selection, box"
---

View File

@@ -70,7 +70,7 @@ const style = new Style({
*
* @param {module:ol/Feature~Feature} feature The feature to style.
* @param {number} resolution Resolution.
* @return {ol.style.Style} The style to use for the feature.
* @return {module:ol/style/Style} The style to use for the feature.
*/
const getStackedStyle = function(feature, resolution) {
const id = feature.getId();

View File

@@ -87,6 +87,6 @@ const centerlausanne = document.getElementById('centerlausanne');
centerlausanne.addEventListener('click', function() {
const feature = source.getFeatures()[1];
const point = /** @type {module:ol/geom/Point~Point} */ (feature.getGeometry());
const size = /** @type {ol.Size} */ (map.getSize());
const size = /** @type {module:ol/size~Size} */ (map.getSize());
view.centerOn(point.getCoordinates(), size, [570, 500]);
}, false);

View File

@@ -1,7 +1,7 @@
---
layout: example.html
title: Clustered Features
shortdesc: Example of using ol.source.Cluster.
shortdesc: Example of using ol/source/Cluster.
docs: >
This example shows how to do clustering on point features.
tags: "cluster, vector"

View File

@@ -3,8 +3,8 @@ layout: example.html
title: Custom Interactions
shortdesc: Example of a custom interaction.
docs: >
This example demonstrates creating a custom interaction by subclassing `ol.interaction.Pointer`.
Note that the built in interaction `ol.interaction.Translate` might be a better option for moving features.
This example demonstrates creating a custom interaction by subclassing `ol/interaction/Pointer`.
Note that the built in interaction `ol/interaction/Translate` might be a better option for moving features.
tags: "drag, feature, vector, editing, custom, interaction"
---
<div id="map" class="map"></div>

View File

@@ -17,7 +17,7 @@ const app = {};
/**
* @constructor
* @extends {ol.interaction.Pointer}
* @extends {module:ol/interaction/Pointer}
*/
app.Drag = function() {
@@ -29,7 +29,7 @@ app.Drag = function() {
});
/**
* @type {ol.Pixel}
* @type {module:ol~Pixel}
* @private
*/
this.coordinate_ = null;

6
examples/d3.js vendored
View File

@@ -24,17 +24,17 @@ const map = new Map({
/**
* Load the topojson data and create an ol.layer.Image for that data.
* Load the topojson data and create an ol/layer/Image for that data.
*/
d3.json('data/topojson/us.json', function(error, us) {
const features = topojson.feature(us, us.objects.counties);
/**
* This function uses d3 to render the topojson features to a canvas.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {number} resolution Resolution.
* @param {number} pixelRatio Pixel ratio.
* @param {ol.Size} size Size.
* @param {module:ol/size~Size} size Size.
* @param {module:ol/proj/Projection~Projection} projection Projection.
* @return {HTMLCanvasElement} A canvas element.
*/

View File

@@ -3,7 +3,7 @@ layout: example.html
title: Drag-and-Drop Image Vector
shortdesc: Example of using the drag-and-drop interaction with image vector rendering.
docs: >
Example of using the drag-and-drop interaction with an `ol.layer.Vector` with `renderMode: 'image'``. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. Each file is rendered to an image on the client.
Example of using the drag-and-drop interaction with an `ol/layer/Vector` with `renderMode: 'image'``. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. Each file is rendered to an image on the client.
tags: "drag-and-drop-image-vector, gpx, geojson, igc, kml, topojson, vector, image"
cloak:
- key: As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5

View File

@@ -1,9 +1,9 @@
---
layout: example.html
title: Draw and Modify Features
shortdesc: Example of using the ol.interaction.Draw interaction together with the ol.interaction.Modify interaction.
shortdesc: Example of using the ol/interaction/Draw interaction together with the ol/interaction/Modify interaction.
docs: >
Example of using the ol.interaction.Draw interaction together with the ol.interaction.Modify interaction.
Example of using the ol/interaction/Draw interaction together with the ol/interaction/Modify interaction.
tags: "draw, edit, modify, vector, featureoverlay"
---
<div id="map" class="map"></div>

View File

@@ -1,7 +1,7 @@
---
layout: example.html
title: Draw Features
shortdesc: Example of using the ol.interaction.Draw interaction.
shortdesc: Example of using the ol/interaction/Draw interaction.
docs: >
Example of using the Draw interaction. Select a geometry type from the
dropdown above to start drawing. To finish drawing, click the last

View File

@@ -1,13 +1,13 @@
---
layout: example.html
title: Freehand Drawing
shortdesc: Example using the ol.interaction.Draw interaction in freehand mode.
shortdesc: Example using the ol/interaction/Draw interaction in freehand mode.
docs: >
This example demonstrates the `ol.interaction.Draw` in freehand mode. During
This example demonstrates the `ol/interaction/Draw` in freehand mode. During
freehand drawing, points are added while dragging. Set `freehand: true` to
enable freehand mode. Note that freehand mode can be conditionally enabled
by using the `freehandCondition` option. For example to toggle freehand mode
with the `Shift` key, use `freehandCondition: ol.events.condition.shiftKeyOnly`.
with the `Shift` key, use `freehandCondition: shiftKeyOnly`.
tags: "draw, edit, freehand, vector"
---
<div id="map" class="map"></div>

View File

@@ -1,10 +1,10 @@
---
layout: example.html
title: Draw Shapes
shortdesc: Using the ol.interaction.Draw to create regular shapes
shortdesc: Using the ol/interaction/Draw to create regular shapes
docs: >
This demonstrates the use of the `geometryFunction` option for the
`ol.interaction.Draw`. Select a shape type from the dropdown above to start
`ol/interaction/Draw`. Select a shape type from the dropdown above to start
drawing. To activate freehand drawing, hold the `Shift` key. Square drawing is
achieved by using `type: 'Circle'` type with a `geometryFunction` that creates
a 4-sided regular polygon instead of a circle. Box drawing uses `type: 'Circle'`

View File

@@ -6,7 +6,7 @@ docs: >
<p>This example parses a KML file and renders the features as clusters on a vector layer. The styling in this example is quite involved. Single earthquake locations
(rendered as stars) have a size relative to their magnitude. Clusters have an opacity relative to the number of features in the cluster, and a size that represents
the extent of the features that make up the cluster. When clicking or hovering on a cluster, the individual features that make up the cluster will be shown.</p>
<p>To achieve this, we make heavy use of style functions and <code>ol.style.Style#geometry</code>.</p>
<p>To achieve this, we make heavy use of style functions.</p>
tags: "KML, vector, style, geometry, cluster"
---
<div id="map" class="map"></div>

View File

@@ -1,7 +1,7 @@
---
layout: example.html
title: Earthquakes with custom symbols
shortdesc: Demonstrates the use of `ol.render.toCanvas` to create custom icon symbols.
shortdesc: Demonstrates the use of `toCanvas` to create custom icon symbols.
docs: >
This example parses a KML file and renders the features as a vector layer. The layer is given a <code>style</code> that renders earthquake locations with a custom lightning symbol and a size relative to their magnitude.
tags: "KML, vector, style, canvas, symbol"

View File

@@ -64,7 +64,7 @@ exportButton.addEventListener('click', function() {
const dim = dims[format];
const width = Math.round(dim[0] * resolution / 25.4);
const height = Math.round(dim[1] * resolution / 25.4);
const size = /** @type {ol.Size} */ (map.getSize());
const size = /** @type {module:ol/size~Size} */ (map.getSize());
const extent = map.getView().calculateExtent(size);
const source = raster.getSource();

View File

@@ -6,7 +6,7 @@ shortdesc: >
request
docs: >
Demonstrates the use of the `layers` option in the
`ol.format.WMSGetFeatureInfo` format object, which allows features returned
`ol/format/WMSGetFeatureInfo` format object, which allows features returned
by a single WMS GetFeatureInfo request that asks for more than one layer
to be read by layer name.
---

View File

@@ -3,7 +3,7 @@ layout: example.html
title: Earthquakes Heatmap
shortdesc: Demonstrates the use of a heatmap layer.
docs: >
This example parses a KML file and renders the features as a <code>ol.layer.Heatmap</code> layer.
This example parses a KML file and renders the features as a <code>ol/layer/Heatmap</code> layer.
tags: "heatmap, kml, vector, style"
---
<div id="map" class="map"></div>

View File

@@ -3,7 +3,7 @@ layout: example.html
title: HERE Map Tile API
shortdesc: Example of a map with map tiles from HERE.
docs: >
<p><a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile">HERE Map Tile API</a> used with <code>ol.source.XYZ</code>.</p>
<p><a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile">HERE Map Tile API</a> used with <code>ol/source/XYZ</code>.</p>
<p>Be sure to respect the <a href="https://legal.here.com/en/terms/serviceterms/us/">HERE Service Terms</a> when using their tile API.</p>
tags: "here, here-maps, here-tile-api"
cloak:

View File

@@ -4,7 +4,7 @@ title: Icon Colors
shortdesc: Example assigning a custom color to an icon
docs: >
Example assigning a custom color to an icon. The features in this examples are all using the same image with the different colors coming from the javascript file.
Note that icon files need to obey the same origin policy or send proper CORS headers for this to work. When relying on CORS headers, the `ol.style.Icon` must be configured with `crossOrigin: 'anonymous'`.
Note that icon files need to obey the same origin policy or send proper CORS headers for this to work. When relying on CORS headers, the `ol/style/Icon` must be configured with `crossOrigin: 'anonymous'`.
tags: "vector, style, icon, marker"
resources:
---

View File

@@ -3,7 +3,7 @@ layout: example.html
title: Image Vector Layer
shortdesc: Example of an image vector layer.
docs: >
<p>This example uses <code>ol.layer.Vector</code> with `renderMode: 'image'`. This mode results in faster rendering during interaction and animations, at the cost of less accurate rendering.</p>
<p>This example uses <code>ol/layer/Vector</code> with `renderMode: 'image'`. This mode results in faster rendering during interaction and animations, at the cost of less accurate rendering.</p>
tags: "vector, image"
---
<div id="map" class="map"></div>

View File

@@ -3,7 +3,7 @@ layout: example.html
title: Timezones in KML
shortdesc: Demonstrates rendering timezones from KML.
docs: >
This example parses a KML file and renders the features as a vector layer. The layer is given a <code>ol.style.Style</code> that fills timezones
This example parses a KML file and renders the features as a vector layer. The layer is given a <code>ol/style/Style</code> that fills timezones
yellow with an opacity calculated based on the current offset to local noon.
tags: "KML, vector, style"
resources:

View File

@@ -3,7 +3,7 @@ layout: example.html
title: KML
shortdesc: Rendering KML with a vector source.
docs: >
This example uses the <code>ol.format.KML</code> to parse KML for rendering with a vector source.
This example uses the <code>ol/format/KML</code> to parse KML for rendering with a vector source.
tags: "KML"
cloak:
- key: As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5

View File

@@ -52,7 +52,7 @@ let helpTooltipElement;
/**
* Overlay to show the help messages.
* @type {ol.Overlay}
* @type {module:ol/Overlay}
*/
let helpTooltip;
@@ -66,7 +66,7 @@ let measureTooltipElement;
/**
* Overlay to show the measurement.
* @type {ol.Overlay}
* @type {module:ol/Overlay}
*/
let measureTooltip;

View File

@@ -3,12 +3,12 @@ layout: example.html
title: Mousewheel/Trackpad Zoom
shortdesc: Shows advanced wheel/trackpad zoom options.
docs: >
This example uses a custom `ol.interaction.MouseWheelZoom` configuration:
This example uses a custom `ol/interaction/MouseWheelZoom` configuration:
* By default, wheel/trackpad zoom is always active, which can be unexpected
on pages with a lot of scrollable content and an embedded map. To perform
wheel/trackpad zoom actions only when the map has the focus, set
`condition: ol.events.condition.focus` as constructor option. This requires
`condition: focus` as constructor option. This requires
a map div with a `tabindex` attribute set.
* By default, the interaction can leave the map at fractional zoom levels. If
instead you want to constrain wheel/trackpad zooming to integer zoom

View File

@@ -3,11 +3,11 @@ layout: example.html
title: Navigation Controls
shortdesc: Shows how to add navigation controls.
docs: >
<p>This example shows how to use the <code>ol.control.ZoomToExtent</code> control.</p>
<p>This example shows how to use the <code>ol/control/ZoomToExtent</code> control.</p>
<p>The following navigation controls are added to the map:</p>
<ul>
<li><code>ol.control.Zoom</code> (added by default)</li>
<li><code>ol.control.ZoomToExtent</code></li>
<li><code>ol/control/Zoom</code> (added by default)</li>
<li><code>ol/control/ZoomToExtent</code></li>
</ul>
tags: "control, navigation, extent"
---

View File

@@ -3,7 +3,7 @@ layout: example.html
title: OSM Vector Tiles
shortdesc: Using OpenStreetMap vector tiles.
docs: >
A simple vector tiles map with Mapzen vector tiles. This example uses the TopoJSON format's `layerName` option to determine the layer ("water", "roads", "buildings") for styling. **Note**: [`ol.format.MVT`](../apidoc/ol.format.MVT.html) is an even more efficient format for vector tiles.
A simple vector tiles map with Mapzen vector tiles. This example uses the TopoJSON format's `layerName` option to determine the layer ("water", "roads", "buildings") for styling. **Note**: [`ol/format/MVT`] is an even more efficient format for vector tiles.
tags: "vector, tiles, osm, mapzen"
cloak:
- key: vector-tiles-5eJz6JX

View File

@@ -3,7 +3,7 @@ layout: example.html
title: Pinch Zoom
shortdesc: Restrict pinch zooming to integer zoom levels.
docs: >
By default, the `ol.interaction.PinchZoom` can leave the map at fractional zoom levels.
By default, the `ol/interaction/PinchZoom` can leave the map at fractional zoom levels.
If instead you want to constrain pinch zooming to integer zoom levels, set
<code>constrainResolution: true</code> when constructing the interaction.
tags: "pinch, zoom, interaction"

View File

@@ -4,7 +4,7 @@ title: Popup
shortdesc: Uses an overlay to create a popup.
docs: >
<p>
Click on the map to get a popup. The popup is composed of a few basic elements: a container, a close button, and a place for the content. To anchor the popup to the map, an <code>ol.Overlay</code> is created with the popup container. A listener is registered for the map's <code>click</code> event to display the popup, and another listener is set as the <code>click</code> handler for the close button to hide the popup.
Click on the map to get a popup. The popup is composed of a few basic elements: a container, a close button, and a place for the content. To anchor the popup to the map, an <code>ol/Overlay</code> is created with the popup container. A listener is registered for the map's <code>click</code> event to display the popup, and another listener is set as the <code>click</code> handler for the close button to hide the popup.
</p>
tags: "overlay, popup"
---

View File

@@ -4,7 +4,7 @@ title: Raster Source
shortdesc: Demonstrates pixelwise operations with a raster source.
docs: >
<p>
This example uses a <code>ol.source.Raster</code> to generate data
This example uses a <code>ol/source/Raster</code> to generate data
based on another source. The raster source accepts any number of
input sources (tile or image based) and runs a pipeline of
operations on the input pixels. The return from the final

View File

@@ -5,7 +5,7 @@ shortdesc: Grow a region from a seed pixel
docs: >
<p>Click a region on the map. The computed region will be red.</p>
<p>
This example uses a <code>ol.source.Raster</code> to generate data
This example uses a <code>ol/source/Raster</code> to generate data
based on another source. The raster source accepts any number of
input sources (tile or image based) and runs a pipeline of
operations on the input data. The return from the final

View File

@@ -4,7 +4,7 @@ title: Sea Level
shortdesc: Render sea level at different elevations
docs: >
<p>
This example uses a <code>ol.source.Raster</code> with
This example uses a <code>ol/source/Raster</code> with
<a href="https://www.mapbox.com/blog/terrain-rgb/">Mapbox Terrain-RGB tiles</a>
to "flood" areas below the elevation shown on the sea level slider.
</p>

View File

@@ -4,7 +4,7 @@ title: Shaded Relief
shortdesc: Calculate shaded relief from elevation data
docs: >
<p>
This example uses a <code>ol.source.Raster</code> to generate data
This example uses a <code>ol/source/Raster</code> to generate data
based on another source. The raster source accepts any number of
input sources (tile or image based) and runs a pipeline of
operations on the input data. The return from the final

View File

@@ -3,7 +3,7 @@ layout: example.html
title: TopoJSON
shortdesc: Demonstrates rendering of features from a TopoJSON topology.
docs: >
This example uses a vector layer with `ol.format.TopoJSON` for rendering features from [TopoJSON](https://github.com/mbostock/topojson/wiki).
This example uses a vector layer with `ol/format/TopoJSON` for rendering features from [TopoJSON](https://github.com/mbostock/topojson/wiki).
tags: "topojson, vector, style"
---
<div id="map" class="map"></div>

View File

@@ -3,7 +3,7 @@ layout: example.html
title: Custom Tiled WMS
shortdesc: Example of using custom coordinate transform functions.
docs: >
With `ol.proj.addCoordinateTransforms()`, custom coordinate transform functions can be added to configured projections.
With `addCoordinateTransforms()`, custom coordinate transform functions can be added to configured projections.
tags: "wms, tile, tilelayer, projection"
---
<div id="map" class="map"></div>

View File

@@ -3,7 +3,7 @@ layout: example.html
title: ArcGIS REST with 512x512 Tiles
shortdesc: Example of a XYZ source in EPSG:4326 using Esri 512x512 tiles.
docs: >
ArcGIS REST tile services with custom tile sizes (here: 512x512 pixels) and projection (here: EPSG:4326) are supported by `ol.source.XYZ`. A custom tile url function is used to handle zoom level offsets.
ArcGIS REST tile services with custom tile sizes (here: 512x512 pixels) and projection (here: EPSG:4326) are supported by `ol/source/XYZ`. A custom tile url function is used to handle zoom level offsets.
tags: "xyz, esri, tilesize, custom projection"
---
<div id="map" class="map"></div>

View File

@@ -3,7 +3,7 @@ layout: example.html
title: XYZ Esri
shortdesc: Example of a XYZ source using Esri tiles.
docs: >
ArcGIS REST tile services are supported by `ol.source.XYZ`.
ArcGIS REST tile services are supported by `ol/source/XYZ`.
tags: "xyz, esri, arcgis rest"
---
<div id="map" class="map"></div>

View File

@@ -3,7 +3,7 @@ layout: example.html
title: XYZ Retina Tiles
shortdesc: Example of Retina / HiDPI mercator tiles (512x512px) available as XYZ.
docs: >
The ol.source.XYZ must contain `tilePixelRatio` parameter. The tiles were prepared from a GeoTIFF file with [MapTiler](http://www.maptiler.com/).
The XYZ source accepts a `tilePixelRatio` option. The tiles were prepared from a GeoTIFF file with [MapTiler](http://www.maptiler.com/).
tags: "retina, hidpi, xyz, maptiler, @2x, devicePixelRatio"
---
<div id="map" class="map"></div>

View File

@@ -9,7 +9,7 @@ import OSM from '../src/ol/source/OSM.js';
* Helper method for map-creation.
*
* @param {string} divId The id of the div for the map.
* @return {ol.PluggableMap} The ol.Map instance.
* @return {module:ol/PluggableMap} The map instance.
*/
function createMap(divId) {
const source = new OSM();

View File

@@ -1,4 +0,0 @@
/**
* @namespace ol
*/

View File

@@ -148,7 +148,7 @@ import Units from './proj/Units.js';
* during a rotation or resolution animation.
* @property {number} [duration=1000] The duration of the animation in milliseconds.
* @property {function(number):number} [easing] The easing function used
* during the animation (defaults to {@link ol.easing.inAndOut}).
* during the animation (defaults to {@link module: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.

View File

@@ -1,3 +0,0 @@
/**
* @namespace ol.control
*/

View File

@@ -14,7 +14,7 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
* can not be derived from the data and if no `defaultDataProjection` is set for a format,
* the features will not be reprojected.
* @property {module:ol/extent~Extent} extent Tile extent of the tile being read. This is only used and
* required for {@link ol.format.MVT}.
* required for {@link module:ol/format/MVT}.
* @property {module:ol/proj~ProjectionLike} featureProjection Projection of the feature geometries
* created by the format reader. If not provided, features will be returned in the
* `dataProjection`.
@@ -230,7 +230,7 @@ export function transformWithOptions(geometry, write, opt_options) {
write ? featureProjection : dataProjection,
write ? dataProjection : featureProjection);
} else {
// FIXME this is necessary because ol.format.GML treats extents
// FIXME this is necessary because GML treats extents
// as geometries
transformed = transformExtent(
geometry,

View File

@@ -67,8 +67,7 @@ export const GMLNS = 'http://www.opengis.net/gml';
* instantiated in apps.
* Feature base format for reading and writing data in the GML format.
* This class cannot be instantiated, it contains only base content that
* is shared with versioned format classes ol.format.GML2 and
* ol.format.GML3.
* is shared with versioned format classes GML2 and GML3.
*
* @constructor
* @abstract

View File

@@ -328,7 +328,7 @@ function writePolygonGeometry(geometry, opt_options) {
/**
* Read a feature from a GeoJSON Feature source. Only works for Feature or
* geometry types. Use {@link ol.format.GeoJSON#readFeatures} to read
* geometry types. Use {@link module:ol/format/GeoJSON#readFeatures} to read
* FeatureCollection source. If feature at source has an id, it will be used
* as Feature id by calling {@link module:ol/Feature#setId} internally.
*

View File

@@ -25,7 +25,7 @@ import RenderFeature from '../render/Feature.js';
/**
* @typedef {Object} Options
* @property {function((module:ol/geom/Geometry|Object.<string,*>)=)|function(module:ol/geom/GeometryType,Array.<number>,(Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)} [featureClass]
* Class for features returned by {@link ol.format.MVT#readFeatures}. Set to
* Class for features returned by {@link module:ol/format/MVT#readFeatures}. Set to
* {@link module:ol/Feature~Feature} to get full editing and geometry support at the cost of
* decreased rendering performance. The default is {@link module:ol/render/Feature~RenderFeature},
* which is optimized for rendering and hit detection.
@@ -103,7 +103,7 @@ inherits(MVT, FeatureFormat);
* Reader callback for parsing layers.
* @param {number} tag The tag.
* @param {Object} layers The layers object.
* @param {ol.ext.PBF} pbf The PBF.
* @param {Object} pbf The PBF.
*/
function layersPBFReader(tag, layers, pbf) {
if (tag === 3) {
@@ -125,7 +125,7 @@ function layersPBFReader(tag, layers, pbf) {
* Reader callback for parsing layer.
* @param {number} tag The tag.
* @param {Object} layer The layer object.
* @param {ol.ext.PBF} pbf The PBF.
* @param {Object} pbf The PBF.
*/
function layerPBFReader(tag, layer, pbf) {
if (tag === 15) {
@@ -159,7 +159,7 @@ function layerPBFReader(tag, layer, pbf) {
* Reader callback for parsing feature.
* @param {number} tag The tag.
* @param {Object} feature The feature object.
* @param {ol.ext.PBF} pbf The PBF.
* @param {Object} pbf The PBF.
*/
function featurePBFReader(tag, feature, pbf) {
if (tag == 1) {
@@ -182,7 +182,7 @@ function featurePBFReader(tag, feature, pbf) {
/**
* Read a raw feature from the pbf offset stored at index `i` in the raw layer.
* @suppress {missingProperties}
* @param {ol.ext.PBF} pbf PBF.
* @param {Object} pbf PBF.
* @param {Object} layer Raw layer.
* @param {number} i Index of the feature in the raw layer's `features` array.
* @return {Object} Raw feature.
@@ -205,7 +205,7 @@ function readRawFeature(pbf, layer, i) {
* Read the raw geometry from the pbf offset stored in a raw feature's geometry
* property.
* @suppress {missingProperties}
* @param {ol.ext.PBF} pbf PBF.
* @param {Object} pbf PBF.
* @param {Object} feature Raw feature.
* @param {Array.<number>} flatCoordinates Array to store flat coordinates in.
* @param {Array.<number>} ends Array to store ends in.
@@ -294,7 +294,7 @@ function getGeometryType(type, numEnds) {
/**
* @private
* @param {ol.ext.PBF} pbf PBF
* @param {Object} pbf PBF
* @param {Object} rawFeature Raw Mapbox feature.
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
* @return {module:ol/Feature|module:ol/render/Feature} Feature.

View File

@@ -21,7 +21,7 @@ import {createElementNS, isDocument, isNode, makeArrayPusher, makeChildAppender,
* @typedef {Object} Options
* @property {Object.<string, string>|string} [featureNS] The namespace URI used for features.
* @property {Array.<string>|string} [featureType] The feature type to parse. Only used for read operations.
* @property {module:ol/format/GMLBase} [gmlFormat] The GML format to use to parse the response. Default is `ol.format.GML3`.
* @property {module:ol/format/GMLBase} [gmlFormat] The GML format to use to parse the response. Default is `ol/format/GML3`.
* @property {string} [schemaLocation] Optional schemaLocation to use for serialization, this will override the default.
*/
@@ -45,7 +45,7 @@ import {createElementNS, isDocument, isNode, makeArrayPusher, makeChildAppender,
* Web Feature Services have repurposed `maxfeatures` instead.
* @property {module:ol/extent~Extent} [bbox] Extent to use for the BBOX filter.
* @property {module:ol/format/filter/Filter} [filter] Filter condition. See
* {@link ol.format.filter} for more information.
* {@link module:ol/format/Filter} for more information.
* @property {string} [resultType] Indicates what response should be returned,
* E.g. `hits` only includes the `numberOfFeatures` attribute in the response and no features.
*/

View File

@@ -1,29 +0,0 @@
/**
* This namespace contains convenience functions to create filters for
* {@link ol.format.WFS#writeGetFeature}.
*
* For example to generate a `GetFeature` request with a `PropertyIsEqualTo` filter:
*
* var request = new ol.format.WFS().writeGetFeature({
* srsName: 'urn:ogc:def:crs:EPSG::4326',
* featureNS: 'http://www.openplans.org/topp',
* featurePrefix: 'topp',
* featureTypes: ['states'],
* filter: ol.format.filter.equalTo('name', 'New York')
* });
*
* Or to combine a `BBOX` filter with a `PropertyIsLike` filter:
*
* var f = ol.format.filter;
* var request = new ol.format.WFS().writeGetFeature({
* srsName: 'urn:ogc:def:crs:EPSG::4326',
* featureNS: 'http://www.openplans.org/topp',
* featurePrefix: 'topp',
* featureTypes: ['states'],
* filter: f.and(
* f.bbox('the_geom', [1, 2, 3, 4], 'urn:ogc:def:crs:EPSG::4326'),
* f.like('name', 'New*')
* )
* });
* @namespace ol.format.filter
*/

View File

@@ -1,3 +0,0 @@
/**
* @namespace ol.format
*/

View File

@@ -1,13 +1,13 @@
# Implementing formats with ol.format.Feature
`ol.format.Feature` defines a number of abstract methods including:
# Implementing formats with ol/format/Feature
`ol/format/Feature` defines a number of abstract methods including:
* `readFeatures` returning an `Array.<ol.Feature>`
* `readFeature` returning an `ol.Feature`
* `readFeatures` returning an `Array.<ol/Feature>`
* `readFeature` returning an `ol/Feature`
* `readGeometry` returning an `module:ol/geom/Geometry~Geometry`
Having different functions for multiple return types allows both the user to specify what type of data they want and for the compiler to properly type check the code. Depending on the format, it is entirely reasonable to leave one or more of these methods unimplemented, or provide sensible default implementations.
For example, `ol.format.GPX` only supports reading multiple features. Therefore `readFeature` and `readGeometry` are unimplemented and will raise an exception if called.
For example, `ol/format/GPX` only supports reading multiple features. Therefore `readFeature` and `readGeometry` are unimplemented and will raise an exception if called.
The IGC format contains only one feature per file, so `readFeature` returns that feature, `readFeatures` returns an array containing a single feature which is the feature in the file, and `readGeometry` is unimplemented.
@@ -18,10 +18,10 @@ If a file cannot be parsed, then the return value should be `null` for all three
# Implementing XML formats
This is an introduction for people looking to contribute an XML format reader to OpenLayers. After having read this document, you should read the code of and make sure that you understand the simpler XML format readers like `ol.format.GPX` before embarking on writing your own format reader.
This is an introduction for people looking to contribute an XML format reader to OpenLayers. After having read this document, you should read the code of and make sure that you understand the simpler XML format readers like `ol/format/GPX` before embarking on writing your own format reader.
The document ends with guidelines for implementing a new format.
The `ol.xml` namespace contains a number of useful functions for parsing XML documents. All code in OpenLayers that reads data from XML documents should use it. It has several features:
The `ol/xml` namespace contains a number of useful functions for parsing XML documents. All code in OpenLayers that reads data from XML documents should use it. It has several features:
* Browser support back to IE9
* Correct treatment of XML namespaces
@@ -30,34 +30,34 @@ The `ol.xml` namespace contains a number of useful functions for parsing XML doc
* Decoupling of the XML document structure from the output data structure
* Good compatibility with the Closure Compiler, including good type checking
The `ol.format.XML` class includes a number of methods for reading arrays of features, single features, geometries, and projections from XML documents. `ol.format.XML` should only be used for formats containing features and geometries. If your format does not contain features or geometries (e.g. WMS GetCapabilities) then you should not use `ol.format.XML`.
The `ol/format/XML` class includes a number of methods for reading arrays of features, single features, geometries, and projections from XML documents. `ol/format/XML` should only be used for formats containing features and geometries. If your format does not contain features or geometries (e.g. WMS GetCapabilities) then you should not use `ol/format/XML`.
## `ol.format.XML`
## `ol/format/XML`
`ol.format.XML` is for formats that contain features and geometries. If your XML file contains something else then you should not inherit from `ol.format.XML` and can skip ahead to the `ol.xml` section.
`ol/format/XML` is for formats that contain features and geometries. If your XML file contains something else then you should not inherit from `ol/format/XML` and can skip ahead to the `ol/xml` section.
`ol.format.XML` is perhaps easiest to explain first, since it is higher level than `ol.xml`.
`ol/format/XML` is perhaps easiest to explain first, since it is higher level than `ol/xml`.
`ol.format.XML` defines a number of abstract type-checked methods with names including:
`ol/format/XML` defines a number of abstract type-checked methods with names including:
read{Features,Feature,Geometry}From{Document,Node}
`Document`s are top-level XML document objects, `Node`s are children of the top-level XML document object. In modern browsers `Document` is a subclass of `Node`, and inherits all of `Node`'s methods. In IE, this is not the case: `Document` is not a subclass of `Node`, and `Document` only has some of `Node`'s functionality. The distinction between the two is therefore necessary.
## `ol.xml`
## `ol/xml`
There are two key concepts to master to understand how `ol.xml` works:
There are two key concepts to master to understand how `ol/xml` works:
* How `ol.xml.parse` traverses the XML document (or node) and calls back to your code
* How `ol.xml` decouples the structure of the XML document (which is always a tree) from the structure of the output data (which could be a single object, an array of objects, or anything else) using an object stack.
* How `ol/xml~parse` traverses the XML document (or node) and calls back to your code
* How `ol/xml` decouples the structure of the XML document (which is always a tree) from the structure of the output data (which could be a single object, an array of objects, or anything else) using an object stack.
It's handy to have the [`src/ol/xml.js` source code](https://github.com/openlayers/openlayers/blob/master/src/ol/xml.js) to hand while you read the following.
## How `ol.xml.parse` traverses the XML document
## How `ol/xml~parse` traverses the XML document
`ol.xml.parse` is the core of the XML parser. Given a `Node`, it loops over all that `Node`'s child `Elements` (ignoring text, CDATA sections, comments, etc.). For each child element, it looks up to see if there is a function to call that matches the child element's namespace and local (unqualified) name. If there is a function to call, then that function is called with the child element.
`ol/xml~parse` is the core of the XML parser. Given a `Node`, it loops over all that `Node`'s child `Elements` (ignoring text, CDATA sections, comments, etc.). For each child element, it looks up to see if there is a function to call that matches the child element's namespace and local (unqualified) name. If there is a function to call, then that function is called with the child element.
The `parserNS` argument to `ol.xml.parse` is an `Object` whose keys are XML namespaces and whose values are `Objects` whose keys are local element names and whose values are functions. A simple example might look like this:
The `parserNS` argument to `parse` is an `Object` whose keys are XML namespaces and whose values are `Objects` whose keys are local element names and whose values are functions. A simple example might look like this:
```js
var parserNS = {
@@ -74,11 +74,11 @@ var parserNS = {
};
```
Many XML formats use different namespaces for different versions, but the code for handling the elements in different versions is the same. `ol.xml.makeParserNS` is an helper function that creates the above structure given a single array of namespaces and a single object mapping element names onto functions.
Many XML formats use different namespaces for different versions, but the code for handling the elements in different versions is the same. `ol/xml~makeParserNS` is an helper function that creates the above structure given a single array of namespaces and a single object mapping element names onto functions.
## How the object stack works
`ol.xml.parse` also takes an argument called `objectStack` which is an `Array` of arbitrary values. This stack is key to the decoupling of the XML tree structure from the structure of the parsed output.
`ol/xml~parse` also takes an argument called `objectStack` which is an `Array` of arbitrary values. This stack is key to the decoupling of the XML tree structure from the structure of the parsed output.
Generally speaking, each callback function will modify the object at the top of the object stack. This is perhaps best demonstrated with a couple of examples.
@@ -93,9 +93,9 @@ First consider the case of constructing a feature. Consider the following (imag
</doc>
```
When we parse find the `<Feature>` tag, we construct a new `ol.Feature` and push it on to the object stack. We will then call a `ol.xml.parse` to parse the child elements of the `Feature` tag. When we find the `<id>` element, we'll set the id of the object that is on top of the object stack (the `ol.Feature`). When find the `<Point>` element we set the geometry of the object on the top of the object stack (still the `ol.Feature`). Finally, at the end of the `</Feature>` tag, our fully-configured `ol.Feature` is on the top of the stack, so we pop it off the top of the stack and return it.
When we parse find the `<Feature>` tag, we construct a new `ol/Feature` and push it on to the object stack. We will then call a `ol/xml~parse` to parse the child elements of the `Feature` tag. When we find the `<id>` element, we'll set the id of the object that is on top of the object stack (the `ol/Feature`). When find the `<Point>` element we set the geometry of the object on the top of the object stack (still the `ol/Feature`). Finally, at the end of the `</Feature>` tag, our fully-configured `ol/Feature` is on the top of the stack, so we pop it off the top of the stack and return it.
This pattern is so common that there is a function, `ol.xml.pushParseAndPop` that implements it.
This pattern is so common that there is a function, `ol/xml~pushParseAndPop` that implements it.
Now consider the case of parsing multiple features:
@@ -112,23 +112,23 @@ Now consider the case of parsing multiple features:
</doc>
```
In this case, we want to extract an `Array` of `ol.Feature`s. Here's how it works. When we encounter the `<doc>` tag we push an empty `Array` on to the stack. On each `<Feature>` tag, we invoke our feature parser above, which will return a populated `ol.Feature`. We append this `ol.Feature` to the object on the top of the object stack (our `Array` of `ol.Feature`s). At the final closing `</doc>` tag we pop the object off the top of the stack - now an `Array` containing two features - and return it.
In this case, we want to extract an `Array` of `ol/Feature`s. Here's how it works. When we encounter the `<doc>` tag we push an empty `Array` on to the stack. On each `<Feature>` tag, we invoke our feature parser above, which will return a populated `ol/Feature`. We append this `ol/Feature` to the object on the top of the object stack (our `Array` of `ol/Feature`s). At the final closing `</doc>` tag we pop the object off the top of the stack - now an `Array` containing two features - and return it.
### Common operations
In the above there are many common operations, like setting the property of the object on the top of the stack, or reading an object and appending that to an array on the top of the stack. There are many helper functions here, for example:
* `ol.xml.makeObjectPropertySetter` reads a value from the child element and sets a property on the object on the top of the stack.
* `ol.xml.makeArrayPusher` reads a value from the child element and appends it to the array on the top of the stack.
* `ol.xml.makeReplacer` reads a value from the child element and *replaces* whatever is on top of the stack with it.
* `ol/xml~makeObjectPropertySetter` reads a value from the child element and sets a property on the object on the top of the stack.
* `ol/xml~makeArrayPusher` reads a value from the child element and appends it to the array on the top of the stack.
* `ol/xml~makeReplacer` reads a value from the child element and *replaces* whatever is on top of the stack with it.
### Putting it all together
With the above, you should be able to read through the [source code to `ol.format.GPX`](https://github.com/openlayers/openlayers/blob/master/src/ol/format/gpxformat.js) and get a feel for how it works. Start from the bottom of the file and work upwards. It's also useful to have [an example GPX file](http://www.topografix.com/fells_loop.gpx) and [the GPX specification](http://www.topografix.com/GPX/1/1/) to hand.
With the above, you should be able to read through the [source code to `ol/format/GPX`](https://github.com/openlayers/openlayers/blob/master/src/ol/format/gpxformat.js) and get a feel for how it works. Start from the bottom of the file and work upwards. It's also useful to have [an example GPX file](http://www.topografix.com/fells_loop.gpx) and [the GPX specification](http://www.topografix.com/GPX/1/1/) to hand.
### Handling errors
If, when reading a value from a child element, you find an invalid value, you should return `undefined`. The helper functions above (like `ol.xml.makeObjectPropertySetter`) will then skip this value. If the structure is incomplete or incorrect (e.g. a child element is missing a mandatory tag) then you should also return `undefined` from your reader, which will in turn cause the value to be skipped.
An `ol.format.Format` should read as many features as it can, skipping features with any errors.
If, when reading a value from a child element, you find an invalid value, you should return `undefined`. The helper functions above (like `ol/xml~makeObjectPropertySetter`) will then skip this value. If the structure is incomplete or incorrect (e.g. a child element is missing a mandatory tag) then you should also return `undefined` from your reader, which will in turn cause the value to be skipped.
An `ol/format/Format` should read as many features as it can, skipping features with any errors.

View File

@@ -1,3 +0,0 @@
/**
* @namespace ol.geom
*/

View File

@@ -82,7 +82,7 @@ const LayerGroup = function(opt_options) {
layers = new Collection(layers.slice(), {unique: true});
} else {
assert(layers instanceof Collection,
43); // Expected `layers` to be an array or an `ol.Collection`
43); // Expected `layers` to be an array or a `Collection`
layers = layers;
}
} else {

View File

@@ -21,7 +21,7 @@ import Layer from '../layer/Layer.js';
* @property {module:ol/PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
* use {@link ol.Map#addLayer}.
* use {@link module:ol/Map#addLayer}.
* @property {module:ol/source/Image} [source] Source for this layer.
*/

View File

@@ -25,7 +25,7 @@ import SourceState from '../source/State.js';
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
* be visible.
* @property {module:ol/source/Source} [source] Source for this layer. If not provided to the constructor,
* the source can be set by calling {@link ol.layer.Layer#setSource layer.setSource(source)} after
* the source can be set by calling {@link module:ol/layer/Layer#setSource layer.setSource(source)} after
* construction.
*/
@@ -52,7 +52,7 @@ import SourceState from '../source/State.js';
* Layers group together those properties that pertain to how the data is to be
* displayed, irrespective of the source of that data.
*
* Layers are usually added to a map with {@link ol.Map#addLayer}. Components
* Layers are usually added to a map with {@link module:ol/Map#addLayer}. Components
* like {@link module:ol/interaction/Select~Select} use unmanaged layers
* internally. These unmanaged layers are associated with the map using
* {@link module:ol/layer/Layer~Layer#setMap} instead.
@@ -191,12 +191,12 @@ Layer.prototype.handleSourcePropertyChange_ = function() {
/**
* Sets the layer to be rendered on top of other layers on a map. The map will
* not manage this layer in its layers collection, and the callback in
* {@link ol.Map#forEachLayerAtPixel} will receive `null` as layer. This
* {@link module:ol/Map#forEachLayerAtPixel} will receive `null` as layer. This
* is useful for temporary layers. To remove an unmanaged layer from the map,
* use `#setMap(null)`.
*
* To add the layer to a map and have it managed by the map, use
* {@link ol.Map#addLayer} instead.
* {@link module:ol/Map#addLayer} instead.
* @param {module:ol/PluggableMap} map Map.
* @api
*/

View File

@@ -26,7 +26,7 @@ import {assign} from '../obj.js';
* @property {module:ol/PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
* use {@link ol.Map#addLayer}.
* use {@link module:ol/Map#addLayer}.
* @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.
*/
@@ -82,7 +82,7 @@ TileLayer.prototype.getPreload = function() {
/**
* Return the associated {@link ol.source.Tile tilesource} of the layer.
* Return the associated {@link module:ol/source/Tile tilesource} of the layer.
* @function
* @return {module:ol/source/Tile} Source.
* @api

View File

@@ -36,12 +36,12 @@ import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style.
* @property {module:ol/PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
* use {@link ol.Map#addLayer}.
* use {@link module:ol/Map#addLayer}.
* @property {boolean} [declutter=false] Declutter images and text. Decluttering is applied to all
* image and text styles, and the priority is defined by the z-index of the style. Lower z-index
* means higher priority.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
* {@link ol.style} for default style which will be used if this is not defined.
* {@link module:ol/style} for default style which will be used if this is not defined.
* @property {number} [maxTilesLoading=16] Maximum number tiles to load simultaneously.
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
* recreated during animations. This means that no vectors will be shown clipped, but the setting
@@ -262,7 +262,7 @@ VectorLayer.prototype.setRenderOrder = function(renderOrder) {
* an array of styles. If it is `undefined` the default style is used. If
* it is `null` the layer has no style (a `null` style), so only features
* that have their own styles will be rendered in the layer. See
* {@link ol.style} for information on the default style.
* {@link module:ol/style} for information on the default style.
* @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction|null|undefined}
* style Layer style.
* @api

View File

@@ -64,13 +64,13 @@ export const RenderType = {
* @property {module:ol/PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
* use {@link ol.Map#addLayer}.
* use {@link module:ol/Map#addLayer}.
* @property {boolean} [declutter=false] Declutter images and text. Decluttering is applied to all
* image and text styles, and the priority is defined by the z-index of the style. Lower z-index
* means higher priority. When set to `true`, a `renderMode` of `'image'` will be overridden with
* `'hybrid'`.
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
* {@link ol.style} for default style which will be used if this is not defined.
* {@link module:ol/style} for default style which will be used if this is not defined.
* @property {number} [maxTilesLoading=16] Maximum number tiles to load simultaneously.
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
* recreated during animations. This means that no vectors will be shown clipped, but the setting
@@ -83,7 +83,7 @@ export const RenderType = {
* @property {module:ol/render~OrderFunction} [renderOrder] Render order. Function to be used when sorting
* features before rendering. By default features are drawn in the order that they are created.
* @property {(module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction)} [style] Layer style. See
* {@link ol.style} for default style which will be used if this is not defined.
* {@link module:ol/style} for default style which will be used if this is not defined.
* @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.
*/

View File

@@ -1,3 +0,0 @@
/**
* @namespace ol.layer
*/

View File

@@ -1,6 +1,58 @@
/**
* @module ol/proj
*/
/**
* The ol/proj module stores:
* * a list of {@link module:ol/proj/Projection}
* objects, one for each projection supported by the application
* * a list of transform functions needed to convert coordinates in one projection
* into another.
*
* The static functions are the methods used to maintain these.
* Each transform function can handle not only simple coordinate pairs, but also
* large arrays of coordinates such as vector geometries.
*
* When loaded, the library adds projection objects for EPSG:4326 (WGS84
* geographic coordinates) and EPSG:3857 (Web or Spherical Mercator, as used
* for example by Bing Maps or OpenStreetMap), together with the relevant
* transform functions.
*
* Additional transforms may be added by using the {@link http://proj4js.org/}
* library (version 2.2 or later). You can use the full build supplied by
* Proj4js, or create a custom build to support those projections you need; see
* the Proj4js website for how to do this. You also need the Proj4js definitions
* for the required projections. These definitions can be obtained from
* {@link https://epsg.io/}, and are a JS function, so can be loaded in a script
* tag (as in the examples) or pasted into your application.
*
* After all required projection definitions are added to proj4's registry (by
* using `proj4.defs()`), simply call `register(proj4)` from the `ol/proj/proj4`
* package. Existing transforms are not changed by this function. See
* examples/wms-image-custom-proj for an example of this.
*
* Additional projection definitions can be registered with `proj4.defs()` any
* time. Just make sure to call `register(proj4)` again; for example, with user-supplied data where you don't
* know in advance what projections are needed, you can initially load minimal
* support and then load whichever are requested.
*
* Note that Proj4js does not support projection extents. If you want to add
* one for creating default tile grids, you can add it after the Projection
* object has been created with `setExtent`, for example,
* `get('EPSG:1234').setExtent(extent)`.
*
* In addition to Proj4js support, any transform functions can be added with
* {@link module:ol/proj~addCoordinateTransforms}. To use this, you must first create
* a {@link module:ol/proj/Projection} object for the new projection and add it with
* {@link module:ol/proj~addProjection}. You can then add the forward and inverse
* functions with {@link module:ol/proj~addCoordinateTransforms}. See
* examples/wms-custom-proj for an example of this.
*
* Note that if no transforms are needed and you only need to define the
* projection, just add a {@link module:ol/proj/Projection} with
* {@link module:ol/proj~addProjection}. See examples/wms-no-proj for an example of
* this.
*/
import {getDistance} from './sphere.js';
import {applyTransform} from './extent.js';
import {modulo} from './math.js';

View File

@@ -20,14 +20,14 @@ import {METERS_PER_UNIT} from '../proj/Units.js';
* Function to determine resolution at a point. The function is called with a
* `{number}` view resolution and an `{module:ol/coordinate~Coordinate}` as arguments, and returns
* the `{number}` resolution at the passed coordinate. If this is `undefined`,
* the default {@link ol.proj#getPointResolution} function will be used.
* the default {@link module:ol/proj#getPointResolution} function will be used.
*/
/**
* @classdesc
* Projection definition class. One of these is created for each projection
* supported in the application and stored in the {@link ol.proj} namespace.
* supported in the application and stored in the {@link module:ol/proj} namespace.
* You can use these in applications, but this is not required, as API params
* and options use {@link module:ol/proj~ProjectionLike} which means the simple string
* code will suffice.
@@ -264,7 +264,7 @@ Projection.prototype.setWorldExtent = function(worldExtent) {
/**
* Set the getPointResolution function (see {@link ol.proj#getPointResolution}
* Set the getPointResolution function (see {@link module:ol/proj~getPointResolution}
* for this projection.
* @param {function(number, module:ol/coordinate~Coordinate):number} func Function
* @api

View File

@@ -1,53 +0,0 @@
/**
* The ol.proj namespace stores:
* * a list of {@link ol.proj.Projection}
* objects, one for each projection supported by the application
* * a list of transform functions needed to convert coordinates in one projection
* into another.
*
* The static functions are the methods used to maintain these.
* Each transform function can handle not only simple coordinate pairs, but also
* large arrays of coordinates such as vector geometries.
*
* When loaded, the library adds projection objects for EPSG:4326 (WGS84
* geographic coordinates) and EPSG:3857 (Web or Spherical Mercator, as used
* for example by Bing Maps or OpenStreetMap), together with the relevant
* transform functions.
*
* Additional transforms may be added by using the {@link http://proj4js.org/}
* library (version 2.2 or later). You can use the full build supplied by
* Proj4js, or create a custom build to support those projections you need; see
* the Proj4js website for how to do this. You also need the Proj4js definitions
* for the required projections. These definitions can be obtained from
* {@link https://epsg.io/}, and are a JS function, so can be loaded in a script
* tag (as in the examples) or pasted into your application.
*
* After all required projection definitions are added to proj4's registry (by
* using `proj4.defs()`), simply call `register(proj4)` from the `ol/proj/proj4`
* package. Existing transforms are not changed by this function. See
* examples/wms-image-custom-proj for an example of this.
*
* Additional projection definitions can be registered with `proj4.defs()` any
* time. Just make sure to call `register(proj4)` again; for example, with user-supplied data where you don't
* know in advance what projections are needed, you can initially load minimal
* support and then load whichever are requested.
*
* Note that Proj4js does not support projection extents. If you want to add
* one for creating default tile grids, you can add it after the Projection
* object has been created with `setExtent`, for example,
* `ol.proj.get('EPSG:1234').setExtent(extent)`.
*
* In addition to Proj4js support, any transform functions can be added with
* {@link ol.proj.addCoordinateTransforms}. To use this, you must first create
* a {@link ol.proj.Projection} object for the new projection and add it with
* {@link ol.proj.addProjection}. You can then add the forward and inverse
* functions with {@link ol.proj.addCoordinateTransforms}. See
* examples/wms-custom-proj for an example of this.
*
* Note that if no transforms are needed and you only need to define the
* projection, just add a {@link ol.proj.Projection} with
* {@link ol.proj.addProjection}. See examples/wms-no-proj for an example of
* this.
*
* @namespace ol.proj
*/

View File

@@ -21,7 +21,7 @@ const RenderEvent = function(
Event.call(this, type);
/**
* For canvas, this is an instance of {@link ol.render.canvas.Immediate}.
* For canvas, this is an instance of {@link module:ol/render/canvas/Immediate}.
* @type {module:ol/render/VectorContext|undefined}
* @api
*/

View File

@@ -64,7 +64,7 @@ import {create as createTransform} from '../transform.js';
* rendered extent of the group in pixel space. `count` is the number of styles
* in the group, i.e. 2 when an image and a text are grouped, or 1 otherwise.
* In addition to these four elements, declutter instruction arrays (i.e. the
* arguments to @{link ol.render.canvas.drawImage} are appended to the array.
* arguments to {@link module:ol/render/canvas~drawImage} are appended to the array.
* @typedef {Array.<*>} DeclutterGroup
*/
@@ -155,7 +155,7 @@ export const defaultLineWidth = 1;
/**
* The label cache for text rendering. To change the default cache size of 2048
* entries, use {@link ol.structs.LRUCache#setSize}.
* entries, use {@link module:ol/structs/LRUCache#setSize}.
* @type {module:ol/structs/LRUCache.<HTMLCanvasElement>}
* @api
*/

View File

@@ -3,7 +3,7 @@
*/
// FIXME test, especially polygons with holes and multipolygons
// FIXME need to handle large thick features (where pixel size matters)
// FIXME add offset and end to ol.geom.flat.transform.transform2D?
// FIXME add offset and end to ol/geom/flat/transform~transform2D?
import {inherits} from '../../index.js';
import {equals} from '../../array.js';
@@ -448,7 +448,7 @@ CanvasImmediateRenderer.prototype.setStyle = function(style) {
/**
* Render a geometry into the canvas. Call
* {@link ol.render.canvas.Immediate#setStyle} first to set the rendering style.
* {@link module:ol/render/canvas/Immediate#setStyle} first to set the rendering style.
*
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry The geometry to render.
* @override

View File

@@ -452,7 +452,7 @@ CanvasReplayGroup.prototype.isEmpty = function() {
* @param {number} viewRotation View rotation.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features to skip.
* @param {Array.<module:ol/render/ReplayType~ReplayType>=} opt_replayTypes Ordered replay types to replay.
* Default is {@link ol.render.replay.ORDER}
* Default is {@link module:ol/render/replay~ORDER}
* @param {Object.<string, module:ol/render/canvas~DeclutterGroup>=} opt_declutterReplays Declutter replays.
*/
CanvasReplayGroup.prototype.replay = function(context,

View File

@@ -1,3 +0,0 @@
/**
* @namespace ol.render.canvas
*/

View File

@@ -17,7 +17,7 @@ import WebGLBuffer from '../../webgl/Buffer.js';
/**
* @constructor
* @extends {ol.render.webgl.Replay}
* @extends {module:ol/render/webgl/Replay}
* @param {number} tolerance Tolerance.
* @param {module:ol/extent~Extent} maxExtent Max extent.
* @struct
@@ -27,7 +27,7 @@ const WebGLCircleReplay = function(tolerance, maxExtent) {
/**
* @private
* @type {ol.render.webgl.circlereplay.defaultshader.Locations}
* @type {module:ol/render/webgl/circlereplay/defaultshader/Locations}
*/
this.defaultLocations_ = null;

View File

@@ -7,7 +7,7 @@ import WebGLBuffer from '../../webgl/Buffer.js';
/**
* @constructor
* @extends {ol.render.webgl.TextureReplay}
* @extends {module:ol/render/webgl/TextureReplay}
* @param {number} tolerance Tolerance.
* @param {module:ol/extent~Extent} maxExtent Max extent.
* @struct

View File

@@ -88,13 +88,13 @@ inherits(WebGLImmediateRenderer, VectorContext);
/**
* @param {ol.render.webgl.ReplayGroup} replayGroup Replay group.
* @param {module:ol/render/webgl/ReplayGroup} replayGroup Replay group.
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
* @private
*/
WebGLImmediateRenderer.prototype.drawText_ = function(replayGroup, geometry) {
const context = this.context_;
const replay = /** @type {ol.render.webgl.TextReplay} */ (
const replay = /** @type {module:ol/render/webgl/TextReplay} */ (
replayGroup.getReplay(0, ReplayType.TEXT));
replay.setTextStyle(this.textStyle_);
replay.drawText(geometry, null);
@@ -128,7 +128,7 @@ WebGLImmediateRenderer.prototype.setStyle = function(style) {
/**
* Render a geometry into the canvas. Call
* {@link ol.render.webgl.Immediate#setStyle} first to set the rendering style.
* {@link ol/render/webgl/Immediate#setStyle} first to set the rendering style.
*
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry The geometry to render.
* @override
@@ -199,7 +199,7 @@ WebGLImmediateRenderer.prototype.drawGeometryCollection = function(geometry, dat
WebGLImmediateRenderer.prototype.drawPoint = function(geometry, data) {
const context = this.context_;
const replayGroup = new WebGLReplayGroup(1, this.extent_);
const replay = /** @type {ol.render.webgl.ImageReplay} */ (
const replay = /** @type {module:ol/render/webgl/ImageReplay} */ (
replayGroup.getReplay(0, ReplayType.IMAGE));
replay.setImageStyle(this.imageStyle_);
replay.drawPoint(geometry, data);
@@ -226,7 +226,7 @@ WebGLImmediateRenderer.prototype.drawPoint = function(geometry, data) {
WebGLImmediateRenderer.prototype.drawMultiPoint = function(geometry, data) {
const context = this.context_;
const replayGroup = new WebGLReplayGroup(1, this.extent_);
const replay = /** @type {ol.render.webgl.ImageReplay} */ (
const replay = /** @type {module:ol/render/webgl/ImageReplay} */ (
replayGroup.getReplay(0, ReplayType.IMAGE));
replay.setImageStyle(this.imageStyle_);
replay.drawMultiPoint(geometry, data);
@@ -252,7 +252,7 @@ WebGLImmediateRenderer.prototype.drawMultiPoint = function(geometry, data) {
WebGLImmediateRenderer.prototype.drawLineString = function(geometry, data) {
const context = this.context_;
const replayGroup = new WebGLReplayGroup(1, this.extent_);
const replay = /** @type {ol.render.webgl.LineStringReplay} */ (
const replay = /** @type {module:ol/render/webgl/LineStringReplay} */ (
replayGroup.getReplay(0, ReplayType.LINE_STRING));
replay.setFillStrokeStyle(null, this.strokeStyle_);
replay.drawLineString(geometry, data);
@@ -278,7 +278,7 @@ WebGLImmediateRenderer.prototype.drawLineString = function(geometry, data) {
WebGLImmediateRenderer.prototype.drawMultiLineString = function(geometry, data) {
const context = this.context_;
const replayGroup = new WebGLReplayGroup(1, this.extent_);
const replay = /** @type {ol.render.webgl.LineStringReplay} */ (
const replay = /** @type {module:ol/render/webgl/LineStringReplay} */ (
replayGroup.getReplay(0, ReplayType.LINE_STRING));
replay.setFillStrokeStyle(null, this.strokeStyle_);
replay.drawMultiLineString(geometry, data);
@@ -304,7 +304,7 @@ WebGLImmediateRenderer.prototype.drawMultiLineString = function(geometry, data)
WebGLImmediateRenderer.prototype.drawPolygon = function(geometry, data) {
const context = this.context_;
const replayGroup = new WebGLReplayGroup(1, this.extent_);
const replay = /** @type {ol.render.webgl.PolygonReplay} */ (
const replay = /** @type {module:ol/render/webgl/PolygonReplay} */ (
replayGroup.getReplay(0, ReplayType.POLYGON));
replay.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_);
replay.drawPolygon(geometry, data);
@@ -330,7 +330,7 @@ WebGLImmediateRenderer.prototype.drawPolygon = function(geometry, data) {
WebGLImmediateRenderer.prototype.drawMultiPolygon = function(geometry, data) {
const context = this.context_;
const replayGroup = new WebGLReplayGroup(1, this.extent_);
const replay = /** @type {ol.render.webgl.PolygonReplay} */ (
const replay = /** @type {module:ol/render/webgl/PolygonReplay} */ (
replayGroup.getReplay(0, ReplayType.POLYGON));
replay.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_);
replay.drawMultiPolygon(geometry, data);
@@ -356,7 +356,7 @@ WebGLImmediateRenderer.prototype.drawMultiPolygon = function(geometry, data) {
WebGLImmediateRenderer.prototype.drawCircle = function(geometry, data) {
const context = this.context_;
const replayGroup = new WebGLReplayGroup(1, this.extent_);
const replay = /** @type {ol.render.webgl.CircleReplay} */ (
const replay = /** @type {module:ol/render/webgl/CircleReplay} */ (
replayGroup.getReplay(0, ReplayType.CIRCLE));
replay.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_);
replay.drawCircle(geometry, data);

View File

@@ -37,7 +37,7 @@ const Instruction = {
/**
* @constructor
* @extends {ol.render.webgl.Replay}
* @extends {module:ol/render/webgl/Replay}
* @param {number} tolerance Tolerance.
* @param {module:ol/extent~Extent} maxExtent Max extent.
* @struct
@@ -47,7 +47,7 @@ const WebGLLineStringReplay = function(tolerance, maxExtent) {
/**
* @private
* @type {ol.render.webgl.linestringreplay.defaultshader.Locations}
* @type {module:ol/render/webgl/linestringreplay/defaultshader/Locations}
*/
this.defaultLocations_ = null;

View File

@@ -38,7 +38,7 @@ import WebGLBuffer from '../../webgl/Buffer.js';
/**
* @constructor
* @extends {ol.render.webgl.Replay}
* @extends {module:ol/render/webgl/Replay}
* @param {number} tolerance Tolerance.
* @param {module:ol/extent~Extent} maxExtent Max extent.
* @struct
@@ -51,7 +51,7 @@ const WebGLPolygonReplay = function(tolerance, maxExtent) {
/**
* @private
* @type {ol.render.webgl.polygonreplay.defaultshader.Locations}
* @type {module:ol/render/webgl/polygonreplay/defaultshader/Locations}
*/
this.defaultLocations_ = null;

View File

@@ -114,7 +114,7 @@ const WebGLReplay = function(tolerance, maxExtent) {
/**
* Optional parameter for PolygonReplay instances.
* @protected
* @type {ol.render.webgl.LineStringReplay|undefined}
* @type {module:ol/render/webgl/LineStringReplay|undefined}
*/
this.lineStringReplay = undefined;
@@ -145,10 +145,10 @@ WebGLReplay.prototype.finish = function(context) {};
* @param {module:ol/webgl/Context} context Context.
* @param {module:ol/size~Size} size Size.
* @param {number} pixelRatio Pixel ratio.
* @return {ol.render.webgl.circlereplay.defaultshader.Locations|
ol.render.webgl.linestringreplay.defaultshader.Locations|
ol.render.webgl.polygonreplay.defaultshader.Locations|
ol.render.webgl.texturereplay.defaultshader.Locations} Locations.
* @return {module:ol/render/webgl/circlereplay/defaultshader/Locations|
module:ol/render/webgl/linestringreplay/defaultshader/Locations|
module:ol/render/webgl/polygonreplay/defaultshader/Locations|
module:ol/render/webgl/texturereplay/defaultshader/Locations} Locations.
*/
WebGLReplay.prototype.setUpProgram = function(gl, context, size, pixelRatio) {};
@@ -157,10 +157,10 @@ WebGLReplay.prototype.setUpProgram = function(gl, context, size, pixelRatio) {};
* @abstract
* @protected
* @param {WebGLRenderingContext} gl gl.
* @param {ol.render.webgl.circlereplay.defaultshader.Locations|
ol.render.webgl.linestringreplay.defaultshader.Locations|
ol.render.webgl.polygonreplay.defaultshader.Locations|
ol.render.webgl.texturereplay.defaultshader.Locations} locations Locations.
* @param {module:ol/render/webgl/circlereplay/defaultshader/Locations|
module:ol/render/webgl/linestringreplay/defaultshader/Locations|
module:ol/render/webgl/polygonreplay/defaultshader/Locations|
module:ol/render/webgl/texturereplay/defaultshader/Locations} locations Locations.
*/
WebGLReplay.prototype.shutDownProgram = function(gl, locations) {};

View File

@@ -20,7 +20,7 @@ const HIT_DETECTION_SIZE = [1, 1];
/**
* @type {Object.<module:ol/render/ReplayType~ReplayType,
* function(new: ol.render.webgl.Replay, number,
* function(new: module:ol/render/webgl/Replay, number,
* module:ol/extent~Extent)>}
*/
const BATCH_CONSTRUCTORS = {
@@ -64,7 +64,7 @@ const WebGLReplayGroup = function(tolerance, maxExtent, opt_renderBuffer) {
/**
* @private
* @type {!Object.<string,
* Object.<module:ol/render/ReplayType~ReplayType, ol.render.webgl.Replay>>}
* Object.<module:ol/render/ReplayType~ReplayType, module:ol/render/webgl/Replay>>}
*/
this.replaysByZIndex_ = {};

View File

@@ -24,7 +24,7 @@ import WebGLBuffer from '../../webgl/Buffer.js';
/**
* @constructor
* @extends {ol.render.webgl.TextureReplay}
* @extends {module:ol/render/webgl/TextureReplay}
* @param {number} tolerance Tolerance.
* @param {module:ol/extent~Extent} maxExtent Max extent.
* @struct

View File

@@ -13,7 +13,7 @@ import {createTexture} from '../../webgl/Context.js';
/**
* @constructor
* @abstract
* @extends {ol.render.webgl.Replay}
* @extends {module:ol/render/webgl/Replay}
* @param {number} tolerance Tolerance.
* @param {module:ol/extent~Extent} maxExtent Max extent.
* @struct
@@ -65,7 +65,7 @@ const WebGLTextureReplay = function(tolerance, maxExtent) {
/**
* @protected
* @type {ol.render.webgl.texturereplay.defaultshader.Locations}
* @type {module:ol/render/webgl/texturereplay/defaultshader/Locations}
*/
this.defaultLocations = null;

View File

@@ -1,3 +0,0 @@
/**
* @namespace ol.render.webgl
*/

View File

@@ -1,3 +0,0 @@
/**
* @namespace ol.renderer
*/

View File

@@ -183,7 +183,7 @@ inherits(WebGLMapRenderer, MapRenderer);
/**
* @param {ol.Tile} tile Tile.
* @param {module:ol/Tile} tile Tile.
* @param {module:ol/size~Size} tileSize Tile size.
* @param {number} tileGutter Tile gutter.
* @param {number} magFilter Mag filter.

View File

@@ -53,7 +53,7 @@ const WebGLVectorLayerRenderer = function(mapRenderer, vectorLayer) {
/**
* @private
* @type {ol.render.webgl.ReplayGroup}
* @type {module:ol/render/webgl/ReplayGroup}
*/
this.replayGroup_ = null;
@@ -307,7 +307,7 @@ WebGLVectorLayerRenderer.prototype.prepareFrame = function(frameState, layerStat
* @param {number} pixelRatio Pixel ratio.
* @param {(module:ol/style/Style|Array.<module:ol/style/Style>)} styles The style or array of
* styles.
* @param {ol.render.webgl.ReplayGroup} replayGroup Replay group.
* @param {module:ol/render/webgl/ReplayGroup} replayGroup Replay group.
* @return {boolean} `true` if an image is loading.
*/
WebGLVectorLayerRenderer.prototype.renderFeature = function(feature, resolution, pixelRatio, styles, replayGroup) {

View File

@@ -19,21 +19,21 @@ const ImageSourceEventType = {
/**
* Triggered when an image starts loading.
* @event ol.source.Image.Event#imageloadstart
* @event ol/source/Image~ImageSourceEvent#imageloadstart
* @api
*/
IMAGELOADSTART: 'imageloadstart',
/**
* Triggered when an image finishes loading.
* @event ol.source.Image.Event#imageloadend
* @event ol/source/Image~ImageSourceEvent#imageloadend
* @api
*/
IMAGELOADEND: 'imageloadend',
/**
* Triggered if image loading results in an error.
* @event ol.source.Image.Event#imageloaderror
* @event ol/source/Image~ImageSourceEvent#imageloaderror
* @api
*/
IMAGELOADERROR: 'imageloaderror'
@@ -107,7 +107,7 @@ const ImageSource = function(options) {
/**
* @private
* @type {ol.reproj.Image}
* @type {module:ol/reproj/Image}
*/
this.reprojectedImage_ = null;

View File

@@ -19,9 +19,9 @@ import {appendParams} from '../uri.js';
* you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to
* access pixel data with the Canvas renderer. See
* {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail.
* @property {boolean} [hidpi=true] Use the `ol.Map#pixelRatio` value when requesting the image from
* @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting the image from
* the remote server.
* @property {ol.ImageLoadFunctionType} [imageLoadFunction] Optional function to load an image given
* @property {module:ol/Image~LoadFunction} [imageLoadFunction] Optional function to load an image given
* a URL.
* @property {Object.<string,*>} params ArcGIS Rest parameters. This field is optional. Service
* defaults will be used for any fields not specified. `FORMAT` is `PNG32` by default. `F` is
@@ -49,7 +49,7 @@ import {appendParams} from '../uri.js';
* {@link module:ol/source/TileArcGISRest} data source.
*
* @constructor
* @fires ol.source.Image.Event
* @fires ol/source/Image~ImageSourceEvent
* @extends {module:ol/source/Image}
* @param {module:ol/source/ImageArcGISRest~Options=} opt_options Image ArcGIS Rest Options.
* @api

View File

@@ -15,7 +15,7 @@ import {appendParams} from '../uri.js';
* @property {string} [url] The mapagent url.
* @property {number} [displayDpi=96] The display resolution.
* @property {number} [metersPerUnit=1] The meters-per-unit value.
* @property {boolean} [hidpi=true] Use the `ol.Map#pixelRatio` value when requesting
* @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting
* the image from the remote server.
* @property {boolean} [useOverlay] If `true`, will use `GETDYNAMICMAPOVERLAYIMAGE`.
* @property {module:ol/proj~ProjectionLike} projection Projection.
@@ -23,7 +23,7 @@ import {appendParams} from '../uri.js';
* twice the width and height of the map viewport, and so on. Must be `1` or higher.
* @property {Array.<number>} [resolutions] Resolutions.
* If specified, requests will be made for these resolutions only.
* @property {ol.ImageLoadFunctionType} [imageLoadFunction] Optional function to load an image given a URL.
* @property {module:ol/Image~LoadFunction} [imageLoadFunction] Optional function to load an image given a URL.
* @property {Object} [params] Additional parameters.
*/
@@ -33,7 +33,7 @@ import {appendParams} from '../uri.js';
* Source for images from Mapguide servers
*
* @constructor
* @fires ol.source.Image.Event
* @fires ol/source/Image~ImageSourceEvent
* @extends {module:ol/source/Image}
* @param {module:ol/source/ImageMapGuide~Options=} options ImageMapGuide options.
* @api
@@ -232,7 +232,7 @@ ImageMapGuide.prototype.getUrl = function(baseUrl, params, extent, size, project
'OPERATION': this.useOverlay_ ? 'GETDYNAMICMAPOVERLAYIMAGE' : 'GETMAPIMAGE',
'VERSION': '2.0.0',
'LOCALE': 'en',
'CLIENTAGENT': 'ol.source.ImageMapGuide source',
'CLIENTAGENT': 'ol/source/ImageMapGuide source',
'CLIP': '1',
'SETDISPLAYDPI': this.displayDpi_,
'SETDISPLAYWIDTH': Math.round(size[0]),

View File

@@ -20,7 +20,7 @@ import ImageSource, {defaultImageLoadFunction} from '../source/Image.js';
* {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail.
* @property {module:ol/extent~Extent} [imageExtent] Extent of the image in map coordinates.
* This is the [left, bottom, right, top] map coordinates of your image.
* @property {ol.ImageLoadFunctionType} [imageLoadFunction] Optional function to load an image given a URL.
* @property {module:ol/Image~LoadFunction} [imageLoadFunction] Optional function to load an image given a URL.
* @property {module:ol/proj~ProjectionLike} projection Projection.
* @property {module:ol/size~Size} [imageSize] 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.

View File

@@ -24,11 +24,11 @@ import {appendParams} from '../uri.js';
* you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to
* access pixel data with the Canvas renderer. See
* {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail.
* @property {boolean} [hidpi=true] Use the `ol.Map#pixelRatio` value when requesting
* @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting
* the image from the remote server.
* @property {module:ol/source/WMSServerType|string} [serverType] The type of
* the remote WMS server: `mapserver`, `geoserver` or `qgis`. Only needed if `hidpi` is `true`.
* @property {ol.ImageLoadFunctionType} [imageLoadFunction] Optional function to load an image given a URL.
* @property {module:ol/Image~LoadFunction} [imageLoadFunction] Optional function to load an image given a URL.
* @property {Object.<string,*>} params WMS request parameters.
* At least a `LAYERS` param is required. `STYLES` is
* `''` by default. `VERSION` is `1.3.0` by default. `WIDTH`, `HEIGHT`, `BBOX`
@@ -48,7 +48,7 @@ import {appendParams} from '../uri.js';
* Source for WMS servers providing single, untiled images.
*
* @constructor
* @fires ol.source.Image.Event
* @fires ol/source/Image~ImageSourceEvent
* @extends {module:ol/source/Image}
* @param {module:ol/source/ImageWMS~Options=} [opt_options] ImageWMS options.
* @api

View File

@@ -46,14 +46,14 @@ import {create as createTransform} from '../transform.js';
const RasterEventType = {
/**
* Triggered before operations are run.
* @event ol.source.Raster.Event#beforeoperations
* @event ol/source/Raster~RasterSourceEvent#beforeoperations
* @api
*/
BEFOREOPERATIONS: 'beforeoperations',
/**
* Triggered after operations are run.
* @event ol.source.Raster.Event#afteroperations
* @event ol/source/Raster~RasterSourceEvent#afteroperations
* @api
*/
AFTEROPERATIONS: 'afteroperations'
@@ -72,7 +72,7 @@ const RasterOperationType = {
/**
* @classdesc
* Events emitted by {@link ol.source.Raster} instances are instances of this
* Events emitted by {@link module:ol/source/Raster} instances are instances of this
* type.
*
* @constructor
@@ -138,7 +138,7 @@ inherits(RasterSourceEvent, Event);
*
* @constructor
* @extends {module:ol/source/Image}
* @fires ol.source.Raster.Event
* @fires ol/source/Raster~RasterSourceEvent
* @param {module:ol/source/Raster~Options=} options Options.
* @api
*/
@@ -152,7 +152,7 @@ const RasterSource = function(options) {
/**
* @private
* @type {ol.source.RasterOperationType}
* @type {module:ol/source/Raster~RasterOperationType}
*/
this.operationType_ = options.operationType !== undefined ?
options.operationType : RasterOperationType.PIXEL;
@@ -328,7 +328,7 @@ RasterSource.prototype.getImage = function(extent, resolution, pixelRatio, proje
const frameState = this.updateFrameState_(extent, resolution, projection);
this.requestedFrameState_ = frameState;
// check if we can't reuse the existing ol.ImageCanvas
// check if we can't reuse the existing ol/ImageCanvas
if (this.renderedImageCanvas_) {
const renderedResolution = this.renderedImageCanvas_.getResolution();
const renderedExtent = this.renderedImageCanvas_.getExtent();

View File

@@ -26,12 +26,12 @@ import {appendParams} from '../uri.js';
* override the default service layer visibility. See
* {@link http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Map/02r3000000v7000000/}
* for further reference.
* @property {ol.tilegrid.TileGrid} [tileGrid] Tile grid. Base this on the resolutions,
* @property {module:ol/tilegrid/TileGrid} [tileGrid] 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.
* @property {ol.ProjectionLike} projection Projection.
* @property {module:ol/proj~ProjectionLike} projection Projection.
* @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).
* Higher values can increase reprojection performance, but decrease precision.
* @property {module:ol/Tile~LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL.

View File

@@ -116,7 +116,7 @@ inherits(TileDebug, TileSource);
TileDebug.prototype.getTile = function(z, x, y) {
const tileCoordKey = getKeyZXY(z, x, y);
if (this.tileCache.containsKey(tileCoordKey)) {
return /** @type {!ol.source.LabeledTile} */ (this.tileCache.get(tileCoordKey));
return /** @type {!module:ol/source/TileDebug~LabeledTile} */ (this.tileCache.get(tileCoordKey));
} else {
const tileSize = toSize(this.tileGrid.getTileSize(z));
const tileCoord = [z, x, y];

View File

@@ -40,7 +40,7 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
* service advertizes 256px by 256px tiles but actually sends 512px
* by 512px images (for retina/hidpi devices) then `tilePixelRatio`
* should be set to `2`.
* @property {ol.TileUrlFunctionType} [tileUrlFunction] Optional function to get tile URL given a tile coordinate and the projection.
* @property {module:ol/Tile~UrlFunction} [tileUrlFunction] Optional function to get tile URL given a tile coordinate and the projection.
* @property {string} [url] URL template. Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders.
* A `{?-?}` template pattern, for example `subdomain{a-f}.domain.com`, may be
* used instead of defining each one separately in the `urls` option.

View File

@@ -384,7 +384,7 @@ UTFGrid.prototype.forDataAtCoordinateAndResolution = function(
if (this.tileGrid) {
const tileCoord = this.tileGrid.getTileCoordForCoordAndResolution(
coordinate, resolution);
const tile = /** @type {!ol.source.CustomTile} */(this.getTile(
const tile = /** @type {!module:ol/source/TileUTFGrid~CustomTile} */(this.getTile(
tileCoord[0], tileCoord[1], tileCoord[2], 1, this.getProjection()));
tile.forDataAtCoordinate(coordinate, callback, null, opt_request);
} else {
@@ -408,7 +408,7 @@ UTFGrid.prototype.handleTileJSONError = function() {
/**
* TODO: very similar to ol.source.TileJSON#handleTileJSONResponse
* TODO: very similar to ol/source/TileJSON#handleTileJSONResponse
* @protected
* @param {TileJSON} tileJSON Tile JSON.
*/

View File

@@ -38,7 +38,7 @@ import {appendParams} from '../uri.js';
* "artifacts at tile edges" issues by properly configuring the WMS service. For
* example, MapServer has a `tile_map_edge_buffer` configuration parameter for
* this. See http://mapserver.org/output/tile_mode.html.
* @property {boolean} [hidpi=true] Use the `ol.Map#pixelRatio` value when requesting
* @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting
* the image from the remote server.
* @property {module:ol/proj~ProjectionLike} projection Projection.
* @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).

View File

@@ -24,7 +24,7 @@ import RBush from '../structs/RBush.js';
/**
* A function that takes an {@link module:ol/extent~Extent} and a resolution as arguments, and
* returns an array of {@link module:ol/extent~Extent} with the extents to load. Usually this
* is one of the standard {@link ol.loadingstrategy} strategies.
* is one of the standard {@link module:ol/loadingstrategy} strategies.
*
* @typedef {function(module:ol/extent~Extent, number): Array.<module:ol/extent~Extent>} LoadingStrategy
* @api
@@ -73,8 +73,12 @@ inherits(VectorSourceEvent, Event);
* Example:
*
* ```js
* var vectorSource = new VectorSource({
* format: new ol.format.GeoJSON(),
* import {Vector} from 'ol/source';
* import {GeoJSON} from 'ol/format';
* import {bbox} from 'ol/loadingstrategy';
*
* var vectorSource = new Vector({
* format: new GeoJSON(),
* loader: function(extent, resolution, projection) {
* var proj = projection.getCode();
* var url = 'https://ahocevar.com/geoserver/wfs?service=WFS&' +
@@ -97,7 +101,7 @@ inherits(VectorSourceEvent, Event);
* }
* xhr.send();
* },
* strategy: ol.loadingstrategy.bbox
* strategy: bbox
* });
* ```
* @property {boolean} [overlaps=true] This source may have overlapping geometries.
@@ -105,12 +109,12 @@ inherits(VectorSourceEvent, Event);
* boundaries or TopoJSON sources) allows the renderer to optimise fill and
* stroke operations.
* @property {module:ol/source/Vector~LoadingStrategy} [strategy] The loading strategy to use.
* By default an {@link ol.loadingstrategy.all}
* By default an {@link module:ol/loadingstrategy~all}
* strategy is used, a one-off strategy which loads all features at once.
* @property {string|module:ol/featureloader~FeatureUrlfunction} [url]
* Setting this option instructs the source to load features using an XHR loader
* (see {@link ol.featureloader.xhr}). Use a `string` and an
* {@link ol.loadingstrategy.all} for a one-off download of all features from
* (see {@link module:ol/featureloader~xhr}). Use a `string` and an
* {@link module:ol/loadingstrategy~all} for a one-off download of all features from
* the given URL. Use a {@link module:ol/featureloader~FeatureUrlfunction} to generate the url with
* other loading strategies.
* Requires `format` to be set as well.
@@ -151,7 +155,7 @@ inherits(VectorSourceEvent, Event);
*
* @constructor
* @extends {module:ol/source/Source}
* @fires ol.source.Vector.Event
* @fires ol/source/Vector~VectorSourceEvent
* @param {module:ol/source/Vector~Options=} opt_options Vector source options.
* @api
*/
@@ -233,7 +237,7 @@ const VectorSource = function(opt_options) {
this.idIndex_ = {};
/**
* A lookup of features without id (keyed by ol.getUid(feature)).
* A lookup of features without id (keyed by getUid(feature)).
* @private
* @type {!Object.<string, module:ol/Feature>}
*/

View File

@@ -8,29 +8,29 @@
export default {
/**
* Triggered when a feature is added to the source.
* @event ol.source.Vector.Event#addfeature
* @event ol/source/Vector~VectorSourceEvent#addfeature
* @api
*/
ADDFEATURE: 'addfeature',
/**
* Triggered when a feature is updated.
* @event ol.source.Vector.Event#changefeature
* @event ol/source/Vector~VectorSourceEvent#changefeature
* @api
*/
CHANGEFEATURE: 'changefeature',
/**
* Triggered when the clear method is called on the source.
* @event ol.source.Vector.Event#clear
* @event ol/source/Vector~VectorSourceEvent#clear
* @api
*/
CLEAR: 'clear',
/**
* Triggered when a feature is removed from the source.
* See {@link ol.source.Vector#clear source.clear()} for exceptions.
* @event ol.source.Vector.Event#removefeature
* See {@link module:ol/source/Vector#clear source.clear()} for exceptions.
* @event ol/source/Vector~VectorSourceEvent#removefeature
* @api
*/
REMOVEFEATURE: 'removefeature'

View File

@@ -22,7 +22,7 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
* @property {module:ol/proj~ProjectionLike} projection Projection.
* @property {module:ol/source/State~State} [state] Source state.
* @property {module:ol/VectorTile~TileClass} [tileClass] Class used to instantiate image tiles.
* Default is {@link ol.VectorTile}.
* Default is {@link module:ol/VectorTile}.
* @property {module:ol/tilegrid/TileGrid} [tileGrid] Tile grid.
* @property {module:ol/Tile~LoadFunction} [tileLoadFunction]
* Optional function to load a tile given a URL. Could look like this:
@@ -32,13 +32,13 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
* var data = // ... fetch data
* var format = tile.getFormat();
* tile.setFeatures(format.readFeatures(data, {
* // uncomment the line below for ol.format.MVT only
* // uncomment the line below for ol/format/MVT only
* extent: tile.getExtent(),
* featureProjection: map.getView().getProjection()
* }));
* };
* });
* @property {ol.TileUrlFunctionType} [tileUrlFunction] Optional function to get tile URL given a tile coordinate and the projection.
* @property {module:ol/Tile~UrlFunction} [tileUrlFunction] Optional function to get tile URL given a tile coordinate and the projection.
* @property {string} [url] URL template. Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders.
* A `{?-?}` template pattern, for example `subdomain{a-f}.domain.com`, may be
* used instead of defining each one separately in the `urls` option.

View File

@@ -31,7 +31,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
* by 512px images (for retina/hidpi devices) then `tilePixelRatio`
* should be set to `2`.
* @property {number|module:ol/size~Size} [tileSize=[256, 256]] The tile size used by the tile service.
* @property {ol.TileUrlFunctionType} [tileUrlFunction] Optional function to get
* @property {module:ol/Tile~UrlFunction} [tileUrlFunction] Optional function to get
* tile URL given a tile coordinate and the projection.
* Required if url or urls are not provided.
* @property {string} [url] URL template. Must include `{x}`, `{y}` or `{-y}`,

View File

@@ -1,6 +1,90 @@
/**
* @module ol/style/Style
*/
/**
* Feature styles.
*
* If no style is defined, the following default style is used:
* ```js
* import {Fill, Stroke, Cirle, Style} from 'ol/style';
*
* var fill = new Fill({
* color: 'rgba(255,255,255,0.4)'
* });
* var stroke = new Stroke({
* color: '#3399CC',
* width: 1.25
* });
* var styles = [
* new Style({
* image: new Circle({
* fill: fill,
* stroke: stroke,
* radius: 5
* }),
* fill: fill,
* stroke: stroke
* })
* ];
* ```
*
* A separate editing style has the following defaults:
* ```js
* import {Fill, Stroke, Cirle, Style} from 'ol/style';
* import GeometryType from 'ol/geom/GeometryType';
*
* var white = [255, 255, 255, 1];
* var blue = [0, 153, 255, 1];
* var width = 3;
* styles[GeometryType.POLYGON] = [
* new Style({
* fill: new Fill({
* color: [255, 255, 255, 0.5]
* })
* })
* ];
* styles[GeometryType.MULTI_POLYGON] =
* styles[GeometryType.POLYGON];
* styles[GeometryType.LINE_STRING] = [
* new Style({
* stroke: new Stroke({
* color: white,
* width: width + 2
* })
* }),
* new Style({
* stroke: new Stroke({
* color: blue,
* width: width
* })
* })
* ];
* styles[GeometryType.MULTI_LINE_STRING] =
* styles[GeometryType.LINE_STRING];
* styles[GeometryType.POINT] = [
* new Style({
* image: new Circle({
* radius: width * 2,
* fill: new Fill({
* color: blue
* }),
* stroke: new Stroke({
* color: white,
* width: width / 2
* })
* }),
* zIndex: Infinity
* })
* ];
* styles[GeometryType.MULTI_POINT] =
* styles[GeometryType.POINT];
* styles[GEOMETRY_COLLECTION] =
* styles[GeometryType.POLYGON].concat(
* styles[GeometryType.POINT]
* );
* ```
*/
import {assert} from '../asserts.js';
import GeometryType from '../geom/GeometryType.js';
import CircleStyle from '../style/Circle.js';

View File

@@ -1,81 +0,0 @@
/**
* Feature styles.
*
* If no style is defined, the following default style is used:
* ```js
* var fill = new ol.style.Fill({
* color: 'rgba(255,255,255,0.4)'
* });
* var stroke = new ol.style.Stroke({
* color: '#3399CC',
* width: 1.25
* });
* var styles = [
* new ol.style.Style({
* image: new ol.style.Circle({
* fill: fill,
* stroke: stroke,
* radius: 5
* }),
* fill: fill,
* stroke: stroke
* })
* ];
* ```
*
* A separate editing style has the following defaults:
* ```js
* import GeometryType from ol/geom/GeometryType
* var white = [255, 255, 255, 1];
* var blue = [0, 153, 255, 1];
* var width = 3;
* styles[GeometryType.POLYGON] = [
* new ol.style.Style({
* fill: new ol.style.Fill({
* color: [255, 255, 255, 0.5]
* })
* })
* ];
* styles[GeometryType.MULTI_POLYGON] =
* styles[GeometryType.POLYGON];
* styles[GeometryType.LINE_STRING] = [
* new ol.style.Style({
* stroke: new ol.style.Stroke({
* color: white,
* width: width + 2
* })
* }),
* new ol.style.Style({
* stroke: new ol.style.Stroke({
* color: blue,
* width: width
* })
* })
* ];
* styles[GeometryType.MULTI_LINE_STRING] =
* styles[GeometryType.LINE_STRING];
* styles[GeometryType.POINT] = [
* new ol.style.Style({
* image: new ol.style.Circle({
* radius: width * 2,
* fill: new ol.style.Fill({
* color: blue
* }),
* stroke: new ol.style.Stroke({
* color: white,
* width: width / 2
* })
* }),
* zIndex: Infinity
* })
* ];
* styles[GeometryType.MULTI_POINT] =
* styles[GeometryType.POINT];
* styles[GEOMETRY_COLLECTION] =
* styles[GeometryType.POLYGON].concat(
* styles[GeometryType.POINT]
* );
*```
*
* @namespace ol.style
*/

View File

@@ -75,7 +75,7 @@ export function createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner) {
* @property {module:ol/extent~Extent} [extent] Extent for the tile grid. The origin for an XYZ tile grid is the
* top-left corner of the extent. The zero level of the grid is defined by the resolution at which one tile fits in the
* provided extent. If not provided, the extent of the EPSG:3857 projection is used.
* @property {number} [maxZoom] Maximum zoom. The default is `ol.DEFAULT_MAX_ZOOM`. This determines the number of levels
* @property {number} [maxZoom] Maximum zoom. The default is `42`. This determines the number of levels
* in the grid set. For example, a `maxZoom` of 21 means there are 22 levels in the grid set.
* @property {number} [minZoom=0] Minimum zoom.
* @property {number|module:ol/size~Size} [tileSize=[256, 256]] Tile size in pixels.

View File

@@ -1,3 +1,7 @@
/**
* @module ol/tilegrid/common
*/
/**
* Default maximum zoom for default tile grids.
* @type {number}

Some files were not shown because too many files have changed in this diff Show More