diff --git a/examples/getfeatureinfo-layers.js b/examples/getfeatureinfo-layers.js index 650ed91f55..de9c69bf7e 100644 --- a/examples/getfeatureinfo-layers.js +++ b/examples/getfeatureinfo-layers.js @@ -14,14 +14,12 @@ fetch('data/wmsgetfeatureinfo/osm-restaurant-hotel.xml') const hotelFeatures = new WMSGetFeatureInfo({ layers: ['hotel'], }).readFeatures(response); - document.getElementById( - 'hotel' - ).innerText = hotelFeatures.length.toString(); + document.getElementById('hotel').innerText = + hotelFeatures.length.toString(); const restaurantFeatures = new WMSGetFeatureInfo({ layers: ['restaurant'], }).readFeatures(response); - document.getElementById( - 'restaurant' - ).innerText = restaurantFeatures.length.toString(); + document.getElementById('restaurant').innerText = + restaurantFeatures.length.toString(); }); diff --git a/examples/igc.js b/examples/igc.js index 9fb6719696..99e3d8dc86 100644 --- a/examples/igc.js +++ b/examples/igc.js @@ -183,7 +183,10 @@ document.getElementById('time').addEventListener('input', function () { const value = parseInt(this.value, 10) / 100; const m = time.start + time.duration * value; vectorSource.forEachFeature(function (feature) { - const geometry = /** @type {import("../src/ol/geom/LineString.js").default} */ (feature.getGeometry()); + const geometry = + /** @type {import("../src/ol/geom/LineString.js").default} */ ( + feature.getGeometry() + ); const coordinate = geometry.getCoordinateAtM(m, true); let highlight = feature.get('highlight'); if (highlight === undefined) { diff --git a/examples/mapguide-untiled.js b/examples/mapguide-untiled.js index b792d830d3..7f3cb8d892 100644 --- a/examples/mapguide-untiled.js +++ b/examples/mapguide-untiled.js @@ -6,9 +6,7 @@ import View from '../src/ol/View.js'; const mdf = 'Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition'; const agentUrl = 'https://mikenunn.net/mapguide/mapagent/mapagent.fcgi?'; const bounds = [ - -87.865114442365922, - 43.665065564837931, - -87.595394059497067, + -87.865114442365922, 43.665065564837931, -87.595394059497067, 43.823852564430069, ]; const map = new Map({ diff --git a/examples/mobile-full-screen.js b/examples/mobile-full-screen.js index 1c3bbb701f..240be78bcf 100644 --- a/examples/mobile-full-screen.js +++ b/examples/mobile-full-screen.js @@ -13,8 +13,7 @@ const map = new Map({ layers: [ new TileLayer({ source: new BingMaps({ - key: - 'ApTJzdkyN1DdFKkRAE6QIDtzihNaf6IWJsT-nQ_2eMoO4PN__0Tzhl2-WgJtXFSp ', + key: 'ApTJzdkyN1DdFKkRAE6QIDtzihNaf6IWJsT-nQ_2eMoO4PN__0Tzhl2-WgJtXFSp ', imagerySet: 'RoadOnDemand', }), }), diff --git a/examples/navigation-controls.js b/examples/navigation-controls.js index 6d63b19139..093fe7e8bb 100644 --- a/examples/navigation-controls.js +++ b/examples/navigation-controls.js @@ -8,9 +8,7 @@ const map = new Map({ controls: defaultControls().extend([ new ZoomToExtent({ extent: [ - 813079.7791264898, - 5929220.284081122, - 848966.9639063801, + 813079.7791264898, 5929220.284081122, 848966.9639063801, 5936863.986909639, ], }), diff --git a/examples/offscreen-canvas.worker.js b/examples/offscreen-canvas.worker.js index 7dc17363ba..d80a4da37f 100644 --- a/examples/offscreen-canvas.worker.js +++ b/examples/offscreen-canvas.worker.js @@ -21,21 +21,18 @@ const sources = { landcover: new VectorTileSource({ maxZoom: 9, format: new MVT(), - url: - 'https://api.maptiler.com/tiles/landcover/{z}/{x}/{y}.pbf?key=get_your_own_D6rA4zTHduk6KOKTXzGB', + url: 'https://api.maptiler.com/tiles/landcover/{z}/{x}/{y}.pbf?key=get_your_own_D6rA4zTHduk6KOKTXzGB', }), contours: new VectorTileSource({ minZoom: 9, maxZoom: 14, format: new MVT(), - url: - 'https://api.maptiler.com/tiles/contours/{z}/{x}/{y}.pbf?key=get_your_own_D6rA4zTHduk6KOKTXzGB', + url: 'https://api.maptiler.com/tiles/contours/{z}/{x}/{y}.pbf?key=get_your_own_D6rA4zTHduk6KOKTXzGB', }), openmaptiles: new VectorTileSource({ format: new MVT(), maxZoom: 14, - url: - 'https://api.maptiler.com/tiles/v3/{z}/{x}/{y}.pbf?key=get_your_own_D6rA4zTHduk6KOKTXzGB', + url: 'https://api.maptiler.com/tiles/v3/{z}/{x}/{y}.pbf?key=get_your_own_D6rA4zTHduk6KOKTXzGB', }), }; const layers = []; diff --git a/examples/sphere-mollweide.js b/examples/sphere-mollweide.js index b96b8dec46..3b985018cd 100644 --- a/examples/sphere-mollweide.js +++ b/examples/sphere-mollweide.js @@ -20,9 +20,7 @@ register(proj4); const sphereMollweideProjection = new Projection({ code: 'ESRI:53009', extent: [ - -18019909.21177587, - -9009954.605703328, - 18019909.21177587, + -18019909.21177587, -9009954.605703328, 18019909.21177587, 9009954.605703328, ], worldExtent: [-179, -89.99, 179, 89.99], diff --git a/examples/style-renderer.js b/examples/style-renderer.js index 5458c314f9..d614c5fb51 100644 --- a/examples/style-renderer.js +++ b/examples/style-renderer.js @@ -45,8 +45,7 @@ const style = new Style({ const vectorLayer = new VectorLayer({ source: new VectorSource({ - url: - 'https://openlayersbook.github.io/openlayers_book_samples/assets/data/countries.geojson', + url: 'https://openlayersbook.github.io/openlayers_book_samples/assets/data/countries.geojson', format: new GeoJSON(), }), style: style, diff --git a/examples/tracing.js b/examples/tracing.js index 87b3fa19f8..8b4ef312c6 100644 --- a/examples/tracing.js +++ b/examples/tracing.js @@ -114,8 +114,7 @@ const raster = new TileLayer({ const baseVector = new VectorLayer({ source: new VectorSource({ format: new GeoJSON(), - url: - "https://ahocevar.com/geoserver/wfs?service=wfs&request=getfeature&typename=topp:states&cql_filter=STATE_NAME='Idaho'&outputformat=application/json", + url: "https://ahocevar.com/geoserver/wfs?service=wfs&request=getfeature&typename=topp:states&cql_filter=STATE_NAME='Idaho'&outputformat=application/json", }), }); diff --git a/examples/vector-tile-info.js b/examples/vector-tile-info.js index 8ac28f9996..5c983433ca 100644 --- a/examples/vector-tile-info.js +++ b/examples/vector-tile-info.js @@ -14,8 +14,7 @@ const map = new Map({ new VectorTileLayer({ source: new VectorTileSource({ format: new MVT(), - url: - 'https://basemaps.arcgis.com/v1/arcgis/rest/services/World_Basemap/VectorTileServer/tile/{z}/{y}/{x}.pbf', + url: 'https://basemaps.arcgis.com/v1/arcgis/rest/services/World_Basemap/VectorTileServer/tile/{z}/{y}/{x}.pbf', }), }), ], diff --git a/examples/webpack/example-builder.js b/examples/webpack/example-builder.js index 41e6bdbd06..cc531f2f22 100644 --- a/examples/webpack/example-builder.js +++ b/examples/webpack/example-builder.js @@ -13,7 +13,8 @@ const baseDir = dirname(fileURLToPath(import.meta.url)); const isCssRegEx = /\.css(\?.*)?$/; const isJsRegEx = /\.js(\?.*)?$/; const importRegEx = /^import .* from '(.*)';$/; -const isTemplateJs = /\/(jquery(-\d+\.\d+\.\d+)?|(bootstrap(\.bundle)?))(\.min)?\.js(\?.*)?$/; +const isTemplateJs = + /\/(jquery(-\d+\.\d+\.\d+)?|(bootstrap(\.bundle)?))(\.min)?\.js(\?.*)?$/; const isTemplateCss = /\/bootstrap(\.min)?\.css(\?.*)?$/; let cachedPackageInfo = null; diff --git a/src/ol/Geolocation.js b/src/ol/Geolocation.js index 0497b14676..ceda60f9e8 100644 --- a/src/ol/Geolocation.js +++ b/src/ol/Geolocation.js @@ -229,9 +229,9 @@ class Geolocation extends BaseObject { * @api */ getAccuracyGeometry() { - return /** @type {?import("./geom/Polygon.js").default} */ (this.get( - Property.ACCURACY_GEOMETRY - ) || null); + return /** @type {?import("./geom/Polygon.js").default} */ ( + this.get(Property.ACCURACY_GEOMETRY) || null + ); } /** @@ -253,9 +253,9 @@ class Geolocation extends BaseObject { * @api */ getAltitudeAccuracy() { - return /** @type {number|undefined} */ (this.get( - Property.ALTITUDE_ACCURACY - )); + return /** @type {number|undefined} */ ( + this.get(Property.ALTITUDE_ACCURACY) + ); } /** @@ -278,9 +278,9 @@ class Geolocation extends BaseObject { * @api */ getPosition() { - return /** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get( - Property.POSITION - )); + return /** @type {import("./coordinate.js").Coordinate|undefined} */ ( + this.get(Property.POSITION) + ); } /** @@ -291,9 +291,9 @@ class Geolocation extends BaseObject { * @api */ getProjection() { - return /** @type {import("./proj/Projection.js").default|undefined} */ (this.get( - Property.PROJECTION - )); + return /** @type {import("./proj/Projection.js").default|undefined} */ ( + this.get(Property.PROJECTION) + ); } /** @@ -327,9 +327,9 @@ class Geolocation extends BaseObject { * @api */ getTrackingOptions() { - return /** @type {PositionOptions|undefined} */ (this.get( - Property.TRACKING_OPTIONS - )); + return /** @type {PositionOptions|undefined} */ ( + this.get(Property.TRACKING_OPTIONS) + ); } /** diff --git a/src/ol/Overlay.js b/src/ol/Overlay.js index ce4350a09d..e4a2ace6b5 100644 --- a/src/ol/Overlay.js +++ b/src/ol/Overlay.js @@ -191,7 +191,9 @@ class Overlay extends BaseObject { this.setPositioning( options.positioning !== undefined - ? /** @type {import("./OverlayPositioning.js").default} */ (options.positioning) + ? /** @type {import("./OverlayPositioning.js").default} */ ( + options.positioning + ) : OverlayPositioning.TOP_LEFT ); @@ -227,9 +229,9 @@ class Overlay extends BaseObject { * @api */ getMap() { - return /** @type {import("./PluggableMap.js").default|undefined} */ (this.get( - Property.MAP - )); + return /** @type {import("./PluggableMap.js").default|undefined} */ ( + this.get(Property.MAP) + ); } /** @@ -250,9 +252,9 @@ class Overlay extends BaseObject { * @api */ getPosition() { - return /** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get( - Property.POSITION - )); + return /** @type {import("./coordinate.js").Coordinate|undefined} */ ( + this.get(Property.POSITION) + ); } /** @@ -263,9 +265,9 @@ class Overlay extends BaseObject { * @api */ getPositioning() { - return /** @type {import("./OverlayPositioning.js").default} */ (this.get( - Property.POSITIONING - )); + return /** @type {import("./OverlayPositioning.js").default} */ ( + this.get(Property.POSITIONING) + ); } /** @@ -440,9 +442,9 @@ class Overlay extends BaseObject { } if (delta[0] !== 0 || delta[1] !== 0) { - const center = /** @type {import("./coordinate.js").Coordinate} */ (map - .getView() - .getCenterInternal()); + const center = /** @type {import("./coordinate.js").Coordinate} */ ( + map.getView().getCenterInternal() + ); const centerPx = map.getPixelFromCoordinateInternal(center); if (!centerPx) { return; diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js index 578d924f98..bdc431cae9 100644 --- a/src/ol/PluggableMap.js +++ b/src/ol/PluggableMap.js @@ -438,7 +438,9 @@ class PluggableMap extends BaseObject { * @param {import("./Collection.js").CollectionEvent} event CollectionEvent. */ function (event) { - const overlay = /** @type {import("./Overlay.js").default} */ (event.element); + const overlay = /** @type {import("./Overlay.js").default} */ ( + event.element + ); const id = overlay.getId(); if (id !== undefined) { delete this.overlayIdIndex_[id.toString()]; @@ -698,9 +700,9 @@ class PluggableMap extends BaseObject { * @api */ getTarget() { - return /** @type {HTMLElement|string|undefined} */ (this.get( - MapProperty.TARGET - )); + return /** @type {HTMLElement|string|undefined} */ ( + this.get(MapProperty.TARGET) + ); } /** @@ -825,7 +827,9 @@ class PluggableMap extends BaseObject { const layerStatesArray = this.getLayerGroup().getLayerStatesArray(); for (let i = 0, ii = layerStatesArray.length; i < ii; ++i) { const layer = layerStatesArray[i].layer; - const source = /** @type {import("./layer/Layer.js").default} */ (layer).getSource(); + const source = /** @type {import("./layer/Layer.js").default} */ ( + layer + ).getSource(); if (source && source.loading) { return true; } @@ -881,9 +885,9 @@ class PluggableMap extends BaseObject { * @api */ getSize() { - return /** @type {import("./size.js").Size|undefined} */ (this.get( - MapProperty.SIZE - )); + return /** @type {import("./size.js").Size|undefined} */ ( + this.get(MapProperty.SIZE) + ); } /** @@ -972,7 +976,9 @@ class PluggableMap extends BaseObject { // coordinates so interactions cannot be used. return; } - const originalEvent = /** @type {PointerEvent} */ (mapBrowserEvent.originalEvent); + const originalEvent = /** @type {PointerEvent} */ ( + mapBrowserEvent.originalEvent + ); const eventType = originalEvent.type; if ( eventType === PointerEventType.POINTERDOWN || diff --git a/src/ol/View.js b/src/ol/View.js index ef34b3a9e9..7df9e8d5f4 100644 --- a/src/ol/View.js +++ b/src/ol/View.js @@ -895,9 +895,9 @@ class View extends BaseObject { * @return {import("./coordinate.js").Coordinate|undefined} The center of the view. */ getCenterInternal() { - return /** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get( - ViewProperty.CENTER - )); + return /** @type {import("./coordinate.js").Coordinate|undefined} */ ( + this.get(ViewProperty.CENTER) + ); } /** @@ -950,7 +950,9 @@ class View extends BaseObject { */ calculateExtentInternal(opt_size) { const size = opt_size || this.getViewportSizeMinusPadding_(); - const center = /** @type {!import("./coordinate.js").Coordinate} */ (this.getCenterInternal()); + const center = /** @type {!import("./coordinate.js").Coordinate} */ ( + this.getCenterInternal() + ); assert(center, 1); // The view center is not defined const resolution = /** @type {!number} */ (this.getResolution()); assert(resolution !== undefined, 2); // The view resolution is not defined @@ -984,9 +986,9 @@ class View extends BaseObject { * @api */ getMaxZoom() { - return /** @type {number} */ (this.getZoomForResolution( - this.minResolution_ - )); + return /** @type {number} */ ( + this.getZoomForResolution(this.minResolution_) + ); } /** @@ -1004,9 +1006,9 @@ class View extends BaseObject { * @api */ getMinZoom() { - return /** @type {number} */ (this.getZoomForResolution( - this.maxResolution_ - )); + return /** @type {number} */ ( + this.getZoomForResolution(this.maxResolution_) + ); } /** @@ -1166,7 +1168,9 @@ class View extends BaseObject { const projection = this.getProjection(); const resolution = /** @type {number} */ (this.getResolution()); const rotation = this.getRotation(); - let center = /** @type {import("./coordinate.js").Coordinate} */ (this.getCenterInternal()); + let center = /** @type {import("./coordinate.js").Coordinate} */ ( + this.getCenterInternal() + ); const padding = this.padding_; if (padding) { const reducedSize = this.getViewportSizeMinusPadding_(); @@ -1290,9 +1294,11 @@ class View extends BaseObject { } else { const userProjection = getUserProjection(); if (userProjection) { - geometry = /** @type {import("./geom/SimpleGeometry.js").default} */ (geometryOrExtent - .clone() - .transform(userProjection, this.getProjection())); + geometry = /** @type {import("./geom/SimpleGeometry.js").default} */ ( + geometryOrExtent + .clone() + .transform(userProjection, this.getProjection()) + ); } else { geometry = geometryOrExtent; } diff --git a/src/ol/control/Attribution.js b/src/ol/control/Attribution.js index 7d1ff8234a..9803d5f619 100644 --- a/src/ol/control/Attribution.js +++ b/src/ol/control/Attribution.js @@ -211,7 +211,9 @@ class Attribution extends Control { continue; } - const source = /** @type {import("../layer/Layer.js").default} */ (layerState.layer).getSource(); + const source = /** @type {import("../layer/Layer.js").default} */ ( + layerState.layer + ).getSource(); if (!source) { continue; } diff --git a/src/ol/control/MousePosition.js b/src/ol/control/MousePosition.js index be5016fafc..1d96ba7352 100644 --- a/src/ol/control/MousePosition.js +++ b/src/ol/control/MousePosition.js @@ -126,9 +126,9 @@ class MousePosition extends Control { * @api */ getCoordinateFormat() { - return /** @type {import("../coordinate.js").CoordinateFormat|undefined} */ (this.get( - COORDINATE_FORMAT - )); + return /** @type {import("../coordinate.js").CoordinateFormat|undefined} */ ( + this.get(COORDINATE_FORMAT) + ); } /** @@ -139,9 +139,9 @@ class MousePosition extends Control { * @api */ getProjection() { - return /** @type {import("../proj/Projection.js").default|undefined} */ (this.get( - PROJECTION - )); + return /** @type {import("../proj/Projection.js").default|undefined} */ ( + this.get(PROJECTION) + ); } /** diff --git a/src/ol/control/OverviewMap.js b/src/ol/control/OverviewMap.js index a7185100dd..454076deea 100644 --- a/src/ol/control/OverviewMap.js +++ b/src/ol/control/OverviewMap.js @@ -319,7 +319,9 @@ class OverviewMap extends Control { */ handleMapPropertyChange_(event) { if (event.key === MapProperty.VIEW) { - const oldView = /** @type {import("../View.js").default} */ (event.oldValue); + const oldView = /** @type {import("../View.js").default} */ ( + event.oldValue + ); if (oldView) { this.unbindView_(oldView); } @@ -407,7 +409,9 @@ class OverviewMap extends Control { } this.viewExtent_ = extent; - const ovmapSize = /** @type {import("../size.js").Size} */ (ovmap.getSize()); + const ovmapSize = /** @type {import("../size.js").Size} */ ( + ovmap.getSize() + ); const ovview = ovmap.getView(); const ovextent = ovview.calculateExtentInternal(ovmapSize); diff --git a/src/ol/control/ZoomSlider.js b/src/ol/control/ZoomSlider.js index 4de7ca0254..93ebc8c7c1 100644 --- a/src/ol/control/ZoomSlider.js +++ b/src/ol/control/ZoomSlider.js @@ -247,8 +247,9 @@ class ZoomSlider extends Control { */ handleDraggerStart_(event) { if (!this.dragging_ && event.target === this.element.firstElementChild) { - const element = /** @type {HTMLElement} */ (this.element - .firstElementChild); + const element = /** @type {HTMLElement} */ ( + this.element.firstElementChild + ); this.getMap().getView().beginInteraction(); this.startX_ = event.clientX - parseFloat(element.style.left); this.startY_ = event.clientY - parseFloat(element.style.top); @@ -277,9 +278,8 @@ class ZoomSlider extends Control { const deltaX = event.clientX - this.startX_; const deltaY = event.clientY - this.startY_; const relativePosition = this.getRelativePosition_(deltaX, deltaY); - this.currentResolution_ = this.getResolutionForPosition_( - relativePosition - ); + this.currentResolution_ = + this.getResolutionForPosition_(relativePosition); this.getMap().getView().setResolution(this.currentResolution_); } } diff --git a/src/ol/dom.js b/src/ol/dom.js index b212a1361d..b035b8c599 100644 --- a/src/ol/dom.js +++ b/src/ol/dom.js @@ -32,10 +32,9 @@ export function createCanvasContext2D( canvas.height = opt_height; } //FIXME Allow OffscreenCanvasRenderingContext2D as return type - return /** @type {CanvasRenderingContext2D} */ (canvas.getContext( - '2d', - opt_Context2DSettings - )); + return /** @type {CanvasRenderingContext2D} */ ( + canvas.getContext('2d', opt_Context2DSettings) + ); } /** diff --git a/src/ol/events/Target.js b/src/ol/events/Target.js index 4a2299de9e..d2cb33c5b1 100644 --- a/src/ol/events/Target.js +++ b/src/ol/events/Target.js @@ -102,13 +102,13 @@ class Target extends Disposable { ++dispatching[type]; for (let i = 0, ii = listeners.length; i < ii; ++i) { if ('handleEvent' in listeners[i]) { - propagate = /** @type {import("../events.js").ListenerObject} */ (listeners[ - i - ]).handleEvent(evt); + propagate = /** @type {import("../events.js").ListenerObject} */ ( + listeners[i] + ).handleEvent(evt); } else { - propagate = /** @type {import("../events.js").ListenerFunction} */ (listeners[ - i - ]).call(this, evt); + propagate = /** @type {import("../events.js").ListenerFunction} */ ( + listeners[i] + ).call(this, evt); } if (propagate === false || evt.propagationStopped) { propagate = false; diff --git a/src/ol/events/condition.js b/src/ol/events/condition.js index f4bc8abf06..bff7b81b81 100644 --- a/src/ol/events/condition.js +++ b/src/ol/events/condition.js @@ -45,7 +45,9 @@ export function all(var_args) { * @api */ export const altKeyOnly = function (mapBrowserEvent) { - const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent); + const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ ( + mapBrowserEvent.originalEvent + ); return ( originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && @@ -62,7 +64,9 @@ export const altKeyOnly = function (mapBrowserEvent) { * @api */ export const altShiftKeysOnly = function (mapBrowserEvent) { - const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent); + const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ ( + mapBrowserEvent.originalEvent + ); return ( originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && @@ -124,7 +128,9 @@ export const click = function (mapBrowserEvent) { * @return {boolean} The result. */ export const mouseActionButton = function (mapBrowserEvent) { - const originalEvent = /** @type {MouseEvent} */ (mapBrowserEvent.originalEvent); + const originalEvent = /** @type {MouseEvent} */ ( + mapBrowserEvent.originalEvent + ); return originalEvent.button == 0 && !(WEBKIT && MAC && originalEvent.ctrlKey); }; @@ -180,7 +186,9 @@ export const doubleClick = function (mapBrowserEvent) { * @api */ export const noModifierKeys = function (mapBrowserEvent) { - const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent); + const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ ( + mapBrowserEvent.originalEvent + ); return ( !originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && @@ -198,7 +206,9 @@ export const noModifierKeys = function (mapBrowserEvent) { * @api */ export const platformModifierKeyOnly = function (mapBrowserEvent) { - const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent); + const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ ( + mapBrowserEvent.originalEvent + ); return ( !originalEvent.altKey && (MAC ? originalEvent.metaKey : originalEvent.ctrlKey) && @@ -215,7 +225,9 @@ export const platformModifierKeyOnly = function (mapBrowserEvent) { * @api */ export const shiftKeyOnly = function (mapBrowserEvent) { - const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent); + const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ ( + mapBrowserEvent.originalEvent + ); return ( !originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && @@ -232,7 +244,9 @@ export const shiftKeyOnly = function (mapBrowserEvent) { * @api */ export const targetNotEditable = function (mapBrowserEvent) { - const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent); + const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ ( + mapBrowserEvent.originalEvent + ); const tagName = /** @type {Element} */ (originalEvent.target).tagName; return tagName !== 'INPUT' && tagName !== 'SELECT' && tagName !== 'TEXTAREA'; }; @@ -245,8 +259,9 @@ export const targetNotEditable = function (mapBrowserEvent) { * @api */ export const mouseOnly = function (mapBrowserEvent) { - const pointerEvent = /** @type {import("../MapBrowserEvent").default} */ (mapBrowserEvent) - .originalEvent; + const pointerEvent = /** @type {import("../MapBrowserEvent").default} */ ( + mapBrowserEvent + ).originalEvent; assert(pointerEvent !== undefined, 56); // mapBrowserEvent must originate from a pointer event // see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType return pointerEvent.pointerType == 'mouse'; @@ -260,8 +275,9 @@ export const mouseOnly = function (mapBrowserEvent) { * @api */ export const touchOnly = function (mapBrowserEvent) { - const pointerEvt = /** @type {import("../MapBrowserEvent").default} */ (mapBrowserEvent) - .originalEvent; + const pointerEvt = /** @type {import("../MapBrowserEvent").default} */ ( + mapBrowserEvent + ).originalEvent; assert(pointerEvt !== undefined, 56); // mapBrowserEvent must originate from a pointer event // see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType return pointerEvt.pointerType === 'touch'; @@ -275,8 +291,9 @@ export const touchOnly = function (mapBrowserEvent) { * @api */ export const penOnly = function (mapBrowserEvent) { - const pointerEvt = /** @type {import("../MapBrowserEvent").default} */ (mapBrowserEvent) - .originalEvent; + const pointerEvt = /** @type {import("../MapBrowserEvent").default} */ ( + mapBrowserEvent + ).originalEvent; assert(pointerEvt !== undefined, 56); // mapBrowserEvent must originate from a pointer event // see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType return pointerEvt.pointerType === 'pen'; @@ -292,8 +309,9 @@ export const penOnly = function (mapBrowserEvent) { * @api */ export const primaryAction = function (mapBrowserEvent) { - const pointerEvent = /** @type {import("../MapBrowserEvent").default} */ (mapBrowserEvent) - .originalEvent; + const pointerEvent = /** @type {import("../MapBrowserEvent").default} */ ( + mapBrowserEvent + ).originalEvent; assert(pointerEvent !== undefined, 56); // mapBrowserEvent must originate from a pointer event return pointerEvent.isPrimary && pointerEvent.button === 0; }; diff --git a/src/ol/featureloader.js b/src/ol/featureloader.js index 5eed20a2f8..9005c41ca1 100644 --- a/src/ol/featureloader.js +++ b/src/ol/featureloader.js @@ -102,10 +102,12 @@ export function loadFeaturesXhr( if (source) { success( /** @type {Array} */ - (format.readFeatures(source, { - extent: extent, - featureProjection: projection, - })), + ( + format.readFeatures(source, { + extent: extent, + featureProjection: projection, + }) + ), format.readProjection(source) ); } else { diff --git a/src/ol/format/EsriJSON.js b/src/ol/format/EsriJSON.js index 5b17a7f43b..600e2f7822 100644 --- a/src/ol/format/EsriJSON.js +++ b/src/ol/format/EsriJSON.js @@ -166,9 +166,9 @@ class EsriJSON extends JSONFeature { object['spatialReference'] && object['spatialReference']['wkid'] !== undefined ) { - const spatialReference = /** @type {EsriJSONSpatialReferenceWkid} */ (object[ - 'spatialReference' - ]); + const spatialReference = /** @type {EsriJSONSpatialReferenceWkid} */ ( + object['spatialReference'] + ); const crs = spatialReference.wkid; return getProjection('EPSG:' + crs); } else { @@ -211,11 +211,10 @@ class EsriJSON extends JSONFeature { opt_options && (opt_options.dataProjection || opt_options.featureProjection); if (projection) { - object['geometry'][ - 'spatialReference' - ] = /** @type {EsriJSONSpatialReferenceWkid} */ ({ - wkid: Number(getProjection(projection).getCode().split(':').pop()), - }); + object['geometry']['spatialReference'] = + /** @type {EsriJSONSpatialReferenceWkid} */ ({ + wkid: Number(getProjection(projection).getCode().split(':').pop()), + }); } delete properties[feature.getGeometryName()]; } @@ -506,9 +505,9 @@ function writePolygonGeometry(polygon, opt_options) { return { hasZ: hasZM.hasZ, hasM: hasZM.hasM, - rings: /** @type {Array>} */ (polygon.getCoordinates( - false - )), + rings: /** @type {Array>} */ ( + polygon.getCoordinates(false) + ), }; } @@ -522,7 +521,9 @@ function writeMultiLineStringGeometry(multiLineString, opt_options) { return { hasZ: hasZM.hasZ, hasM: hasZM.hasM, - paths: /** @type {Array>} */ (multiLineString.getCoordinates()), + paths: /** @type {Array>} */ ( + multiLineString.getCoordinates() + ), }; } @@ -536,7 +537,9 @@ function writeMultiPointGeometry(multiPoint, opt_options) { return { hasZ: hasZM.hasZ, hasM: hasZM.hasM, - points: /** @type {Array} */ (multiPoint.getCoordinates()), + points: /** @type {Array} */ ( + multiPoint.getCoordinates() + ), }; } diff --git a/src/ol/format/GML2.js b/src/ol/format/GML2.js index 300f27fc29..03bfdc3807 100644 --- a/src/ol/format/GML2.js +++ b/src/ol/format/GML2.js @@ -77,7 +77,9 @@ class GML2 extends GMLBase { */ readFlatCoordinates(node, objectStack) { const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, ''); - const context = /** @type {import("../xml.js").NodeStackItem} */ (objectStack[0]); + const context = /** @type {import("../xml.js").NodeStackItem} */ ( + objectStack[0] + ); const containerSrs = context['srsName']; let axisOrientation = 'enu'; if (containerSrs) { @@ -181,7 +183,9 @@ class GML2 extends GMLBase { const multiCurve = context['multiCurve']; let nodeName; if (!Array.isArray(value)) { - nodeName = /** @type {import("../geom/Geometry.js").default} */ (value).getType(); + nodeName = /** @type {import("../geom/Geometry.js").default} */ ( + value + ).getType(); if (nodeName === 'MultiPolygon' && multiSurface === true) { nodeName = 'MultiSurface'; } else if (nodeName === 'Polygon' && surface === true) { @@ -234,9 +238,8 @@ class GML2 extends GMLBase { } } else { if (!(key in context.serializers[featureNS])) { - context.serializers[featureNS][key] = makeChildAppender( - writeStringTextNode - ); + context.serializers[featureNS][key] = + makeChildAppender(writeStringTextNode); } } } @@ -324,9 +327,9 @@ class GML2 extends GMLBase { * @param {Array<*>} objectStack Node stack. */ writeGeometryElement(node, geometry, objectStack) { - const context = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[ - objectStack.length - 1 - ]); + const context = /** @type {import("./Feature.js").WriteOptions} */ ( + objectStack[objectStack.length - 1] + ); const item = assign({}, context); item['node'] = node; let value; diff --git a/src/ol/format/GML3.js b/src/ol/format/GML3.js index 50fb0572eb..a16fcc0995 100644 --- a/src/ol/format/GML3.js +++ b/src/ol/format/GML3.js @@ -797,9 +797,9 @@ class GML3 extends GMLBase { * @param {Array<*>} objectStack Node stack. */ writeGeometryElement(node, geometry, objectStack) { - const context = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[ - objectStack.length - 1 - ]); + const context = /** @type {import("./Feature.js").WriteOptions} */ ( + objectStack[objectStack.length - 1] + ); const item = assign({}, context); item['node'] = node; let value; @@ -866,9 +866,8 @@ class GML3 extends GMLBase { } } else { if (!(key in context.serializers[featureNS])) { - context.serializers[featureNS][key] = makeChildAppender( - writeStringTextNode - ); + context.serializers[featureNS][key] = + makeChildAppender(writeStringTextNode); } } } @@ -948,7 +947,9 @@ class GML3 extends GMLBase { const multiCurve = context['multiCurve']; let nodeName; if (!Array.isArray(value)) { - nodeName = /** @type {import("../geom/Geometry.js").default} */ (value).getType(); + nodeName = /** @type {import("../geom/Geometry.js").default} */ ( + value + ).getType(); if (nodeName === 'MultiPolygon' && multiSurface === true) { nodeName = 'MultiSurface'; } else if (nodeName === 'Polygon' && surface === true) { diff --git a/src/ol/format/GML32.js b/src/ol/format/GML32.js index 5e6dec6a89..193d9b2378 100644 --- a/src/ol/format/GML32.js +++ b/src/ol/format/GML32.js @@ -17,9 +17,9 @@ class GML32 extends GML3 { * @param {import("./GMLBase.js").Options} [opt_options] Optional configuration object. */ constructor(opt_options) { - const options = /** @type {import("./GMLBase.js").Options} */ (opt_options - ? opt_options - : {}); + const options = /** @type {import("./GMLBase.js").Options} */ ( + opt_options ? opt_options : {} + ); super(options); diff --git a/src/ol/format/GMLBase.js b/src/ol/format/GMLBase.js index afbffa04f5..d67249db04 100644 --- a/src/ol/format/GMLBase.js +++ b/src/ol/format/GMLBase.js @@ -238,9 +238,8 @@ class GMLBase extends XMLFeature { readGeometryElement(node, objectStack) { const context = /** @type {Object} */ (objectStack[0]); context['srsName'] = node.firstElementChild.getAttribute('srsName'); - context['srsDimension'] = node.firstElementChild.getAttribute( - 'srsDimension' - ); + context['srsDimension'] = + node.firstElementChild.getAttribute('srsDimension'); const geometry = pushParseAndPop( null, this.GEOMETRY_PARSERS, diff --git a/src/ol/format/GPX.js b/src/ol/format/GPX.js index 9ac50dc18b..f5d06a8f58 100644 --- a/src/ol/format/GPX.js +++ b/src/ol/format/GPX.js @@ -623,15 +623,15 @@ function parseExtensions(node, objectStack) { function parseRtePt(node, objectStack) { const values = pushParseAndPop({}, RTEPT_PARSERS, node, objectStack); if (values) { - const rteValues = /** @type {!Object} */ (objectStack[ - objectStack.length - 1 - ]); - const flatCoordinates = /** @type {Array} */ (rteValues[ - 'flatCoordinates' - ]); - const layoutOptions = /** @type {LayoutOptions} */ (rteValues[ - 'layoutOptions' - ]); + const rteValues = /** @type {!Object} */ ( + objectStack[objectStack.length - 1] + ); + const flatCoordinates = /** @type {Array} */ ( + rteValues['flatCoordinates'] + ); + const layoutOptions = /** @type {LayoutOptions} */ ( + rteValues['layoutOptions'] + ); appendCoordinate(flatCoordinates, layoutOptions, node, values); } } @@ -643,15 +643,15 @@ function parseRtePt(node, objectStack) { function parseTrkPt(node, objectStack) { const values = pushParseAndPop({}, TRKPT_PARSERS, node, objectStack); if (values) { - const trkValues = /** @type {!Object} */ (objectStack[ - objectStack.length - 1 - ]); - const flatCoordinates = /** @type {Array} */ (trkValues[ - 'flatCoordinates' - ]); - const layoutOptions = /** @type {LayoutOptions} */ (trkValues[ - 'layoutOptions' - ]); + const trkValues = /** @type {!Object} */ ( + objectStack[objectStack.length - 1] + ); + const flatCoordinates = /** @type {Array} */ ( + trkValues['flatCoordinates'] + ); + const layoutOptions = /** @type {LayoutOptions} */ ( + trkValues['layoutOptions'] + ); appendCoordinate(flatCoordinates, layoutOptions, node, values); } } @@ -676,7 +676,9 @@ function parseTrkSeg(node, objectStack) { * @return {Feature|undefined} Track. */ function readRte(node, objectStack) { - const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]); + const options = /** @type {import("./Feature.js").ReadOptions} */ ( + objectStack[0] + ); const values = pushParseAndPop( { 'flatCoordinates': [], @@ -709,7 +711,9 @@ function readRte(node, objectStack) { * @return {Feature|undefined} Track. */ function readTrk(node, objectStack) { - const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]); + const options = /** @type {import("./Feature.js").ReadOptions} */ ( + objectStack[0] + ); const values = pushParseAndPop( { 'flatCoordinates': [], @@ -745,7 +749,9 @@ function readTrk(node, objectStack) { * @return {Feature|undefined} Waypoint. */ function readWpt(node, objectStack) { - const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]); + const options = /** @type {import("./Feature.js").ReadOptions} */ ( + objectStack[0] + ); const values = pushParseAndPop({}, WPT_PARSERS, node, objectStack); if (!values) { return undefined; @@ -835,17 +841,17 @@ function writeWptType(node, coordinate, objectStack) { * @param {Array<*>} objectStack Object stack. */ function writeRte(node, feature, objectStack) { - const options = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[0]); + const options = /** @type {import("./Feature.js").WriteOptions} */ ( + objectStack[0] + ); const properties = feature.getProperties(); const context = {node: node}; context['properties'] = properties; const geometry = feature.getGeometry(); if (geometry.getType() == GeometryType.LINE_STRING) { - const lineString = /** @type {LineString} */ (transformGeometryWithOptions( - geometry, - true, - options - )); + const lineString = /** @type {LineString} */ ( + transformGeometryWithOptions(geometry, true, options) + ); context['geometryLayout'] = lineString.getLayout(); properties['rtept'] = lineString.getCoordinates(); } @@ -868,18 +874,18 @@ function writeRte(node, feature, objectStack) { * @param {Array<*>} objectStack Object stack. */ function writeTrk(node, feature, objectStack) { - const options = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[0]); + const options = /** @type {import("./Feature.js").WriteOptions} */ ( + objectStack[0] + ); const properties = feature.getProperties(); /** @type {import("../xml.js").NodeStackItem} */ const context = {node: node}; context['properties'] = properties; const geometry = feature.getGeometry(); if (geometry.getType() == GeometryType.MULTI_LINE_STRING) { - const multiLineString = /** @type {MultiLineString} */ (transformGeometryWithOptions( - geometry, - true, - options - )); + const multiLineString = /** @type {MultiLineString} */ ( + transformGeometryWithOptions(geometry, true, options) + ); properties['trkseg'] = multiLineString.getLineStrings(); } const parentNode = objectStack[objectStack.length - 1].node; @@ -920,16 +926,16 @@ function writeTrkSeg(node, lineString, objectStack) { * @param {Array<*>} objectStack Object stack. */ function writeWpt(node, feature, objectStack) { - const options = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[0]); + const options = /** @type {import("./Feature.js").WriteOptions} */ ( + objectStack[0] + ); const context = objectStack[objectStack.length - 1]; context['properties'] = feature.getProperties(); const geometry = feature.getGeometry(); if (geometry.getType() == GeometryType.POINT) { - const point = /** @type {Point} */ (transformGeometryWithOptions( - geometry, - true, - options - )); + const point = /** @type {Point} */ ( + transformGeometryWithOptions(geometry, true, options) + ); context['geometryLayout'] = point.getLayout(); writeWptType(node, point.getCoordinates(), objectStack); } diff --git a/src/ol/format/GeoJSON.js b/src/ol/format/GeoJSON.js index 3ef5d15beb..4de6ee2885 100644 --- a/src/ol/format/GeoJSON.js +++ b/src/ol/format/GeoJSON.js @@ -138,7 +138,9 @@ class GeoJSON extends JSONFeature { /** @type {Array} */ let features = null; if (geoJSONObject['type'] === 'FeatureCollection') { - const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (object); + const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ ( + object + ); features = []; const geoJSONFeatures = geoJSONFeatureCollection['features']; for (let i = 0, ii = geoJSONFeatures.length; i < ii; ++i) { diff --git a/src/ol/format/IGC.js b/src/ol/format/IGC.js index d519fb5cd4..2c00be8359 100644 --- a/src/ol/format/IGC.js +++ b/src/ol/format/IGC.js @@ -22,7 +22,8 @@ const IGCZ = { * @const * @type {RegExp} */ -const B_RECORD_RE = /^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/; +const B_RECORD_RE = + /^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/; /** * @const diff --git a/src/ol/format/IIIFInfo.js b/src/ol/format/IIIFInfo.js index 37b7e7baa8..c71a148b44 100644 --- a/src/ol/format/IIIFInfo.js +++ b/src/ol/format/IIIFInfo.js @@ -146,9 +146,12 @@ IIIF_PROFILE_VALUES['none'] = { }, }; -const COMPLIANCE_VERSION1 = /^https?:\/\/library\.stanford\.edu\/iiif\/image-api\/(?:1\.1\/)?compliance\.html#level[0-2]$/; -const COMPLIANCE_VERSION2 = /^https?:\/\/iiif\.io\/api\/image\/2\/level[0-2](?:\.json)?$/; -const COMPLIANCE_VERSION3 = /(^https?:\/\/iiif\.io\/api\/image\/3\/level[0-2](?:\.json)?$)|(^level[0-2]$)/; +const COMPLIANCE_VERSION1 = + /^https?:\/\/library\.stanford\.edu\/iiif\/image-api\/(?:1\.1\/)?compliance\.html#level[0-2]$/; +const COMPLIANCE_VERSION2 = + /^https?:\/\/iiif\.io\/api\/image\/2\/level[0-2](?:\.json)?$/; +const COMPLIANCE_VERSION3 = + /(^https?:\/\/iiif\.io\/api\/image\/3\/level[0-2](?:\.json)?$)|(^level[0-2]$)/; function generateVersion1Options(iiifInfo) { let levelProfile = iiifInfo.getComplianceLevelSupportedFeatures(); diff --git a/src/ol/format/KML.js b/src/ol/format/KML.js index 6f5a893b65..548c0d679d 100644 --- a/src/ol/format/KML.js +++ b/src/ol/format/KML.js @@ -538,7 +538,9 @@ class KML extends XMLFeature { if (id !== null) { feature.setId(id); } - const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]); + const options = /** @type {import("./Feature.js").ReadOptions} */ ( + objectStack[0] + ); const geometry = object['geometry']; if (geometry) { @@ -1112,7 +1114,8 @@ export function readFlatCoordinates(node) { // The KML specification states that coordinate tuples should not include // spaces, but we tolerate them. s = s.replace(/\s*,\s*/g, ','); - const re = /^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i; + const re = + /^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i; let m; while ((m = re.exec(s))) { const x = parseFloat(m[1]); @@ -1253,9 +1256,9 @@ function iconStyleParser(node, objectStack) { if (!object) { return; } - const styleObject = /** @type {Object} */ (objectStack[ - objectStack.length - 1 - ]); + const styleObject = /** @type {Object} */ ( + objectStack[objectStack.length - 1] + ); const IconObject = 'Icon' in object ? object['Icon'] : {}; const drawIcon = !('Icon' in object) || Object.keys(IconObject).length > 0; let src; @@ -1468,7 +1471,8 @@ function gxCoordParser(node, objectStack) { (objectStack[objectStack.length - 1]); const coordinates = gxTrackObject.coordinates; const s = getAllTextContent(node, false); - const re = /^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i; + const re = + /^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i; const m = re.exec(s); if (m) { const x = parseFloat(m[1]); @@ -1840,9 +1844,9 @@ function readStyle(node, objectStack) { } let fillStyle = /** @type {Fill} */ - ('fillStyle' in styleObject - ? styleObject['fillStyle'] - : DEFAULT_FILL_STYLE); + ( + 'fillStyle' in styleObject ? styleObject['fillStyle'] : DEFAULT_FILL_STYLE + ); const fill = /** @type {boolean|undefined} */ (styleObject['fill']); if (fill !== undefined && !fill) { fillStyle = null; @@ -1857,14 +1861,16 @@ function readStyle(node, objectStack) { } const textStyle = /** @type {Text} */ - ('textStyle' in styleObject - ? styleObject['textStyle'] - : DEFAULT_TEXT_STYLE); + ( + 'textStyle' in styleObject ? styleObject['textStyle'] : DEFAULT_TEXT_STYLE + ); const strokeStyle = /** @type {Stroke} */ - ('strokeStyle' in styleObject - ? styleObject['strokeStyle'] - : DEFAULT_STROKE_STYLE); + ( + 'strokeStyle' in styleObject + ? styleObject['strokeStyle'] + : DEFAULT_STROKE_STYLE + ); const outline = /** @type {boolean|undefined} */ (styleObject['outline']); if (outline !== undefined && !outline) { // if the polystyle specifies no outline two styles are needed, @@ -1992,9 +1998,9 @@ const DATA_PARSERS = makeStructureNS(NAMESPACE_URIS, { function dataParser(node, objectStack) { const name = node.getAttribute('name'); parseNode(DATA_PARSERS, node, objectStack); - const featureObject = /** @type {Object} */ (objectStack[ - objectStack.length - 1 - ]); + const featureObject = /** @type {Object} */ ( + objectStack[objectStack.length - 1] + ); if (name && featureObject.displayName) { featureObject[name] = { value: featureObject.value, @@ -2115,9 +2121,9 @@ function simpleDataParser(node, objectStack) { const name = node.getAttribute('name'); if (name !== null) { const data = readString(node); - const featureObject = /** @type {Object} */ (objectStack[ - objectStack.length - 1 - ]); + const featureObject = /** @type {Object} */ ( + objectStack[objectStack.length - 1] + ); featureObject[name] = data; } } @@ -2151,9 +2157,9 @@ function latLonAltBoxParser(node, objectStack) { if (!object) { return; } - const regionObject = /** @type {Object} */ (objectStack[ - objectStack.length - 1 - ]); + const regionObject = /** @type {Object} */ ( + objectStack[objectStack.length - 1] + ); const extent = [ parseFloat(object['west']), parseFloat(object['south']), @@ -3078,7 +3084,9 @@ function writePlacemark(node, feature, objectStack) { } // serialize geometry - const options = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[0]); + const options = /** @type {import("./Feature.js").WriteOptions} */ ( + objectStack[0] + ); let geometry = feature.getGeometry(); if (geometry) { geometry = transformGeometryWithOptions(geometry, true, options); diff --git a/src/ol/format/MVT.js b/src/ol/format/MVT.js index 456f652608..5fa9305c36 100644 --- a/src/ol/format/MVT.js +++ b/src/ol/format/MVT.js @@ -234,8 +234,9 @@ class MVT extends FeatureFormat { ? new MultiLineString(flatCoordinates, GeometryLayout.XY, ends) : null; } - const ctor = /** @type {typeof import("../Feature.js").default} */ (this - .featureClass_); + const ctor = /** @type {typeof import("../Feature.js").default} */ ( + this.featureClass_ + ); feature = new ctor(); if (this.geometryName_) { feature.setGeometryName(this.geometryName_); @@ -266,9 +267,9 @@ class MVT extends FeatureFormat { */ readFeatures(source, opt_options) { const layers = this.layers_; - const options = /** @type {import("./Feature.js").ReadOptions} */ (this.adaptOptions( - opt_options - )); + const options = /** @type {import("./Feature.js").ReadOptions} */ ( + this.adaptOptions(opt_options) + ); const dataProjection = get(options.dataProjection); dataProjection.setWorldExtent(options.extent); options.dataProjection = dataProjection; diff --git a/src/ol/format/OSMXML.js b/src/ol/format/OSMXML.js index 8dc5a2c815..50bba52f56 100644 --- a/src/ol/format/OSMXML.js +++ b/src/ol/format/OSMXML.js @@ -122,7 +122,9 @@ const NODE_PARSERS = makeStructureNS(NAMESPACE_URIS, { * @param {Array<*>} objectStack Object stack. */ function readNode(node, objectStack) { - const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]); + const options = /** @type {import("./Feature.js").ReadOptions} */ ( + objectStack[0] + ); const state = /** @type {Object} */ (objectStack[objectStack.length - 1]); const id = node.getAttribute('id'); /** @type {import("../coordinate.js").Coordinate} */ diff --git a/src/ol/format/Polyline.js b/src/ol/format/Polyline.js index 047aad1285..f0c9ae1820 100644 --- a/src/ol/format/Polyline.js +++ b/src/ol/format/Polyline.js @@ -144,11 +144,13 @@ class Polyline extends TextFeature { writeGeometryText(geometry, opt_options) { geometry = /** @type {LineString} */ - (transformGeometryWithOptions( - geometry, - true, - this.adaptOptions(opt_options) - )); + ( + transformGeometryWithOptions( + geometry, + true, + this.adaptOptions(opt_options) + ) + ); const flatCoordinates = geometry.getFlatCoordinates(); const stride = geometry.getStride(); flipXY(flatCoordinates, 0, flatCoordinates.length, stride, flatCoordinates); diff --git a/src/ol/format/TopoJSON.js b/src/ol/format/TopoJSON.js index ede0944c52..f6e1e0c5a5 100644 --- a/src/ol/format/TopoJSON.js +++ b/src/ol/format/TopoJSON.js @@ -114,9 +114,9 @@ class TopoJSON extends JSONFeature { continue; } if (topoJSONFeatures[objectName].type === 'GeometryCollection') { - feature = /** @type {TopoJSONGeometryCollection} */ (topoJSONFeatures[ - objectName - ]); + feature = /** @type {TopoJSONGeometryCollection} */ ( + topoJSONFeatures[objectName] + ); features.push.apply( features, readFeaturesFromGeometryCollection( @@ -130,9 +130,9 @@ class TopoJSON extends JSONFeature { ) ); } else { - feature = /** @type {TopoJSONGeometry} */ (topoJSONFeatures[ - objectName - ]); + feature = /** @type {TopoJSONGeometry} */ ( + topoJSONFeatures[objectName] + ); features.push( readFeatureFromGeometry( feature, diff --git a/src/ol/format/WFS.js b/src/ol/format/WFS.js index 12f76c44df..b0d3554d68 100644 --- a/src/ol/format/WFS.js +++ b/src/ol/format/WFS.js @@ -1034,10 +1034,9 @@ function writeQuery(node, featureType, objectStack) { if (featureNS) { node.setAttributeNS(XMLNS, 'xmlns:' + featurePrefix, featureNS); } - const item = /** @type {import("../xml.js").NodeStackItem} */ (assign( - {}, - context - )); + const item = /** @type {import("../xml.js").NodeStackItem} */ ( + assign({}, context) + ); item.node = node; pushSerializeAndPop( item, @@ -1348,10 +1347,9 @@ export function writeFilter(filter, opt_version) { */ function writeGetFeature(node, featureTypes, objectStack) { const context = /** @type {Object} */ (objectStack[objectStack.length - 1]); - const item = /** @type {import("../xml.js").NodeStackItem} */ (assign( - {}, - context - )); + const item = /** @type {import("../xml.js").NodeStackItem} */ ( + assign({}, context) + ); item.node = node; pushSerializeAndPop( item, diff --git a/src/ol/format/WKB.js b/src/ol/format/WKB.js index 831fd3c800..fa537ffbe3 100644 --- a/src/ol/format/WKB.js +++ b/src/ol/format/WKB.js @@ -315,7 +315,9 @@ class WkbReader { case WKBGeometryType.POLYGON: case WKBGeometryType.TRIANGLE: return new Polygon( - /** @type {Array>} */ (result), + /** @type {Array>} */ ( + result + ), this.layout_ ); @@ -327,7 +329,9 @@ class WkbReader { case WKBGeometryType.MULTI_LINE_STRING: return new MultiLineString( - /** @type {Array>} */ (result), + /** @type {Array>} */ ( + result + ), this.layout_ ); @@ -335,7 +339,9 @@ class WkbReader { case WKBGeometryType.POLYHEDRAL_SURFACE: case WKBGeometryType.TIN: return new MultiPolygon( - /** @type {Array>>} */ (result), + /** @type {Array>>} */ ( + result + ), this.layout_ ); diff --git a/src/ol/format/WKT.js b/src/ol/format/WKT.js index 3fc5add4eb..0475eada42 100644 --- a/src/ol/format/WKT.js +++ b/src/ol/format/WKT.js @@ -652,7 +652,9 @@ class WKT extends TextFeature { this.splitCollection_ && geometry.getType() == GeometryType.GEOMETRY_COLLECTION ) { - geometries = /** @type {GeometryCollection} */ (geometry).getGeometriesArray(); + geometries = /** @type {GeometryCollection} */ ( + geometry + ).getGeometriesArray(); } else { geometries = [geometry]; } diff --git a/src/ol/format/WMSCapabilities.js b/src/ol/format/WMSCapabilities.js index 38594ec232..4396617bc7 100644 --- a/src/ol/format/WMSCapabilities.js +++ b/src/ol/format/WMSCapabilities.js @@ -422,9 +422,9 @@ function readCapabilityLayer(node, objectStack) { * @return {Object|undefined} Layer object. */ function readLayer(node, objectStack) { - const parentLayerObject = /** @type {!Object} */ (objectStack[ - objectStack.length - 1 - ]); + const parentLayerObject = /** @type {!Object} */ ( + objectStack[objectStack.length - 1] + ); const layerObject = pushParseAndPop({}, LAYER_PARSERS, node, objectStack); diff --git a/src/ol/geom/GeometryCollection.js b/src/ol/geom/GeometryCollection.js index c41cc79045..acc3a9299a 100644 --- a/src/ol/geom/GeometryCollection.js +++ b/src/ol/geom/GeometryCollection.js @@ -151,9 +151,9 @@ class GeometryCollection extends Geometry { for (let i = 0, ii = geometries.length; i < ii; ++i) { if (geometries[i].getType() === this.getType()) { geometriesArray = geometriesArray.concat( - /** @type {GeometryCollection} */ (geometries[ - i - ]).getGeometriesArrayRecursive() + /** @type {GeometryCollection} */ ( + geometries[i] + ).getGeometriesArrayRecursive() ); } else { geometriesArray.push(geometries[i]); @@ -185,9 +185,8 @@ class GeometryCollection extends Geometry { let simplified = false; for (let i = 0, ii = geometries.length; i < ii; ++i) { const geometry = geometries[i]; - const simplifiedGeometry = geometry.getSimplifiedGeometry( - squaredTolerance - ); + const simplifiedGeometry = + geometry.getSimplifiedGeometry(squaredTolerance); simplifiedGeometries.push(simplifiedGeometry); if (simplifiedGeometry !== geometry) { simplified = true; diff --git a/src/ol/geom/LineString.js b/src/ol/geom/LineString.js index 8f340fc27f..1cedd06d0a 100644 --- a/src/ol/geom/LineString.js +++ b/src/ol/geom/LineString.js @@ -61,7 +61,9 @@ class LineString extends SimpleGeometry { ); } else { this.setCoordinates( - /** @type {Array} */ (coordinates), + /** @type {Array} */ ( + coordinates + ), opt_layout ); } diff --git a/src/ol/geom/LinearRing.js b/src/ol/geom/LinearRing.js index f7618e619f..f5fc061705 100644 --- a/src/ol/geom/LinearRing.js +++ b/src/ol/geom/LinearRing.js @@ -46,7 +46,9 @@ class LinearRing extends SimpleGeometry { ); } else { this.setCoordinates( - /** @type {Array} */ (coordinates), + /** @type {Array} */ ( + coordinates + ), opt_layout ); } diff --git a/src/ol/geom/MultiLineString.js b/src/ol/geom/MultiLineString.js index d4f712c2be..25d547ebee 100644 --- a/src/ol/geom/MultiLineString.js +++ b/src/ol/geom/MultiLineString.js @@ -54,7 +54,9 @@ class MultiLineString extends SimpleGeometry { if (Array.isArray(coordinates[0])) { this.setCoordinates( - /** @type {Array>} */ (coordinates), + /** @type {Array>} */ ( + coordinates + ), opt_layout ); } else if (opt_layout !== undefined && opt_ends) { diff --git a/src/ol/geom/MultiPoint.js b/src/ol/geom/MultiPoint.js index 4036c7993d..330ce5285f 100644 --- a/src/ol/geom/MultiPoint.js +++ b/src/ol/geom/MultiPoint.js @@ -31,7 +31,9 @@ class MultiPoint extends SimpleGeometry { ); } else { this.setCoordinates( - /** @type {Array} */ (coordinates), + /** @type {Array} */ ( + coordinates + ), opt_layout ); } diff --git a/src/ol/geom/MultiPolygon.js b/src/ol/geom/MultiPolygon.js index 2c15391d78..5fa6a0a019 100644 --- a/src/ol/geom/MultiPolygon.js +++ b/src/ol/geom/MultiPolygon.js @@ -113,7 +113,9 @@ class MultiPolygon extends SimpleGeometry { this.endss_ = opt_endss; } else { this.setCoordinates( - /** @type {Array>>} */ (coordinates), + /** @type {Array>>} */ ( + coordinates + ), opt_layout ); } diff --git a/src/ol/geom/Polygon.js b/src/ol/geom/Polygon.js index cc4785e13e..af17e62eb3 100644 --- a/src/ol/geom/Polygon.js +++ b/src/ol/geom/Polygon.js @@ -91,7 +91,9 @@ class Polygon extends SimpleGeometry { this.ends_ = opt_ends; } else { this.setCoordinates( - /** @type {Array>} */ (coordinates), + /** @type {Array>} */ ( + coordinates + ), opt_layout ); } diff --git a/src/ol/geom/SimpleGeometry.js b/src/ol/geom/SimpleGeometry.js index 87e1c67e2d..fa100c3d01 100644 --- a/src/ol/geom/SimpleGeometry.js +++ b/src/ol/geom/SimpleGeometry.js @@ -117,9 +117,8 @@ class SimpleGeometry extends Geometry { return this; } - const simplifiedGeometry = this.getSimplifiedGeometryInternal( - squaredTolerance - ); + const simplifiedGeometry = + this.getSimplifiedGeometryInternal(squaredTolerance); const simplifiedFlatCoordinates = simplifiedGeometry.getFlatCoordinates(); if (simplifiedFlatCoordinates.length < this.flatCoordinates.length) { return simplifiedGeometry; diff --git a/src/ol/interaction/DoubleClickZoom.js b/src/ol/interaction/DoubleClickZoom.js index bea4c52e3f..bd9d2a0f59 100644 --- a/src/ol/interaction/DoubleClickZoom.js +++ b/src/ol/interaction/DoubleClickZoom.js @@ -46,7 +46,9 @@ class DoubleClickZoom extends Interaction { handleEvent(mapBrowserEvent) { let stopEvent = false; if (mapBrowserEvent.type == MapBrowserEventType.DBLCLICK) { - const browserEvent = /** @type {MouseEvent} */ (mapBrowserEvent.originalEvent); + const browserEvent = /** @type {MouseEvent} */ ( + mapBrowserEvent.originalEvent + ); const map = mapBrowserEvent.map; const anchor = mapBrowserEvent.coordinate; const delta = browserEvent.shiftKey ? -this.delta_ : this.delta_; diff --git a/src/ol/interaction/Draw.js b/src/ol/interaction/Draw.js index bf11c3f9ea..664911be03 100644 --- a/src/ol/interaction/Draw.js +++ b/src/ol/interaction/Draw.js @@ -185,7 +185,9 @@ class Draw extends PointerInteraction { * @param {Options} options Options. */ constructor(options) { - const pointerOptions = /** @type {import("./Pointer.js").Options} */ (options); + const pointerOptions = /** @type {import("./Pointer.js").Options} */ ( + options + ); if (!pointerOptions.stopDown) { pointerOptions.stopDown = FALSE; } @@ -255,7 +257,9 @@ class Draw extends PointerInteraction { * @type {import("../geom/GeometryType.js").default} * @private */ - this.type_ = /** @type {import("../geom/GeometryType.js").default} */ (options.type); + this.type_ = /** @type {import("../geom/GeometryType.js").default} */ ( + options.type + ); /** * Drawing mode (derived from geometry type. diff --git a/src/ol/interaction/KeyboardPan.js b/src/ol/interaction/KeyboardPan.js index 6ed2168cbe..640fb59808 100644 --- a/src/ol/interaction/KeyboardPan.js +++ b/src/ol/interaction/KeyboardPan.js @@ -86,7 +86,9 @@ class KeyboardPan extends Interaction { handleEvent(mapBrowserEvent) { let stopEvent = false; if (mapBrowserEvent.type == EventType.KEYDOWN) { - const keyEvent = /** @type {KeyboardEvent} */ (mapBrowserEvent.originalEvent); + const keyEvent = /** @type {KeyboardEvent} */ ( + mapBrowserEvent.originalEvent + ); const keyCode = keyEvent.keyCode; if ( this.condition_(mapBrowserEvent) && diff --git a/src/ol/interaction/KeyboardZoom.js b/src/ol/interaction/KeyboardZoom.js index f31cd51f87..a88810f9fe 100644 --- a/src/ol/interaction/KeyboardZoom.js +++ b/src/ol/interaction/KeyboardZoom.js @@ -70,7 +70,9 @@ class KeyboardZoom extends Interaction { mapBrowserEvent.type == EventType.KEYDOWN || mapBrowserEvent.type == EventType.KEYPRESS ) { - const keyEvent = /** @type {KeyboardEvent} */ (mapBrowserEvent.originalEvent); + const keyEvent = /** @type {KeyboardEvent} */ ( + mapBrowserEvent.originalEvent + ); const charCode = keyEvent.charCode; if ( this.condition_(mapBrowserEvent) && diff --git a/src/ol/interaction/Modify.js b/src/ol/interaction/Modify.js index 3884024d7c..bbfbb4f961 100644 --- a/src/ol/interaction/Modify.js +++ b/src/ol/interaction/Modify.js @@ -757,7 +757,9 @@ class Modify extends PointerInteraction { centerSegmentData.featureSegments = featureSegments; circumferenceSegmentData.featureSegments = featureSegments; this.rBush_.insert(createExtent(coordinates), centerSegmentData); - let circleGeometry = /** @type {import("../geom/Geometry.js").default} */ (geometry); + let circleGeometry = /** @type {import("../geom/Geometry.js").default} */ ( + geometry + ); const userProjection = getUserProjection(); if (userProjection && this.getMap()) { const projection = this.getMap().getView().getProjection(); @@ -1526,14 +1528,16 @@ function projectedDistanceToSegmentDataSquared( const geometry = segmentData.geometry; if (geometry.getType() === GeometryType.CIRCLE) { - let circleGeometry = /** @type {import("../geom/Circle.js").default} */ (geometry); + let circleGeometry = /** @type {import("../geom/Circle.js").default} */ ( + geometry + ); if (segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) { const userProjection = getUserProjection(); if (userProjection) { - circleGeometry = /** @type {import("../geom/Circle.js").default} */ (circleGeometry - .clone() - .transform(userProjection, projection)); + circleGeometry = /** @type {import("../geom/Circle.js").default} */ ( + circleGeometry.clone().transform(userProjection, projection) + ); } const distanceToCenterSquared = squaredCoordinateDistance( circleGeometry.getCenter(), @@ -1568,12 +1572,14 @@ function closestOnSegmentData(pointCoordinates, segmentData, projection) { geometry.getType() === GeometryType.CIRCLE && segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX ) { - let circleGeometry = /** @type {import("../geom/Circle.js").default} */ (geometry); + let circleGeometry = /** @type {import("../geom/Circle.js").default} */ ( + geometry + ); const userProjection = getUserProjection(); if (userProjection) { - circleGeometry = /** @type {import("../geom/Circle.js").default} */ (circleGeometry - .clone() - .transform(userProjection, projection)); + circleGeometry = /** @type {import("../geom/Circle.js").default} */ ( + circleGeometry.clone().transform(userProjection, projection) + ); } return toUserCoordinate( circleGeometry.getClosestPoint( diff --git a/src/ol/interaction/MouseWheelZoom.js b/src/ol/interaction/MouseWheelZoom.js index 2b6bbb3cd5..0348918860 100644 --- a/src/ol/interaction/MouseWheelZoom.js +++ b/src/ol/interaction/MouseWheelZoom.js @@ -179,7 +179,9 @@ class MouseWheelZoom extends Interaction { } const map = mapBrowserEvent.map; - const wheelEvent = /** @type {WheelEvent} */ (mapBrowserEvent.originalEvent); + const wheelEvent = /** @type {WheelEvent} */ ( + mapBrowserEvent.originalEvent + ); wheelEvent.preventDefault(); if (this.useAnchor_) { diff --git a/src/ol/interaction/PinchRotate.js b/src/ol/interaction/PinchRotate.js index f971f82bd4..e6ab04c9a0 100644 --- a/src/ol/interaction/PinchRotate.js +++ b/src/ol/interaction/PinchRotate.js @@ -27,7 +27,9 @@ class PinchRotate extends PointerInteraction { constructor(opt_options) { const options = opt_options ? opt_options : {}; - const pointerOptions = /** @type {import("./Pointer.js").Options} */ (options); + const pointerOptions = /** @type {import("./Pointer.js").Options} */ ( + options + ); if (!pointerOptions.stopDown) { pointerOptions.stopDown = FALSE; diff --git a/src/ol/interaction/PinchZoom.js b/src/ol/interaction/PinchZoom.js index 4e29acc821..24adab9e3d 100644 --- a/src/ol/interaction/PinchZoom.js +++ b/src/ol/interaction/PinchZoom.js @@ -24,7 +24,9 @@ class PinchZoom extends PointerInteraction { constructor(opt_options) { const options = opt_options ? opt_options : {}; - const pointerOptions = /** @type {import("./Pointer.js").Options} */ (options); + const pointerOptions = /** @type {import("./Pointer.js").Options} */ ( + options + ); if (!pointerOptions.stopDown) { pointerOptions.stopDown = FALSE; diff --git a/src/ol/interaction/Select.js b/src/ol/interaction/Select.js index cf1252d9b9..4152e1b347 100644 --- a/src/ol/interaction/Select.js +++ b/src/ol/interaction/Select.js @@ -295,8 +295,9 @@ class Select extends Interaction { * @api */ getLayer(feature) { - return /** @type {import('../layer/Vector.js').default} */ (this - .featureLayerAssociation_[getUid(feature)]); + return /** @type {import('../layer/Vector.js').default} */ ( + this.featureLayerAssociation_[getUid(feature)] + ); } /** diff --git a/src/ol/interaction/Snap.js b/src/ol/interaction/Snap.js index f3b29ce299..91d4da84b9 100644 --- a/src/ol/interaction/Snap.js +++ b/src/ol/interaction/Snap.js @@ -100,7 +100,9 @@ class Snap extends PointerInteraction { constructor(opt_options) { const options = opt_options ? opt_options : {}; - const pointerOptions = /** @type {import("./Pointer.js").Options} */ (options); + const pointerOptions = /** @type {import("./Pointer.js").Options} */ ( + options + ); if (!pointerOptions.handleDownEvent) { pointerOptions.handleDownEvent = TRUE; @@ -358,7 +360,9 @@ class Snap extends PointerInteraction { setMap(map) { const currentMap = this.getMap(); const keys = this.featuresListenerKeys_; - const features = /** @type {Array} */ (this.getFeatures_()); + const features = /** @type {Array} */ ( + this.getFeatures_() + ); if (currentMap) { keys.forEach(unlistenByKey); @@ -548,9 +552,9 @@ class Snap extends PointerInteraction { let circleGeometry = geometry; const userProjection = getUserProjection(); if (userProjection) { - circleGeometry = /** @type {import("../geom/Circle.js").default} */ (circleGeometry - .clone() - .transform(userProjection, projection)); + circleGeometry = /** @type {import("../geom/Circle.js").default} */ ( + circleGeometry.clone().transform(userProjection, projection) + ); } const polygon = fromCircle(circleGeometry); if (userProjection) { diff --git a/src/ol/layer/Base.js b/src/ol/layer/Base.js index 9363040a88..26cf842e98 100644 --- a/src/ol/layer/Base.js +++ b/src/ol/layer/Base.js @@ -156,9 +156,9 @@ class BaseLayer extends BaseObject { * @api */ getExtent() { - return /** @type {import("../extent.js").Extent|undefined} */ (this.get( - LayerProperty.EXTENT - )); + return /** @type {import("../extent.js").Extent|undefined} */ ( + this.get(LayerProperty.EXTENT) + ); } /** diff --git a/src/ol/layer/BaseTile.js b/src/ol/layer/BaseTile.js index d86cb43892..ba4344c912 100644 --- a/src/ol/layer/BaseTile.js +++ b/src/ol/layer/BaseTile.js @@ -96,9 +96,9 @@ class BaseTileLayer extends Layer { * @api */ getUseInterimTilesOnError() { - return /** @type {boolean} */ (this.get( - TileProperty.USE_INTERIM_TILES_ON_ERROR - )); + return /** @type {boolean} */ ( + this.get(TileProperty.USE_INTERIM_TILES_ON_ERROR) + ); } /** diff --git a/src/ol/layer/BaseVector.js b/src/ol/layer/BaseVector.js index ffdd5877f3..daa60af223 100644 --- a/src/ol/layer/BaseVector.js +++ b/src/ol/layer/BaseVector.js @@ -178,9 +178,9 @@ class BaseVectorLayer extends Layer { * order. */ getRenderOrder() { - return /** @type {import("../render.js").OrderFunction|null|undefined} */ (this.get( - Property.RENDER_ORDER - )); + return /** @type {import("../render.js").OrderFunction|null|undefined} */ ( + this.get(Property.RENDER_ORDER) + ); } /** diff --git a/src/ol/layer/Graticule.js b/src/ol/layer/Graticule.js index aadbe4ccfa..de624ba133 100644 --- a/src/ol/layer/Graticule.js +++ b/src/ol/layer/Graticule.js @@ -52,22 +52,7 @@ const DEFAULT_STROKE_STYLE = new Stroke({ * @private */ const INTERVALS = [ - 90, - 45, - 30, - 20, - 10, - 5, - 2, - 1, - 0.5, - 0.2, - 0.1, - 0.05, - 0.01, - 0.005, - 0.002, - 0.001, + 90, 45, 30, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, 0.01, 0.005, 0.002, 0.001, ]; /** diff --git a/src/ol/layer/Group.js b/src/ol/layer/Group.js index 90cad451f5..c89611ad22 100644 --- a/src/ol/layer/Group.js +++ b/src/ol/layer/Group.js @@ -138,7 +138,9 @@ class LayerGroup extends BaseLayer { * @private */ handleLayersAdd_(collectionEvent) { - const layer = /** @type {import("./Base.js").default} */ (collectionEvent.element); + const layer = /** @type {import("./Base.js").default} */ ( + collectionEvent.element + ); this.listenerKeys_[getUid(layer)] = [ listen( layer, @@ -156,7 +158,9 @@ class LayerGroup extends BaseLayer { * @private */ handleLayersRemove_(collectionEvent) { - const layer = /** @type {import("./Base.js").default} */ (collectionEvent.element); + const layer = /** @type {import("./Base.js").default} */ ( + collectionEvent.element + ); const key = getUid(layer); this.listenerKeys_[key].forEach(unlistenByKey); delete this.listenerKeys_[key]; @@ -172,9 +176,9 @@ class LayerGroup extends BaseLayer { * @api */ getLayers() { - return /** @type {!import("../Collection.js").default} */ (this.get( - Property.LAYERS - )); + return /** @type {!import("../Collection.js").default} */ ( + this.get(Property.LAYERS) + ); } /** diff --git a/src/ol/layer/Layer.js b/src/ol/layer/Layer.js index 56ab517ee1..59188d25f4 100644 --- a/src/ol/layer/Layer.js +++ b/src/ol/layer/Layer.js @@ -264,7 +264,8 @@ class Layer extends BaseLayer { map, RenderEventType.PRECOMPOSE, function (evt) { - const renderEvent = /** @type {import("../render/Event.js").default} */ (evt); + const renderEvent = + /** @type {import("../render/Event.js").default} */ (evt); const layerStatesArray = renderEvent.frameState.layerStatesArray; const layerState = this.getLayerState(false); // A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both. diff --git a/src/ol/layer/VectorTile.js b/src/ol/layer/VectorTile.js index 42b3998808..e6642777f6 100644 --- a/src/ol/layer/VectorTile.js +++ b/src/ol/layer/VectorTile.js @@ -90,7 +90,9 @@ class VectorTileLayer extends BaseVectorLayer { delete baseOptions.useInterimTilesOnError; super( - /** @type {import("./BaseVector.js").Options} */ (baseOptions) + /** @type {import("./BaseVector.js").Options} */ ( + baseOptions + ) ); if (options.renderMode === VectorTileRenderType.IMAGE) { @@ -171,9 +173,9 @@ class VectorTileLayer extends BaseVectorLayer { * @api */ getUseInterimTilesOnError() { - return /** @type {boolean} */ (this.get( - TileProperty.USE_INTERIM_TILES_ON_ERROR - )); + return /** @type {boolean} */ ( + this.get(TileProperty.USE_INTERIM_TILES_ON_ERROR) + ); } /** diff --git a/src/ol/render/canvas.js b/src/ol/render/canvas.js index fd3d531944..6202e5f92d 100644 --- a/src/ol/render/canvas.js +++ b/src/ol/render/canvas.js @@ -443,7 +443,9 @@ export function drawImageOrLabel( context.translate(x, y); context.scale(scale[0], scale[1]); context.drawImage( - /** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */ (labelOrImage), + /** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */ ( + labelOrImage + ), originX, originY, w, @@ -456,7 +458,9 @@ export function drawImageOrLabel( } else { // if image not flipped translate and scale can be avoided context.drawImage( - /** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */ (labelOrImage), + /** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */ ( + labelOrImage + ), originX, originY, w, diff --git a/src/ol/render/canvas/Builder.js b/src/ol/render/canvas/Builder.js index 215917d532..9735410470 100644 --- a/src/ol/render/canvas/Builder.js +++ b/src/ol/render/canvas/Builder.js @@ -256,9 +256,15 @@ class CanvasBuilder extends VectorContext { let flatCoordinates, builderEnd, builderEnds, builderEndss; let offset; if (type == GeometryType.MULTI_POLYGON) { - flatCoordinates = /** @type {import("../../geom/MultiPolygon.js").default} */ (geometry).getOrientedFlatCoordinates(); + flatCoordinates = + /** @type {import("../../geom/MultiPolygon.js").default} */ ( + geometry + ).getOrientedFlatCoordinates(); builderEndss = []; - const endss = /** @type {import("../../geom/MultiPolygon.js").default} */ (geometry).getEndss(); + const endss = + /** @type {import("../../geom/MultiPolygon.js").default} */ ( + geometry + ).getEndss(); offset = 0; for (let i = 0, ii = endss.length; i < ii; ++i) { const myEnds = []; @@ -286,12 +292,16 @@ class CanvasBuilder extends VectorContext { builderEnds = []; flatCoordinates = type == GeometryType.POLYGON - ? /** @type {import("../../geom/Polygon.js").default} */ (geometry).getOrientedFlatCoordinates() + ? /** @type {import("../../geom/Polygon.js").default} */ ( + geometry + ).getOrientedFlatCoordinates() : geometry.getFlatCoordinates(); offset = this.drawCustomCoordinates_( flatCoordinates, 0, - /** @type {import("../../geom/Polygon.js").default|import("../../geom/MultiLineString.js").default} */ (geometry).getEnds(), + /** @type {import("../../geom/Polygon.js").default|import("../../geom/MultiLineString.js").default} */ ( + geometry + ).getEnds(), stride, builderEnds ); diff --git a/src/ol/render/canvas/Executor.js b/src/ol/render/canvas/Executor.js index 813a94324f..4aa9f4a5dc 100644 --- a/src/ol/render/canvas/Executor.js +++ b/src/ol/render/canvas/Executor.js @@ -538,9 +538,8 @@ class Executor { * @param {Array<*>} instruction Instruction. */ setStrokeStyle_(context, instruction) { - context[ - 'strokeStyle' - ] = /** @type {import("../../colorlike.js").ColorLike} */ (instruction[1]); + context['strokeStyle'] = + /** @type {import("../../colorlike.js").ColorLike} */ (instruction[1]); context.lineWidth = /** @type {number} */ (instruction[2]); context.lineCap = /** @type {CanvasLineCap} */ (instruction[3]); context.lineJoin = /** @type {CanvasLineJoin} */ (instruction[4]); @@ -669,10 +668,14 @@ class Executor { let x, y, currentGeometry; while (i < ii) { const instruction = instructions[i]; - const type = /** @type {import("./Instruction.js").default} */ (instruction[0]); + const type = /** @type {import("./Instruction.js").default} */ ( + instruction[0] + ); switch (type) { case CanvasInstruction.BEGIN_GEOMETRY: - feature = /** @type {import("../../Feature.js").FeatureLike} */ (instruction[1]); + feature = /** @type {import("../../Feature.js").FeatureLike} */ ( + instruction[1] + ); currentGeometry = instruction[3]; if (!feature.getGeometry()) { i = /** @type {number} */ (instruction[2]); @@ -721,7 +724,10 @@ class Executor { case CanvasInstruction.CUSTOM: d = /** @type {number} */ (instruction[1]); dd = instruction[2]; - const geometry = /** @type {import("../../geom/SimpleGeometry.js").default} */ (instruction[3]); + const geometry = + /** @type {import("../../geom/SimpleGeometry.js").default} */ ( + instruction[3] + ); const renderer = instruction[4]; const fn = instruction.length == 6 ? instruction[5] : undefined; state.geometry = geometry; @@ -743,7 +749,10 @@ class Executor { case CanvasInstruction.DRAW_IMAGE: d = /** @type {number} */ (instruction[1]); dd = /** @type {number} */ (instruction[2]); - image = /** @type {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} */ (instruction[3]); + image = + /** @type {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} */ ( + instruction[3] + ); // Remaining arguments in DRAW_IMAGE are in alphabetical order anchorX = /** @type {number} */ (instruction[4]); @@ -754,9 +763,14 @@ class Executor { const originY = /** @type {number} */ (instruction[9]); const rotateWithView = /** @type {boolean} */ (instruction[10]); let rotation = /** @type {number} */ (instruction[11]); - const scale = /** @type {import("../../size.js").Size} */ (instruction[12]); + const scale = /** @type {import("../../size.js").Size} */ ( + instruction[12] + ); let width = /** @type {number} */ (instruction[13]); - const declutterImageWithText = /** @type {import("../canvas.js").DeclutterImageWithText} */ (instruction[14]); + const declutterImageWithText = + /** @type {import("../canvas.js").DeclutterImageWithText} */ ( + instruction[14] + ); if (!image && instruction.length >= 19) { // create label images @@ -1047,7 +1061,9 @@ class Executor { break; case CanvasInstruction.END_GEOMETRY: if (opt_featureCallback !== undefined) { - feature = /** @type {import("../../Feature.js").FeatureLike} */ (instruction[1]); + feature = /** @type {import("../../Feature.js").FeatureLike} */ ( + instruction[1] + ); const result = opt_featureCallback(feature, currentGeometry); if (result) { return result; @@ -1101,7 +1117,10 @@ class Executor { } } - context.fillStyle = /** @type {import("../../colorlike.js").ColorLike} */ (instruction[1]); + context.fillStyle = + /** @type {import("../../colorlike.js").ColorLike} */ ( + instruction[1] + ); ++i; break; case CanvasInstruction.SET_STROKE_STYLE: diff --git a/src/ol/render/canvas/ExecutorGroup.js b/src/ol/render/canvas/ExecutorGroup.js index 160b3426c2..a33d7677cd 100644 --- a/src/ol/render/canvas/ExecutorGroup.js +++ b/src/ol/render/canvas/ExecutorGroup.js @@ -228,8 +228,12 @@ class ExecutorGroup { * @return {T|undefined} Callback result. */ function featureCallback(feature, geometry) { - const imageData = context.getImageData(0, 0, contextSize, contextSize) - .data; + const imageData = context.getImageData( + 0, + 0, + contextSize, + contextSize + ).data; for (let i = 0, ii = indexes.length; i < ii; i++) { if (imageData[indexes[i]] > 0) { if ( diff --git a/src/ol/render/canvas/Immediate.js b/src/ol/render/canvas/Immediate.js index 20946447b5..b83b9e56da 100644 --- a/src/ol/render/canvas/Immediate.js +++ b/src/ol/render/canvas/Immediate.js @@ -571,7 +571,9 @@ class CanvasImmediateRenderer extends VectorContext { break; case GeometryType.MULTI_LINE_STRING: this.drawMultiLineString( - /** @type {import("../../geom/MultiLineString.js").default} */ (geometry) + /** @type {import("../../geom/MultiLineString.js").default} */ ( + geometry + ) ); break; case GeometryType.MULTI_POLYGON: @@ -581,7 +583,9 @@ class CanvasImmediateRenderer extends VectorContext { break; case GeometryType.GEOMETRY_COLLECTION: this.drawGeometryCollection( - /** @type {import("../../geom/GeometryCollection.js").default} */ (geometry) + /** @type {import("../../geom/GeometryCollection.js").default} */ ( + geometry + ) ); break; case GeometryType.CIRCLE: @@ -633,10 +637,12 @@ class CanvasImmediateRenderer extends VectorContext { */ drawPoint(geometry) { if (this.squaredTolerance_) { - geometry = /** @type {import("../../geom/Point.js").default} */ (geometry.simplifyTransformed( - this.squaredTolerance_, - this.userTransform_ - )); + geometry = /** @type {import("../../geom/Point.js").default} */ ( + geometry.simplifyTransformed( + this.squaredTolerance_, + this.userTransform_ + ) + ); } const flatCoordinates = geometry.getFlatCoordinates(); const stride = geometry.getStride(); @@ -656,10 +662,12 @@ class CanvasImmediateRenderer extends VectorContext { */ drawMultiPoint(geometry) { if (this.squaredTolerance_) { - geometry = /** @type {import("../../geom/MultiPoint.js").default} */ (geometry.simplifyTransformed( - this.squaredTolerance_, - this.userTransform_ - )); + geometry = /** @type {import("../../geom/MultiPoint.js").default} */ ( + geometry.simplifyTransformed( + this.squaredTolerance_, + this.userTransform_ + ) + ); } const flatCoordinates = geometry.getFlatCoordinates(); const stride = geometry.getStride(); @@ -679,10 +687,12 @@ class CanvasImmediateRenderer extends VectorContext { */ drawLineString(geometry) { if (this.squaredTolerance_) { - geometry = /** @type {import("../../geom/LineString.js").default} */ (geometry.simplifyTransformed( - this.squaredTolerance_, - this.userTransform_ - )); + geometry = /** @type {import("../../geom/LineString.js").default} */ ( + geometry.simplifyTransformed( + this.squaredTolerance_, + this.userTransform_ + ) + ); } if (!intersects(this.extent_, geometry.getExtent())) { return; @@ -715,10 +725,13 @@ class CanvasImmediateRenderer extends VectorContext { */ drawMultiLineString(geometry) { if (this.squaredTolerance_) { - geometry = /** @type {import("../../geom/MultiLineString.js").default} */ (geometry.simplifyTransformed( - this.squaredTolerance_, - this.userTransform_ - )); + geometry = + /** @type {import("../../geom/MultiLineString.js").default} */ ( + geometry.simplifyTransformed( + this.squaredTolerance_, + this.userTransform_ + ) + ); } const geometryExtent = geometry.getExtent(); if (!intersects(this.extent_, geometryExtent)) { @@ -757,10 +770,12 @@ class CanvasImmediateRenderer extends VectorContext { */ drawPolygon(geometry) { if (this.squaredTolerance_) { - geometry = /** @type {import("../../geom/Polygon.js").default} */ (geometry.simplifyTransformed( - this.squaredTolerance_, - this.userTransform_ - )); + geometry = /** @type {import("../../geom/Polygon.js").default} */ ( + geometry.simplifyTransformed( + this.squaredTolerance_, + this.userTransform_ + ) + ); } if (!intersects(this.extent_, geometry.getExtent())) { return; @@ -800,10 +815,12 @@ class CanvasImmediateRenderer extends VectorContext { */ drawMultiPolygon(geometry) { if (this.squaredTolerance_) { - geometry = /** @type {import("../../geom/MultiPolygon.js").default} */ (geometry.simplifyTransformed( - this.squaredTolerance_, - this.userTransform_ - )); + geometry = /** @type {import("../../geom/MultiPolygon.js").default} */ ( + geometry.simplifyTransformed( + this.squaredTolerance_, + this.userTransform_ + ) + ); } if (!intersects(this.extent_, geometry.getExtent())) { return; @@ -932,7 +949,9 @@ class CanvasImmediateRenderer extends VectorContext { if (!contextTextState) { context.font = textState.font; context.textAlign = /** @type {CanvasTextAlign} */ (textAlign); - context.textBaseline = /** @type {CanvasTextBaseline} */ (textState.textBaseline); + context.textBaseline = /** @type {CanvasTextBaseline} */ ( + textState.textBaseline + ); this.contextTextState_ = { font: textState.font, textAlign: textAlign, @@ -948,8 +967,12 @@ class CanvasImmediateRenderer extends VectorContext { context.textAlign = /** @type {CanvasTextAlign} */ (textAlign); } if (contextTextState.textBaseline != textState.textBaseline) { - contextTextState.textBaseline = /** @type {CanvasTextBaseline} */ (textState.textBaseline); - context.textBaseline = /** @type {CanvasTextBaseline} */ (textState.textBaseline); + contextTextState.textBaseline = /** @type {CanvasTextBaseline} */ ( + textState.textBaseline + ); + context.textBaseline = /** @type {CanvasTextBaseline} */ ( + textState.textBaseline + ); } } } @@ -1082,7 +1105,8 @@ class CanvasImmediateRenderer extends VectorContext { const textStrokeStyleColor = textStrokeStyle.getColor(); const textStrokeStyleLineCap = textStrokeStyle.getLineCap(); const textStrokeStyleLineDash = textStrokeStyle.getLineDash(); - const textStrokeStyleLineDashOffset = textStrokeStyle.getLineDashOffset(); + const textStrokeStyleLineDashOffset = + textStrokeStyle.getLineDashOffset(); const textStrokeStyleLineJoin = textStrokeStyle.getLineJoin(); const textStrokeStyleWidth = textStrokeStyle.getWidth(); const textStrokeStyleMiterLimit = textStrokeStyle.getMiterLimit(); diff --git a/src/ol/render/canvas/TextBuilder.js b/src/ol/render/canvas/TextBuilder.js index c9c4c809d7..849cd872d5 100644 --- a/src/ol/render/canvas/TextBuilder.js +++ b/src/ol/render/canvas/TextBuilder.js @@ -192,13 +192,18 @@ class CanvasTextBuilder extends CanvasBuilder { if (geometryType == GeometryType.LINE_STRING) { ends = [flatCoordinates.length]; } else if (geometryType == GeometryType.MULTI_LINE_STRING) { - ends = /** @type {import("../../geom/MultiLineString.js").default} */ (geometry).getEnds(); + ends = /** @type {import("../../geom/MultiLineString.js").default} */ ( + geometry + ).getEnds(); } else if (geometryType == GeometryType.POLYGON) { ends = /** @type {import("../../geom/Polygon.js").default} */ (geometry) .getEnds() .slice(0, 1); } else if (geometryType == GeometryType.MULTI_POLYGON) { - const endss = /** @type {import("../../geom/MultiPolygon.js").default} */ (geometry).getEndss(); + const endss = + /** @type {import("../../geom/MultiPolygon.js").default} */ ( + geometry + ).getEndss(); ends = []; for (let i = 0, ii = endss.length; i < ii; ++i) { ends.push(endss[i][0]); @@ -236,27 +241,45 @@ class CanvasTextBuilder extends CanvasBuilder { switch (geometryType) { case GeometryType.POINT: case GeometryType.MULTI_POINT: - flatCoordinates = /** @type {import("../../geom/MultiPoint.js").default} */ (geometry).getFlatCoordinates(); + flatCoordinates = + /** @type {import("../../geom/MultiPoint.js").default} */ ( + geometry + ).getFlatCoordinates(); break; case GeometryType.LINE_STRING: - flatCoordinates = /** @type {import("../../geom/LineString.js").default} */ (geometry).getFlatMidpoint(); + flatCoordinates = + /** @type {import("../../geom/LineString.js").default} */ ( + geometry + ).getFlatMidpoint(); break; case GeometryType.CIRCLE: - flatCoordinates = /** @type {import("../../geom/Circle.js").default} */ (geometry).getCenter(); + flatCoordinates = + /** @type {import("../../geom/Circle.js").default} */ ( + geometry + ).getCenter(); break; case GeometryType.MULTI_LINE_STRING: - flatCoordinates = /** @type {import("../../geom/MultiLineString.js").default} */ (geometry).getFlatMidpoints(); + flatCoordinates = + /** @type {import("../../geom/MultiLineString.js").default} */ ( + geometry + ).getFlatMidpoints(); stride = 2; break; case GeometryType.POLYGON: - flatCoordinates = /** @type {import("../../geom/Polygon.js").default} */ (geometry).getFlatInteriorPoint(); + flatCoordinates = + /** @type {import("../../geom/Polygon.js").default} */ ( + geometry + ).getFlatInteriorPoint(); if (!textState.overflow) { geometryWidths.push(flatCoordinates[2] / this.resolution); } stride = 3; break; case GeometryType.MULTI_POLYGON: - const interiorPoints = /** @type {import("../../geom/MultiPolygon.js").default} */ (geometry).getFlatInteriorPoints(); + const interiorPoints = + /** @type {import("../../geom/MultiPolygon.js").default} */ ( + geometry + ).getFlatInteriorPoints(); flatCoordinates = []; for (let i = 0, ii = interiorPoints.length; i < ii; i += 3) { if (!textState.overflow) { diff --git a/src/ol/renderer/canvas/TileLayer.js b/src/ol/renderer/canvas/TileLayer.js index 6cffd7f854..54cd7f76cd 100644 --- a/src/ol/renderer/canvas/TileLayer.js +++ b/src/ol/renderer/canvas/TileLayer.js @@ -356,9 +356,9 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer { tilePixelRatio * tileSource.getGutterForProjection(projection); const tilesToDraw = tilesToDrawByZ[currentZ]; for (const tileCoordKey in tilesToDraw) { - const tile = /** @type {import("../../ImageTile.js").default} */ (tilesToDraw[ - tileCoordKey - ]); + const tile = /** @type {import("../../ImageTile.js").default} */ ( + tilesToDraw[tileCoordKey] + ); const tileCoord = tile.tileCoord; // Calculate integer positions and sizes so that tiles align @@ -543,7 +543,9 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer { }.bind(null, tileSource); frameState.postRenderFunctions.push( - /** @type {import("../../PluggableMap.js").PostRenderFunction} */ (postRenderFunction) + /** @type {import("../../PluggableMap.js").PostRenderFunction} */ ( + postRenderFunction + ) ); } } diff --git a/src/ol/renderer/canvas/VectorImageLayer.js b/src/ol/renderer/canvas/VectorImageLayer.js index ec3689b4c7..a191d9b318 100644 --- a/src/ol/renderer/canvas/VectorImageLayer.js +++ b/src/ol/renderer/canvas/VectorImageLayer.js @@ -107,22 +107,19 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer { ) { vectorRenderer.useContainer(null, null, 1); const context = vectorRenderer.context; - const imageFrameState = /** @type {import("../../PluggableMap.js").FrameState} */ (assign( - {}, - frameState, - { - declutterTree: new RBush(9), - extent: renderedExtent, - size: [width, height], - viewState: /** @type {import("../../View.js").State} */ (assign( - {}, - frameState.viewState, - { - rotation: 0, - } - )), - } - )); + const imageFrameState = + /** @type {import("../../PluggableMap.js").FrameState} */ ( + assign({}, frameState, { + declutterTree: new RBush(9), + extent: renderedExtent, + size: [width, height], + viewState: /** @type {import("../../View.js").State} */ ( + assign({}, frameState.viewState, { + rotation: 0, + }) + ), + }) + ); const image = new ImageCanvas( renderedExtent, viewResolution, @@ -168,7 +165,8 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer { } if (this.image_) { - this.renderedPixelToCoordinateTransform_ = frameState.pixelToCoordinateTransform.slice(); + this.renderedPixelToCoordinateTransform_ = + frameState.pixelToCoordinateTransform.slice(); } return !!this.image_; diff --git a/src/ol/renderer/canvas/VectorTileLayer.js b/src/ol/renderer/canvas/VectorTileLayer.js index ef9c6d065a..2c0c523416 100644 --- a/src/ol/renderer/canvas/VectorTileLayer.js +++ b/src/ol/renderer/canvas/VectorTileLayer.js @@ -242,7 +242,9 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer { * @private */ updateExecutorGroup_(tile, pixelRatio, projection) { - const layer = /** @type {import("../../layer/VectorTile.js").default} */ (this.getLayer()); + const layer = /** @type {import("../../layer/VectorTile.js").default} */ ( + this.getLayer() + ); const revision = layer.getRevision(); const renderOrder = layer.getRenderOrder() || null; @@ -276,9 +278,8 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer { continue; } const sourceTileCoord = sourceTile.tileCoord; - const sourceTileExtent = sourceTileGrid.getTileCoordExtent( - sourceTileCoord - ); + const sourceTileExtent = + sourceTileGrid.getTileCoordExtent(sourceTileCoord); const sharedExtent = getIntersection(tileExtent, sourceTileExtent); const builderExtent = buffer( sharedExtent, @@ -443,8 +444,10 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer { return undefined; }; - const renderedTiles = /** @type {Array} */ (this - .renderedTiles); + const renderedTiles = + /** @type {Array} */ ( + this.renderedTiles + ); let found; for (let i = 0, ii = renderedTiles.length; !found && i < ii; ++i) { @@ -492,7 +495,10 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer { getFeatures(pixel) { return new Promise( function (resolve, reject) { - const layer = /** @type {import("../../layer/VectorTile.js").default} */ (this.getLayer()); + const layer = + /** @type {import("../../layer/VectorTile.js").default} */ ( + this.getLayer() + ); const layerUid = getUid(layer); const source = layer.getSource(); const projection = this.renderedProjection; @@ -607,8 +613,10 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer { const hifi = !( viewHints[ViewHint.ANIMATING] || viewHints[ViewHint.INTERACTING] ); - const tiles = /** @type {Array} */ (this - .renderedTiles); + const tiles = + /** @type {Array} */ ( + this.renderedTiles + ); for (let i = 0, ii = tiles.length; i < ii; ++i) { const tile = tiles[i]; const declutterExecutorGroups = @@ -677,10 +685,13 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer { this.renderQueuedTileImages_(hifi, frameState); super.renderFrame(frameState, target); - this.renderedPixelToCoordinateTransform_ = frameState.pixelToCoordinateTransform.slice(); + this.renderedPixelToCoordinateTransform_ = + frameState.pixelToCoordinateTransform.slice(); this.renderedRotation_ = frameState.viewState.rotation; - const layer = /** @type {import("../../layer/VectorTile.js").default} */ (this.getLayer()); + const layer = /** @type {import("../../layer/VectorTile.js").default} */ ( + this.getLayer() + ); const renderMode = layer.getRenderMode(); const source = layer.getSource(); @@ -703,9 +714,9 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer { const clips = []; const clipZs = []; for (let i = tiles.length - 1; i >= 0; --i) { - const tile = /** @type {import("../../VectorRenderTile.js").default} */ (tiles[ - i - ]); + const tile = /** @type {import("../../VectorRenderTile.js").default} */ ( + tiles[i] + ); const transform = this.getTileRenderTransform(tile, frameState); const executorGroups = tile.executorGroups[getUid(layer)]; let clipped = false; @@ -834,7 +845,9 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer { * @private */ tileImageNeedsRender_(tile) { - const layer = /** @type {import("../../layer/VectorTile.js").default} */ (this.getLayer()); + const layer = /** @type {import("../../layer/VectorTile.js").default} */ ( + this.getLayer() + ); if (layer.getRenderMode() === VectorTileRenderType.VECTOR) { return false; } @@ -853,7 +866,9 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer { * @private */ renderTileImage_(tile, frameState) { - const layer = /** @type {import("../../layer/VectorTile.js").default} */ (this.getLayer()); + const layer = /** @type {import("../../layer/VectorTile.js").default} */ ( + this.getLayer() + ); const replayState = tile.getReplayState(layer); const revision = layer.getRevision(); const executorGroups = tile.executorGroups[getUid(layer)]; diff --git a/src/ol/renderer/vector.js b/src/ol/renderer/vector.js index e4a0849d98..db4929d430 100644 --- a/src/ol/renderer/vector.js +++ b/src/ol/renderer/vector.js @@ -195,7 +195,10 @@ function renderFeatureInternal( */ function renderGeometry(replayGroup, geometry, style, feature) { if (geometry.getType() == GeometryType.GEOMETRY_COLLECTION) { - const geometries = /** @type {import("../geom/GeometryCollection.js").default} */ (geometry).getGeometries(); + const geometries = + /** @type {import("../geom/GeometryCollection.js").default} */ ( + geometry + ).getGeometries(); for (let i = 0, ii = geometries.length; i < ii; ++i) { renderGeometry(replayGroup, geometries[i], style, feature); } diff --git a/src/ol/renderer/webgl/PointsLayer.js b/src/ol/renderer/webgl/PointsLayer.js index a97c36cf0c..4b0d150746 100644 --- a/src/ol/renderer/webgl/PointsLayer.js +++ b/src/ol/renderer/webgl/PointsLayer.js @@ -526,7 +526,9 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer { let hitColor; for (const featureUid in this.featureCache_) { featureCache = this.featureCache_[featureUid]; - geometry = /** @type {import("../../geom").Point} */ (featureCache.geometry); + geometry = /** @type {import("../../geom").Point} */ ( + featureCache.geometry + ); if (!geometry || geometry.getType() !== GeometryType.POINT) { continue; } diff --git a/src/ol/source/CartoDB.js b/src/ol/source/CartoDB.js index 08b5f3bc71..833610823e 100644 --- a/src/ol/source/CartoDB.js +++ b/src/ol/source/CartoDB.js @@ -157,9 +157,9 @@ class CartoDB extends XYZ { if (!client.status || (client.status >= 200 && client.status < 300)) { let response; try { - response = /** @type {CartoDBLayerInfo} */ (JSON.parse( - client.responseText - )); + response = /** @type {CartoDBLayerInfo} */ ( + JSON.parse(client.responseText) + ); } catch (err) { this.setState(SourceState.ERROR); return; diff --git a/src/ol/source/ImageWMS.js b/src/ol/source/ImageWMS.js index cb9a90c86a..ad815637de 100644 --- a/src/ol/source/ImageWMS.js +++ b/src/ol/source/ImageWMS.js @@ -113,7 +113,10 @@ class ImageWMS extends ImageSource { * @private * @type {import("./WMSServerType.js").default|undefined} */ - this.serverType_ = /** @type {import("./WMSServerType.js").default|undefined} */ (options.serverType); + this.serverType_ = + /** @type {import("./WMSServerType.js").default|undefined} */ ( + options.serverType + ); /** * @private diff --git a/src/ol/source/Raster.js b/src/ol/source/Raster.js index 46b78774c7..bb9e28c709 100644 --- a/src/ol/source/Raster.js +++ b/src/ol/source/Raster.js @@ -626,15 +626,13 @@ class RasterSource extends ImageSource { * @private */ updateFrameState_(extent, resolution, projection) { - const frameState = /** @type {import("../PluggableMap.js").FrameState} */ (assign( - {}, - this.frameState_ - )); + const frameState = /** @type {import("../PluggableMap.js").FrameState} */ ( + assign({}, this.frameState_) + ); - frameState.viewState = /** @type {import("../View.js").State} */ (assign( - {}, - frameState.viewState - )); + frameState.viewState = /** @type {import("../View.js").State} */ ( + assign({}, frameState.viewState) + ); const center = getCenter(extent); diff --git a/src/ol/source/Tile.js b/src/ol/source/Tile.js index cb8e7de7e3..f5336c54c4 100644 --- a/src/ol/source/Tile.js +++ b/src/ol/source/Tile.js @@ -153,9 +153,9 @@ class TileSource extends Source { tileCoordKey = getKeyZXY(z, x, y); loaded = false; if (tileCache.containsKey(tileCoordKey)) { - tile = /** @type {!import("../Tile.js").default} */ (tileCache.get( - tileCoordKey - )); + tile = /** @type {!import("../Tile.js").default} */ ( + tileCache.get(tileCoordKey) + ); loaded = tile.getState() === TileState.LOADED; if (loaded) { loaded = callback(tile) !== false; diff --git a/src/ol/source/TileImage.js b/src/ol/source/TileImage.js index e345aac0ea..5951bb399a 100644 --- a/src/ol/source/TileImage.js +++ b/src/ol/source/TileImage.js @@ -251,9 +251,8 @@ class TileImage extends UrlTile { } else { const projKey = getUid(projection); if (!(projKey in this.tileGridForProjection)) { - this.tileGridForProjection[projKey] = getTileGridForProjection( - projection - ); + this.tileGridForProjection[projKey] = + getTileGridForProjection(projection); } return this.tileGridForProjection[projKey]; } @@ -472,7 +471,8 @@ class TileImage extends UrlTile { * @param {string} src Source. */ function defaultTileLoadFunction(imageTile, src) { - /** @type {HTMLImageElement|HTMLVideoElement} */ (imageTile.getImage()).src = src; + /** @type {HTMLImageElement|HTMLVideoElement} */ (imageTile.getImage()).src = + src; } export default TileImage; diff --git a/src/ol/source/TileWMS.js b/src/ol/source/TileWMS.js index 9df80f92e7..4632d950f9 100644 --- a/src/ol/source/TileWMS.js +++ b/src/ol/source/TileWMS.js @@ -127,7 +127,10 @@ class TileWMS extends TileImage { * @private * @type {import("./WMSServerType.js").default|undefined} */ - this.serverType_ = /** @type {import("./WMSServerType.js").default|undefined} */ (options.serverType); + this.serverType_ = + /** @type {import("./WMSServerType.js").default|undefined} */ ( + options.serverType + ); /** * @private diff --git a/src/ol/source/UTFGrid.js b/src/ol/source/UTFGrid.js index 7d5c97895b..77903bb171 100644 --- a/src/ol/source/UTFGrid.js +++ b/src/ol/source/UTFGrid.js @@ -222,9 +222,9 @@ export class CustomTile extends Tile { if (!client.status || (client.status >= 200 && client.status < 300)) { let response; try { - response = /** @type {!UTFGridJSON} */ (JSON.parse( - client.responseText - )); + response = /** @type {!UTFGridJSON} */ ( + JSON.parse(client.responseText) + ); } catch (err) { this.handleError_(); return; @@ -341,9 +341,9 @@ class UTFGrid extends TileSource { if (!client.status || (client.status >= 200 && client.status < 300)) { let response; try { - response = /** @type {import("./TileJSON.js").Config} */ (JSON.parse( - client.responseText - )); + response = /** @type {import("./TileJSON.js").Config} */ ( + JSON.parse(client.responseText) + ); } catch (err) { this.handleTileJSONError(); return; @@ -391,13 +391,15 @@ class UTFGrid extends TileSource { if (this.tileGrid) { const z = this.tileGrid.getZForResolution(resolution, this.zDirection); const tileCoord = this.tileGrid.getTileCoordForCoordAndZ(coordinate, z); - const tile = /** @type {!CustomTile} */ (this.getTile( - tileCoord[0], - tileCoord[1], - tileCoord[2], - 1, - this.getProjection() - )); + const tile = /** @type {!CustomTile} */ ( + this.getTile( + tileCoord[0], + tileCoord[1], + tileCoord[2], + 1, + this.getProjection() + ) + ); tile.forDataAtCoordinate(coordinate, callback, opt_request); } else { if (opt_request === true) { diff --git a/src/ol/source/Vector.js b/src/ol/source/Vector.js index bcc0f0ee2d..433bb05e94 100644 --- a/src/ol/source/Vector.js +++ b/src/ol/source/Vector.js @@ -474,7 +474,9 @@ class VectorSource extends Source { if (!modifyingCollection) { modifyingCollection = true; this.addFeature( - /** @type {import("../Feature.js").default} */ (evt.element) + /** @type {import("../Feature.js").default} */ ( + evt.element + ) ); modifyingCollection = false; } @@ -489,7 +491,9 @@ class VectorSource extends Source { if (!modifyingCollection) { modifyingCollection = true; this.removeFeature( - /** @type {import("../Feature.js").default} */ (evt.element) + /** @type {import("../Feature.js").default} */ ( + evt.element + ) ); modifyingCollection = false; } @@ -668,7 +672,9 @@ class VectorSource extends Source { extend(features, getValues(this.nullGeometryFeatures_)); } } - return /** @type {Array>} */ (features); + return /** @type {Array>} */ ( + features + ); } /** @@ -838,7 +844,9 @@ class VectorSource extends Source { * @private */ handleFeatureChange_(event) { - const feature = /** @type {import("../Feature.js").default} */ (event.target); + const feature = /** @type {import("../Feature.js").default} */ ( + event.target + ); const featureKey = getUid(feature); const geometry = feature.getGeometry(); if (!geometry) { diff --git a/src/ol/source/VectorTile.js b/src/ol/source/VectorTile.js index fc3ee620c7..2cc148028f 100644 --- a/src/ol/source/VectorTile.js +++ b/src/ol/source/VectorTile.js @@ -323,9 +323,8 @@ class VectorTile extends UrlTile { tile.loadingSourceTiles++; } if (sourceTileState === TileState.IDLE) { - sourceTile.extent = sourceTileGrid.getTileCoordExtent( - sourceTileCoord - ); + sourceTile.extent = + sourceTileGrid.getTileCoordExtent(sourceTileCoord); sourceTile.projection = projection; sourceTile.resolution = sourceTileGrid.getResolution( sourceTileCoord[0] @@ -471,9 +470,8 @@ class VectorTile extends UrlTile { */ updateCacheSize(tileCount, projection) { super.updateCacheSize(tileCount * 2, projection); - this.sourceTileCache.highWaterMark = this.getTileCacheForProjection( - projection - ).highWaterMark; + this.sourceTileCache.highWaterMark = + this.getTileCacheForProjection(projection).highWaterMark; } } diff --git a/src/ol/source/WMTS.js b/src/ol/source/WMTS.js index 099578a843..4366528558 100644 --- a/src/ol/source/WMTS.js +++ b/src/ol/source/WMTS.js @@ -70,7 +70,9 @@ class WMTS extends TileImage { const requestEncoding = options.requestEncoding !== undefined - ? /** @type {import("./WMTSRequestEncoding.js").default} */ (options.requestEncoding) + ? /** @type {import("./WMTSRequestEncoding.js").default} */ ( + options.requestEncoding + ) : WMTSRequestEncoding.KVP; // FIXME: should we create a default tileGrid? @@ -293,8 +295,9 @@ class WMTS extends TileImage { return p.toLowerCase() in context ? context[p.toLowerCase()] : m; }); - const tileGrid = /** @type {import("../tilegrid/WMTS.js").default} */ (this - .tileGrid); + const tileGrid = /** @type {import("../tilegrid/WMTS.js").default} */ ( + this.tileGrid + ); const dimensions = this.dimensions_; return ( diff --git a/src/ol/sphere.js b/src/ol/sphere.js index fc06e3d4b1..1c4063878f 100644 --- a/src/ol/sphere.js +++ b/src/ol/sphere.js @@ -90,20 +90,26 @@ export function getLength(geometry, opt_options) { } case GeometryType.LINE_STRING: case GeometryType.LINEAR_RING: { - coordinates = /** @type {import("./geom/SimpleGeometry.js").default} */ (geometry).getCoordinates(); + coordinates = /** @type {import("./geom/SimpleGeometry.js").default} */ ( + geometry + ).getCoordinates(); length = getLengthInternal(coordinates, radius); break; } case GeometryType.MULTI_LINE_STRING: case GeometryType.POLYGON: { - coordinates = /** @type {import("./geom/SimpleGeometry.js").default} */ (geometry).getCoordinates(); + coordinates = /** @type {import("./geom/SimpleGeometry.js").default} */ ( + geometry + ).getCoordinates(); for (i = 0, ii = coordinates.length; i < ii; ++i) { length += getLengthInternal(coordinates[i], radius); } break; } case GeometryType.MULTI_POLYGON: { - coordinates = /** @type {import("./geom/SimpleGeometry.js").default} */ (geometry).getCoordinates(); + coordinates = /** @type {import("./geom/SimpleGeometry.js").default} */ ( + geometry + ).getCoordinates(); for (i = 0, ii = coordinates.length; i < ii; ++i) { coords = coordinates[i]; for (j = 0, jj = coords.length; j < jj; ++j) { @@ -113,7 +119,10 @@ export function getLength(geometry, opt_options) { break; } case GeometryType.GEOMETRY_COLLECTION: { - const geometries = /** @type {import("./geom/GeometryCollection.js").default} */ (geometry).getGeometries(); + const geometries = + /** @type {import("./geom/GeometryCollection.js").default} */ ( + geometry + ).getGeometries(); for (i = 0, ii = geometries.length; i < ii; ++i) { length += getLength(geometries[i], opt_options); } @@ -186,7 +195,9 @@ export function getArea(geometry, opt_options) { break; } case GeometryType.POLYGON: { - coordinates = /** @type {import("./geom/Polygon.js").default} */ (geometry).getCoordinates(); + coordinates = /** @type {import("./geom/Polygon.js").default} */ ( + geometry + ).getCoordinates(); area = Math.abs(getAreaInternal(coordinates[0], radius)); for (i = 1, ii = coordinates.length; i < ii; ++i) { area -= Math.abs(getAreaInternal(coordinates[i], radius)); @@ -194,7 +205,9 @@ export function getArea(geometry, opt_options) { break; } case GeometryType.MULTI_POLYGON: { - coordinates = /** @type {import("./geom/SimpleGeometry.js").default} */ (geometry).getCoordinates(); + coordinates = /** @type {import("./geom/SimpleGeometry.js").default} */ ( + geometry + ).getCoordinates(); for (i = 0, ii = coordinates.length; i < ii; ++i) { coords = coordinates[i]; area += Math.abs(getAreaInternal(coords[0], radius)); @@ -205,7 +218,10 @@ export function getArea(geometry, opt_options) { break; } case GeometryType.GEOMETRY_COLLECTION: { - const geometries = /** @type {import("./geom/GeometryCollection.js").default} */ (geometry).getGeometries(); + const geometries = + /** @type {import("./geom/GeometryCollection.js").default} */ ( + geometry + ).getGeometries(); for (i = 0, ii = geometries.length; i < ii; ++i) { area += getArea(geometries[i], opt_options); } diff --git a/src/ol/style/Style.js b/src/ol/style/Style.js index aa16023376..2dc137c6c1 100644 --- a/src/ol/style/Style.js +++ b/src/ol/style/Style.js @@ -213,7 +213,9 @@ class Style { clone() { let geometry = this.getGeometry(); if (geometry && typeof geometry === 'object') { - geometry = /** @type {import("../geom/Geometry.js").default} */ (geometry).clone(); + geometry = /** @type {import("../geom/Geometry.js").default} */ ( + geometry + ).clone(); } return new Style({ geometry: geometry, @@ -361,9 +363,9 @@ class Style { this.geometryFunction_ = geometry; } else if (typeof geometry === 'string') { this.geometryFunction_ = function (feature) { - return /** @type {import("../geom/Geometry.js").default} */ (feature.get( - geometry - )); + return /** @type {import("../geom/Geometry.js").default} */ ( + feature.get(geometry) + ); }; } else if (!geometry) { this.geometryFunction_ = defaultGeometryFunction; diff --git a/src/ol/util.js b/src/ol/util.js index 6b965f0611..7d61ca855b 100644 --- a/src/ol/util.js +++ b/src/ol/util.js @@ -6,9 +6,11 @@ * @return {?} Any return. */ export function abstract() { - return /** @type {?} */ ((function () { - throw new Error('Unimplemented abstract method.'); - })()); + return /** @type {?} */ ( + (function () { + throw new Error('Unimplemented abstract method.'); + })() + ); } /** diff --git a/src/ol/webgl/Helper.js b/src/ol/webgl/Helper.js index 79c139d622..69001218c2 100644 --- a/src/ol/webgl/Helper.js +++ b/src/ol/webgl/Helper.js @@ -248,9 +248,8 @@ class WebGLHelper extends Disposable { this.boundHandleWebGLContextLost_ = this.handleWebGLContextLost.bind(this); /** @private */ - this.boundHandleWebGLContextRestored_ = this.handleWebGLContextRestored.bind( - this - ); + this.boundHandleWebGLContextRestored_ = + this.handleWebGLContextRestored.bind(this); /** * @private diff --git a/src/ol/xml.js b/src/ol/xml.js index e9d3db3571..fe4b6884ef 100644 --- a/src/ol/xml.js +++ b/src/ol/xml.js @@ -123,9 +123,9 @@ export function makeArrayExtender(valueReader, opt_this) { objectStack ); if (value !== undefined) { - const array = /** @type {Array<*>} */ (objectStack[ - objectStack.length - 1 - ]); + const array = /** @type {Array<*>} */ ( + objectStack[objectStack.length - 1] + ); extend(array, value); } } @@ -153,9 +153,9 @@ export function makeArrayPusher(valueReader, opt_this) { objectStack ); if (value !== undefined) { - const array = /** @type {Array<*>} */ (objectStack[ - objectStack.length - 1 - ]); + const array = /** @type {Array<*>} */ ( + objectStack[objectStack.length - 1] + ); array.push(value); } } @@ -211,9 +211,9 @@ export function makeObjectPropertyPusher(valueReader, opt_property, opt_this) { objectStack ); if (value !== undefined) { - const object = /** @type {!Object} */ (objectStack[ - objectStack.length - 1 - ]); + const object = /** @type {!Object} */ ( + objectStack[objectStack.length - 1] + ); const property = opt_property !== undefined ? opt_property : node.localName; let array; @@ -250,9 +250,9 @@ export function makeObjectPropertySetter(valueReader, opt_property, opt_this) { objectStack ); if (value !== undefined) { - const object = /** @type {!Object} */ (objectStack[ - objectStack.length - 1 - ]); + const object = /** @type {!Object} */ ( + objectStack[objectStack.length - 1] + ); const property = opt_property !== undefined ? opt_property : node.localName; object[property] = value; @@ -278,9 +278,9 @@ export function makeChildAppender(nodeWriter, opt_this) { value, objectStack ); - const parent = /** @type {NodeStackItem} */ (objectStack[ - objectStack.length - 1 - ]); + const parent = /** @type {NodeStackItem} */ ( + objectStack[objectStack.length - 1] + ); const parentNode = parent.node; parentNode.appendChild(node); }; @@ -335,9 +335,9 @@ export function makeSimpleNodeFactory(opt_nodeName, opt_namespaceURI) { * @return {Node} Node. */ function (value, objectStack, opt_nodeName) { - const context = /** @type {NodeStackItem} */ (objectStack[ - objectStack.length - 1 - ]); + const context = /** @type {NodeStackItem} */ ( + objectStack[objectStack.length - 1] + ); const node = context.node; let nodeName = fixedNodeName; if (nodeName === undefined) { diff --git a/test/browser/spec/ol/color.test.js b/test/browser/spec/ol/color.test.js index 5d28db45d4..8812c7fa76 100644 --- a/test/browser/spec/ol/color.test.js +++ b/test/browser/spec/ol/color.test.js @@ -86,19 +86,13 @@ describe('ol.color', function () { expect(fromString('rgba(255, 255, 0, 0.0)')).to.eql([255, 255, 0, 0]); // opacity 0.0000000000000000 (float with 16 digits) expect(fromString('rgba(255, 255, 0, 0.0000000000000000)')).to.eql([ - 255, - 255, - 0, - 0, + 255, 255, 0, 0, ]); // opacity 0.1 (simple float) expect(fromString('rgba(255, 255, 0, 0.1)')).to.eql([255, 255, 0, 0.1]); // opacity 0.1111111111111111 (float with 16 digits) expect(fromString('rgba(255, 255, 0, 0.1111111111111111)')).to.eql([ - 255, - 255, - 0, - 0.1111111111111111, + 255, 255, 0, 0.1111111111111111, ]); // opacity 1 expect(fromString('rgba(255, 255, 0, 1)')).to.eql([255, 255, 0, 1]); @@ -106,10 +100,7 @@ describe('ol.color', function () { expect(fromString('rgba(255, 255, 0, 1.0)')).to.eql([255, 255, 0, 1]); // opacity 1.0000000000000000 expect(fromString('rgba(255, 255, 0, 1.0000000000000000)')).to.eql([ - 255, - 255, - 0, - 1, + 255, 255, 0, 1, ]); // with 30 decimal digits expect( @@ -118,9 +109,9 @@ describe('ol.color', function () { }); it('ignores whitespace before, between & after numbers (rgba)', function () { - expect( - fromString('rgba( \t 0 , 0 \n , 255 , 0.4711 )') - ).to.eql([0, 0, 255, 0.4711]); + expect(fromString('rgba( \t 0 , 0 \n , 255 , 0.4711 )')).to.eql( + [0, 0, 255, 0.4711] + ); }); it('throws an error on invalid colors', function () { diff --git a/test/browser/spec/ol/control/zoomslider.test.js b/test/browser/spec/ol/control/zoomslider.test.js index 055a3f523b..a8b55fd4c0 100644 --- a/test/browser/spec/ol/control/zoomslider.test.js +++ b/test/browser/spec/ol/control/zoomslider.test.js @@ -47,9 +47,8 @@ describe('ol.control.ZoomSlider', function () { const zoomSliderContainer = zoomSliderContainers[0]; expect(zoomSliderContainer instanceof HTMLDivElement).to.be(true); - let hasUnselectableCls = zoomSliderContainer.classList.contains( - 'ol-unselectable' - ); + let hasUnselectableCls = + zoomSliderContainer.classList.contains('ol-unselectable'); expect(hasUnselectableCls).to.be(true); const zoomSliderThumbs = zoomSliderContainer.querySelectorAll( @@ -60,9 +59,8 @@ describe('ol.control.ZoomSlider', function () { const zoomSliderThumb = zoomSliderThumbs[0]; expect(zoomSliderThumb instanceof HTMLButtonElement).to.be(true); - hasUnselectableCls = zoomSliderThumb.classList.contains( - 'ol-unselectable' - ); + hasUnselectableCls = + zoomSliderThumb.classList.contains('ol-unselectable'); expect(hasUnselectableCls).to.be(true); }); }); diff --git a/test/browser/spec/ol/format/gml.test.js b/test/browser/spec/ol/format/gml.test.js index 3eaacae281..5aea37a7ea 100644 --- a/test/browser/spec/ol/format/gml.test.js +++ b/test/browser/spec/ol/format/gml.test.js @@ -1793,29 +1793,13 @@ describe('ol.format.GML3', function () { it('creates 3D Features with the expected geometries', function () { const expectedGeometry1 = [ - 4.46386854, - 51.91122415, - 46.04679351, - 4.46382399, - 51.91120839, + 4.46386854, 51.91122415, 46.04679351, 4.46382399, 51.91120839, 46.04679382, ]; const expectedGeometry2 = [ - 4.46385491, - 51.91119276, - 46.06074531, - 4.4638264, - 51.91118582, - 46.06074609, - 4.46380612, - 51.91121772, - 46.06074168, - 4.46383463, - 51.91122465, - 46.06074089, - 4.46385491, - 51.91119276, - 46.06074531, + 4.46385491, 51.91119276, 46.06074531, 4.4638264, 51.91118582, + 46.06074609, 4.46380612, 51.91121772, 46.06074168, 4.46383463, + 51.91122465, 46.06074089, 4.46385491, 51.91119276, 46.06074531, ]; const expectedGeometry3 = [4.46383715, 51.91125849, 46.04679348]; diff --git a/test/browser/spec/ol/format/mvt.test.js b/test/browser/spec/ol/format/mvt.test.js index f4a04bf891..6b10c84fc8 100644 --- a/test/browser/spec/ol/format/mvt.test.js +++ b/test/browser/spec/ol/format/mvt.test.js @@ -22,9 +22,7 @@ where('ArrayBuffer.isView').describe('ol.format.MVT', function () { const options = { featureProjection: 'EPSG:3857', extent: [ - 1824704.739223726, - 6141868.096770482, - 1827150.7241288517, + 1824704.739223726, 6141868.096770482, 1827150.7241288517, 6144314.081675608, ], }; @@ -134,9 +132,7 @@ describe('ol.format.MVT', function () { const options = { featureProjection: 'EPSG:3857', extent: [ - 1824704.739223726, - 6141868.096770482, - 1827150.7241288517, + 1824704.739223726, 6141868.096770482, 1827150.7241288517, 6144314.081675608, ], }; diff --git a/test/browser/spec/ol/format/wfs.test.js b/test/browser/spec/ol/format/wfs.test.js index d95750a705..12f01788df 100644 --- a/test/browser/spec/ol/format/wfs.test.js +++ b/test/browser/spec/ol/format/wfs.test.js @@ -139,10 +139,7 @@ describe('ol.format.WFS', function () { expect(feature.getId()).to.equal('1'); expect(feature.get('name')).to.equal('My Polygon with hole'); expect(feature.get('boundedBy')).to.eql([ - 47.003018, - -0.768746, - 47.925567, - 0.532597, + 47.003018, -0.768746, 47.925567, 0.532597, ]); expect(feature.getGeometry()).to.be.an(MultiPolygon); expect(feature.getGeometry().getFlatCoordinates()).to.have.length(60); @@ -205,10 +202,7 @@ describe('ol.format.WFS', function () { }); it('returns the correct bounds', function () { expect(response.bounds).to.eql([ - 3197.88, - 306457.313, - 280339.156, - 613850.438, + 3197.88, 306457.313, 280339.156, 613850.438, ]); }); }); diff --git a/test/browser/spec/ol/format/wmscapabilities.test.js b/test/browser/spec/ol/format/wmscapabilities.test.js index e6a395cb39..3feadcdc48 100644 --- a/test/browser/spec/ol/format/wmscapabilities.test.js +++ b/test/browser/spec/ol/format/wmscapabilities.test.js @@ -117,10 +117,7 @@ describe('ol.format.WMSCapabilities', function () { }, ]); expect(layer.Layer[0].EX_GeographicBoundingBox).to.eql([ - -71.63, - 41.75, - -70.78, - 42.9, + -71.63, 41.75, -70.78, 42.9, ]); expect(layer.Layer[0].Style).to.eql([ { diff --git a/test/browser/spec/ol/format/wmsgetfeatureinfo.test.js b/test/browser/spec/ol/format/wmsgetfeatureinfo.test.js index de209de9ec..1328e3430e 100644 --- a/test/browser/spec/ol/format/wmsgetfeatureinfo.test.js +++ b/test/browser/spec/ol/format/wmsgetfeatureinfo.test.js @@ -55,10 +55,7 @@ describe('ol.format.WMSGetFeatureInfo', function () { const feature = features[0]; expect(feature.getGeometry()).to.be(undefined); expect(feature.get('boundedBy')).to.eql([ - -531138.686422, - 5386348.414671, - -117252.819653, - 6144475.186022, + -531138.686422, 5386348.414671, -117252.819653, 6144475.186022, ]); }); diff --git a/test/browser/spec/ol/graticule.test.js b/test/browser/spec/ol/graticule.test.js index 4d31da592f..2f3642dd79 100644 --- a/test/browser/spec/ol/graticule.test.js +++ b/test/browser/spec/ol/graticule.test.js @@ -19,9 +19,7 @@ describe('ol.layer.Graticule', function () { it('creates a graticule without labels', function () { createGraticule(); const extent = [ - -25614353.926475704, - -7827151.696402049, - 25614353.926475704, + -25614353.926475704, -7827151.696402049, 25614353.926475704, 7827151.696402049, ]; const projection = getProjection('EPSG:3857'); @@ -45,9 +43,7 @@ describe('ol.layer.Graticule', function () { layers: [graticule], }); const extent = [ - -25614353.926475704, - -7827151.696402049, - 25614353.926475704, + -25614353.926475704, -7827151.696402049, 25614353.926475704, 7827151.696402049, ]; const projection = getProjection('EPSG:3857'); @@ -97,9 +93,7 @@ describe('ol.layer.Graticule', function () { layers: [graticule], }); const extent = [ - -25614353.926475704, - -7827151.696402049, - 25614353.926475704, + -25614353.926475704, -7827151.696402049, 25614353.926475704, 7827151.696402049, ]; const projection = getProjection('EPSG:3857'); @@ -183,9 +177,7 @@ describe('ol.layer.Graticule', function () { latLabelStyle: latLabelStyle, }); const extent = [ - -25614353.926475704, - -7827151.696402049, - 25614353.926475704, + -25614353.926475704, -7827151.696402049, 25614353.926475704, 7827151.696402049, ]; const projection = getProjection('EPSG:3857'); @@ -224,9 +216,7 @@ describe('ol.layer.Graticule', function () { layers: [graticule], }); const extent = [ - -25614353.926475704, - -7827151.696402049, - 25614353.926475704, + -25614353.926475704, -7827151.696402049, 25614353.926475704, 7827151.696402049, ]; const projection = getProjection('EPSG:3857'); diff --git a/test/browser/spec/ol/layer/layer.test.js b/test/browser/spec/ol/layer/layer.test.js index e017a9dcce..e1ba3fbc1a 100644 --- a/test/browser/spec/ol/layer/layer.test.js +++ b/test/browser/spec/ol/layer/layer.test.js @@ -330,8 +330,7 @@ describe('ol.layer.Layer', function () { inView: true, }, { - when: - 'view resolution is greater than minResolution (with maxResolution)', + when: 'view resolution is greater than minResolution (with maxResolution)', minResolution: 2, maxResolution: 4, view: { @@ -369,8 +368,7 @@ describe('ol.layer.Layer', function () { inView: false, }, { - when: - 'view resolution is greater than maxResolution (with minResolution)', + when: 'view resolution is greater than maxResolution (with minResolution)', minResolution: 2, maxResolution: 4, view: { diff --git a/test/browser/spec/ol/map.test.js b/test/browser/spec/ol/map.test.js index 4867764f88..51deb0d674 100644 --- a/test/browser/spec/ol/map.test.js +++ b/test/browser/spec/ol/map.test.js @@ -1018,9 +1018,8 @@ describe('ol.Map', function () { it('gets coordinates in view projection', function (done) { map.renderSync(); - const coordinateMercator = map.getCoordinateFromPixelInternal( - screenCenter - ); + const coordinateMercator = + map.getCoordinateFromPixelInternal(screenCenter); expect(coordinateMercator[0]).to.roughlyEqual(centerMercator[0], 1e-5); expect(coordinateMercator[1]).to.roughlyEqual(centerMercator[1], 1e-5); done(); diff --git a/test/browser/spec/ol/render/canvas/hitdetect.test.js b/test/browser/spec/ol/render/canvas/hitdetect.test.js index 85de0c7106..7842dfcfd5 100644 --- a/test/browser/spec/ol/render/canvas/hitdetect.test.js +++ b/test/browser/spec/ol/render/canvas/hitdetect.test.js @@ -39,9 +39,7 @@ describe('hitdetect', function () { 0 ); expect(Array.prototype.slice.call(imageData.data, 0, 3)).to.eql([ - 255, - 255, - 252, + 255, 255, 252, ]); }); it('detects hit at the correct position', function () { diff --git a/test/browser/spec/ol/render/canvas/immediate.test.js b/test/browser/spec/ol/render/canvas/immediate.test.js index 5fa1ef227d..0f5615af17 100644 --- a/test/browser/spec/ol/render/canvas/immediate.test.js +++ b/test/browser/spec/ol/render/canvas/immediate.test.js @@ -271,18 +271,12 @@ describe('ol.render.canvas.Immediate', function () { }; const transform = [ - 0.0004088332670837288, - 0, - 0, - -0.0004088332670837288, - 4480.991370439071, + 0.0004088332670837288, 0, 0, -0.0004088332670837288, 4480.991370439071, 1529.5752568707105, ]; const extent = [ - -10960437.252092224, - 2762924.0275091752, - -7572748.158493212, + -10960437.252092224, 2762924.0275091752, -7572748.158493212, 3741317.9895594316, ]; diff --git a/test/browser/spec/ol/render/canvas/textbuilder.test.js b/test/browser/spec/ol/render/canvas/textbuilder.test.js index a1a16253b9..9aae74124e 100644 --- a/test/browser/spec/ol/render/canvas/textbuilder.test.js +++ b/test/browser/spec/ol/render/canvas/textbuilder.test.js @@ -121,28 +121,7 @@ describe('ol.render.canvas.TextBuilder', function () { builder.drawText(feature.getGeometry(), feature); }); expect(builder.coordinates).to.eql([ - 0, - 0, - 1, - 1, - 2, - 2, - 3, - 3, - 4, - 4, - 5, - 5, - 6, - 6, - 7, - 7, - 8, - 8, - 9, - 9, - 10, - 10, + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, ]); }); @@ -219,28 +198,7 @@ describe('ol.render.canvas.TextBuilder', function () { builder.drawText(feature.getGeometry(), feature); }); expect(builder.coordinates).to.eql([ - 0, - 0, - 1, - 1, - 2, - 2, - 3, - 3, - 4, - 4, - 5, - 5, - 6, - 6, - 7, - 7, - 8, - 8, - 9, - 9, - 10, - 10, + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, ]); }); diff --git a/test/browser/spec/ol/renderer/canvas/builder.test.js b/test/browser/spec/ol/renderer/canvas/builder.test.js index a741d531c6..433f95d163 100644 --- a/test/browser/spec/ol/renderer/canvas/builder.test.js +++ b/test/browser/spec/ol/renderer/canvas/builder.test.js @@ -353,14 +353,7 @@ describe('ol.render.canvas.Builder', function () { const flat = [-110, 45, 110, 45, 110, -45, -110, -45, -110, 45]; replay.appendFlatLineCoordinates(flat, 0, flat.length, 2, true, true); expect(replay.coordinates).to.eql([ - 110, - 45, - 110, - -45, - -110, - -45, - -110, - 45, + 110, 45, 110, -45, -110, -45, -110, 45, ]); }); diff --git a/test/browser/spec/ol/renderer/canvas/vectortilelayer.test.js b/test/browser/spec/ol/renderer/canvas/vectortilelayer.test.js index fefb991827..73fe57935c 100644 --- a/test/browser/spec/ol/renderer/canvas/vectortilelayer.test.js +++ b/test/browser/spec/ol/renderer/canvas/vectortilelayer.test.js @@ -385,9 +385,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function () { target.style.height = '100px'; document.body.appendChild(target); const extent = [ - 1824704.739223726, - 6141868.096770482, - 1827150.7241288517, + 1824704.739223726, 6141868.096770482, 1827150.7241288517, 6144314.081675608, ]; const source = new VectorTileSource({ diff --git a/test/browser/spec/ol/renderer/webgl/pointslayer.test.js b/test/browser/spec/ol/renderer/webgl/pointslayer.test.js index 80244dc97a..32d719b6bc 100644 --- a/test/browser/spec/ol/renderer/webgl/pointslayer.test.js +++ b/test/browser/spec/ol/renderer/webgl/pointslayer.test.js @@ -593,8 +593,7 @@ describe('ol.renderer.webgl.PointsLayer', function () { expect(getCache(features[0], renderer).feature).to.be(features[0]); expect(getCache(features[0], renderer).geometry.getCoordinates()).to.eql([ - 10, - 20, + 10, 20, ]); expect(getCache(features[0], renderer).properties['test']).to.be( features[0].get('test') @@ -649,10 +648,7 @@ describe('ol.renderer.webgl.PointsLayer', function () { zoom: 7, }, extent: [ - 11.1932373046875, - 46.429931640625, - 18.8067626953125, - 57.570068359375, + 11.1932373046875, 46.429931640625, 18.8067626953125, 57.570068359375, ], size: [693, 1014], layerIndex: 0, diff --git a/test/browser/spec/ol/source/imagestatic.test.js b/test/browser/spec/ol/source/imagestatic.test.js index fb1c0dc4bc..89f186ce49 100644 --- a/test/browser/spec/ol/source/imagestatic.test.js +++ b/test/browser/spec/ol/source/imagestatic.test.js @@ -5,9 +5,7 @@ describe('ol.source.ImageStatic', function () { let extent, pixelRatio, projection, resolution; beforeEach(function () { extent = [ - -13637278.73946974, - 4543799.13271362, - -13617443.330629736, + -13637278.73946974, 4543799.13271362, -13617443.330629736, 4553927.038961405, ]; pixelRatio = 1; @@ -20,9 +18,7 @@ describe('ol.source.ImageStatic', function () { const source = new Static({ url: 'spec/ol/source/images/12-655-1583.png', imageExtent: [ - -13629027.891360067, - 4539747.983913189, - -13619243.951739565, + -13629027.891360067, 4539747.983913189, -13619243.951739565, 4559315.863154193, ], projection: projection, @@ -43,9 +39,7 @@ describe('ol.source.ImageStatic', function () { const source = new Static({ url: 'spec/ol/source/images/12-655-1583.png', imageExtent: [ - -13629027.891360067, - 4539747.983913189, - -13609460.012119063, + -13629027.891360067, 4539747.983913189, -13609460.012119063, 4549531.923533691, ], projection: projection, @@ -66,9 +60,7 @@ describe('ol.source.ImageStatic', function () { const source = new Static({ url: 'spec/ol/source/images/12-655-1583.png', imageExtent: [ - -13629027.891360067, - 4539747.983913189, - -13619243.951739565, + -13629027.891360067, 4539747.983913189, -13619243.951739565, 4559315.863154193, ], imageSize: [254, 254], @@ -90,9 +82,7 @@ describe('ol.source.ImageStatic', function () { const source = new Static({ url: 'spec/ol/source/images/12-655-1583.png', imageExtent: [ - -13629027.891360067, - 4539747.983913189, - -13619243.951739565, + -13629027.891360067, 4539747.983913189, -13619243.951739565, 4549531.923533691, ], projection: projection, diff --git a/test/browser/spec/ol/source/tilejson.test.js b/test/browser/spec/ol/source/tilejson.test.js index b54c0a2826..dd497790ad 100644 --- a/test/browser/spec/ol/source/tilejson.test.js +++ b/test/browser/spec/ol/source/tilejson.test.js @@ -79,9 +79,7 @@ describe('ol.source.TileJSON', function () { it('returns attributions, but not when outside bounds', function () { tileJSON.bounds = [ - -10.764179999935878, - 49.528423000201656, - 1.9134115551745678, + -10.764179999935878, 49.528423000201656, 1.9134115551745678, 61.3311509999582, ]; const source = new TileJSON({ diff --git a/test/browser/spec/ol/source/tilewms.test.js b/test/browser/spec/ol/source/tilewms.test.js index 824f3ce9cd..ee31470a80 100644 --- a/test/browser/spec/ol/source/tilewms.test.js +++ b/test/browser/spec/ol/source/tilewms.test.js @@ -70,9 +70,7 @@ describe('ol.source.TileWMS', function () { const queryData = uri.searchParams; const bbox = queryData.get('BBOX').split(','); const expected = [ - -10331840.239250705, - -15341217.324948018, - -4696291.017841229, + -10331840.239250705, -15341217.324948018, -4696291.017841229, -9705668.103538541, ]; for (let i = 0, ii = bbox.length; i < ii; ++i) { diff --git a/test/browser/spec/ol/source/vectortile.test.js b/test/browser/spec/ol/source/vectortile.test.js index 949c1f0e59..283abda02f 100644 --- a/test/browser/spec/ol/source/vectortile.test.js +++ b/test/browser/spec/ol/source/vectortile.test.js @@ -247,9 +247,7 @@ describe('ol.source.VectorTile', function () { } const extent = [ - 665584.2026596286, - 7033250.839875697, - 667162.0221431496, + 665584.2026596286, 7033250.839875697, 667162.0221431496, 7035280.378636755, ]; @@ -257,20 +255,7 @@ describe('ol.source.VectorTile', function () { tileGrid: new TileGrid({ origin: [218128, 6126002], resolutions: [ - 4096, - 2048, - 1024, - 512, - 256, - 128, - 64, - 32, - 16, - 8, - 4, - 2, - 1, - 0.5, + 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, ], }), tileUrlFunction: tileUrlFunction, @@ -391,9 +376,7 @@ describe('ol.source.VectorTile', function () { target.style.height = '100px'; document.body.appendChild(target); const extent = [ - 1824704.739223726, - 6141868.096770482, - 1827150.7241288517, + 1824704.739223726, 6141868.096770482, 1827150.7241288517, 6144314.081675608, ]; source = new VectorTileSource({ diff --git a/test/browser/spec/ol/tilegrid/wmts.test.js b/test/browser/spec/ol/tilegrid/wmts.test.js index 0b90bf35a8..f9d69e55d4 100644 --- a/test/browser/spec/ol/tilegrid/wmts.test.js +++ b/test/browser/spec/ol/tilegrid/wmts.test.js @@ -47,35 +47,22 @@ describe('ol.tilegrid.WMTS', function () { expect(tileGrid.resolutions_).to.be.an('array'); expect(tileGrid.resolutions_).to.have.length(20); expect(tileGrid.resolutions_).to.eql([ - 156543.03392811998, - 78271.51696419998, - 39135.758481959994, - 19567.879241008, - 9783.939620504, - 4891.969810252, - 2445.984905126, - 1222.9924525644, - 611.4962262807999, - 305.74811314039994, - 152.87405657047998, - 76.43702828523999, - 38.21851414248, - 19.109257071295996, - 9.554628535647998, - 4.777314267823999, - 2.3886571339119995, - 1.1943285669559998, - 0.5971642834779999, + 156543.03392811998, 78271.51696419998, 39135.758481959994, + 19567.879241008, 9783.939620504, 4891.969810252, 2445.984905126, + 1222.9924525644, 611.4962262807999, 305.74811314039994, + 152.87405657047998, 76.43702828523999, 38.21851414248, + 19.109257071295996, 9.554628535647998, 4.777314267823999, + 2.3886571339119995, 1.1943285669559998, 0.5971642834779999, 0.29858214174039993, ]); expect(tileGrid.origins_).to.be.an('array'); expect(tileGrid.origins_).to.have.length(20); expect(tileGrid.origins_).to.eql( - Array.apply(null, Array(20)).map(Array.prototype.valueOf, [ - -20037508.3428, - 20037508.3428, - ]) + Array.apply(null, Array(20)).map( + Array.prototype.valueOf, + [-20037508.3428, 20037508.3428] + ) ); expect(tileGrid.tileSizes_).to.be.an('array'); @@ -133,37 +120,22 @@ describe('ol.tilegrid.WMTS', function () { expect(tileGrid.resolutions_).to.be.an('array'); expect(tileGrid.resolutions_).to.have.length(22); expect(tileGrid.resolutions_).to.eql([ - 156543.033928041, - 78271.51696402048, - 39135.758482010235, - 19567.87924100512, - 9783.93962050256, - 4891.96981025128, - 2445.98490512564, - 1222.99245256282, - 611.49622628141, - 305.7481131407048, - 152.8740565703525, - 76.43702828517624, - 38.21851414258813, - 19.10925707129406, - 9.554628535647032, - 4.777314267823516, - 2.388657133911758, - 1.194328566955879, - 0.5971642834779395, - 0.2985821417389697, - 0.1492910708694849, - 0.0746455354347424, + 156543.033928041, 78271.51696402048, 39135.758482010235, + 19567.87924100512, 9783.93962050256, 4891.96981025128, 2445.98490512564, + 1222.99245256282, 611.49622628141, 305.7481131407048, 152.8740565703525, + 76.43702828517624, 38.21851414258813, 19.10925707129406, + 9.554628535647032, 4.777314267823516, 2.388657133911758, + 1.194328566955879, 0.5971642834779395, 0.2985821417389697, + 0.1492910708694849, 0.0746455354347424, ]); expect(tileGrid.origins_).to.be.an('array'); expect(tileGrid.origins_).to.have.length(22); expect(tileGrid.origins_).to.eql( - Array.apply(null, Array(22)).map(Array.prototype.valueOf, [ - -20037508, - 20037508, - ]) + Array.apply(null, Array(22)).map( + Array.prototype.valueOf, + [-20037508, 20037508] + ) ); expect(tileGrid.tileSizes_).to.be.an('array'); @@ -210,35 +182,21 @@ describe('ol.tilegrid.WMTS', function () { expect(tileGrid.resolutions_).to.be.an('array'); expect(tileGrid.resolutions_).to.have.length(20); expect(tileGrid.resolutions_).to.eql([ - 156543.033928041, - 78271.51696402048, - 39135.758482010235, - 19567.87924100512, - 9783.93962050256, - 4891.96981025128, - 2445.98490512564, - 1222.99245256282, - 611.49622628141, - 305.7481131407048, - 152.8740565703525, - 76.43702828517624, - 38.21851414258813, - 19.10925707129406, - 9.554628535647032, - 4.777314267823516, - 2.388657133911758, - 1.194328566955879, - 0.5971642834779395, - 0.2985821417389697, + 156543.033928041, 78271.51696402048, 39135.758482010235, + 19567.87924100512, 9783.93962050256, 4891.96981025128, 2445.98490512564, + 1222.99245256282, 611.49622628141, 305.7481131407048, 152.8740565703525, + 76.43702828517624, 38.21851414258813, 19.10925707129406, + 9.554628535647032, 4.777314267823516, 2.388657133911758, + 1.194328566955879, 0.5971642834779395, 0.2985821417389697, ]); expect(tileGrid.origins_).to.be.an('array'); expect(tileGrid.origins_).to.have.length(20); expect(tileGrid.origins_).to.eql( - Array.apply(null, Array(20)).map(Array.prototype.valueOf, [ - -20037508, - 20037508, - ]) + Array.apply(null, Array(20)).map( + Array.prototype.valueOf, + [-20037508, 20037508] + ) ); expect(tileGrid.tileSizes_).to.be.an('array'); @@ -264,17 +222,16 @@ describe('ol.tilegrid.WMTS', function () { expect(tileGrid.resolutions_).to.be.an('array'); expect(tileGrid.resolutions_).to.have.length(2); expect(tileGrid.resolutions_).to.eql([ - 156543.033928041, - 78271.51696402048, + 156543.033928041, 78271.51696402048, ]); expect(tileGrid.origins_).to.be.an('array'); expect(tileGrid.origins_).to.have.length(2); expect(tileGrid.origins_).to.eql( - Array.apply(null, Array(2)).map(Array.prototype.valueOf, [ - -20037508, - 20037508, - ]) + Array.apply(null, Array(2)).map( + Array.prototype.valueOf, + [-20037508, 20037508] + ) ); expect(tileGrid.tileSizes_).to.be.an('array'); diff --git a/test/browser/spec/ol/vectortile.test.js b/test/browser/spec/ol/vectortile.test.js index 6850b9f7f5..65846b0dd5 100644 --- a/test/browser/spec/ol/vectortile.test.js +++ b/test/browser/spec/ol/vectortile.test.js @@ -15,8 +15,7 @@ describe('ol.VectorTile', function () { const loader = tile.loader_; listen(tile, 'change', function (e) { expect(tile.getFeatures()[0].getGeometry().getFlatCoordinates()).to.eql([ - -9724792.346778862, - 4164041.638405114, + -9724792.346778862, 4164041.638405114, ]); done(); }); diff --git a/test/node/ol/array.test.js b/test/node/ol/array.test.js index 6f7b07b3d4..12bcc24bb4 100644 --- a/test/node/ol/array.test.js +++ b/test/node/ol/array.test.js @@ -126,22 +126,8 @@ describe('ol/array.js', function () { describe('default comparison on array of Number(s)', function () { const d = [ - -897123.9, - -321434.58758, - -1321.3124, - -324, - -9, - -3, - 0, - 0, - 0, - 0.31255, - 5, - 142.88888708, - 334, - 342, - 453, - 54254, + -897123.9, -321434.58758, -1321.3124, -324, -9, -3, 0, 0, 0, 0.31255, 5, + 142.88888708, 334, 342, 453, 54254, ]; it('should find -897123.9 at index 0', function () { expect(binarySearch(d, -897123.9)).to.be(0); @@ -187,22 +173,8 @@ describe('ol/array.js', function () { describe('custom comparison function, which reverse orders numbers', function () { const e = [ - 54254, - 453, - 342, - 334, - 142.88888708, - 5, - 0.31255, - 0, - 0, - 0, - -3, - -9, - -324, - -1321.3124, - -321434.58758, - -897123.9, + 54254, 453, 342, 334, 142.88888708, 5, 0.31255, 0, 0, 0, -3, -9, -324, + -1321.3124, -321434.58758, -897123.9, ]; it('should find 54254 at index 0', function () { const pos = binarySearch(e, 54254, revNumCompare); diff --git a/test/node/ol/extent.test.js b/test/node/ol/extent.test.js index 6147492c8c..28dbc2eec9 100644 --- a/test/node/ol/extent.test.js +++ b/test/node/ol/extent.test.js @@ -519,10 +519,12 @@ describe('ol/extent.js', function () { }); it('works for rotation', function () { - const extent = _ol_extent_.getForViewAndSize([0, 0], 1, Math.PI / 4, [ + const extent = _ol_extent_.getForViewAndSize( + [0, 0], 1, - 1, - ]); + Math.PI / 4, + [1, 1] + ); expect(extent[0]).to.roughlyEqual(-Math.sqrt(0.5), 1e-9); expect(extent[2]).to.roughlyEqual(Math.sqrt(0.5), 1e-9); expect(extent[1]).to.roughlyEqual(-Math.sqrt(0.5), 1e-9); @@ -889,85 +891,55 @@ describe('ol/extent.js', function () { it('leaves real world extent untouched', function () { expect(_ol_extent_.wrapX([16, 48, 18, 49], projection)).to.eql([ - 16, - 48, - 18, - 49, + 16, 48, 18, 49, ]); }); it('moves left world extent to real world', function () { expect(_ol_extent_.wrapX([-344, 48, -342, 49], projection)).to.eql([ - 16, - 48, - 18, - 49, + 16, 48, 18, 49, ]); }); it('moves right world extent to real world', function () { expect(_ol_extent_.wrapX([376, 48, 378, 49], projection)).to.eql([ - 16, - 48, - 18, - 49, + 16, 48, 18, 49, ]); }); it('moves far off left extent to real world', function () { expect(_ol_extent_.wrapX([-1064, 48, -1062, 49], projection)).to.eql([ - 16, - 48, - 18, - 49, + 16, 48, 18, 49, ]); }); it('moves far off right extent to real world', function () { expect(_ol_extent_.wrapX([1096, 48, 1098, 49], projection)).to.eql([ - 16, - 48, - 18, - 49, + 16, 48, 18, 49, ]); }); it('leaves -180 crossing extent with real world center untouched', function () { expect(_ol_extent_.wrapX([-184, 48, 16, 49], projection)).to.eql([ - -184, - 48, - 16, - 49, + -184, 48, 16, 49, ]); }); it('moves +180 crossing extent with off-world center to the real world', function () { expect(_ol_extent_.wrapX([300, 48, 376, 49], projection)).to.eql([ - -60, - 48, - 16, - 49, + -60, 48, 16, 49, ]); }); it('produces the same real world extent for shifted extents with center at +/-180', function () { expect(_ol_extent_.wrapX([360, -90, 720, 90], projection)).to.eql([ - -360, - -90, - 0, - 90, + -360, -90, 0, 90, ]); expect(_ol_extent_.wrapX([0, -90, 360, 90], projection)).to.eql([ - -360, - -90, - 0, - 90, + -360, -90, 0, 90, ]); expect(_ol_extent_.wrapX([-360, -90, 0, 90], projection)).to.eql([ - -360, - -90, - 0, - 90, + -360, -90, 0, 90, ]); }); }); diff --git a/test/node/ol/format/EsriJSON.test.js b/test/node/ol/format/EsriJSON.test.js index 35610e4886..695702e77d 100644 --- a/test/node/ol/format/EsriJSON.test.js +++ b/test/node/ol/format/EsriJSON.test.js @@ -391,12 +391,13 @@ describe('ol/format/EsriJSON.js', function () { const firstGeom = first.getGeometry(); expect(firstGeom).to.be.a(Polygon); expect( - equals(firstGeom.getExtent(), [ - -10585772.743554419, - 4712365.161160459, - -10579560.16462974, - 4716567.373073828, - ]) + equals( + firstGeom.getExtent(), + [ + -10585772.743554419, 4712365.161160459, -10579560.16462974, + 4716567.373073828, + ] + ) ).to.be(true); const last = result[8]; @@ -406,12 +407,13 @@ describe('ol/format/EsriJSON.js', function () { const lastGeom = last.getGeometry(); expect(lastGeom).to.be.a(Polygon); expect( - equals(lastGeom.getExtent(), [ - -10555714.026858449, - 4576511.565880965, - -10553671.199322715, - 4578554.9934867555, - ]) + equals( + lastGeom.getExtent(), + [ + -10555714.026858449, 4576511.565880965, -10553671.199322715, + 4578554.9934867555, + ] + ) ).to.be(true); }); }); diff --git a/test/node/ol/format/GeoJSON.test.js b/test/node/ol/format/GeoJSON.test.js index cf7ab2314c..16522d4aeb 100644 --- a/test/node/ol/format/GeoJSON.test.js +++ b/test/node/ol/format/GeoJSON.test.js @@ -358,12 +358,10 @@ describe('ol/format/GeoJSON.js', function () { const firstGeom = first.getGeometry(); expect(firstGeom).to.be.a(Polygon); expect( - equals(firstGeom.getExtent(), [ - 60.52843, - 29.318572, - 75.158028, - 38.486282, - ]) + equals( + firstGeom.getExtent(), + [60.52843, 29.318572, 75.158028, 38.486282] + ) ).to.be(true); const last = result[178]; @@ -373,12 +371,10 @@ describe('ol/format/GeoJSON.js', function () { const lastGeom = last.getGeometry(); expect(lastGeom).to.be.a(Polygon); expect( - equals(lastGeom.getExtent(), [ - 25.264226, - -22.271612, - 32.849861, - -15.507787, - ]) + equals( + lastGeom.getExtent(), + [25.264226, -22.271612, 32.849861, -15.507787] + ) ).to.be(true); }); diff --git a/test/node/ol/format/TopoJSON.test.js b/test/node/ol/format/TopoJSON.test.js index 32860edade..f629e8474e 100644 --- a/test/node/ol/format/TopoJSON.test.js +++ b/test/node/ol/format/TopoJSON.test.js @@ -93,9 +93,7 @@ describe('ol/format/TopoJSON.js', function () { expect(feature.get('prop0')).to.be('value0'); expect(geometry.getExtent()).to.eql([ - -70.08100810081008, - 12.417091709170947, - -69.9009900990099, + -70.08100810081008, 12.417091709170947, -69.9009900990099, 12.608069195591469, ]); }); @@ -138,29 +136,13 @@ describe('ol/format/TopoJSON.js', function () { const line = features[1].getGeometry(); expect(line.getType()).to.be('LineString'); expect(line.getFlatCoordinates()).to.eql([ - 102, - 0, - 103, - 1, - 104, - 0, - 105, - 1, + 102, 0, 103, 1, 104, 0, 105, 1, ]); const polygon = features[2].getGeometry(); expect(polygon.getType()).to.be('Polygon'); expect(polygon.getFlatCoordinates()).to.eql([ - 100, - 0, - 100, - 1, - 101, - 1, - 101, - 0, - 100, - 0, + 100, 0, 100, 1, 101, 1, 101, 0, 100, 0, ]); }); @@ -216,10 +198,7 @@ describe('ol/format/TopoJSON.js', function () { const firstGeom = first.getGeometry(); expect(firstGeom).to.be.a(MultiPolygon); expect(firstGeom.getExtent()).to.eql([ - -180, - -85.60903777459777, - 180, - 83.64513000000002, + -180, -85.60903777459777, 180, 83.64513000000002, ]); const last = features[177]; @@ -227,9 +206,7 @@ describe('ol/format/TopoJSON.js', function () { const lastGeom = last.getGeometry(); expect(lastGeom).to.be.a(Polygon); expect(lastGeom.getExtent()).to.eql([ - 25.26325263252633, - -22.271802279310577, - 32.848528485284874, + 25.26325263252633, -22.271802279310577, 32.848528485284874, -15.50833810039586, ]); }); diff --git a/test/node/ol/format/WKB.test.js b/test/node/ol/format/WKB.test.js index bc4a847be4..56ae1f5e4b 100644 --- a/test/node/ol/format/WKB.test.js +++ b/test/node/ol/format/WKB.test.js @@ -979,27 +979,8 @@ describe('ol/format/WKB.js', function () { it('returns the default projection', function () { const wkb = new Uint8Array([ // POINT(1 2) - 0x01, - 0x01, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xf0, - 0x3f, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x40, + 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, ]); const projection = format.readProjection(wkb); expect(projection).to.be(undefined); @@ -1008,30 +989,8 @@ describe('ol/format/WKB.js', function () { it('returns an embed projection', function () { const wkb = new Uint8Array([ // SRID=4326;POINT(1 2) - 0x01, - 0x01, - 0x00, - 0x00, - 0x20, - 0xe6, - 0x10, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xf0, - 0x3f, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x01, 0x01, 0x00, 0x00, 0x20, 0xe6, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, ]); const projection = format.readProjection(wkb); @@ -1066,27 +1025,8 @@ describe('ol/format/WKB.js', function () { it('transforms with dataProjection and featureProjection', function () { const wkb = new Uint8Array([ // POINT(1 2) - 0x01, - 0x01, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xf0, - 0x3f, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x40, + 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, ]); const geom = format.readGeometry(wkb, { dataProjection: 'EPSG:4326', @@ -1100,30 +1040,8 @@ describe('ol/format/WKB.js', function () { it('transforms with auto detection of dataProjection', function () { const wkb = new Uint8Array([ // SRID=4326;POINT(1 2) - 0x01, - 0x01, - 0x00, - 0x00, - 0x20, - 0xe6, - 0x10, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xf0, - 0x3f, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, + 0x01, 0x01, 0x00, 0x00, 0x20, 0xe6, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, ]); const geom = format.readGeometry(wkb, { diff --git a/test/node/ol/geom/MultiLineString.test.js b/test/node/ol/geom/MultiLineString.test.js index 8bf4c2a7ee..5fce4a137e 100644 --- a/test/node/ol/geom/MultiLineString.test.js +++ b/test/node/ol/geom/MultiLineString.test.js @@ -106,14 +106,7 @@ describe('ol/geom/MultiLineString.js', function () { it('has the expected flat coordinates', function () { expect(multiLineString.getFlatCoordinates()).to.eql([ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, + 1, 2, 3, 4, 5, 6, 7, 8, ]); }); @@ -176,18 +169,7 @@ describe('ol/geom/MultiLineString.js', function () { it('has the expected flat coordinates', function () { expect(multiLineString.getFlatCoordinates()).to.eql([ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ]); }); @@ -237,18 +219,7 @@ describe('ol/geom/MultiLineString.js', function () { it('has the expected flat coordinates', function () { expect(multiLineString.getFlatCoordinates()).to.eql([ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ]); }); @@ -277,49 +248,31 @@ describe('ol/geom/MultiLineString.js', function () { describe('with extrapolation and interpolation', function () { it('returns the expected value', function () { expect(multiLineString.getCoordinateAtM(0, true, true)).to.eql([ - 1, - 2, - 0, + 1, 2, 0, ]); expect(multiLineString.getCoordinateAtM(3, true, true)).to.eql([ - 1, - 2, - 3, + 1, 2, 3, ]); expect(multiLineString.getCoordinateAtM(4.5, true, true)).to.eql([ - 2.5, - 3.5, - 4.5, + 2.5, 3.5, 4.5, ]); expect(multiLineString.getCoordinateAtM(6, true, true)).to.eql([ - 4, - 5, - 6, + 4, 5, 6, ]); expect(multiLineString.getCoordinateAtM(7.5, true, true)).to.eql([ - 5.5, - 6.5, - 7.5, + 5.5, 6.5, 7.5, ]); expect(multiLineString.getCoordinateAtM(9, true, true)).to.eql([ - 7, - 8, - 9, + 7, 8, 9, ]); expect(multiLineString.getCoordinateAtM(10.5, true, true)).to.eql([ - 8.5, - 9.5, - 10.5, + 8.5, 9.5, 10.5, ]); expect(multiLineString.getCoordinateAtM(12, true, true)).to.eql([ - 10, - 11, - 12, + 10, 11, 12, ]); expect(multiLineString.getCoordinateAtM(15, true, true)).to.eql([ - 10, - 11, - 15, + 10, 11, 15, ]); }); }); @@ -327,47 +280,31 @@ describe('ol/geom/MultiLineString.js', function () { describe('with extrapolation and no interpolation', function () { it('returns the expected value', function () { expect(multiLineString.getCoordinateAtM(0, true, false)).to.eql([ - 1, - 2, - 0, + 1, 2, 0, ]); expect(multiLineString.getCoordinateAtM(3, true, false)).to.eql([ - 1, - 2, - 3, + 1, 2, 3, ]); expect(multiLineString.getCoordinateAtM(4.5, true, false)).to.eql([ - 2.5, - 3.5, - 4.5, + 2.5, 3.5, 4.5, ]); expect(multiLineString.getCoordinateAtM(6, true, false)).to.eql([ - 4, - 5, - 6, + 4, 5, 6, ]); expect(multiLineString.getCoordinateAtM(7.5, true, false)).to.be( null ); expect(multiLineString.getCoordinateAtM(9, true, false)).to.eql([ - 7, - 8, - 9, + 7, 8, 9, ]); expect(multiLineString.getCoordinateAtM(10.5, true, false)).to.eql([ - 8.5, - 9.5, - 10.5, + 8.5, 9.5, 10.5, ]); expect(multiLineString.getCoordinateAtM(12, true, false)).to.eql([ - 10, - 11, - 12, + 10, 11, 12, ]); expect(multiLineString.getCoordinateAtM(15, true, false)).to.eql([ - 10, - 11, - 15, + 10, 11, 15, ]); }); }); @@ -376,39 +313,25 @@ describe('ol/geom/MultiLineString.js', function () { it('returns the expected value', function () { expect(multiLineString.getCoordinateAtM(0, false, true)).to.eql(null); expect(multiLineString.getCoordinateAtM(3, false, true)).to.eql([ - 1, - 2, - 3, + 1, 2, 3, ]); expect(multiLineString.getCoordinateAtM(4.5, false, true)).to.eql([ - 2.5, - 3.5, - 4.5, + 2.5, 3.5, 4.5, ]); expect(multiLineString.getCoordinateAtM(6, false, true)).to.eql([ - 4, - 5, - 6, + 4, 5, 6, ]); expect(multiLineString.getCoordinateAtM(7.5, false, true)).to.eql([ - 5.5, - 6.5, - 7.5, + 5.5, 6.5, 7.5, ]); expect(multiLineString.getCoordinateAtM(9, false, true)).to.eql([ - 7, - 8, - 9, + 7, 8, 9, ]); expect(multiLineString.getCoordinateAtM(10.5, false, true)).to.eql([ - 8.5, - 9.5, - 10.5, + 8.5, 9.5, 10.5, ]); expect(multiLineString.getCoordinateAtM(12, false, true)).to.eql([ - 10, - 11, - 12, + 10, 11, 12, ]); expect(multiLineString.getCoordinateAtM(15, false, true)).to.eql( null @@ -422,37 +345,25 @@ describe('ol/geom/MultiLineString.js', function () { null ); expect(multiLineString.getCoordinateAtM(3, false, false)).to.eql([ - 1, - 2, - 3, + 1, 2, 3, ]); expect(multiLineString.getCoordinateAtM(4.5, false, false)).to.eql([ - 2.5, - 3.5, - 4.5, + 2.5, 3.5, 4.5, ]); expect(multiLineString.getCoordinateAtM(6, false, false)).to.eql([ - 4, - 5, - 6, + 4, 5, 6, ]); expect(multiLineString.getCoordinateAtM(7.5, false, false)).to.eql( null ); expect(multiLineString.getCoordinateAtM(9, false, false)).to.eql([ - 7, - 8, - 9, + 7, 8, 9, ]); expect(multiLineString.getCoordinateAtM(10.5, false, false)).to.eql([ - 8.5, - 9.5, - 10.5, + 8.5, 9.5, 10.5, ]); expect(multiLineString.getCoordinateAtM(12, false, false)).to.eql([ - 10, - 11, - 12, + 10, 11, 12, ]); expect(multiLineString.getCoordinateAtM(15, false, false)).to.eql( null @@ -500,22 +411,7 @@ describe('ol/geom/MultiLineString.js', function () { it('has the expected flat coordinates', function () { expect(multiLineString.getFlatCoordinates()).to.eql([ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ]); }); @@ -613,14 +509,7 @@ describe('ol/geom/MultiLineString.js', function () { ]); const multiLineString = new MultiLineString([lineString1, lineString2]); expect(multiLineString.getFlatCoordinates()).to.eql([ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, + 1, 2, 3, 4, 5, 6, 7, 8, ]); expect(multiLineString.getEnds()).to.eql([4, 8]); const coordinates = multiLineString.getCoordinates(); diff --git a/test/node/ol/geom/Polygon.test.js b/test/node/ol/geom/Polygon.test.js index b2a9576766..67f0ca1175 100644 --- a/test/node/ol/geom/Polygon.test.js +++ b/test/node/ol/geom/Polygon.test.js @@ -438,46 +438,8 @@ describe('ol/geom/Polygon.js', function () { ]; polygon = new Polygon([outerRing, innerRing1, innerRing2]); flatCoordinates = [ - 0, - 6, - 1, - 2, - 6, - 6, - 3, - 4, - 3, - 0, - 5, - 6, - 2, - 4, - 7, - 8, - 4, - 4, - 9, - 10, - 4, - 5, - 11, - 12, - 2, - 5, - 13, - 14, - 3, - 2, - 15, - 16, - 4, - 3, - 17, - 18, - 2, - 3, - 19, - 20, + 0, 6, 1, 2, 6, 6, 3, 4, 3, 0, 5, 6, 2, 4, 7, 8, 4, 4, 9, 10, 4, 5, 11, + 12, 2, 5, 13, 14, 3, 2, 15, 16, 4, 3, 17, 18, 2, 3, 19, 20, ]; outsideOuter = [1, 1]; inside = [3, 1]; diff --git a/test/node/ol/geom/flat/closest.test.js b/test/node/ol/geom/flat/closest.test.js index 7e37eb8ea2..65aee09896 100644 --- a/test/node/ol/geom/flat/closest.test.js +++ b/test/node/ol/geom/flat/closest.test.js @@ -89,206 +89,29 @@ describe('ol/geom/flat/closest.js', function () { describe('with real data', function () { const flatCoordinates = [ - 224.55, - 250.15, - 226.91, - 244.19, - 233.31, - 241.45, - 234.98, - 236.06, - 244.21, - 232.76, - 262.59, - 215.31, - 267.76, - 213.81, - 273.57, - 201.84, - 273.12, - 192.16, - 277.62, - 189.03, - 280.36, - 181.41, - 286.51, - 177.74, - 292.41, - 159.37, - 296.91, - 155.64, - 314.95, - 151.37, - 319.75, - 145.16, - 330.33, - 137.57, - 341.48, - 139.96, - 369.98, - 137.89, - 387.39, - 142.51, - 391.28, - 139.39, - 409.52, - 141.14, - 414.82, - 139.75, - 427.72, - 127.3, - 439.6, - 119.74, - 474.93, - 107.87, - 486.51, - 106.75, - 489.2, - 109.45, - 493.79, - 108.63, - 504.74, - 119.66, - 512.96, - 122.35, - 518.63, - 120.89, - 524.09, - 126.88, - 529.57, - 127.86, - 534.21, - 140.93, - 539.27, - 147.24, - 567.69, - 148.91, - 575.25, - 157.26, - 580.62, - 158.15, - 601.53, - 156.85, - 617.74, - 159.86, - 622.0, - 167.04, - 629.55, - 194.6, - 638.9, - 195.61, - 641.26, - 200.81, - 651.77, - 204.56, - 671.55, - 222.55, - 683.68, - 217.45, - 695.25, - 219.15, - 700.64, - 217.98, - 703.12, - 214.36, - 712.26, - 215.87, - 721.49, - 212.81, - 727.81, - 213.36, - 729.98, - 208.73, - 735.32, - 208.2, - 739.94, - 204.77, - 769.98, - 208.42, - 779.6, - 216.87, - 784.2, - 218.16, - 800.24, - 214.62, - 810.53, - 219.73, - 817.19, - 226.82, - 820.77, - 236.17, - 827.23, - 236.16, - 829.89, - 239.89, - 851.0, - 248.94, - 859.88, - 255.49, - 865.21, - 268.53, - 857.95, - 280.3, - 865.48, - 291.45, - 866.81, - 298.66, - 864.68, - 302.71, - 867.79, - 306.17, - 859.87, - 311.37, - 860.08, - 314.35, - 858.29, - 314.94, - 858.1, - 327.6, - 854.54, - 335.4, - 860.92, - 343.0, - 856.43, - 350.15, - 851.42, - 352.96, - 849.84, - 359.59, - 854.56, - 365.53, - 849.74, - 370.38, - 844.09, - 371.89, - 844.75, - 380.44, - 841.52, - 383.67, - 839.57, - 390.4, - 845.59, - 399.05, - 848.4, - 407.55, - 843.71, - 411.3, - 844.09, - 419.88, - 839.51, - 432.76, - 841.33, - 441.04, - 847.62, - 449.22, - 847.16, - 458.44, - 851.38, - 462.79, - 853.97, - 471.15, - 866.36, - 480.77, + 224.55, 250.15, 226.91, 244.19, 233.31, 241.45, 234.98, 236.06, 244.21, + 232.76, 262.59, 215.31, 267.76, 213.81, 273.57, 201.84, 273.12, 192.16, + 277.62, 189.03, 280.36, 181.41, 286.51, 177.74, 292.41, 159.37, 296.91, + 155.64, 314.95, 151.37, 319.75, 145.16, 330.33, 137.57, 341.48, 139.96, + 369.98, 137.89, 387.39, 142.51, 391.28, 139.39, 409.52, 141.14, 414.82, + 139.75, 427.72, 127.3, 439.6, 119.74, 474.93, 107.87, 486.51, 106.75, + 489.2, 109.45, 493.79, 108.63, 504.74, 119.66, 512.96, 122.35, 518.63, + 120.89, 524.09, 126.88, 529.57, 127.86, 534.21, 140.93, 539.27, 147.24, + 567.69, 148.91, 575.25, 157.26, 580.62, 158.15, 601.53, 156.85, 617.74, + 159.86, 622.0, 167.04, 629.55, 194.6, 638.9, 195.61, 641.26, 200.81, + 651.77, 204.56, 671.55, 222.55, 683.68, 217.45, 695.25, 219.15, 700.64, + 217.98, 703.12, 214.36, 712.26, 215.87, 721.49, 212.81, 727.81, 213.36, + 729.98, 208.73, 735.32, 208.2, 739.94, 204.77, 769.98, 208.42, 779.6, + 216.87, 784.2, 218.16, 800.24, 214.62, 810.53, 219.73, 817.19, 226.82, + 820.77, 236.17, 827.23, 236.16, 829.89, 239.89, 851.0, 248.94, 859.88, + 255.49, 865.21, 268.53, 857.95, 280.3, 865.48, 291.45, 866.81, 298.66, + 864.68, 302.71, 867.79, 306.17, 859.87, 311.37, 860.08, 314.35, 858.29, + 314.94, 858.1, 327.6, 854.54, 335.4, 860.92, 343.0, 856.43, 350.15, + 851.42, 352.96, 849.84, 359.59, 854.56, 365.53, 849.74, 370.38, 844.09, + 371.89, 844.75, 380.44, 841.52, 383.67, 839.57, 390.4, 845.59, 399.05, + 848.4, 407.55, 843.71, 411.3, 844.09, 419.88, 839.51, 432.76, 841.33, + 441.04, 847.62, 449.22, 847.16, 458.44, 851.38, 462.79, 853.97, 471.15, + 866.36, 480.77, ]; describe('maxSquaredDelta', function () { diff --git a/test/node/ol/geom/flat/contains.test.js b/test/node/ol/geom/flat/contains.test.js index 6fdb20df5c..26f62e46e6 100644 --- a/test/node/ol/geom/flat/contains.test.js +++ b/test/node/ol/geom/flat/contains.test.js @@ -5,26 +5,7 @@ describe('ol/geom/flat/contains.js', function () { describe('with simple data', function () { const flatCoordinatesSimple = [0, 0, 1, 0, 1, 1, 0, 1]; const flatCoordinatesNonSimple = [ - 0, - 0, - 4, - 0, - 4, - 3, - 1, - 3, - 1, - 2, - 3, - 2, - 3, - 1, - 2, - 1, - 2, - 4, - 0, - 4, + 0, 0, 4, 0, 4, 3, 1, 3, 1, 2, 3, 2, 3, 1, 2, 1, 2, 4, 0, 4, ]; describe('linearRingContainsXY', function () { diff --git a/test/node/ol/geom/flat/intersectsextent.test.js b/test/node/ol/geom/flat/intersectsextent.test.js index a149cbcffe..49484da6e5 100644 --- a/test/node/ol/geom/flat/intersectsextent.test.js +++ b/test/node/ol/geom/flat/intersectsextent.test.js @@ -144,32 +144,8 @@ describe('ol/geom/flat/intersectsextent.js', function () { let ends; beforeEach(function () { flatCoordinates = [ - 0, - 0, - 0, - 10, - 10, - 10, - 10, - 0, - 0, - 0, - /*hole*/ 2, - 2, - 8, - 2, - 8, - 4, - 5, - 5, - 8, - 6, - 8, - 8, - 2, - 8, - 2, - 2, + 0, 0, 0, 10, 10, 10, 10, 0, 0, 0, /*hole*/ 2, 2, 8, 2, 8, 4, 5, 5, 8, 6, + 8, 8, 2, 8, 2, 2, ]; ends = [10, flatCoordinates.length]; }); diff --git a/test/node/ol/geom/flat/orient.test.js b/test/node/ol/geom/flat/orient.test.js index f93949ac9e..8ddc4246b3 100644 --- a/test/node/ol/geom/flat/orient.test.js +++ b/test/node/ol/geom/flat/orient.test.js @@ -91,49 +91,13 @@ describe('ol/geom/flat/orient.js', function () { const oriented = linearRingsAreOriented; const rightCoords = [ - -180, - -90, - 180, - -90, - 180, - 90, - -180, - 90, - -180, - -90, - -100, - -45, - -100, - 45, - 100, - 45, - 100, - -45, - -100, - -45, + -180, -90, 180, -90, 180, 90, -180, 90, -180, -90, -100, -45, -100, 45, + 100, 45, 100, -45, -100, -45, ]; const leftCoords = [ - -180, - -90, - -180, - 90, - 180, - 90, - 180, - -90, - -180, - -90, - -100, - -45, - 100, - -45, - 100, - 45, - -100, - 45, - -100, - -45, + -180, -90, -180, 90, 180, 90, 180, -90, -180, -90, -100, -45, 100, -45, + 100, 45, -100, 45, -100, -45, ]; const ends = [10, 20]; @@ -153,89 +117,15 @@ describe('ol/geom/flat/orient.js', function () { const oriented = linearRingssAreOriented; const rightCoords = [ - -180, - -90, - 180, - -90, - 180, - 90, - -180, - 90, - -180, - -90, - -100, - -45, - -100, - 45, - 100, - 45, - 100, - -45, - -100, - -45, - -180, - -90, - 180, - -90, - 180, - 90, - -180, - 90, - -180, - -90, - -100, - -45, - -100, - 45, - 100, - 45, - 100, - -45, - -100, - -45, + -180, -90, 180, -90, 180, 90, -180, 90, -180, -90, -100, -45, -100, 45, + 100, 45, 100, -45, -100, -45, -180, -90, 180, -90, 180, 90, -180, 90, + -180, -90, -100, -45, -100, 45, 100, 45, 100, -45, -100, -45, ]; const leftCoords = [ - -180, - -90, - -180, - 90, - 180, - 90, - 180, - -90, - -180, - -90, - -100, - -45, - 100, - -45, - 100, - 45, - -100, - 45, - -100, - -45, - -180, - -90, - -180, - 90, - 180, - 90, - 180, - -90, - -180, - -90, - -100, - -45, - 100, - -45, - 100, - 45, - -100, - 45, - -100, - -45, + -180, -90, -180, 90, 180, 90, 180, -90, -180, -90, -100, -45, 100, -45, + 100, 45, -100, 45, -100, -45, -180, -90, -180, 90, 180, 90, 180, -90, + -180, -90, -100, -45, 100, -45, 100, 45, -100, 45, -100, -45, ]; const ends = [ @@ -258,49 +148,13 @@ describe('ol/geom/flat/orient.js', function () { const orient = orientLinearRings; const rightCoords = [ - -180, - -90, - 180, - -90, - 180, - 90, - -180, - 90, - -180, - -90, - -100, - -45, - -100, - 45, - 100, - 45, - 100, - -45, - -100, - -45, + -180, -90, 180, -90, 180, 90, -180, 90, -180, -90, -100, -45, -100, 45, + 100, 45, 100, -45, -100, -45, ]; const leftCoords = [ - -180, - -90, - -180, - 90, - 180, - 90, - 180, - -90, - -180, - -90, - -100, - -45, - 100, - -45, - 100, - 45, - -100, - 45, - -100, - -45, + -180, -90, -180, 90, 180, 90, 180, -90, -180, -90, -100, -45, 100, -45, + 100, 45, -100, 45, -100, -45, ]; const ends = [10, 20]; @@ -330,89 +184,15 @@ describe('ol/geom/flat/orient.js', function () { const orient = orientLinearRingsArray; const rightCoords = [ - -180, - -90, - 180, - -90, - 180, - 90, - -180, - 90, - -180, - -90, - -100, - -45, - -100, - 45, - 100, - 45, - 100, - -45, - -100, - -45, - -180, - -90, - 180, - -90, - 180, - 90, - -180, - 90, - -180, - -90, - -100, - -45, - -100, - 45, - 100, - 45, - 100, - -45, - -100, - -45, + -180, -90, 180, -90, 180, 90, -180, 90, -180, -90, -100, -45, -100, 45, + 100, 45, 100, -45, -100, -45, -180, -90, 180, -90, 180, 90, -180, 90, + -180, -90, -100, -45, -100, 45, 100, 45, 100, -45, -100, -45, ]; const leftCoords = [ - -180, - -90, - -180, - 90, - 180, - 90, - 180, - -90, - -180, - -90, - -100, - -45, - 100, - -45, - 100, - 45, - -100, - 45, - -100, - -45, - -180, - -90, - -180, - 90, - 180, - 90, - 180, - -90, - -180, - -90, - -100, - -45, - 100, - -45, - 100, - 45, - -100, - 45, - -100, - -45, + -180, -90, -180, 90, 180, 90, 180, -90, -180, -90, -100, -45, 100, -45, + 100, 45, -100, 45, -100, -45, -180, -90, -180, 90, 180, 90, 180, -90, + -180, -90, -100, -45, 100, -45, 100, 45, -100, 45, -100, -45, ]; const ends = [ diff --git a/test/node/ol/geom/flat/reverse.test.js b/test/node/ol/geom/flat/reverse.test.js index ed35229753..5d997044ba 100644 --- a/test/node/ol/geom/flat/reverse.test.js +++ b/test/node/ol/geom/flat/reverse.test.js @@ -94,41 +94,11 @@ describe('ol/geom/flat/reverse.js', function () { it('can reverse four flat coordinates', function () { const flatCoordinates = [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ]; reverseCoordinates(flatCoordinates, 0, flatCoordinates.length, 4); expect(flatCoordinates).to.eql([ - 13, - 14, - 15, - 16, - 9, - 10, - 11, - 12, - 5, - 6, - 7, - 8, - 1, - 2, - 3, - 4, + 13, 14, 15, 16, 9, 10, 11, 12, 5, 6, 7, 8, 1, 2, 3, 4, ]); }); }); diff --git a/test/node/ol/geom/flat/simplify.test.js b/test/node/ol/geom/flat/simplify.test.js index 0648610c83..b70f16ac01 100644 --- a/test/node/ol/geom/flat/simplify.test.js +++ b/test/node/ol/geom/flat/simplify.test.js @@ -8,529 +8,74 @@ import { describe('ol/geom/flat/simplify.js', function () { const flatCoordinates = [ - 224.55, - 250.15, - 226.91, - 244.19, - 233.31, - 241.45, - 234.98, - 236.06, - 244.21, - 232.76, - 262.59, - 215.31, - 267.76, - 213.81, - 273.57, - 201.84, - 273.12, - 192.16, - 277.62, - 189.03, - 280.36, - 181.41, - 286.51, - 177.74, - 292.41, - 159.37, - 296.91, - 155.64, - 314.95, - 151.37, - 319.75, - 145.16, - 330.33, - 137.57, - 341.48, - 139.96, - 369.98, - 137.89, - 387.39, - 142.51, - 391.28, - 139.39, - 409.52, - 141.14, - 414.82, - 139.75, - 427.72, - 127.3, - 439.6, - 119.74, - 474.93, - 107.87, - 486.51, - 106.75, - 489.2, - 109.45, - 493.79, - 108.63, - 504.74, - 119.66, - 512.96, - 122.35, - 518.63, - 120.89, - 524.09, - 126.88, - 529.57, - 127.86, - 534.21, - 140.93, - 539.27, - 147.24, - 567.69, - 148.91, - 575.25, - 157.26, - 580.62, - 158.15, - 601.53, - 156.85, - 617.74, - 159.86, - 622.0, - 167.04, - 629.55, - 194.6, - 638.9, - 195.61, - 641.26, - 200.81, - 651.77, - 204.56, - 671.55, - 222.55, - 683.68, - 217.45, - 695.25, - 219.15, - 700.64, - 217.98, - 703.12, - 214.36, - 712.26, - 215.87, - 721.49, - 212.81, - 727.81, - 213.36, - 729.98, - 208.73, - 735.32, - 208.2, - 739.94, - 204.77, - 769.98, - 208.42, - 779.6, - 216.87, - 784.2, - 218.16, - 800.24, - 214.62, - 810.53, - 219.73, - 817.19, - 226.82, - 820.77, - 236.17, - 827.23, - 236.16, - 829.89, - 239.89, - 851.0, - 248.94, - 859.88, - 255.49, - 865.21, - 268.53, - 857.95, - 280.3, - 865.48, - 291.45, - 866.81, - 298.66, - 864.68, - 302.71, - 867.79, - 306.17, - 859.87, - 311.37, - 860.08, - 314.35, - 858.29, - 314.94, - 858.1, - 327.6, - 854.54, - 335.4, - 860.92, - 343.0, - 856.43, - 350.15, - 851.42, - 352.96, - 849.84, - 359.59, - 854.56, - 365.53, - 849.74, - 370.38, - 844.09, - 371.89, - 844.75, - 380.44, - 841.52, - 383.67, - 839.57, - 390.4, - 845.59, - 399.05, - 848.4, - 407.55, - 843.71, - 411.3, - 844.09, - 419.88, - 839.51, - 432.76, - 841.33, - 441.04, - 847.62, - 449.22, - 847.16, - 458.44, - 851.38, - 462.79, - 853.97, - 471.15, - 866.36, - 480.77, + 224.55, 250.15, 226.91, 244.19, 233.31, 241.45, 234.98, 236.06, 244.21, + 232.76, 262.59, 215.31, 267.76, 213.81, 273.57, 201.84, 273.12, 192.16, + 277.62, 189.03, 280.36, 181.41, 286.51, 177.74, 292.41, 159.37, 296.91, + 155.64, 314.95, 151.37, 319.75, 145.16, 330.33, 137.57, 341.48, 139.96, + 369.98, 137.89, 387.39, 142.51, 391.28, 139.39, 409.52, 141.14, 414.82, + 139.75, 427.72, 127.3, 439.6, 119.74, 474.93, 107.87, 486.51, 106.75, 489.2, + 109.45, 493.79, 108.63, 504.74, 119.66, 512.96, 122.35, 518.63, 120.89, + 524.09, 126.88, 529.57, 127.86, 534.21, 140.93, 539.27, 147.24, 567.69, + 148.91, 575.25, 157.26, 580.62, 158.15, 601.53, 156.85, 617.74, 159.86, + 622.0, 167.04, 629.55, 194.6, 638.9, 195.61, 641.26, 200.81, 651.77, 204.56, + 671.55, 222.55, 683.68, 217.45, 695.25, 219.15, 700.64, 217.98, 703.12, + 214.36, 712.26, 215.87, 721.49, 212.81, 727.81, 213.36, 729.98, 208.73, + 735.32, 208.2, 739.94, 204.77, 769.98, 208.42, 779.6, 216.87, 784.2, 218.16, + 800.24, 214.62, 810.53, 219.73, 817.19, 226.82, 820.77, 236.17, 827.23, + 236.16, 829.89, 239.89, 851.0, 248.94, 859.88, 255.49, 865.21, 268.53, + 857.95, 280.3, 865.48, 291.45, 866.81, 298.66, 864.68, 302.71, 867.79, + 306.17, 859.87, 311.37, 860.08, 314.35, 858.29, 314.94, 858.1, 327.6, + 854.54, 335.4, 860.92, 343.0, 856.43, 350.15, 851.42, 352.96, 849.84, + 359.59, 854.56, 365.53, 849.74, 370.38, 844.09, 371.89, 844.75, 380.44, + 841.52, 383.67, 839.57, 390.4, 845.59, 399.05, 848.4, 407.55, 843.71, 411.3, + 844.09, 419.88, 839.51, 432.76, 841.33, 441.04, 847.62, 449.22, 847.16, + 458.44, 851.38, 462.79, 853.97, 471.15, 866.36, 480.77, ]; const simplifiedRadiallyFlatCoordinates = [ - 224.55, - 250.15, - 226.91, - 244.19, - 233.31, - 241.45, - 234.98, - 236.06, - 244.21, - 232.76, - 262.59, - 215.31, - 267.76, - 213.81, - 273.57, - 201.84, - 273.12, - 192.16, - 277.62, - 189.03, - 280.36, - 181.41, - 286.51, - 177.74, - 292.41, - 159.37, - 296.91, - 155.64, - 314.95, - 151.37, - 319.75, - 145.16, - 330.33, - 137.57, - 341.48, - 139.96, - 369.98, - 137.89, - 387.39, - 142.51, - 409.52, - 141.14, - 414.82, - 139.75, - 427.72, - 127.3, - 439.6, - 119.74, - 474.93, - 107.87, - 486.51, - 106.75, - 493.79, - 108.63, - 504.74, - 119.66, - 512.96, - 122.35, - 518.63, - 120.89, - 524.09, - 126.88, - 529.57, - 127.86, - 534.21, - 140.93, - 539.27, - 147.24, - 567.69, - 148.91, - 575.25, - 157.26, - 580.62, - 158.15, - 601.53, - 156.85, - 617.74, - 159.86, - 622.0, - 167.04, - 629.55, - 194.6, - 638.9, - 195.61, - 641.26, - 200.81, - 651.77, - 204.56, - 671.55, - 222.55, - 683.68, - 217.45, - 695.25, - 219.15, - 700.64, - 217.98, - 712.26, - 215.87, - 721.49, - 212.81, - 727.81, - 213.36, - 729.98, - 208.73, - 735.32, - 208.2, - 739.94, - 204.77, - 769.98, - 208.42, - 779.6, - 216.87, - 800.24, - 214.62, - 810.53, - 219.73, - 817.19, - 226.82, - 820.77, - 236.17, - 827.23, - 236.16, - 851.0, - 248.94, - 859.88, - 255.49, - 865.21, - 268.53, - 857.95, - 280.3, - 865.48, - 291.45, - 866.81, - 298.66, - 867.79, - 306.17, - 859.87, - 311.37, - 858.1, - 327.6, - 854.54, - 335.4, - 860.92, - 343.0, - 856.43, - 350.15, - 851.42, - 352.96, - 849.84, - 359.59, - 854.56, - 365.53, - 849.74, - 370.38, - 844.09, - 371.89, - 844.75, - 380.44, - 839.57, - 390.4, - 845.59, - 399.05, - 848.4, - 407.55, - 843.71, - 411.3, - 844.09, - 419.88, - 839.51, - 432.76, - 841.33, - 441.04, - 847.62, - 449.22, - 847.16, - 458.44, - 851.38, - 462.79, - 853.97, - 471.15, - 866.36, + 224.55, 250.15, 226.91, 244.19, 233.31, 241.45, 234.98, 236.06, 244.21, + 232.76, 262.59, 215.31, 267.76, 213.81, 273.57, 201.84, 273.12, 192.16, + 277.62, 189.03, 280.36, 181.41, 286.51, 177.74, 292.41, 159.37, 296.91, + 155.64, 314.95, 151.37, 319.75, 145.16, 330.33, 137.57, 341.48, 139.96, + 369.98, 137.89, 387.39, 142.51, 409.52, 141.14, 414.82, 139.75, 427.72, + 127.3, 439.6, 119.74, 474.93, 107.87, 486.51, 106.75, 493.79, 108.63, + 504.74, 119.66, 512.96, 122.35, 518.63, 120.89, 524.09, 126.88, 529.57, + 127.86, 534.21, 140.93, 539.27, 147.24, 567.69, 148.91, 575.25, 157.26, + 580.62, 158.15, 601.53, 156.85, 617.74, 159.86, 622.0, 167.04, 629.55, + 194.6, 638.9, 195.61, 641.26, 200.81, 651.77, 204.56, 671.55, 222.55, + 683.68, 217.45, 695.25, 219.15, 700.64, 217.98, 712.26, 215.87, 721.49, + 212.81, 727.81, 213.36, 729.98, 208.73, 735.32, 208.2, 739.94, 204.77, + 769.98, 208.42, 779.6, 216.87, 800.24, 214.62, 810.53, 219.73, 817.19, + 226.82, 820.77, 236.17, 827.23, 236.16, 851.0, 248.94, 859.88, 255.49, + 865.21, 268.53, 857.95, 280.3, 865.48, 291.45, 866.81, 298.66, 867.79, + 306.17, 859.87, 311.37, 858.1, 327.6, 854.54, 335.4, 860.92, 343.0, 856.43, + 350.15, 851.42, 352.96, 849.84, 359.59, 854.56, 365.53, 849.74, 370.38, + 844.09, 371.89, 844.75, 380.44, 839.57, 390.4, 845.59, 399.05, 848.4, + 407.55, 843.71, 411.3, 844.09, 419.88, 839.51, 432.76, 841.33, 441.04, + 847.62, 449.22, 847.16, 458.44, 851.38, 462.79, 853.97, 471.15, 866.36, 480.77, ]; const simplifiedFlatCoordinates = [ - 224.55, - 250.15, - 267.76, - 213.81, - 296.91, - 155.64, - 330.33, - 137.57, - 409.52, - 141.14, - 439.6, - 119.74, - 486.51, - 106.75, - 529.57, - 127.86, - 539.27, - 147.24, - 617.74, - 159.86, - 629.55, - 194.6, - 671.55, - 222.55, - 727.81, - 213.36, - 739.94, - 204.77, - 769.98, - 208.42, - 779.6, - 216.87, - 800.24, - 214.62, - 820.77, - 236.17, - 859.88, - 255.49, - 865.21, - 268.53, - 857.95, - 280.3, - 867.79, - 306.17, - 859.87, - 311.37, - 854.54, - 335.4, - 860.92, - 343.0, - 849.84, - 359.59, - 854.56, - 365.53, - 844.09, - 371.89, - 839.57, - 390.4, - 848.4, - 407.55, - 839.51, - 432.76, - 853.97, - 471.15, - 866.36, - 480.77, + 224.55, 250.15, 267.76, 213.81, 296.91, 155.64, 330.33, 137.57, 409.52, + 141.14, 439.6, 119.74, 486.51, 106.75, 529.57, 127.86, 539.27, 147.24, + 617.74, 159.86, 629.55, 194.6, 671.55, 222.55, 727.81, 213.36, 739.94, + 204.77, 769.98, 208.42, 779.6, 216.87, 800.24, 214.62, 820.77, 236.17, + 859.88, 255.49, 865.21, 268.53, 857.95, 280.3, 867.79, 306.17, 859.87, + 311.37, 854.54, 335.4, 860.92, 343.0, 849.84, 359.59, 854.56, 365.53, + 844.09, 371.89, 839.57, 390.4, 848.4, 407.55, 839.51, 432.76, 853.97, + 471.15, 866.36, 480.77, ]; const simplifiedHighQualityFlatCoordinates = [ - 224.55, - 250.15, - 267.76, - 213.81, - 296.91, - 155.64, - 330.33, - 137.57, - 409.52, - 141.14, - 439.6, - 119.74, - 486.51, - 106.75, - 529.57, - 127.86, - 539.27, - 147.24, - 617.74, - 159.86, - 629.55, - 194.6, - 671.55, - 222.55, - 727.81, - 213.36, - 739.94, - 204.77, - 769.98, - 208.42, - 784.2, - 218.16, - 800.24, - 214.62, - 820.77, - 236.17, - 859.88, - 255.49, - 865.21, - 268.53, - 857.95, - 280.3, - 867.79, - 306.17, - 858.29, - 314.94, - 854.54, - 335.4, - 860.92, - 343.0, - 849.84, - 359.59, - 854.56, - 365.53, - 844.09, - 371.89, - 839.57, - 390.4, - 848.4, - 407.55, - 839.51, - 432.76, - 853.97, - 471.15, - 866.36, - 480.77, + 224.55, 250.15, 267.76, 213.81, 296.91, 155.64, 330.33, 137.57, 409.52, + 141.14, 439.6, 119.74, 486.51, 106.75, 529.57, 127.86, 539.27, 147.24, + 617.74, 159.86, 629.55, 194.6, 671.55, 222.55, 727.81, 213.36, 739.94, + 204.77, 769.98, 208.42, 784.2, 218.16, 800.24, 214.62, 820.77, 236.17, + 859.88, 255.49, 865.21, 268.53, 857.95, 280.3, 867.79, 306.17, 858.29, + 314.94, 854.54, 335.4, 860.92, 343.0, 849.84, 359.59, 854.56, 365.53, + 844.09, 371.89, 839.57, 390.4, 848.4, 407.55, 839.51, 432.76, 853.97, + 471.15, 866.36, 480.77, ]; describe('simplifyLineString', function () { diff --git a/test/node/ol/geom/flat/straightchunk.test.js b/test/node/ol/geom/flat/straightchunk.test.js index e1f6efa2e1..dc89283af9 100644 --- a/test/node/ol/geom/flat/straightchunk.test.js +++ b/test/node/ol/geom/flat/straightchunk.test.js @@ -35,24 +35,7 @@ describe('ol/geom/flat/straightchunk.js', function () { describe('longer line string', function () { const flatCoords = [ - 0, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 0, - -1, - -1, - -1, - -1, - 0, - -1, - 2, - -2, - 4, + 0, 0, 1, 0, 1, 1, 0, 1, 0, -1, -1, -1, -1, 0, -1, 2, -2, 4, ]; const stride = 2; diff --git a/test/node/ol/geom/flat/transform.test.js b/test/node/ol/geom/flat/transform.test.js index 15a2471956..2c041b5498 100644 --- a/test/node/ol/geom/flat/transform.test.js +++ b/test/node/ol/geom/flat/transform.test.js @@ -32,11 +32,7 @@ describe('ol/geom/flat/transform.js', function () { ], ]).transform('EPSG:4326', 'EPSG:3857'); const transform = [ - 0.0004088332670837288, - 0, - 0, - -0.0004088332670837288, - 4480.991370439071, + 0.0004088332670837288, 0, 0, -0.0004088332670837288, 4480.991370439071, 1529.5752568707105, ]; const pixelCoordinates = transformGeom2D( @@ -112,36 +108,8 @@ describe('ol/geom/flat/transform.js', function () { flatCoordinates ); expect(flatCoordinates).to.eql([ - 1, - 2, - 2, - 1, - 3, - 2, - 2, - 3, - 2, - 2, - 2, - 2, - 1, - 2, - 2, - 3, - 4, - 3, - 3, - 5, - 3, - 4, - 5, - 3, - 4, - 4, - 3, - 3, - 4, - 3, + 1, 2, 2, 1, 3, 2, 2, 3, 2, 2, 2, 2, 1, 2, 2, 3, 4, 3, 3, 5, 3, 4, 5, 3, + 4, 4, 3, 3, 4, 3, ]); }); }); diff --git a/test/node/ol/proj.test.js b/test/node/ol/proj.test.js index 68def7cdf3..057c860764 100644 --- a/test/node/ol/proj.test.js +++ b/test/node/ol/proj.test.js @@ -673,12 +673,8 @@ describe('ol/proj.js', function () { expect(typeof transform).to.be('function'); const output = transform([ - -626172.13571216376, - 6887893.4928337997, - -12000000, - 5000000, - -626172.13571216376, - 6887893.4928337997, + -626172.13571216376, 6887893.4928337997, -12000000, 5000000, + -626172.13571216376, 6887893.4928337997, ]); expect(output[0]).to.roughlyEqual(-5.625, 1e-9); @@ -710,15 +706,8 @@ describe('ol/proj.js', function () { const dimension = 3; const output = transform( [ - -626172.13571216376, - 6887893.4928337997, - 100, - -12000000, - 5000000, - 200, - -626172.13571216376, - 6887893.4928337997, - 300, + -626172.13571216376, 6887893.4928337997, 100, -12000000, 5000000, 200, + -626172.13571216376, 6887893.4928337997, 300, ], undefined, dimension diff --git a/test/node/ol/tilegrid/TileGrid.test.js b/test/node/ol/tilegrid/TileGrid.test.js index 4353b1ed1f..a3cfb3c816 100644 --- a/test/node/ol/tilegrid/TileGrid.test.js +++ b/test/node/ol/tilegrid/TileGrid.test.js @@ -328,9 +328,7 @@ describe('ol/tilegrid/TileGrid.js', function () { beforeEach(function () { tileGrid = new TileGrid({ extent: [ - 343870.8496458133, - 5809157.009546259, - 1905238.0275122682, + 343870.8496458133, 5809157.009546259, 1905238.0275122682, 7515502.7821859205, ], sizes: [ @@ -340,9 +338,7 @@ describe('ol/tilegrid/TileGrid.js', function () { [11, 16], ], resolutions: [ - 4174.778550445067, - 2087.3892752225333, - 1043.6946376112667, + 4174.778550445067, 2087.3892752225333, 1043.6946376112667, 521.8473188056333, ], tileSizes: [ diff --git a/test/node/ol/vec/mat4.test.js b/test/node/ol/vec/mat4.test.js index 66a8264804..8f5ecb9b49 100644 --- a/test/node/ol/vec/mat4.test.js +++ b/test/node/ol/vec/mat4.test.js @@ -13,22 +13,7 @@ describe('ol/vec/mat4.js', function () { const transform = [1, 2, 3, 4, 5, 6]; const result = create(); expect(fromTransform(result, transform)).to.eql([ - 1, - 2, - 0, - 0, - 3, - 4, - 0, - 0, - 0, - 0, - 1, - 0, - 5, - 6, - 0, - 1, + 1, 2, 0, 0, 3, 4, 0, 0, 0, 0, 1, 0, 5, 6, 0, 1, ]); expect(result).to.eql([1, 2, 0, 0, 3, 4, 0, 0, 0, 0, 1, 0, 5, 6, 0, 1]); }); diff --git a/test/rendering/cases/text-style-linestring-nice/main.js b/test/rendering/cases/text-style-linestring-nice/main.js index e0e4fc93cf..afada42cb2 100644 --- a/test/rendering/cases/text-style-linestring-nice/main.js +++ b/test/rendering/cases/text-style-linestring-nice/main.js @@ -12,36 +12,8 @@ import View from '../../../../src/ol/View.js'; const vectorSource = new VectorSource(); const nicePath = [ - 20, - 33, - 40, - 31, - 60, - 30, - 80, - 31, - 100, - 33, - 120, - 37, - 140, - 39, - 160, - 40, - 180, - 39, - 200, - 37, - 220, - 33, - 240, - 31, - 260, - 30, - 280, - 31, - 300, - 33, + 20, 33, 40, 31, 60, 30, 80, 31, 100, 33, 120, 37, 140, 39, 160, 40, 180, 39, + 200, 37, 220, 33, 240, 31, 260, 30, 280, 31, 300, 33, ]; const lineString1 = new LineString(nicePath, 'XY'); diff --git a/test/rendering/cases/text-style-overlap/main.js b/test/rendering/cases/text-style-overlap/main.js index 666e8388a0..81e1b75c47 100644 --- a/test/rendering/cases/text-style-overlap/main.js +++ b/test/rendering/cases/text-style-overlap/main.js @@ -11,36 +11,8 @@ import VectorSource from '../../../../src/ol/source/Vector.js'; import View from '../../../../src/ol/View.js'; const nicePath = [ - 20, - 33, - 40, - 31, - 60, - 30, - 80, - 31, - 100, - 33, - 120, - 37, - 140, - 39, - 160, - 40, - 180, - 39, - 200, - 37, - 220, - 33, - 240, - 31, - 260, - 30, - 280, - 31, - 300, - 33, + 20, 33, 40, 31, 60, 30, 80, 31, 100, 33, 120, 37, 140, 39, 160, 40, 180, 39, + 200, 37, 220, 33, 240, 31, 260, 30, 280, 31, 300, 33, ]; const vectorSource = new VectorSource();