Fix type notation in examples

This commit is contained in:
Frederic Junod
2018-12-07 10:55:26 +01:00
parent cd3e65e3df
commit 759b317707
11 changed files with 34 additions and 41 deletions

View File

@@ -38,35 +38,35 @@ const vector = new VectorLayer({
/**
* Currently drawn feature.
* @type {module:ol/Feature~Feature}
* @type {import("../src/ol/Feature.js").default}
*/
let sketch;
/**
* The help tooltip element.
* @type {Element}
* @type {HTMLElement}
*/
let helpTooltipElement;
/**
* Overlay to show the help messages.
* @type {module:ol/Overlay}
* @type {Overlay}
*/
let helpTooltip;
/**
* The measure tooltip element.
* @type {Element}
* @type {HTMLElement}
*/
let measureTooltipElement;
/**
* Overlay to show the measurement.
* @type {module:ol/Overlay}
* @type {Overlay}
*/
let measureTooltip;
@@ -87,7 +87,7 @@ const continueLineMsg = 'Click to continue drawing the line';
/**
* Handle pointer move.
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} evt The event.
* @param {import("../src/ol/MapBrowserEvent").default} evt The event.
*/
const pointerMoveHandler = function(evt) {
if (evt.dragging) {
@@ -97,7 +97,7 @@ const pointerMoveHandler = function(evt) {
let helpMsg = 'Click to start drawing';
if (sketch) {
const geom = (sketch.getGeometry());
const geom = sketch.getGeometry();
if (geom instanceof Polygon) {
helpMsg = continuePolygonMsg;
} else if (geom instanceof LineString) {
@@ -134,7 +134,7 @@ let draw; // global so we can remove it later
/**
* Format length output.
* @param {module:ol/geom/LineString~LineString} line The line.
* @param {LineString} line The line.
* @return {string} The formatted length.
*/
const formatLength = function(line) {
@@ -153,7 +153,7 @@ const formatLength = function(line) {
/**
* Format area output.
* @param {module:ol/geom/Polygon~Polygon} polygon The polygon.
* @param {Polygon} polygon The polygon.
* @return {string} Formatted area.
*/
const formatArea = function(polygon) {
@@ -205,7 +205,7 @@ function addInteraction() {
// set sketch
sketch = evt.feature;
/** @type {module:ol/coordinate~Coordinate|undefined} */
/** @type {import("../src/ol/coordinate.js").Coordinate|undefined} */
let tooltipCoord = evt.coordinate;
listener = sketch.getGeometry().on('change', function(evt) {