Remove lint
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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',
|
||||
}),
|
||||
}),
|
||||
|
||||
@@ -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,
|
||||
],
|
||||
}),
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
@@ -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',
|
||||
}),
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 ||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -102,10 +102,12 @@ export function loadFeaturesXhr(
|
||||
if (source) {
|
||||
success(
|
||||
/** @type {Array<import("./Feature.js").default>} */
|
||||
(format.readFeatures(source, {
|
||||
extent: extent,
|
||||
featureProjection: projection,
|
||||
})),
|
||||
(
|
||||
format.readFeatures(source, {
|
||||
extent: extent,
|
||||
featureProjection: projection,
|
||||
})
|
||||
),
|
||||
format.readProjection(source)
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -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<Array<EsriJSONPosition>>} */ (polygon.getCoordinates(
|
||||
false
|
||||
)),
|
||||
rings: /** @type {Array<Array<EsriJSONPosition>>} */ (
|
||||
polygon.getCoordinates(false)
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -522,7 +521,9 @@ function writeMultiLineStringGeometry(multiLineString, opt_options) {
|
||||
return {
|
||||
hasZ: hasZM.hasZ,
|
||||
hasM: hasZM.hasM,
|
||||
paths: /** @type {Array<Array<EsriJSONPosition>>} */ (multiLineString.getCoordinates()),
|
||||
paths: /** @type {Array<Array<EsriJSONPosition>>} */ (
|
||||
multiLineString.getCoordinates()
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -536,7 +537,9 @@ function writeMultiPointGeometry(multiPoint, opt_options) {
|
||||
return {
|
||||
hasZ: hasZM.hasZ,
|
||||
hasM: hasZM.hasM,
|
||||
points: /** @type {Array<EsriJSONPosition>} */ (multiPoint.getCoordinates()),
|
||||
points: /** @type {Array<EsriJSONPosition>} */ (
|
||||
multiPoint.getCoordinates()
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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<number>} */ (rteValues[
|
||||
'flatCoordinates'
|
||||
]);
|
||||
const layoutOptions = /** @type {LayoutOptions} */ (rteValues[
|
||||
'layoutOptions'
|
||||
]);
|
||||
const rteValues = /** @type {!Object} */ (
|
||||
objectStack[objectStack.length - 1]
|
||||
);
|
||||
const flatCoordinates = /** @type {Array<number>} */ (
|
||||
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<number>} */ (trkValues[
|
||||
'flatCoordinates'
|
||||
]);
|
||||
const layoutOptions = /** @type {LayoutOptions} */ (trkValues[
|
||||
'layoutOptions'
|
||||
]);
|
||||
const trkValues = /** @type {!Object} */ (
|
||||
objectStack[objectStack.length - 1]
|
||||
);
|
||||
const flatCoordinates = /** @type {Array<number>} */ (
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,9 @@ class GeoJSON extends JSONFeature {
|
||||
/** @type {Array<import("../Feature.js").default>} */
|
||||
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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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} */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -315,7 +315,9 @@ class WkbReader {
|
||||
case WKBGeometryType.POLYGON:
|
||||
case WKBGeometryType.TRIANGLE:
|
||||
return new Polygon(
|
||||
/** @type {Array<Array<import('../coordinate.js').Coordinate>>} */ (result),
|
||||
/** @type {Array<Array<import('../coordinate.js').Coordinate>>} */ (
|
||||
result
|
||||
),
|
||||
this.layout_
|
||||
);
|
||||
|
||||
@@ -327,7 +329,9 @@ class WkbReader {
|
||||
|
||||
case WKBGeometryType.MULTI_LINE_STRING:
|
||||
return new MultiLineString(
|
||||
/** @type {Array<Array<import('../coordinate.js').Coordinate>>} */ (result),
|
||||
/** @type {Array<Array<import('../coordinate.js').Coordinate>>} */ (
|
||||
result
|
||||
),
|
||||
this.layout_
|
||||
);
|
||||
|
||||
@@ -335,7 +339,9 @@ class WkbReader {
|
||||
case WKBGeometryType.POLYHEDRAL_SURFACE:
|
||||
case WKBGeometryType.TIN:
|
||||
return new MultiPolygon(
|
||||
/** @type {Array<Array<Array<import('../coordinate.js').Coordinate>>>} */ (result),
|
||||
/** @type {Array<Array<Array<import('../coordinate.js').Coordinate>>>} */ (
|
||||
result
|
||||
),
|
||||
this.layout_
|
||||
);
|
||||
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
@@ -422,9 +422,9 @@ function readCapabilityLayer(node, objectStack) {
|
||||
* @return {Object|undefined} Layer object.
|
||||
*/
|
||||
function readLayer(node, objectStack) {
|
||||
const parentLayerObject = /** @type {!Object<string,*>} */ (objectStack[
|
||||
objectStack.length - 1
|
||||
]);
|
||||
const parentLayerObject = /** @type {!Object<string,*>} */ (
|
||||
objectStack[objectStack.length - 1]
|
||||
);
|
||||
|
||||
const layerObject = pushParseAndPop({}, LAYER_PARSERS, node, objectStack);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -61,7 +61,9 @@ class LineString extends SimpleGeometry {
|
||||
);
|
||||
} else {
|
||||
this.setCoordinates(
|
||||
/** @type {Array<import("../coordinate.js").Coordinate>} */ (coordinates),
|
||||
/** @type {Array<import("../coordinate.js").Coordinate>} */ (
|
||||
coordinates
|
||||
),
|
||||
opt_layout
|
||||
);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,9 @@ class LinearRing extends SimpleGeometry {
|
||||
);
|
||||
} else {
|
||||
this.setCoordinates(
|
||||
/** @type {Array<import("../coordinate.js").Coordinate>} */ (coordinates),
|
||||
/** @type {Array<import("../coordinate.js").Coordinate>} */ (
|
||||
coordinates
|
||||
),
|
||||
opt_layout
|
||||
);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,9 @@ class MultiLineString extends SimpleGeometry {
|
||||
|
||||
if (Array.isArray(coordinates[0])) {
|
||||
this.setCoordinates(
|
||||
/** @type {Array<Array<import("../coordinate.js").Coordinate>>} */ (coordinates),
|
||||
/** @type {Array<Array<import("../coordinate.js").Coordinate>>} */ (
|
||||
coordinates
|
||||
),
|
||||
opt_layout
|
||||
);
|
||||
} else if (opt_layout !== undefined && opt_ends) {
|
||||
|
||||
@@ -31,7 +31,9 @@ class MultiPoint extends SimpleGeometry {
|
||||
);
|
||||
} else {
|
||||
this.setCoordinates(
|
||||
/** @type {Array<import("../coordinate.js").Coordinate>} */ (coordinates),
|
||||
/** @type {Array<import("../coordinate.js").Coordinate>} */ (
|
||||
coordinates
|
||||
),
|
||||
opt_layout
|
||||
);
|
||||
}
|
||||
|
||||
@@ -113,7 +113,9 @@ class MultiPolygon extends SimpleGeometry {
|
||||
this.endss_ = opt_endss;
|
||||
} else {
|
||||
this.setCoordinates(
|
||||
/** @type {Array<Array<Array<import("../coordinate.js").Coordinate>>>} */ (coordinates),
|
||||
/** @type {Array<Array<Array<import("../coordinate.js").Coordinate>>>} */ (
|
||||
coordinates
|
||||
),
|
||||
opt_layout
|
||||
);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,9 @@ class Polygon extends SimpleGeometry {
|
||||
this.ends_ = opt_ends;
|
||||
} else {
|
||||
this.setCoordinates(
|
||||
/** @type {Array<Array<import("../coordinate.js").Coordinate>>} */ (coordinates),
|
||||
/** @type {Array<Array<import("../coordinate.js").Coordinate>>} */ (
|
||||
coordinates
|
||||
),
|
||||
opt_layout
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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_;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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) &&
|
||||
|
||||
@@ -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) &&
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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_) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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<import("../Feature.js").default>} */ (this.getFeatures_());
|
||||
const features = /** @type {Array<import("../Feature.js").default>} */ (
|
||||
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) {
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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,
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -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<import("./Base.js").default>} */ (this.get(
|
||||
Property.LAYERS
|
||||
));
|
||||
return /** @type {!import("../Collection.js").default<import("./Base.js").default>} */ (
|
||||
this.get(Property.LAYERS)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -90,7 +90,9 @@ class VectorTileLayer extends BaseVectorLayer {
|
||||
delete baseOptions.useInterimTilesOnError;
|
||||
|
||||
super(
|
||||
/** @type {import("./BaseVector.js").Options<import("../source/VectorTile.js").default>} */ (baseOptions)
|
||||
/** @type {import("./BaseVector.js").Options<import("../source/VectorTile.js").default>} */ (
|
||||
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)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_;
|
||||
|
||||
@@ -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<import("../../VectorRenderTile.js").default>} */ (this
|
||||
.renderedTiles);
|
||||
const renderedTiles =
|
||||
/** @type {Array<import("../../VectorRenderTile.js").default>} */ (
|
||||
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<import("../../VectorRenderTile.js").default>} */ (this
|
||||
.renderedTiles);
|
||||
const tiles =
|
||||
/** @type {Array<import("../../VectorRenderTile.js").default>} */ (
|
||||
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)];
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -474,7 +474,9 @@ class VectorSource extends Source {
|
||||
if (!modifyingCollection) {
|
||||
modifyingCollection = true;
|
||||
this.addFeature(
|
||||
/** @type {import("../Feature.js").default<Geometry>} */ (evt.element)
|
||||
/** @type {import("../Feature.js").default<Geometry>} */ (
|
||||
evt.element
|
||||
)
|
||||
);
|
||||
modifyingCollection = false;
|
||||
}
|
||||
@@ -489,7 +491,9 @@ class VectorSource extends Source {
|
||||
if (!modifyingCollection) {
|
||||
modifyingCollection = true;
|
||||
this.removeFeature(
|
||||
/** @type {import("../Feature.js").default<Geometry>} */ (evt.element)
|
||||
/** @type {import("../Feature.js").default<Geometry>} */ (
|
||||
evt.element
|
||||
)
|
||||
);
|
||||
modifyingCollection = false;
|
||||
}
|
||||
@@ -668,7 +672,9 @@ class VectorSource extends Source {
|
||||
extend(features, getValues(this.nullGeometryFeatures_));
|
||||
}
|
||||
}
|
||||
return /** @type {Array<import("../Feature.js").default<Geometry>>} */ (features);
|
||||
return /** @type {Array<import("../Feature.js").default<Geometry>>} */ (
|
||||
features
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -838,7 +844,9 @@ class VectorSource extends Source {
|
||||
* @private
|
||||
*/
|
||||
handleFeatureChange_(event) {
|
||||
const feature = /** @type {import("../Feature.js").default<Geometry>} */ (event.target);
|
||||
const feature = /** @type {import("../Feature.js").default<Geometry>} */ (
|
||||
event.target
|
||||
);
|
||||
const featureKey = getUid(feature);
|
||||
const geometry = feature.getGeometry();
|
||||
if (!geometry) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.');
|
||||
})()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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,
|
||||
],
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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([
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user