Remove lint
This commit is contained in:
@@ -14,14 +14,12 @@ fetch('data/wmsgetfeatureinfo/osm-restaurant-hotel.xml')
|
|||||||
const hotelFeatures = new WMSGetFeatureInfo({
|
const hotelFeatures = new WMSGetFeatureInfo({
|
||||||
layers: ['hotel'],
|
layers: ['hotel'],
|
||||||
}).readFeatures(response);
|
}).readFeatures(response);
|
||||||
document.getElementById(
|
document.getElementById('hotel').innerText =
|
||||||
'hotel'
|
hotelFeatures.length.toString();
|
||||||
).innerText = hotelFeatures.length.toString();
|
|
||||||
|
|
||||||
const restaurantFeatures = new WMSGetFeatureInfo({
|
const restaurantFeatures = new WMSGetFeatureInfo({
|
||||||
layers: ['restaurant'],
|
layers: ['restaurant'],
|
||||||
}).readFeatures(response);
|
}).readFeatures(response);
|
||||||
document.getElementById(
|
document.getElementById('restaurant').innerText =
|
||||||
'restaurant'
|
restaurantFeatures.length.toString();
|
||||||
).innerText = restaurantFeatures.length.toString();
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -183,7 +183,10 @@ document.getElementById('time').addEventListener('input', function () {
|
|||||||
const value = parseInt(this.value, 10) / 100;
|
const value = parseInt(this.value, 10) / 100;
|
||||||
const m = time.start + time.duration * value;
|
const m = time.start + time.duration * value;
|
||||||
vectorSource.forEachFeature(function (feature) {
|
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);
|
const coordinate = geometry.getCoordinateAtM(m, true);
|
||||||
let highlight = feature.get('highlight');
|
let highlight = feature.get('highlight');
|
||||||
if (highlight === undefined) {
|
if (highlight === undefined) {
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ import View from '../src/ol/View.js';
|
|||||||
const mdf = 'Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition';
|
const mdf = 'Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition';
|
||||||
const agentUrl = 'https://mikenunn.net/mapguide/mapagent/mapagent.fcgi?';
|
const agentUrl = 'https://mikenunn.net/mapguide/mapagent/mapagent.fcgi?';
|
||||||
const bounds = [
|
const bounds = [
|
||||||
-87.865114442365922,
|
-87.865114442365922, 43.665065564837931, -87.595394059497067,
|
||||||
43.665065564837931,
|
|
||||||
-87.595394059497067,
|
|
||||||
43.823852564430069,
|
43.823852564430069,
|
||||||
];
|
];
|
||||||
const map = new Map({
|
const map = new Map({
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ const map = new Map({
|
|||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new BingMaps({
|
source: new BingMaps({
|
||||||
key:
|
key: 'ApTJzdkyN1DdFKkRAE6QIDtzihNaf6IWJsT-nQ_2eMoO4PN__0Tzhl2-WgJtXFSp ',
|
||||||
'ApTJzdkyN1DdFKkRAE6QIDtzihNaf6IWJsT-nQ_2eMoO4PN__0Tzhl2-WgJtXFSp ',
|
|
||||||
imagerySet: 'RoadOnDemand',
|
imagerySet: 'RoadOnDemand',
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -8,9 +8,7 @@ const map = new Map({
|
|||||||
controls: defaultControls().extend([
|
controls: defaultControls().extend([
|
||||||
new ZoomToExtent({
|
new ZoomToExtent({
|
||||||
extent: [
|
extent: [
|
||||||
813079.7791264898,
|
813079.7791264898, 5929220.284081122, 848966.9639063801,
|
||||||
5929220.284081122,
|
|
||||||
848966.9639063801,
|
|
||||||
5936863.986909639,
|
5936863.986909639,
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -21,21 +21,18 @@ const sources = {
|
|||||||
landcover: new VectorTileSource({
|
landcover: new VectorTileSource({
|
||||||
maxZoom: 9,
|
maxZoom: 9,
|
||||||
format: new MVT(),
|
format: new MVT(),
|
||||||
url:
|
url: 'https://api.maptiler.com/tiles/landcover/{z}/{x}/{y}.pbf?key=get_your_own_D6rA4zTHduk6KOKTXzGB',
|
||||||
'https://api.maptiler.com/tiles/landcover/{z}/{x}/{y}.pbf?key=get_your_own_D6rA4zTHduk6KOKTXzGB',
|
|
||||||
}),
|
}),
|
||||||
contours: new VectorTileSource({
|
contours: new VectorTileSource({
|
||||||
minZoom: 9,
|
minZoom: 9,
|
||||||
maxZoom: 14,
|
maxZoom: 14,
|
||||||
format: new MVT(),
|
format: new MVT(),
|
||||||
url:
|
url: 'https://api.maptiler.com/tiles/contours/{z}/{x}/{y}.pbf?key=get_your_own_D6rA4zTHduk6KOKTXzGB',
|
||||||
'https://api.maptiler.com/tiles/contours/{z}/{x}/{y}.pbf?key=get_your_own_D6rA4zTHduk6KOKTXzGB',
|
|
||||||
}),
|
}),
|
||||||
openmaptiles: new VectorTileSource({
|
openmaptiles: new VectorTileSource({
|
||||||
format: new MVT(),
|
format: new MVT(),
|
||||||
maxZoom: 14,
|
maxZoom: 14,
|
||||||
url:
|
url: 'https://api.maptiler.com/tiles/v3/{z}/{x}/{y}.pbf?key=get_your_own_D6rA4zTHduk6KOKTXzGB',
|
||||||
'https://api.maptiler.com/tiles/v3/{z}/{x}/{y}.pbf?key=get_your_own_D6rA4zTHduk6KOKTXzGB',
|
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
const layers = [];
|
const layers = [];
|
||||||
|
|||||||
@@ -20,9 +20,7 @@ register(proj4);
|
|||||||
const sphereMollweideProjection = new Projection({
|
const sphereMollweideProjection = new Projection({
|
||||||
code: 'ESRI:53009',
|
code: 'ESRI:53009',
|
||||||
extent: [
|
extent: [
|
||||||
-18019909.21177587,
|
-18019909.21177587, -9009954.605703328, 18019909.21177587,
|
||||||
-9009954.605703328,
|
|
||||||
18019909.21177587,
|
|
||||||
9009954.605703328,
|
9009954.605703328,
|
||||||
],
|
],
|
||||||
worldExtent: [-179, -89.99, 179, 89.99],
|
worldExtent: [-179, -89.99, 179, 89.99],
|
||||||
|
|||||||
@@ -45,8 +45,7 @@ const style = new Style({
|
|||||||
|
|
||||||
const vectorLayer = new VectorLayer({
|
const vectorLayer = new VectorLayer({
|
||||||
source: new VectorSource({
|
source: new VectorSource({
|
||||||
url:
|
url: 'https://openlayersbook.github.io/openlayers_book_samples/assets/data/countries.geojson',
|
||||||
'https://openlayersbook.github.io/openlayers_book_samples/assets/data/countries.geojson',
|
|
||||||
format: new GeoJSON(),
|
format: new GeoJSON(),
|
||||||
}),
|
}),
|
||||||
style: style,
|
style: style,
|
||||||
|
|||||||
@@ -114,8 +114,7 @@ const raster = new TileLayer({
|
|||||||
const baseVector = new VectorLayer({
|
const baseVector = new VectorLayer({
|
||||||
source: new VectorSource({
|
source: new VectorSource({
|
||||||
format: new GeoJSON(),
|
format: new GeoJSON(),
|
||||||
url:
|
url: "https://ahocevar.com/geoserver/wfs?service=wfs&request=getfeature&typename=topp:states&cql_filter=STATE_NAME='Idaho'&outputformat=application/json",
|
||||||
"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({
|
new VectorTileLayer({
|
||||||
source: new VectorTileSource({
|
source: new VectorTileSource({
|
||||||
format: new MVT(),
|
format: new MVT(),
|
||||||
url:
|
url: 'https://basemaps.arcgis.com/v1/arcgis/rest/services/World_Basemap/VectorTileServer/tile/{z}/{y}/{x}.pbf',
|
||||||
'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 isCssRegEx = /\.css(\?.*)?$/;
|
||||||
const isJsRegEx = /\.js(\?.*)?$/;
|
const isJsRegEx = /\.js(\?.*)?$/;
|
||||||
const importRegEx = /^import .* from '(.*)';$/;
|
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(\?.*)?$/;
|
const isTemplateCss = /\/bootstrap(\.min)?\.css(\?.*)?$/;
|
||||||
|
|
||||||
let cachedPackageInfo = null;
|
let cachedPackageInfo = null;
|
||||||
|
|||||||
@@ -229,9 +229,9 @@ class Geolocation extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getAccuracyGeometry() {
|
getAccuracyGeometry() {
|
||||||
return /** @type {?import("./geom/Polygon.js").default} */ (this.get(
|
return /** @type {?import("./geom/Polygon.js").default} */ (
|
||||||
Property.ACCURACY_GEOMETRY
|
this.get(Property.ACCURACY_GEOMETRY) || null
|
||||||
) || null);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -253,9 +253,9 @@ class Geolocation extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getAltitudeAccuracy() {
|
getAltitudeAccuracy() {
|
||||||
return /** @type {number|undefined} */ (this.get(
|
return /** @type {number|undefined} */ (
|
||||||
Property.ALTITUDE_ACCURACY
|
this.get(Property.ALTITUDE_ACCURACY)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -278,9 +278,9 @@ class Geolocation extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getPosition() {
|
getPosition() {
|
||||||
return /** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get(
|
return /** @type {import("./coordinate.js").Coordinate|undefined} */ (
|
||||||
Property.POSITION
|
this.get(Property.POSITION)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -291,9 +291,9 @@ class Geolocation extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getProjection() {
|
getProjection() {
|
||||||
return /** @type {import("./proj/Projection.js").default|undefined} */ (this.get(
|
return /** @type {import("./proj/Projection.js").default|undefined} */ (
|
||||||
Property.PROJECTION
|
this.get(Property.PROJECTION)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -327,9 +327,9 @@ class Geolocation extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getTrackingOptions() {
|
getTrackingOptions() {
|
||||||
return /** @type {PositionOptions|undefined} */ (this.get(
|
return /** @type {PositionOptions|undefined} */ (
|
||||||
Property.TRACKING_OPTIONS
|
this.get(Property.TRACKING_OPTIONS)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -191,7 +191,9 @@ class Overlay extends BaseObject {
|
|||||||
|
|
||||||
this.setPositioning(
|
this.setPositioning(
|
||||||
options.positioning !== undefined
|
options.positioning !== undefined
|
||||||
? /** @type {import("./OverlayPositioning.js").default} */ (options.positioning)
|
? /** @type {import("./OverlayPositioning.js").default} */ (
|
||||||
|
options.positioning
|
||||||
|
)
|
||||||
: OverlayPositioning.TOP_LEFT
|
: OverlayPositioning.TOP_LEFT
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -227,9 +229,9 @@ class Overlay extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getMap() {
|
getMap() {
|
||||||
return /** @type {import("./PluggableMap.js").default|undefined} */ (this.get(
|
return /** @type {import("./PluggableMap.js").default|undefined} */ (
|
||||||
Property.MAP
|
this.get(Property.MAP)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -250,9 +252,9 @@ class Overlay extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getPosition() {
|
getPosition() {
|
||||||
return /** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get(
|
return /** @type {import("./coordinate.js").Coordinate|undefined} */ (
|
||||||
Property.POSITION
|
this.get(Property.POSITION)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -263,9 +265,9 @@ class Overlay extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getPositioning() {
|
getPositioning() {
|
||||||
return /** @type {import("./OverlayPositioning.js").default} */ (this.get(
|
return /** @type {import("./OverlayPositioning.js").default} */ (
|
||||||
Property.POSITIONING
|
this.get(Property.POSITIONING)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -440,9 +442,9 @@ class Overlay extends BaseObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (delta[0] !== 0 || delta[1] !== 0) {
|
if (delta[0] !== 0 || delta[1] !== 0) {
|
||||||
const center = /** @type {import("./coordinate.js").Coordinate} */ (map
|
const center = /** @type {import("./coordinate.js").Coordinate} */ (
|
||||||
.getView()
|
map.getView().getCenterInternal()
|
||||||
.getCenterInternal());
|
);
|
||||||
const centerPx = map.getPixelFromCoordinateInternal(center);
|
const centerPx = map.getPixelFromCoordinateInternal(center);
|
||||||
if (!centerPx) {
|
if (!centerPx) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -438,7 +438,9 @@ class PluggableMap extends BaseObject {
|
|||||||
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
|
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
|
||||||
*/
|
*/
|
||||||
function (event) {
|
function (event) {
|
||||||
const overlay = /** @type {import("./Overlay.js").default} */ (event.element);
|
const overlay = /** @type {import("./Overlay.js").default} */ (
|
||||||
|
event.element
|
||||||
|
);
|
||||||
const id = overlay.getId();
|
const id = overlay.getId();
|
||||||
if (id !== undefined) {
|
if (id !== undefined) {
|
||||||
delete this.overlayIdIndex_[id.toString()];
|
delete this.overlayIdIndex_[id.toString()];
|
||||||
@@ -698,9 +700,9 @@ class PluggableMap extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getTarget() {
|
getTarget() {
|
||||||
return /** @type {HTMLElement|string|undefined} */ (this.get(
|
return /** @type {HTMLElement|string|undefined} */ (
|
||||||
MapProperty.TARGET
|
this.get(MapProperty.TARGET)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -825,7 +827,9 @@ class PluggableMap extends BaseObject {
|
|||||||
const layerStatesArray = this.getLayerGroup().getLayerStatesArray();
|
const layerStatesArray = this.getLayerGroup().getLayerStatesArray();
|
||||||
for (let i = 0, ii = layerStatesArray.length; i < ii; ++i) {
|
for (let i = 0, ii = layerStatesArray.length; i < ii; ++i) {
|
||||||
const layer = layerStatesArray[i].layer;
|
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) {
|
if (source && source.loading) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -881,9 +885,9 @@ class PluggableMap extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getSize() {
|
getSize() {
|
||||||
return /** @type {import("./size.js").Size|undefined} */ (this.get(
|
return /** @type {import("./size.js").Size|undefined} */ (
|
||||||
MapProperty.SIZE
|
this.get(MapProperty.SIZE)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -972,7 +976,9 @@ class PluggableMap extends BaseObject {
|
|||||||
// coordinates so interactions cannot be used.
|
// coordinates so interactions cannot be used.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const originalEvent = /** @type {PointerEvent} */ (mapBrowserEvent.originalEvent);
|
const originalEvent = /** @type {PointerEvent} */ (
|
||||||
|
mapBrowserEvent.originalEvent
|
||||||
|
);
|
||||||
const eventType = originalEvent.type;
|
const eventType = originalEvent.type;
|
||||||
if (
|
if (
|
||||||
eventType === PointerEventType.POINTERDOWN ||
|
eventType === PointerEventType.POINTERDOWN ||
|
||||||
|
|||||||
@@ -895,9 +895,9 @@ class View extends BaseObject {
|
|||||||
* @return {import("./coordinate.js").Coordinate|undefined} The center of the view.
|
* @return {import("./coordinate.js").Coordinate|undefined} The center of the view.
|
||||||
*/
|
*/
|
||||||
getCenterInternal() {
|
getCenterInternal() {
|
||||||
return /** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get(
|
return /** @type {import("./coordinate.js").Coordinate|undefined} */ (
|
||||||
ViewProperty.CENTER
|
this.get(ViewProperty.CENTER)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -950,7 +950,9 @@ class View extends BaseObject {
|
|||||||
*/
|
*/
|
||||||
calculateExtentInternal(opt_size) {
|
calculateExtentInternal(opt_size) {
|
||||||
const size = opt_size || this.getViewportSizeMinusPadding_();
|
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
|
assert(center, 1); // The view center is not defined
|
||||||
const resolution = /** @type {!number} */ (this.getResolution());
|
const resolution = /** @type {!number} */ (this.getResolution());
|
||||||
assert(resolution !== undefined, 2); // The view resolution is not defined
|
assert(resolution !== undefined, 2); // The view resolution is not defined
|
||||||
@@ -984,9 +986,9 @@ class View extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getMaxZoom() {
|
getMaxZoom() {
|
||||||
return /** @type {number} */ (this.getZoomForResolution(
|
return /** @type {number} */ (
|
||||||
this.minResolution_
|
this.getZoomForResolution(this.minResolution_)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1004,9 +1006,9 @@ class View extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getMinZoom() {
|
getMinZoom() {
|
||||||
return /** @type {number} */ (this.getZoomForResolution(
|
return /** @type {number} */ (
|
||||||
this.maxResolution_
|
this.getZoomForResolution(this.maxResolution_)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1166,7 +1168,9 @@ class View extends BaseObject {
|
|||||||
const projection = this.getProjection();
|
const projection = this.getProjection();
|
||||||
const resolution = /** @type {number} */ (this.getResolution());
|
const resolution = /** @type {number} */ (this.getResolution());
|
||||||
const rotation = this.getRotation();
|
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_;
|
const padding = this.padding_;
|
||||||
if (padding) {
|
if (padding) {
|
||||||
const reducedSize = this.getViewportSizeMinusPadding_();
|
const reducedSize = this.getViewportSizeMinusPadding_();
|
||||||
@@ -1290,9 +1294,11 @@ class View extends BaseObject {
|
|||||||
} else {
|
} else {
|
||||||
const userProjection = getUserProjection();
|
const userProjection = getUserProjection();
|
||||||
if (userProjection) {
|
if (userProjection) {
|
||||||
geometry = /** @type {import("./geom/SimpleGeometry.js").default} */ (geometryOrExtent
|
geometry = /** @type {import("./geom/SimpleGeometry.js").default} */ (
|
||||||
.clone()
|
geometryOrExtent
|
||||||
.transform(userProjection, this.getProjection()));
|
.clone()
|
||||||
|
.transform(userProjection, this.getProjection())
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
geometry = geometryOrExtent;
|
geometry = geometryOrExtent;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -211,7 +211,9 @@ class Attribution extends Control {
|
|||||||
continue;
|
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) {
|
if (!source) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,9 +126,9 @@ class MousePosition extends Control {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getCoordinateFormat() {
|
getCoordinateFormat() {
|
||||||
return /** @type {import("../coordinate.js").CoordinateFormat|undefined} */ (this.get(
|
return /** @type {import("../coordinate.js").CoordinateFormat|undefined} */ (
|
||||||
COORDINATE_FORMAT
|
this.get(COORDINATE_FORMAT)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -139,9 +139,9 @@ class MousePosition extends Control {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getProjection() {
|
getProjection() {
|
||||||
return /** @type {import("../proj/Projection.js").default|undefined} */ (this.get(
|
return /** @type {import("../proj/Projection.js").default|undefined} */ (
|
||||||
PROJECTION
|
this.get(PROJECTION)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -319,7 +319,9 @@ class OverviewMap extends Control {
|
|||||||
*/
|
*/
|
||||||
handleMapPropertyChange_(event) {
|
handleMapPropertyChange_(event) {
|
||||||
if (event.key === MapProperty.VIEW) {
|
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) {
|
if (oldView) {
|
||||||
this.unbindView_(oldView);
|
this.unbindView_(oldView);
|
||||||
}
|
}
|
||||||
@@ -407,7 +409,9 @@ class OverviewMap extends Control {
|
|||||||
}
|
}
|
||||||
this.viewExtent_ = extent;
|
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 ovview = ovmap.getView();
|
||||||
const ovextent = ovview.calculateExtentInternal(ovmapSize);
|
const ovextent = ovview.calculateExtentInternal(ovmapSize);
|
||||||
|
|||||||
@@ -247,8 +247,9 @@ class ZoomSlider extends Control {
|
|||||||
*/
|
*/
|
||||||
handleDraggerStart_(event) {
|
handleDraggerStart_(event) {
|
||||||
if (!this.dragging_ && event.target === this.element.firstElementChild) {
|
if (!this.dragging_ && event.target === this.element.firstElementChild) {
|
||||||
const element = /** @type {HTMLElement} */ (this.element
|
const element = /** @type {HTMLElement} */ (
|
||||||
.firstElementChild);
|
this.element.firstElementChild
|
||||||
|
);
|
||||||
this.getMap().getView().beginInteraction();
|
this.getMap().getView().beginInteraction();
|
||||||
this.startX_ = event.clientX - parseFloat(element.style.left);
|
this.startX_ = event.clientX - parseFloat(element.style.left);
|
||||||
this.startY_ = event.clientY - parseFloat(element.style.top);
|
this.startY_ = event.clientY - parseFloat(element.style.top);
|
||||||
@@ -277,9 +278,8 @@ class ZoomSlider extends Control {
|
|||||||
const deltaX = event.clientX - this.startX_;
|
const deltaX = event.clientX - this.startX_;
|
||||||
const deltaY = event.clientY - this.startY_;
|
const deltaY = event.clientY - this.startY_;
|
||||||
const relativePosition = this.getRelativePosition_(deltaX, deltaY);
|
const relativePosition = this.getRelativePosition_(deltaX, deltaY);
|
||||||
this.currentResolution_ = this.getResolutionForPosition_(
|
this.currentResolution_ =
|
||||||
relativePosition
|
this.getResolutionForPosition_(relativePosition);
|
||||||
);
|
|
||||||
this.getMap().getView().setResolution(this.currentResolution_);
|
this.getMap().getView().setResolution(this.currentResolution_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,10 +32,9 @@ export function createCanvasContext2D(
|
|||||||
canvas.height = opt_height;
|
canvas.height = opt_height;
|
||||||
}
|
}
|
||||||
//FIXME Allow OffscreenCanvasRenderingContext2D as return type
|
//FIXME Allow OffscreenCanvasRenderingContext2D as return type
|
||||||
return /** @type {CanvasRenderingContext2D} */ (canvas.getContext(
|
return /** @type {CanvasRenderingContext2D} */ (
|
||||||
'2d',
|
canvas.getContext('2d', opt_Context2DSettings)
|
||||||
opt_Context2DSettings
|
);
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -102,13 +102,13 @@ class Target extends Disposable {
|
|||||||
++dispatching[type];
|
++dispatching[type];
|
||||||
for (let i = 0, ii = listeners.length; i < ii; ++i) {
|
for (let i = 0, ii = listeners.length; i < ii; ++i) {
|
||||||
if ('handleEvent' in listeners[i]) {
|
if ('handleEvent' in listeners[i]) {
|
||||||
propagate = /** @type {import("../events.js").ListenerObject} */ (listeners[
|
propagate = /** @type {import("../events.js").ListenerObject} */ (
|
||||||
i
|
listeners[i]
|
||||||
]).handleEvent(evt);
|
).handleEvent(evt);
|
||||||
} else {
|
} else {
|
||||||
propagate = /** @type {import("../events.js").ListenerFunction} */ (listeners[
|
propagate = /** @type {import("../events.js").ListenerFunction} */ (
|
||||||
i
|
listeners[i]
|
||||||
]).call(this, evt);
|
).call(this, evt);
|
||||||
}
|
}
|
||||||
if (propagate === false || evt.propagationStopped) {
|
if (propagate === false || evt.propagationStopped) {
|
||||||
propagate = false;
|
propagate = false;
|
||||||
|
|||||||
@@ -45,7 +45,9 @@ export function all(var_args) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export const altKeyOnly = function (mapBrowserEvent) {
|
export const altKeyOnly = function (mapBrowserEvent) {
|
||||||
const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);
|
const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (
|
||||||
|
mapBrowserEvent.originalEvent
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
originalEvent.altKey &&
|
originalEvent.altKey &&
|
||||||
!(originalEvent.metaKey || originalEvent.ctrlKey) &&
|
!(originalEvent.metaKey || originalEvent.ctrlKey) &&
|
||||||
@@ -62,7 +64,9 @@ export const altKeyOnly = function (mapBrowserEvent) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export const altShiftKeysOnly = function (mapBrowserEvent) {
|
export const altShiftKeysOnly = function (mapBrowserEvent) {
|
||||||
const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);
|
const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (
|
||||||
|
mapBrowserEvent.originalEvent
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
originalEvent.altKey &&
|
originalEvent.altKey &&
|
||||||
!(originalEvent.metaKey || originalEvent.ctrlKey) &&
|
!(originalEvent.metaKey || originalEvent.ctrlKey) &&
|
||||||
@@ -124,7 +128,9 @@ export const click = function (mapBrowserEvent) {
|
|||||||
* @return {boolean} The result.
|
* @return {boolean} The result.
|
||||||
*/
|
*/
|
||||||
export const mouseActionButton = function (mapBrowserEvent) {
|
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);
|
return originalEvent.button == 0 && !(WEBKIT && MAC && originalEvent.ctrlKey);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -180,7 +186,9 @@ export const doubleClick = function (mapBrowserEvent) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export const noModifierKeys = function (mapBrowserEvent) {
|
export const noModifierKeys = function (mapBrowserEvent) {
|
||||||
const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);
|
const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (
|
||||||
|
mapBrowserEvent.originalEvent
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
!originalEvent.altKey &&
|
!originalEvent.altKey &&
|
||||||
!(originalEvent.metaKey || originalEvent.ctrlKey) &&
|
!(originalEvent.metaKey || originalEvent.ctrlKey) &&
|
||||||
@@ -198,7 +206,9 @@ export const noModifierKeys = function (mapBrowserEvent) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export const platformModifierKeyOnly = function (mapBrowserEvent) {
|
export const platformModifierKeyOnly = function (mapBrowserEvent) {
|
||||||
const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);
|
const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (
|
||||||
|
mapBrowserEvent.originalEvent
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
!originalEvent.altKey &&
|
!originalEvent.altKey &&
|
||||||
(MAC ? originalEvent.metaKey : originalEvent.ctrlKey) &&
|
(MAC ? originalEvent.metaKey : originalEvent.ctrlKey) &&
|
||||||
@@ -215,7 +225,9 @@ export const platformModifierKeyOnly = function (mapBrowserEvent) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export const shiftKeyOnly = function (mapBrowserEvent) {
|
export const shiftKeyOnly = function (mapBrowserEvent) {
|
||||||
const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);
|
const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (
|
||||||
|
mapBrowserEvent.originalEvent
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
!originalEvent.altKey &&
|
!originalEvent.altKey &&
|
||||||
!(originalEvent.metaKey || originalEvent.ctrlKey) &&
|
!(originalEvent.metaKey || originalEvent.ctrlKey) &&
|
||||||
@@ -232,7 +244,9 @@ export const shiftKeyOnly = function (mapBrowserEvent) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export const targetNotEditable = function (mapBrowserEvent) {
|
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;
|
const tagName = /** @type {Element} */ (originalEvent.target).tagName;
|
||||||
return tagName !== 'INPUT' && tagName !== 'SELECT' && tagName !== 'TEXTAREA';
|
return tagName !== 'INPUT' && tagName !== 'SELECT' && tagName !== 'TEXTAREA';
|
||||||
};
|
};
|
||||||
@@ -245,8 +259,9 @@ export const targetNotEditable = function (mapBrowserEvent) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export const mouseOnly = function (mapBrowserEvent) {
|
export const mouseOnly = function (mapBrowserEvent) {
|
||||||
const pointerEvent = /** @type {import("../MapBrowserEvent").default} */ (mapBrowserEvent)
|
const pointerEvent = /** @type {import("../MapBrowserEvent").default} */ (
|
||||||
.originalEvent;
|
mapBrowserEvent
|
||||||
|
).originalEvent;
|
||||||
assert(pointerEvent !== undefined, 56); // mapBrowserEvent must originate from a pointer event
|
assert(pointerEvent !== undefined, 56); // mapBrowserEvent must originate from a pointer event
|
||||||
// see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
// see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
||||||
return pointerEvent.pointerType == 'mouse';
|
return pointerEvent.pointerType == 'mouse';
|
||||||
@@ -260,8 +275,9 @@ export const mouseOnly = function (mapBrowserEvent) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export const touchOnly = function (mapBrowserEvent) {
|
export const touchOnly = function (mapBrowserEvent) {
|
||||||
const pointerEvt = /** @type {import("../MapBrowserEvent").default} */ (mapBrowserEvent)
|
const pointerEvt = /** @type {import("../MapBrowserEvent").default} */ (
|
||||||
.originalEvent;
|
mapBrowserEvent
|
||||||
|
).originalEvent;
|
||||||
assert(pointerEvt !== undefined, 56); // mapBrowserEvent must originate from a pointer event
|
assert(pointerEvt !== undefined, 56); // mapBrowserEvent must originate from a pointer event
|
||||||
// see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
// see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
||||||
return pointerEvt.pointerType === 'touch';
|
return pointerEvt.pointerType === 'touch';
|
||||||
@@ -275,8 +291,9 @@ export const touchOnly = function (mapBrowserEvent) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export const penOnly = function (mapBrowserEvent) {
|
export const penOnly = function (mapBrowserEvent) {
|
||||||
const pointerEvt = /** @type {import("../MapBrowserEvent").default} */ (mapBrowserEvent)
|
const pointerEvt = /** @type {import("../MapBrowserEvent").default} */ (
|
||||||
.originalEvent;
|
mapBrowserEvent
|
||||||
|
).originalEvent;
|
||||||
assert(pointerEvt !== undefined, 56); // mapBrowserEvent must originate from a pointer event
|
assert(pointerEvt !== undefined, 56); // mapBrowserEvent must originate from a pointer event
|
||||||
// see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
// see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
||||||
return pointerEvt.pointerType === 'pen';
|
return pointerEvt.pointerType === 'pen';
|
||||||
@@ -292,8 +309,9 @@ export const penOnly = function (mapBrowserEvent) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export const primaryAction = function (mapBrowserEvent) {
|
export const primaryAction = function (mapBrowserEvent) {
|
||||||
const pointerEvent = /** @type {import("../MapBrowserEvent").default} */ (mapBrowserEvent)
|
const pointerEvent = /** @type {import("../MapBrowserEvent").default} */ (
|
||||||
.originalEvent;
|
mapBrowserEvent
|
||||||
|
).originalEvent;
|
||||||
assert(pointerEvent !== undefined, 56); // mapBrowserEvent must originate from a pointer event
|
assert(pointerEvent !== undefined, 56); // mapBrowserEvent must originate from a pointer event
|
||||||
return pointerEvent.isPrimary && pointerEvent.button === 0;
|
return pointerEvent.isPrimary && pointerEvent.button === 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -102,10 +102,12 @@ export function loadFeaturesXhr(
|
|||||||
if (source) {
|
if (source) {
|
||||||
success(
|
success(
|
||||||
/** @type {Array<import("./Feature.js").default>} */
|
/** @type {Array<import("./Feature.js").default>} */
|
||||||
(format.readFeatures(source, {
|
(
|
||||||
extent: extent,
|
format.readFeatures(source, {
|
||||||
featureProjection: projection,
|
extent: extent,
|
||||||
})),
|
featureProjection: projection,
|
||||||
|
})
|
||||||
|
),
|
||||||
format.readProjection(source)
|
format.readProjection(source)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -166,9 +166,9 @@ class EsriJSON extends JSONFeature {
|
|||||||
object['spatialReference'] &&
|
object['spatialReference'] &&
|
||||||
object['spatialReference']['wkid'] !== undefined
|
object['spatialReference']['wkid'] !== undefined
|
||||||
) {
|
) {
|
||||||
const spatialReference = /** @type {EsriJSONSpatialReferenceWkid} */ (object[
|
const spatialReference = /** @type {EsriJSONSpatialReferenceWkid} */ (
|
||||||
'spatialReference'
|
object['spatialReference']
|
||||||
]);
|
);
|
||||||
const crs = spatialReference.wkid;
|
const crs = spatialReference.wkid;
|
||||||
return getProjection('EPSG:' + crs);
|
return getProjection('EPSG:' + crs);
|
||||||
} else {
|
} else {
|
||||||
@@ -211,11 +211,10 @@ class EsriJSON extends JSONFeature {
|
|||||||
opt_options &&
|
opt_options &&
|
||||||
(opt_options.dataProjection || opt_options.featureProjection);
|
(opt_options.dataProjection || opt_options.featureProjection);
|
||||||
if (projection) {
|
if (projection) {
|
||||||
object['geometry'][
|
object['geometry']['spatialReference'] =
|
||||||
'spatialReference'
|
/** @type {EsriJSONSpatialReferenceWkid} */ ({
|
||||||
] = /** @type {EsriJSONSpatialReferenceWkid} */ ({
|
wkid: Number(getProjection(projection).getCode().split(':').pop()),
|
||||||
wkid: Number(getProjection(projection).getCode().split(':').pop()),
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
delete properties[feature.getGeometryName()];
|
delete properties[feature.getGeometryName()];
|
||||||
}
|
}
|
||||||
@@ -506,9 +505,9 @@ function writePolygonGeometry(polygon, opt_options) {
|
|||||||
return {
|
return {
|
||||||
hasZ: hasZM.hasZ,
|
hasZ: hasZM.hasZ,
|
||||||
hasM: hasZM.hasM,
|
hasM: hasZM.hasM,
|
||||||
rings: /** @type {Array<Array<EsriJSONPosition>>} */ (polygon.getCoordinates(
|
rings: /** @type {Array<Array<EsriJSONPosition>>} */ (
|
||||||
false
|
polygon.getCoordinates(false)
|
||||||
)),
|
),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -522,7 +521,9 @@ function writeMultiLineStringGeometry(multiLineString, opt_options) {
|
|||||||
return {
|
return {
|
||||||
hasZ: hasZM.hasZ,
|
hasZ: hasZM.hasZ,
|
||||||
hasM: hasZM.hasM,
|
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 {
|
return {
|
||||||
hasZ: hasZM.hasZ,
|
hasZ: hasZM.hasZ,
|
||||||
hasM: hasZM.hasM,
|
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) {
|
readFlatCoordinates(node, objectStack) {
|
||||||
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
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'];
|
const containerSrs = context['srsName'];
|
||||||
let axisOrientation = 'enu';
|
let axisOrientation = 'enu';
|
||||||
if (containerSrs) {
|
if (containerSrs) {
|
||||||
@@ -181,7 +183,9 @@ class GML2 extends GMLBase {
|
|||||||
const multiCurve = context['multiCurve'];
|
const multiCurve = context['multiCurve'];
|
||||||
let nodeName;
|
let nodeName;
|
||||||
if (!Array.isArray(value)) {
|
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) {
|
if (nodeName === 'MultiPolygon' && multiSurface === true) {
|
||||||
nodeName = 'MultiSurface';
|
nodeName = 'MultiSurface';
|
||||||
} else if (nodeName === 'Polygon' && surface === true) {
|
} else if (nodeName === 'Polygon' && surface === true) {
|
||||||
@@ -234,9 +238,8 @@ class GML2 extends GMLBase {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!(key in context.serializers[featureNS])) {
|
if (!(key in context.serializers[featureNS])) {
|
||||||
context.serializers[featureNS][key] = makeChildAppender(
|
context.serializers[featureNS][key] =
|
||||||
writeStringTextNode
|
makeChildAppender(writeStringTextNode);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -324,9 +327,9 @@ class GML2 extends GMLBase {
|
|||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
writeGeometryElement(node, geometry, objectStack) {
|
writeGeometryElement(node, geometry, objectStack) {
|
||||||
const context = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[
|
const context = /** @type {import("./Feature.js").WriteOptions} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
const item = assign({}, context);
|
const item = assign({}, context);
|
||||||
item['node'] = node;
|
item['node'] = node;
|
||||||
let value;
|
let value;
|
||||||
|
|||||||
@@ -797,9 +797,9 @@ class GML3 extends GMLBase {
|
|||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
writeGeometryElement(node, geometry, objectStack) {
|
writeGeometryElement(node, geometry, objectStack) {
|
||||||
const context = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[
|
const context = /** @type {import("./Feature.js").WriteOptions} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
const item = assign({}, context);
|
const item = assign({}, context);
|
||||||
item['node'] = node;
|
item['node'] = node;
|
||||||
let value;
|
let value;
|
||||||
@@ -866,9 +866,8 @@ class GML3 extends GMLBase {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!(key in context.serializers[featureNS])) {
|
if (!(key in context.serializers[featureNS])) {
|
||||||
context.serializers[featureNS][key] = makeChildAppender(
|
context.serializers[featureNS][key] =
|
||||||
writeStringTextNode
|
makeChildAppender(writeStringTextNode);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -948,7 +947,9 @@ class GML3 extends GMLBase {
|
|||||||
const multiCurve = context['multiCurve'];
|
const multiCurve = context['multiCurve'];
|
||||||
let nodeName;
|
let nodeName;
|
||||||
if (!Array.isArray(value)) {
|
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) {
|
if (nodeName === 'MultiPolygon' && multiSurface === true) {
|
||||||
nodeName = 'MultiSurface';
|
nodeName = 'MultiSurface';
|
||||||
} else if (nodeName === 'Polygon' && surface === true) {
|
} else if (nodeName === 'Polygon' && surface === true) {
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ class GML32 extends GML3 {
|
|||||||
* @param {import("./GMLBase.js").Options} [opt_options] Optional configuration object.
|
* @param {import("./GMLBase.js").Options} [opt_options] Optional configuration object.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
const options = /** @type {import("./GMLBase.js").Options} */ (opt_options
|
const options = /** @type {import("./GMLBase.js").Options} */ (
|
||||||
? opt_options
|
opt_options ? opt_options : {}
|
||||||
: {});
|
);
|
||||||
|
|
||||||
super(options);
|
super(options);
|
||||||
|
|
||||||
|
|||||||
@@ -238,9 +238,8 @@ class GMLBase extends XMLFeature {
|
|||||||
readGeometryElement(node, objectStack) {
|
readGeometryElement(node, objectStack) {
|
||||||
const context = /** @type {Object} */ (objectStack[0]);
|
const context = /** @type {Object} */ (objectStack[0]);
|
||||||
context['srsName'] = node.firstElementChild.getAttribute('srsName');
|
context['srsName'] = node.firstElementChild.getAttribute('srsName');
|
||||||
context['srsDimension'] = node.firstElementChild.getAttribute(
|
context['srsDimension'] =
|
||||||
'srsDimension'
|
node.firstElementChild.getAttribute('srsDimension');
|
||||||
);
|
|
||||||
const geometry = pushParseAndPop(
|
const geometry = pushParseAndPop(
|
||||||
null,
|
null,
|
||||||
this.GEOMETRY_PARSERS,
|
this.GEOMETRY_PARSERS,
|
||||||
|
|||||||
@@ -623,15 +623,15 @@ function parseExtensions(node, objectStack) {
|
|||||||
function parseRtePt(node, objectStack) {
|
function parseRtePt(node, objectStack) {
|
||||||
const values = pushParseAndPop({}, RTEPT_PARSERS, node, objectStack);
|
const values = pushParseAndPop({}, RTEPT_PARSERS, node, objectStack);
|
||||||
if (values) {
|
if (values) {
|
||||||
const rteValues = /** @type {!Object} */ (objectStack[
|
const rteValues = /** @type {!Object} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
const flatCoordinates = /** @type {Array<number>} */ (rteValues[
|
const flatCoordinates = /** @type {Array<number>} */ (
|
||||||
'flatCoordinates'
|
rteValues['flatCoordinates']
|
||||||
]);
|
);
|
||||||
const layoutOptions = /** @type {LayoutOptions} */ (rteValues[
|
const layoutOptions = /** @type {LayoutOptions} */ (
|
||||||
'layoutOptions'
|
rteValues['layoutOptions']
|
||||||
]);
|
);
|
||||||
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -643,15 +643,15 @@ function parseRtePt(node, objectStack) {
|
|||||||
function parseTrkPt(node, objectStack) {
|
function parseTrkPt(node, objectStack) {
|
||||||
const values = pushParseAndPop({}, TRKPT_PARSERS, node, objectStack);
|
const values = pushParseAndPop({}, TRKPT_PARSERS, node, objectStack);
|
||||||
if (values) {
|
if (values) {
|
||||||
const trkValues = /** @type {!Object} */ (objectStack[
|
const trkValues = /** @type {!Object} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
const flatCoordinates = /** @type {Array<number>} */ (trkValues[
|
const flatCoordinates = /** @type {Array<number>} */ (
|
||||||
'flatCoordinates'
|
trkValues['flatCoordinates']
|
||||||
]);
|
);
|
||||||
const layoutOptions = /** @type {LayoutOptions} */ (trkValues[
|
const layoutOptions = /** @type {LayoutOptions} */ (
|
||||||
'layoutOptions'
|
trkValues['layoutOptions']
|
||||||
]);
|
);
|
||||||
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -676,7 +676,9 @@ function parseTrkSeg(node, objectStack) {
|
|||||||
* @return {Feature|undefined} Track.
|
* @return {Feature|undefined} Track.
|
||||||
*/
|
*/
|
||||||
function readRte(node, objectStack) {
|
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(
|
const values = pushParseAndPop(
|
||||||
{
|
{
|
||||||
'flatCoordinates': [],
|
'flatCoordinates': [],
|
||||||
@@ -709,7 +711,9 @@ function readRte(node, objectStack) {
|
|||||||
* @return {Feature|undefined} Track.
|
* @return {Feature|undefined} Track.
|
||||||
*/
|
*/
|
||||||
function readTrk(node, objectStack) {
|
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(
|
const values = pushParseAndPop(
|
||||||
{
|
{
|
||||||
'flatCoordinates': [],
|
'flatCoordinates': [],
|
||||||
@@ -745,7 +749,9 @@ function readTrk(node, objectStack) {
|
|||||||
* @return {Feature|undefined} Waypoint.
|
* @return {Feature|undefined} Waypoint.
|
||||||
*/
|
*/
|
||||||
function readWpt(node, objectStack) {
|
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);
|
const values = pushParseAndPop({}, WPT_PARSERS, node, objectStack);
|
||||||
if (!values) {
|
if (!values) {
|
||||||
return undefined;
|
return undefined;
|
||||||
@@ -835,17 +841,17 @@ function writeWptType(node, coordinate, objectStack) {
|
|||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeRte(node, feature, objectStack) {
|
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 properties = feature.getProperties();
|
||||||
const context = {node: node};
|
const context = {node: node};
|
||||||
context['properties'] = properties;
|
context['properties'] = properties;
|
||||||
const geometry = feature.getGeometry();
|
const geometry = feature.getGeometry();
|
||||||
if (geometry.getType() == GeometryType.LINE_STRING) {
|
if (geometry.getType() == GeometryType.LINE_STRING) {
|
||||||
const lineString = /** @type {LineString} */ (transformGeometryWithOptions(
|
const lineString = /** @type {LineString} */ (
|
||||||
geometry,
|
transformGeometryWithOptions(geometry, true, options)
|
||||||
true,
|
);
|
||||||
options
|
|
||||||
));
|
|
||||||
context['geometryLayout'] = lineString.getLayout();
|
context['geometryLayout'] = lineString.getLayout();
|
||||||
properties['rtept'] = lineString.getCoordinates();
|
properties['rtept'] = lineString.getCoordinates();
|
||||||
}
|
}
|
||||||
@@ -868,18 +874,18 @@ function writeRte(node, feature, objectStack) {
|
|||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeTrk(node, feature, objectStack) {
|
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();
|
const properties = feature.getProperties();
|
||||||
/** @type {import("../xml.js").NodeStackItem} */
|
/** @type {import("../xml.js").NodeStackItem} */
|
||||||
const context = {node: node};
|
const context = {node: node};
|
||||||
context['properties'] = properties;
|
context['properties'] = properties;
|
||||||
const geometry = feature.getGeometry();
|
const geometry = feature.getGeometry();
|
||||||
if (geometry.getType() == GeometryType.MULTI_LINE_STRING) {
|
if (geometry.getType() == GeometryType.MULTI_LINE_STRING) {
|
||||||
const multiLineString = /** @type {MultiLineString} */ (transformGeometryWithOptions(
|
const multiLineString = /** @type {MultiLineString} */ (
|
||||||
geometry,
|
transformGeometryWithOptions(geometry, true, options)
|
||||||
true,
|
);
|
||||||
options
|
|
||||||
));
|
|
||||||
properties['trkseg'] = multiLineString.getLineStrings();
|
properties['trkseg'] = multiLineString.getLineStrings();
|
||||||
}
|
}
|
||||||
const parentNode = objectStack[objectStack.length - 1].node;
|
const parentNode = objectStack[objectStack.length - 1].node;
|
||||||
@@ -920,16 +926,16 @@ function writeTrkSeg(node, lineString, objectStack) {
|
|||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeWpt(node, feature, objectStack) {
|
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];
|
const context = objectStack[objectStack.length - 1];
|
||||||
context['properties'] = feature.getProperties();
|
context['properties'] = feature.getProperties();
|
||||||
const geometry = feature.getGeometry();
|
const geometry = feature.getGeometry();
|
||||||
if (geometry.getType() == GeometryType.POINT) {
|
if (geometry.getType() == GeometryType.POINT) {
|
||||||
const point = /** @type {Point} */ (transformGeometryWithOptions(
|
const point = /** @type {Point} */ (
|
||||||
geometry,
|
transformGeometryWithOptions(geometry, true, options)
|
||||||
true,
|
);
|
||||||
options
|
|
||||||
));
|
|
||||||
context['geometryLayout'] = point.getLayout();
|
context['geometryLayout'] = point.getLayout();
|
||||||
writeWptType(node, point.getCoordinates(), objectStack);
|
writeWptType(node, point.getCoordinates(), objectStack);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,7 +138,9 @@ class GeoJSON extends JSONFeature {
|
|||||||
/** @type {Array<import("../Feature.js").default>} */
|
/** @type {Array<import("../Feature.js").default>} */
|
||||||
let features = null;
|
let features = null;
|
||||||
if (geoJSONObject['type'] === 'FeatureCollection') {
|
if (geoJSONObject['type'] === 'FeatureCollection') {
|
||||||
const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (object);
|
const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (
|
||||||
|
object
|
||||||
|
);
|
||||||
features = [];
|
features = [];
|
||||||
const geoJSONFeatures = geoJSONFeatureCollection['features'];
|
const geoJSONFeatures = geoJSONFeatureCollection['features'];
|
||||||
for (let i = 0, ii = geoJSONFeatures.length; i < ii; ++i) {
|
for (let i = 0, ii = geoJSONFeatures.length; i < ii; ++i) {
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ const IGCZ = {
|
|||||||
* @const
|
* @const
|
||||||
* @type {RegExp}
|
* @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
|
* @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_VERSION1 =
|
||||||
const COMPLIANCE_VERSION2 = /^https?:\/\/iiif\.io\/api\/image\/2\/level[0-2](?:\.json)?$/;
|
/^https?:\/\/library\.stanford\.edu\/iiif\/image-api\/(?:1\.1\/)?compliance\.html#level[0-2]$/;
|
||||||
const COMPLIANCE_VERSION3 = /(^https?:\/\/iiif\.io\/api\/image\/3\/level[0-2](?:\.json)?$)|(^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) {
|
function generateVersion1Options(iiifInfo) {
|
||||||
let levelProfile = iiifInfo.getComplianceLevelSupportedFeatures();
|
let levelProfile = iiifInfo.getComplianceLevelSupportedFeatures();
|
||||||
|
|||||||
@@ -538,7 +538,9 @@ class KML extends XMLFeature {
|
|||||||
if (id !== null) {
|
if (id !== null) {
|
||||||
feature.setId(id);
|
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'];
|
const geometry = object['geometry'];
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
@@ -1112,7 +1114,8 @@ export function readFlatCoordinates(node) {
|
|||||||
// The KML specification states that coordinate tuples should not include
|
// The KML specification states that coordinate tuples should not include
|
||||||
// spaces, but we tolerate them.
|
// spaces, but we tolerate them.
|
||||||
s = s.replace(/\s*,\s*/g, ',');
|
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;
|
let m;
|
||||||
while ((m = re.exec(s))) {
|
while ((m = re.exec(s))) {
|
||||||
const x = parseFloat(m[1]);
|
const x = parseFloat(m[1]);
|
||||||
@@ -1253,9 +1256,9 @@ function iconStyleParser(node, objectStack) {
|
|||||||
if (!object) {
|
if (!object) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const styleObject = /** @type {Object} */ (objectStack[
|
const styleObject = /** @type {Object} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
const IconObject = 'Icon' in object ? object['Icon'] : {};
|
const IconObject = 'Icon' in object ? object['Icon'] : {};
|
||||||
const drawIcon = !('Icon' in object) || Object.keys(IconObject).length > 0;
|
const drawIcon = !('Icon' in object) || Object.keys(IconObject).length > 0;
|
||||||
let src;
|
let src;
|
||||||
@@ -1468,7 +1471,8 @@ function gxCoordParser(node, objectStack) {
|
|||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
const coordinates = gxTrackObject.coordinates;
|
const coordinates = gxTrackObject.coordinates;
|
||||||
const s = getAllTextContent(node, false);
|
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);
|
const m = re.exec(s);
|
||||||
if (m) {
|
if (m) {
|
||||||
const x = parseFloat(m[1]);
|
const x = parseFloat(m[1]);
|
||||||
@@ -1840,9 +1844,9 @@ function readStyle(node, objectStack) {
|
|||||||
}
|
}
|
||||||
let fillStyle =
|
let fillStyle =
|
||||||
/** @type {Fill} */
|
/** @type {Fill} */
|
||||||
('fillStyle' in styleObject
|
(
|
||||||
? styleObject['fillStyle']
|
'fillStyle' in styleObject ? styleObject['fillStyle'] : DEFAULT_FILL_STYLE
|
||||||
: DEFAULT_FILL_STYLE);
|
);
|
||||||
const fill = /** @type {boolean|undefined} */ (styleObject['fill']);
|
const fill = /** @type {boolean|undefined} */ (styleObject['fill']);
|
||||||
if (fill !== undefined && !fill) {
|
if (fill !== undefined && !fill) {
|
||||||
fillStyle = null;
|
fillStyle = null;
|
||||||
@@ -1857,14 +1861,16 @@ function readStyle(node, objectStack) {
|
|||||||
}
|
}
|
||||||
const textStyle =
|
const textStyle =
|
||||||
/** @type {Text} */
|
/** @type {Text} */
|
||||||
('textStyle' in styleObject
|
(
|
||||||
? styleObject['textStyle']
|
'textStyle' in styleObject ? styleObject['textStyle'] : DEFAULT_TEXT_STYLE
|
||||||
: DEFAULT_TEXT_STYLE);
|
);
|
||||||
const strokeStyle =
|
const strokeStyle =
|
||||||
/** @type {Stroke} */
|
/** @type {Stroke} */
|
||||||
('strokeStyle' in styleObject
|
(
|
||||||
? styleObject['strokeStyle']
|
'strokeStyle' in styleObject
|
||||||
: DEFAULT_STROKE_STYLE);
|
? styleObject['strokeStyle']
|
||||||
|
: DEFAULT_STROKE_STYLE
|
||||||
|
);
|
||||||
const outline = /** @type {boolean|undefined} */ (styleObject['outline']);
|
const outline = /** @type {boolean|undefined} */ (styleObject['outline']);
|
||||||
if (outline !== undefined && !outline) {
|
if (outline !== undefined && !outline) {
|
||||||
// if the polystyle specifies no outline two styles are needed,
|
// if the polystyle specifies no outline two styles are needed,
|
||||||
@@ -1992,9 +1998,9 @@ const DATA_PARSERS = makeStructureNS(NAMESPACE_URIS, {
|
|||||||
function dataParser(node, objectStack) {
|
function dataParser(node, objectStack) {
|
||||||
const name = node.getAttribute('name');
|
const name = node.getAttribute('name');
|
||||||
parseNode(DATA_PARSERS, node, objectStack);
|
parseNode(DATA_PARSERS, node, objectStack);
|
||||||
const featureObject = /** @type {Object} */ (objectStack[
|
const featureObject = /** @type {Object} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
if (name && featureObject.displayName) {
|
if (name && featureObject.displayName) {
|
||||||
featureObject[name] = {
|
featureObject[name] = {
|
||||||
value: featureObject.value,
|
value: featureObject.value,
|
||||||
@@ -2115,9 +2121,9 @@ function simpleDataParser(node, objectStack) {
|
|||||||
const name = node.getAttribute('name');
|
const name = node.getAttribute('name');
|
||||||
if (name !== null) {
|
if (name !== null) {
|
||||||
const data = readString(node);
|
const data = readString(node);
|
||||||
const featureObject = /** @type {Object} */ (objectStack[
|
const featureObject = /** @type {Object} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
featureObject[name] = data;
|
featureObject[name] = data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2151,9 +2157,9 @@ function latLonAltBoxParser(node, objectStack) {
|
|||||||
if (!object) {
|
if (!object) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const regionObject = /** @type {Object} */ (objectStack[
|
const regionObject = /** @type {Object} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
const extent = [
|
const extent = [
|
||||||
parseFloat(object['west']),
|
parseFloat(object['west']),
|
||||||
parseFloat(object['south']),
|
parseFloat(object['south']),
|
||||||
@@ -3078,7 +3084,9 @@ function writePlacemark(node, feature, objectStack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// serialize geometry
|
// serialize geometry
|
||||||
const options = /** @type {import("./Feature.js").WriteOptions} */ (objectStack[0]);
|
const options = /** @type {import("./Feature.js").WriteOptions} */ (
|
||||||
|
objectStack[0]
|
||||||
|
);
|
||||||
let geometry = feature.getGeometry();
|
let geometry = feature.getGeometry();
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
geometry = transformGeometryWithOptions(geometry, true, options);
|
geometry = transformGeometryWithOptions(geometry, true, options);
|
||||||
|
|||||||
@@ -234,8 +234,9 @@ class MVT extends FeatureFormat {
|
|||||||
? new MultiLineString(flatCoordinates, GeometryLayout.XY, ends)
|
? new MultiLineString(flatCoordinates, GeometryLayout.XY, ends)
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
const ctor = /** @type {typeof import("../Feature.js").default} */ (this
|
const ctor = /** @type {typeof import("../Feature.js").default} */ (
|
||||||
.featureClass_);
|
this.featureClass_
|
||||||
|
);
|
||||||
feature = new ctor();
|
feature = new ctor();
|
||||||
if (this.geometryName_) {
|
if (this.geometryName_) {
|
||||||
feature.setGeometryName(this.geometryName_);
|
feature.setGeometryName(this.geometryName_);
|
||||||
@@ -266,9 +267,9 @@ class MVT extends FeatureFormat {
|
|||||||
*/
|
*/
|
||||||
readFeatures(source, opt_options) {
|
readFeatures(source, opt_options) {
|
||||||
const layers = this.layers_;
|
const layers = this.layers_;
|
||||||
const options = /** @type {import("./Feature.js").ReadOptions} */ (this.adaptOptions(
|
const options = /** @type {import("./Feature.js").ReadOptions} */ (
|
||||||
opt_options
|
this.adaptOptions(opt_options)
|
||||||
));
|
);
|
||||||
const dataProjection = get(options.dataProjection);
|
const dataProjection = get(options.dataProjection);
|
||||||
dataProjection.setWorldExtent(options.extent);
|
dataProjection.setWorldExtent(options.extent);
|
||||||
options.dataProjection = dataProjection;
|
options.dataProjection = dataProjection;
|
||||||
|
|||||||
@@ -122,7 +122,9 @@ const NODE_PARSERS = makeStructureNS(NAMESPACE_URIS, {
|
|||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function readNode(node, objectStack) {
|
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 state = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
const id = node.getAttribute('id');
|
const id = node.getAttribute('id');
|
||||||
/** @type {import("../coordinate.js").Coordinate} */
|
/** @type {import("../coordinate.js").Coordinate} */
|
||||||
|
|||||||
@@ -144,11 +144,13 @@ class Polyline extends TextFeature {
|
|||||||
writeGeometryText(geometry, opt_options) {
|
writeGeometryText(geometry, opt_options) {
|
||||||
geometry =
|
geometry =
|
||||||
/** @type {LineString} */
|
/** @type {LineString} */
|
||||||
(transformGeometryWithOptions(
|
(
|
||||||
geometry,
|
transformGeometryWithOptions(
|
||||||
true,
|
geometry,
|
||||||
this.adaptOptions(opt_options)
|
true,
|
||||||
));
|
this.adaptOptions(opt_options)
|
||||||
|
)
|
||||||
|
);
|
||||||
const flatCoordinates = geometry.getFlatCoordinates();
|
const flatCoordinates = geometry.getFlatCoordinates();
|
||||||
const stride = geometry.getStride();
|
const stride = geometry.getStride();
|
||||||
flipXY(flatCoordinates, 0, flatCoordinates.length, stride, flatCoordinates);
|
flipXY(flatCoordinates, 0, flatCoordinates.length, stride, flatCoordinates);
|
||||||
|
|||||||
@@ -114,9 +114,9 @@ class TopoJSON extends JSONFeature {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (topoJSONFeatures[objectName].type === 'GeometryCollection') {
|
if (topoJSONFeatures[objectName].type === 'GeometryCollection') {
|
||||||
feature = /** @type {TopoJSONGeometryCollection} */ (topoJSONFeatures[
|
feature = /** @type {TopoJSONGeometryCollection} */ (
|
||||||
objectName
|
topoJSONFeatures[objectName]
|
||||||
]);
|
);
|
||||||
features.push.apply(
|
features.push.apply(
|
||||||
features,
|
features,
|
||||||
readFeaturesFromGeometryCollection(
|
readFeaturesFromGeometryCollection(
|
||||||
@@ -130,9 +130,9 @@ class TopoJSON extends JSONFeature {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
feature = /** @type {TopoJSONGeometry} */ (topoJSONFeatures[
|
feature = /** @type {TopoJSONGeometry} */ (
|
||||||
objectName
|
topoJSONFeatures[objectName]
|
||||||
]);
|
);
|
||||||
features.push(
|
features.push(
|
||||||
readFeatureFromGeometry(
|
readFeatureFromGeometry(
|
||||||
feature,
|
feature,
|
||||||
|
|||||||
@@ -1034,10 +1034,9 @@ function writeQuery(node, featureType, objectStack) {
|
|||||||
if (featureNS) {
|
if (featureNS) {
|
||||||
node.setAttributeNS(XMLNS, 'xmlns:' + featurePrefix, featureNS);
|
node.setAttributeNS(XMLNS, 'xmlns:' + featurePrefix, featureNS);
|
||||||
}
|
}
|
||||||
const item = /** @type {import("../xml.js").NodeStackItem} */ (assign(
|
const item = /** @type {import("../xml.js").NodeStackItem} */ (
|
||||||
{},
|
assign({}, context)
|
||||||
context
|
);
|
||||||
));
|
|
||||||
item.node = node;
|
item.node = node;
|
||||||
pushSerializeAndPop(
|
pushSerializeAndPop(
|
||||||
item,
|
item,
|
||||||
@@ -1348,10 +1347,9 @@ export function writeFilter(filter, opt_version) {
|
|||||||
*/
|
*/
|
||||||
function writeGetFeature(node, featureTypes, objectStack) {
|
function writeGetFeature(node, featureTypes, objectStack) {
|
||||||
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
const item = /** @type {import("../xml.js").NodeStackItem} */ (assign(
|
const item = /** @type {import("../xml.js").NodeStackItem} */ (
|
||||||
{},
|
assign({}, context)
|
||||||
context
|
);
|
||||||
));
|
|
||||||
item.node = node;
|
item.node = node;
|
||||||
pushSerializeAndPop(
|
pushSerializeAndPop(
|
||||||
item,
|
item,
|
||||||
|
|||||||
@@ -315,7 +315,9 @@ class WkbReader {
|
|||||||
case WKBGeometryType.POLYGON:
|
case WKBGeometryType.POLYGON:
|
||||||
case WKBGeometryType.TRIANGLE:
|
case WKBGeometryType.TRIANGLE:
|
||||||
return new Polygon(
|
return new Polygon(
|
||||||
/** @type {Array<Array<import('../coordinate.js').Coordinate>>} */ (result),
|
/** @type {Array<Array<import('../coordinate.js').Coordinate>>} */ (
|
||||||
|
result
|
||||||
|
),
|
||||||
this.layout_
|
this.layout_
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -327,7 +329,9 @@ class WkbReader {
|
|||||||
|
|
||||||
case WKBGeometryType.MULTI_LINE_STRING:
|
case WKBGeometryType.MULTI_LINE_STRING:
|
||||||
return new MultiLineString(
|
return new MultiLineString(
|
||||||
/** @type {Array<Array<import('../coordinate.js').Coordinate>>} */ (result),
|
/** @type {Array<Array<import('../coordinate.js').Coordinate>>} */ (
|
||||||
|
result
|
||||||
|
),
|
||||||
this.layout_
|
this.layout_
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -335,7 +339,9 @@ class WkbReader {
|
|||||||
case WKBGeometryType.POLYHEDRAL_SURFACE:
|
case WKBGeometryType.POLYHEDRAL_SURFACE:
|
||||||
case WKBGeometryType.TIN:
|
case WKBGeometryType.TIN:
|
||||||
return new MultiPolygon(
|
return new MultiPolygon(
|
||||||
/** @type {Array<Array<Array<import('../coordinate.js').Coordinate>>>} */ (result),
|
/** @type {Array<Array<Array<import('../coordinate.js').Coordinate>>>} */ (
|
||||||
|
result
|
||||||
|
),
|
||||||
this.layout_
|
this.layout_
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -652,7 +652,9 @@ class WKT extends TextFeature {
|
|||||||
this.splitCollection_ &&
|
this.splitCollection_ &&
|
||||||
geometry.getType() == GeometryType.GEOMETRY_COLLECTION
|
geometry.getType() == GeometryType.GEOMETRY_COLLECTION
|
||||||
) {
|
) {
|
||||||
geometries = /** @type {GeometryCollection} */ (geometry).getGeometriesArray();
|
geometries = /** @type {GeometryCollection} */ (
|
||||||
|
geometry
|
||||||
|
).getGeometriesArray();
|
||||||
} else {
|
} else {
|
||||||
geometries = [geometry];
|
geometries = [geometry];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -422,9 +422,9 @@ function readCapabilityLayer(node, objectStack) {
|
|||||||
* @return {Object|undefined} Layer object.
|
* @return {Object|undefined} Layer object.
|
||||||
*/
|
*/
|
||||||
function readLayer(node, objectStack) {
|
function readLayer(node, objectStack) {
|
||||||
const parentLayerObject = /** @type {!Object<string,*>} */ (objectStack[
|
const parentLayerObject = /** @type {!Object<string,*>} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
|
|
||||||
const layerObject = pushParseAndPop({}, LAYER_PARSERS, node, objectStack);
|
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) {
|
for (let i = 0, ii = geometries.length; i < ii; ++i) {
|
||||||
if (geometries[i].getType() === this.getType()) {
|
if (geometries[i].getType() === this.getType()) {
|
||||||
geometriesArray = geometriesArray.concat(
|
geometriesArray = geometriesArray.concat(
|
||||||
/** @type {GeometryCollection} */ (geometries[
|
/** @type {GeometryCollection} */ (
|
||||||
i
|
geometries[i]
|
||||||
]).getGeometriesArrayRecursive()
|
).getGeometriesArrayRecursive()
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
geometriesArray.push(geometries[i]);
|
geometriesArray.push(geometries[i]);
|
||||||
@@ -185,9 +185,8 @@ class GeometryCollection extends Geometry {
|
|||||||
let simplified = false;
|
let simplified = false;
|
||||||
for (let i = 0, ii = geometries.length; i < ii; ++i) {
|
for (let i = 0, ii = geometries.length; i < ii; ++i) {
|
||||||
const geometry = geometries[i];
|
const geometry = geometries[i];
|
||||||
const simplifiedGeometry = geometry.getSimplifiedGeometry(
|
const simplifiedGeometry =
|
||||||
squaredTolerance
|
geometry.getSimplifiedGeometry(squaredTolerance);
|
||||||
);
|
|
||||||
simplifiedGeometries.push(simplifiedGeometry);
|
simplifiedGeometries.push(simplifiedGeometry);
|
||||||
if (simplifiedGeometry !== geometry) {
|
if (simplifiedGeometry !== geometry) {
|
||||||
simplified = true;
|
simplified = true;
|
||||||
|
|||||||
@@ -61,7 +61,9 @@ class LineString extends SimpleGeometry {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.setCoordinates(
|
this.setCoordinates(
|
||||||
/** @type {Array<import("../coordinate.js").Coordinate>} */ (coordinates),
|
/** @type {Array<import("../coordinate.js").Coordinate>} */ (
|
||||||
|
coordinates
|
||||||
|
),
|
||||||
opt_layout
|
opt_layout
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,9 @@ class LinearRing extends SimpleGeometry {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.setCoordinates(
|
this.setCoordinates(
|
||||||
/** @type {Array<import("../coordinate.js").Coordinate>} */ (coordinates),
|
/** @type {Array<import("../coordinate.js").Coordinate>} */ (
|
||||||
|
coordinates
|
||||||
|
),
|
||||||
opt_layout
|
opt_layout
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,9 @@ class MultiLineString extends SimpleGeometry {
|
|||||||
|
|
||||||
if (Array.isArray(coordinates[0])) {
|
if (Array.isArray(coordinates[0])) {
|
||||||
this.setCoordinates(
|
this.setCoordinates(
|
||||||
/** @type {Array<Array<import("../coordinate.js").Coordinate>>} */ (coordinates),
|
/** @type {Array<Array<import("../coordinate.js").Coordinate>>} */ (
|
||||||
|
coordinates
|
||||||
|
),
|
||||||
opt_layout
|
opt_layout
|
||||||
);
|
);
|
||||||
} else if (opt_layout !== undefined && opt_ends) {
|
} else if (opt_layout !== undefined && opt_ends) {
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ class MultiPoint extends SimpleGeometry {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.setCoordinates(
|
this.setCoordinates(
|
||||||
/** @type {Array<import("../coordinate.js").Coordinate>} */ (coordinates),
|
/** @type {Array<import("../coordinate.js").Coordinate>} */ (
|
||||||
|
coordinates
|
||||||
|
),
|
||||||
opt_layout
|
opt_layout
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,9 @@ class MultiPolygon extends SimpleGeometry {
|
|||||||
this.endss_ = opt_endss;
|
this.endss_ = opt_endss;
|
||||||
} else {
|
} else {
|
||||||
this.setCoordinates(
|
this.setCoordinates(
|
||||||
/** @type {Array<Array<Array<import("../coordinate.js").Coordinate>>>} */ (coordinates),
|
/** @type {Array<Array<Array<import("../coordinate.js").Coordinate>>>} */ (
|
||||||
|
coordinates
|
||||||
|
),
|
||||||
opt_layout
|
opt_layout
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,9 @@ class Polygon extends SimpleGeometry {
|
|||||||
this.ends_ = opt_ends;
|
this.ends_ = opt_ends;
|
||||||
} else {
|
} else {
|
||||||
this.setCoordinates(
|
this.setCoordinates(
|
||||||
/** @type {Array<Array<import("../coordinate.js").Coordinate>>} */ (coordinates),
|
/** @type {Array<Array<import("../coordinate.js").Coordinate>>} */ (
|
||||||
|
coordinates
|
||||||
|
),
|
||||||
opt_layout
|
opt_layout
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,9 +117,8 @@ class SimpleGeometry extends Geometry {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const simplifiedGeometry = this.getSimplifiedGeometryInternal(
|
const simplifiedGeometry =
|
||||||
squaredTolerance
|
this.getSimplifiedGeometryInternal(squaredTolerance);
|
||||||
);
|
|
||||||
const simplifiedFlatCoordinates = simplifiedGeometry.getFlatCoordinates();
|
const simplifiedFlatCoordinates = simplifiedGeometry.getFlatCoordinates();
|
||||||
if (simplifiedFlatCoordinates.length < this.flatCoordinates.length) {
|
if (simplifiedFlatCoordinates.length < this.flatCoordinates.length) {
|
||||||
return simplifiedGeometry;
|
return simplifiedGeometry;
|
||||||
|
|||||||
@@ -46,7 +46,9 @@ class DoubleClickZoom extends Interaction {
|
|||||||
handleEvent(mapBrowserEvent) {
|
handleEvent(mapBrowserEvent) {
|
||||||
let stopEvent = false;
|
let stopEvent = false;
|
||||||
if (mapBrowserEvent.type == MapBrowserEventType.DBLCLICK) {
|
if (mapBrowserEvent.type == MapBrowserEventType.DBLCLICK) {
|
||||||
const browserEvent = /** @type {MouseEvent} */ (mapBrowserEvent.originalEvent);
|
const browserEvent = /** @type {MouseEvent} */ (
|
||||||
|
mapBrowserEvent.originalEvent
|
||||||
|
);
|
||||||
const map = mapBrowserEvent.map;
|
const map = mapBrowserEvent.map;
|
||||||
const anchor = mapBrowserEvent.coordinate;
|
const anchor = mapBrowserEvent.coordinate;
|
||||||
const delta = browserEvent.shiftKey ? -this.delta_ : this.delta_;
|
const delta = browserEvent.shiftKey ? -this.delta_ : this.delta_;
|
||||||
|
|||||||
@@ -185,7 +185,9 @@ class Draw extends PointerInteraction {
|
|||||||
* @param {Options} options Options.
|
* @param {Options} options Options.
|
||||||
*/
|
*/
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
const pointerOptions = /** @type {import("./Pointer.js").Options} */ (options);
|
const pointerOptions = /** @type {import("./Pointer.js").Options} */ (
|
||||||
|
options
|
||||||
|
);
|
||||||
if (!pointerOptions.stopDown) {
|
if (!pointerOptions.stopDown) {
|
||||||
pointerOptions.stopDown = FALSE;
|
pointerOptions.stopDown = FALSE;
|
||||||
}
|
}
|
||||||
@@ -255,7 +257,9 @@ class Draw extends PointerInteraction {
|
|||||||
* @type {import("../geom/GeometryType.js").default}
|
* @type {import("../geom/GeometryType.js").default}
|
||||||
* @private
|
* @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.
|
* Drawing mode (derived from geometry type.
|
||||||
|
|||||||
@@ -86,7 +86,9 @@ class KeyboardPan extends Interaction {
|
|||||||
handleEvent(mapBrowserEvent) {
|
handleEvent(mapBrowserEvent) {
|
||||||
let stopEvent = false;
|
let stopEvent = false;
|
||||||
if (mapBrowserEvent.type == EventType.KEYDOWN) {
|
if (mapBrowserEvent.type == EventType.KEYDOWN) {
|
||||||
const keyEvent = /** @type {KeyboardEvent} */ (mapBrowserEvent.originalEvent);
|
const keyEvent = /** @type {KeyboardEvent} */ (
|
||||||
|
mapBrowserEvent.originalEvent
|
||||||
|
);
|
||||||
const keyCode = keyEvent.keyCode;
|
const keyCode = keyEvent.keyCode;
|
||||||
if (
|
if (
|
||||||
this.condition_(mapBrowserEvent) &&
|
this.condition_(mapBrowserEvent) &&
|
||||||
|
|||||||
@@ -70,7 +70,9 @@ class KeyboardZoom extends Interaction {
|
|||||||
mapBrowserEvent.type == EventType.KEYDOWN ||
|
mapBrowserEvent.type == EventType.KEYDOWN ||
|
||||||
mapBrowserEvent.type == EventType.KEYPRESS
|
mapBrowserEvent.type == EventType.KEYPRESS
|
||||||
) {
|
) {
|
||||||
const keyEvent = /** @type {KeyboardEvent} */ (mapBrowserEvent.originalEvent);
|
const keyEvent = /** @type {KeyboardEvent} */ (
|
||||||
|
mapBrowserEvent.originalEvent
|
||||||
|
);
|
||||||
const charCode = keyEvent.charCode;
|
const charCode = keyEvent.charCode;
|
||||||
if (
|
if (
|
||||||
this.condition_(mapBrowserEvent) &&
|
this.condition_(mapBrowserEvent) &&
|
||||||
|
|||||||
@@ -757,7 +757,9 @@ class Modify extends PointerInteraction {
|
|||||||
centerSegmentData.featureSegments = featureSegments;
|
centerSegmentData.featureSegments = featureSegments;
|
||||||
circumferenceSegmentData.featureSegments = featureSegments;
|
circumferenceSegmentData.featureSegments = featureSegments;
|
||||||
this.rBush_.insert(createExtent(coordinates), centerSegmentData);
|
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();
|
const userProjection = getUserProjection();
|
||||||
if (userProjection && this.getMap()) {
|
if (userProjection && this.getMap()) {
|
||||||
const projection = this.getMap().getView().getProjection();
|
const projection = this.getMap().getView().getProjection();
|
||||||
@@ -1526,14 +1528,16 @@ function projectedDistanceToSegmentDataSquared(
|
|||||||
const geometry = segmentData.geometry;
|
const geometry = segmentData.geometry;
|
||||||
|
|
||||||
if (geometry.getType() === GeometryType.CIRCLE) {
|
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) {
|
if (segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {
|
||||||
const userProjection = getUserProjection();
|
const userProjection = getUserProjection();
|
||||||
if (userProjection) {
|
if (userProjection) {
|
||||||
circleGeometry = /** @type {import("../geom/Circle.js").default} */ (circleGeometry
|
circleGeometry = /** @type {import("../geom/Circle.js").default} */ (
|
||||||
.clone()
|
circleGeometry.clone().transform(userProjection, projection)
|
||||||
.transform(userProjection, projection));
|
);
|
||||||
}
|
}
|
||||||
const distanceToCenterSquared = squaredCoordinateDistance(
|
const distanceToCenterSquared = squaredCoordinateDistance(
|
||||||
circleGeometry.getCenter(),
|
circleGeometry.getCenter(),
|
||||||
@@ -1568,12 +1572,14 @@ function closestOnSegmentData(pointCoordinates, segmentData, projection) {
|
|||||||
geometry.getType() === GeometryType.CIRCLE &&
|
geometry.getType() === GeometryType.CIRCLE &&
|
||||||
segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX
|
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();
|
const userProjection = getUserProjection();
|
||||||
if (userProjection) {
|
if (userProjection) {
|
||||||
circleGeometry = /** @type {import("../geom/Circle.js").default} */ (circleGeometry
|
circleGeometry = /** @type {import("../geom/Circle.js").default} */ (
|
||||||
.clone()
|
circleGeometry.clone().transform(userProjection, projection)
|
||||||
.transform(userProjection, projection));
|
);
|
||||||
}
|
}
|
||||||
return toUserCoordinate(
|
return toUserCoordinate(
|
||||||
circleGeometry.getClosestPoint(
|
circleGeometry.getClosestPoint(
|
||||||
|
|||||||
@@ -179,7 +179,9 @@ class MouseWheelZoom extends Interaction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const map = mapBrowserEvent.map;
|
const map = mapBrowserEvent.map;
|
||||||
const wheelEvent = /** @type {WheelEvent} */ (mapBrowserEvent.originalEvent);
|
const wheelEvent = /** @type {WheelEvent} */ (
|
||||||
|
mapBrowserEvent.originalEvent
|
||||||
|
);
|
||||||
wheelEvent.preventDefault();
|
wheelEvent.preventDefault();
|
||||||
|
|
||||||
if (this.useAnchor_) {
|
if (this.useAnchor_) {
|
||||||
|
|||||||
@@ -27,7 +27,9 @@ class PinchRotate extends PointerInteraction {
|
|||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
const options = opt_options ? 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) {
|
if (!pointerOptions.stopDown) {
|
||||||
pointerOptions.stopDown = FALSE;
|
pointerOptions.stopDown = FALSE;
|
||||||
|
|||||||
@@ -24,7 +24,9 @@ class PinchZoom extends PointerInteraction {
|
|||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
const options = opt_options ? 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) {
|
if (!pointerOptions.stopDown) {
|
||||||
pointerOptions.stopDown = FALSE;
|
pointerOptions.stopDown = FALSE;
|
||||||
|
|||||||
@@ -295,8 +295,9 @@ class Select extends Interaction {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getLayer(feature) {
|
getLayer(feature) {
|
||||||
return /** @type {import('../layer/Vector.js').default} */ (this
|
return /** @type {import('../layer/Vector.js').default} */ (
|
||||||
.featureLayerAssociation_[getUid(feature)]);
|
this.featureLayerAssociation_[getUid(feature)]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -100,7 +100,9 @@ class Snap extends PointerInteraction {
|
|||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
const options = opt_options ? 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) {
|
if (!pointerOptions.handleDownEvent) {
|
||||||
pointerOptions.handleDownEvent = TRUE;
|
pointerOptions.handleDownEvent = TRUE;
|
||||||
@@ -358,7 +360,9 @@ class Snap extends PointerInteraction {
|
|||||||
setMap(map) {
|
setMap(map) {
|
||||||
const currentMap = this.getMap();
|
const currentMap = this.getMap();
|
||||||
const keys = this.featuresListenerKeys_;
|
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) {
|
if (currentMap) {
|
||||||
keys.forEach(unlistenByKey);
|
keys.forEach(unlistenByKey);
|
||||||
@@ -548,9 +552,9 @@ class Snap extends PointerInteraction {
|
|||||||
let circleGeometry = geometry;
|
let circleGeometry = geometry;
|
||||||
const userProjection = getUserProjection();
|
const userProjection = getUserProjection();
|
||||||
if (userProjection) {
|
if (userProjection) {
|
||||||
circleGeometry = /** @type {import("../geom/Circle.js").default} */ (circleGeometry
|
circleGeometry = /** @type {import("../geom/Circle.js").default} */ (
|
||||||
.clone()
|
circleGeometry.clone().transform(userProjection, projection)
|
||||||
.transform(userProjection, projection));
|
);
|
||||||
}
|
}
|
||||||
const polygon = fromCircle(circleGeometry);
|
const polygon = fromCircle(circleGeometry);
|
||||||
if (userProjection) {
|
if (userProjection) {
|
||||||
|
|||||||
@@ -156,9 +156,9 @@ class BaseLayer extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getExtent() {
|
getExtent() {
|
||||||
return /** @type {import("../extent.js").Extent|undefined} */ (this.get(
|
return /** @type {import("../extent.js").Extent|undefined} */ (
|
||||||
LayerProperty.EXTENT
|
this.get(LayerProperty.EXTENT)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -96,9 +96,9 @@ class BaseTileLayer extends Layer {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getUseInterimTilesOnError() {
|
getUseInterimTilesOnError() {
|
||||||
return /** @type {boolean} */ (this.get(
|
return /** @type {boolean} */ (
|
||||||
TileProperty.USE_INTERIM_TILES_ON_ERROR
|
this.get(TileProperty.USE_INTERIM_TILES_ON_ERROR)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -178,9 +178,9 @@ class BaseVectorLayer extends Layer {
|
|||||||
* order.
|
* order.
|
||||||
*/
|
*/
|
||||||
getRenderOrder() {
|
getRenderOrder() {
|
||||||
return /** @type {import("../render.js").OrderFunction|null|undefined} */ (this.get(
|
return /** @type {import("../render.js").OrderFunction|null|undefined} */ (
|
||||||
Property.RENDER_ORDER
|
this.get(Property.RENDER_ORDER)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -52,22 +52,7 @@ const DEFAULT_STROKE_STYLE = new Stroke({
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
const INTERVALS = [
|
const INTERVALS = [
|
||||||
90,
|
90, 45, 30, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, 0.01, 0.005, 0.002, 0.001,
|
||||||
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
|
* @private
|
||||||
*/
|
*/
|
||||||
handleLayersAdd_(collectionEvent) {
|
handleLayersAdd_(collectionEvent) {
|
||||||
const layer = /** @type {import("./Base.js").default} */ (collectionEvent.element);
|
const layer = /** @type {import("./Base.js").default} */ (
|
||||||
|
collectionEvent.element
|
||||||
|
);
|
||||||
this.listenerKeys_[getUid(layer)] = [
|
this.listenerKeys_[getUid(layer)] = [
|
||||||
listen(
|
listen(
|
||||||
layer,
|
layer,
|
||||||
@@ -156,7 +158,9 @@ class LayerGroup extends BaseLayer {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
handleLayersRemove_(collectionEvent) {
|
handleLayersRemove_(collectionEvent) {
|
||||||
const layer = /** @type {import("./Base.js").default} */ (collectionEvent.element);
|
const layer = /** @type {import("./Base.js").default} */ (
|
||||||
|
collectionEvent.element
|
||||||
|
);
|
||||||
const key = getUid(layer);
|
const key = getUid(layer);
|
||||||
this.listenerKeys_[key].forEach(unlistenByKey);
|
this.listenerKeys_[key].forEach(unlistenByKey);
|
||||||
delete this.listenerKeys_[key];
|
delete this.listenerKeys_[key];
|
||||||
@@ -172,9 +176,9 @@ class LayerGroup extends BaseLayer {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getLayers() {
|
getLayers() {
|
||||||
return /** @type {!import("../Collection.js").default<import("./Base.js").default>} */ (this.get(
|
return /** @type {!import("../Collection.js").default<import("./Base.js").default>} */ (
|
||||||
Property.LAYERS
|
this.get(Property.LAYERS)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -264,7 +264,8 @@ class Layer extends BaseLayer {
|
|||||||
map,
|
map,
|
||||||
RenderEventType.PRECOMPOSE,
|
RenderEventType.PRECOMPOSE,
|
||||||
function (evt) {
|
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 layerStatesArray = renderEvent.frameState.layerStatesArray;
|
||||||
const layerState = this.getLayerState(false);
|
const layerState = this.getLayerState(false);
|
||||||
// A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both.
|
// 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;
|
delete baseOptions.useInterimTilesOnError;
|
||||||
|
|
||||||
super(
|
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) {
|
if (options.renderMode === VectorTileRenderType.IMAGE) {
|
||||||
@@ -171,9 +173,9 @@ class VectorTileLayer extends BaseVectorLayer {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getUseInterimTilesOnError() {
|
getUseInterimTilesOnError() {
|
||||||
return /** @type {boolean} */ (this.get(
|
return /** @type {boolean} */ (
|
||||||
TileProperty.USE_INTERIM_TILES_ON_ERROR
|
this.get(TileProperty.USE_INTERIM_TILES_ON_ERROR)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -443,7 +443,9 @@ export function drawImageOrLabel(
|
|||||||
context.translate(x, y);
|
context.translate(x, y);
|
||||||
context.scale(scale[0], scale[1]);
|
context.scale(scale[0], scale[1]);
|
||||||
context.drawImage(
|
context.drawImage(
|
||||||
/** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */ (labelOrImage),
|
/** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */ (
|
||||||
|
labelOrImage
|
||||||
|
),
|
||||||
originX,
|
originX,
|
||||||
originY,
|
originY,
|
||||||
w,
|
w,
|
||||||
@@ -456,7 +458,9 @@ export function drawImageOrLabel(
|
|||||||
} else {
|
} else {
|
||||||
// if image not flipped translate and scale can be avoided
|
// if image not flipped translate and scale can be avoided
|
||||||
context.drawImage(
|
context.drawImage(
|
||||||
/** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */ (labelOrImage),
|
/** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */ (
|
||||||
|
labelOrImage
|
||||||
|
),
|
||||||
originX,
|
originX,
|
||||||
originY,
|
originY,
|
||||||
w,
|
w,
|
||||||
|
|||||||
@@ -256,9 +256,15 @@ class CanvasBuilder extends VectorContext {
|
|||||||
let flatCoordinates, builderEnd, builderEnds, builderEndss;
|
let flatCoordinates, builderEnd, builderEnds, builderEndss;
|
||||||
let offset;
|
let offset;
|
||||||
if (type == GeometryType.MULTI_POLYGON) {
|
if (type == GeometryType.MULTI_POLYGON) {
|
||||||
flatCoordinates = /** @type {import("../../geom/MultiPolygon.js").default} */ (geometry).getOrientedFlatCoordinates();
|
flatCoordinates =
|
||||||
|
/** @type {import("../../geom/MultiPolygon.js").default} */ (
|
||||||
|
geometry
|
||||||
|
).getOrientedFlatCoordinates();
|
||||||
builderEndss = [];
|
builderEndss = [];
|
||||||
const endss = /** @type {import("../../geom/MultiPolygon.js").default} */ (geometry).getEndss();
|
const endss =
|
||||||
|
/** @type {import("../../geom/MultiPolygon.js").default} */ (
|
||||||
|
geometry
|
||||||
|
).getEndss();
|
||||||
offset = 0;
|
offset = 0;
|
||||||
for (let i = 0, ii = endss.length; i < ii; ++i) {
|
for (let i = 0, ii = endss.length; i < ii; ++i) {
|
||||||
const myEnds = [];
|
const myEnds = [];
|
||||||
@@ -286,12 +292,16 @@ class CanvasBuilder extends VectorContext {
|
|||||||
builderEnds = [];
|
builderEnds = [];
|
||||||
flatCoordinates =
|
flatCoordinates =
|
||||||
type == GeometryType.POLYGON
|
type == GeometryType.POLYGON
|
||||||
? /** @type {import("../../geom/Polygon.js").default} */ (geometry).getOrientedFlatCoordinates()
|
? /** @type {import("../../geom/Polygon.js").default} */ (
|
||||||
|
geometry
|
||||||
|
).getOrientedFlatCoordinates()
|
||||||
: geometry.getFlatCoordinates();
|
: geometry.getFlatCoordinates();
|
||||||
offset = this.drawCustomCoordinates_(
|
offset = this.drawCustomCoordinates_(
|
||||||
flatCoordinates,
|
flatCoordinates,
|
||||||
0,
|
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,
|
stride,
|
||||||
builderEnds
|
builderEnds
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -538,9 +538,8 @@ class Executor {
|
|||||||
* @param {Array<*>} instruction Instruction.
|
* @param {Array<*>} instruction Instruction.
|
||||||
*/
|
*/
|
||||||
setStrokeStyle_(context, instruction) {
|
setStrokeStyle_(context, instruction) {
|
||||||
context[
|
context['strokeStyle'] =
|
||||||
'strokeStyle'
|
/** @type {import("../../colorlike.js").ColorLike} */ (instruction[1]);
|
||||||
] = /** @type {import("../../colorlike.js").ColorLike} */ (instruction[1]);
|
|
||||||
context.lineWidth = /** @type {number} */ (instruction[2]);
|
context.lineWidth = /** @type {number} */ (instruction[2]);
|
||||||
context.lineCap = /** @type {CanvasLineCap} */ (instruction[3]);
|
context.lineCap = /** @type {CanvasLineCap} */ (instruction[3]);
|
||||||
context.lineJoin = /** @type {CanvasLineJoin} */ (instruction[4]);
|
context.lineJoin = /** @type {CanvasLineJoin} */ (instruction[4]);
|
||||||
@@ -669,10 +668,14 @@ class Executor {
|
|||||||
let x, y, currentGeometry;
|
let x, y, currentGeometry;
|
||||||
while (i < ii) {
|
while (i < ii) {
|
||||||
const instruction = instructions[i];
|
const instruction = instructions[i];
|
||||||
const type = /** @type {import("./Instruction.js").default} */ (instruction[0]);
|
const type = /** @type {import("./Instruction.js").default} */ (
|
||||||
|
instruction[0]
|
||||||
|
);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case CanvasInstruction.BEGIN_GEOMETRY:
|
case CanvasInstruction.BEGIN_GEOMETRY:
|
||||||
feature = /** @type {import("../../Feature.js").FeatureLike} */ (instruction[1]);
|
feature = /** @type {import("../../Feature.js").FeatureLike} */ (
|
||||||
|
instruction[1]
|
||||||
|
);
|
||||||
currentGeometry = instruction[3];
|
currentGeometry = instruction[3];
|
||||||
if (!feature.getGeometry()) {
|
if (!feature.getGeometry()) {
|
||||||
i = /** @type {number} */ (instruction[2]);
|
i = /** @type {number} */ (instruction[2]);
|
||||||
@@ -721,7 +724,10 @@ class Executor {
|
|||||||
case CanvasInstruction.CUSTOM:
|
case CanvasInstruction.CUSTOM:
|
||||||
d = /** @type {number} */ (instruction[1]);
|
d = /** @type {number} */ (instruction[1]);
|
||||||
dd = instruction[2];
|
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 renderer = instruction[4];
|
||||||
const fn = instruction.length == 6 ? instruction[5] : undefined;
|
const fn = instruction.length == 6 ? instruction[5] : undefined;
|
||||||
state.geometry = geometry;
|
state.geometry = geometry;
|
||||||
@@ -743,7 +749,10 @@ class Executor {
|
|||||||
case CanvasInstruction.DRAW_IMAGE:
|
case CanvasInstruction.DRAW_IMAGE:
|
||||||
d = /** @type {number} */ (instruction[1]);
|
d = /** @type {number} */ (instruction[1]);
|
||||||
dd = /** @type {number} */ (instruction[2]);
|
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
|
// Remaining arguments in DRAW_IMAGE are in alphabetical order
|
||||||
anchorX = /** @type {number} */ (instruction[4]);
|
anchorX = /** @type {number} */ (instruction[4]);
|
||||||
@@ -754,9 +763,14 @@ class Executor {
|
|||||||
const originY = /** @type {number} */ (instruction[9]);
|
const originY = /** @type {number} */ (instruction[9]);
|
||||||
const rotateWithView = /** @type {boolean} */ (instruction[10]);
|
const rotateWithView = /** @type {boolean} */ (instruction[10]);
|
||||||
let rotation = /** @type {number} */ (instruction[11]);
|
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]);
|
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) {
|
if (!image && instruction.length >= 19) {
|
||||||
// create label images
|
// create label images
|
||||||
@@ -1047,7 +1061,9 @@ class Executor {
|
|||||||
break;
|
break;
|
||||||
case CanvasInstruction.END_GEOMETRY:
|
case CanvasInstruction.END_GEOMETRY:
|
||||||
if (opt_featureCallback !== undefined) {
|
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);
|
const result = opt_featureCallback(feature, currentGeometry);
|
||||||
if (result) {
|
if (result) {
|
||||||
return 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;
|
++i;
|
||||||
break;
|
break;
|
||||||
case CanvasInstruction.SET_STROKE_STYLE:
|
case CanvasInstruction.SET_STROKE_STYLE:
|
||||||
|
|||||||
@@ -228,8 +228,12 @@ class ExecutorGroup {
|
|||||||
* @return {T|undefined} Callback result.
|
* @return {T|undefined} Callback result.
|
||||||
*/
|
*/
|
||||||
function featureCallback(feature, geometry) {
|
function featureCallback(feature, geometry) {
|
||||||
const imageData = context.getImageData(0, 0, contextSize, contextSize)
|
const imageData = context.getImageData(
|
||||||
.data;
|
0,
|
||||||
|
0,
|
||||||
|
contextSize,
|
||||||
|
contextSize
|
||||||
|
).data;
|
||||||
for (let i = 0, ii = indexes.length; i < ii; i++) {
|
for (let i = 0, ii = indexes.length; i < ii; i++) {
|
||||||
if (imageData[indexes[i]] > 0) {
|
if (imageData[indexes[i]] > 0) {
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -571,7 +571,9 @@ class CanvasImmediateRenderer extends VectorContext {
|
|||||||
break;
|
break;
|
||||||
case GeometryType.MULTI_LINE_STRING:
|
case GeometryType.MULTI_LINE_STRING:
|
||||||
this.drawMultiLineString(
|
this.drawMultiLineString(
|
||||||
/** @type {import("../../geom/MultiLineString.js").default} */ (geometry)
|
/** @type {import("../../geom/MultiLineString.js").default} */ (
|
||||||
|
geometry
|
||||||
|
)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case GeometryType.MULTI_POLYGON:
|
case GeometryType.MULTI_POLYGON:
|
||||||
@@ -581,7 +583,9 @@ class CanvasImmediateRenderer extends VectorContext {
|
|||||||
break;
|
break;
|
||||||
case GeometryType.GEOMETRY_COLLECTION:
|
case GeometryType.GEOMETRY_COLLECTION:
|
||||||
this.drawGeometryCollection(
|
this.drawGeometryCollection(
|
||||||
/** @type {import("../../geom/GeometryCollection.js").default} */ (geometry)
|
/** @type {import("../../geom/GeometryCollection.js").default} */ (
|
||||||
|
geometry
|
||||||
|
)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case GeometryType.CIRCLE:
|
case GeometryType.CIRCLE:
|
||||||
@@ -633,10 +637,12 @@ class CanvasImmediateRenderer extends VectorContext {
|
|||||||
*/
|
*/
|
||||||
drawPoint(geometry) {
|
drawPoint(geometry) {
|
||||||
if (this.squaredTolerance_) {
|
if (this.squaredTolerance_) {
|
||||||
geometry = /** @type {import("../../geom/Point.js").default} */ (geometry.simplifyTransformed(
|
geometry = /** @type {import("../../geom/Point.js").default} */ (
|
||||||
this.squaredTolerance_,
|
geometry.simplifyTransformed(
|
||||||
this.userTransform_
|
this.squaredTolerance_,
|
||||||
));
|
this.userTransform_
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const flatCoordinates = geometry.getFlatCoordinates();
|
const flatCoordinates = geometry.getFlatCoordinates();
|
||||||
const stride = geometry.getStride();
|
const stride = geometry.getStride();
|
||||||
@@ -656,10 +662,12 @@ class CanvasImmediateRenderer extends VectorContext {
|
|||||||
*/
|
*/
|
||||||
drawMultiPoint(geometry) {
|
drawMultiPoint(geometry) {
|
||||||
if (this.squaredTolerance_) {
|
if (this.squaredTolerance_) {
|
||||||
geometry = /** @type {import("../../geom/MultiPoint.js").default} */ (geometry.simplifyTransformed(
|
geometry = /** @type {import("../../geom/MultiPoint.js").default} */ (
|
||||||
this.squaredTolerance_,
|
geometry.simplifyTransformed(
|
||||||
this.userTransform_
|
this.squaredTolerance_,
|
||||||
));
|
this.userTransform_
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const flatCoordinates = geometry.getFlatCoordinates();
|
const flatCoordinates = geometry.getFlatCoordinates();
|
||||||
const stride = geometry.getStride();
|
const stride = geometry.getStride();
|
||||||
@@ -679,10 +687,12 @@ class CanvasImmediateRenderer extends VectorContext {
|
|||||||
*/
|
*/
|
||||||
drawLineString(geometry) {
|
drawLineString(geometry) {
|
||||||
if (this.squaredTolerance_) {
|
if (this.squaredTolerance_) {
|
||||||
geometry = /** @type {import("../../geom/LineString.js").default} */ (geometry.simplifyTransformed(
|
geometry = /** @type {import("../../geom/LineString.js").default} */ (
|
||||||
this.squaredTolerance_,
|
geometry.simplifyTransformed(
|
||||||
this.userTransform_
|
this.squaredTolerance_,
|
||||||
));
|
this.userTransform_
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (!intersects(this.extent_, geometry.getExtent())) {
|
if (!intersects(this.extent_, geometry.getExtent())) {
|
||||||
return;
|
return;
|
||||||
@@ -715,10 +725,13 @@ class CanvasImmediateRenderer extends VectorContext {
|
|||||||
*/
|
*/
|
||||||
drawMultiLineString(geometry) {
|
drawMultiLineString(geometry) {
|
||||||
if (this.squaredTolerance_) {
|
if (this.squaredTolerance_) {
|
||||||
geometry = /** @type {import("../../geom/MultiLineString.js").default} */ (geometry.simplifyTransformed(
|
geometry =
|
||||||
this.squaredTolerance_,
|
/** @type {import("../../geom/MultiLineString.js").default} */ (
|
||||||
this.userTransform_
|
geometry.simplifyTransformed(
|
||||||
));
|
this.squaredTolerance_,
|
||||||
|
this.userTransform_
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const geometryExtent = geometry.getExtent();
|
const geometryExtent = geometry.getExtent();
|
||||||
if (!intersects(this.extent_, geometryExtent)) {
|
if (!intersects(this.extent_, geometryExtent)) {
|
||||||
@@ -757,10 +770,12 @@ class CanvasImmediateRenderer extends VectorContext {
|
|||||||
*/
|
*/
|
||||||
drawPolygon(geometry) {
|
drawPolygon(geometry) {
|
||||||
if (this.squaredTolerance_) {
|
if (this.squaredTolerance_) {
|
||||||
geometry = /** @type {import("../../geom/Polygon.js").default} */ (geometry.simplifyTransformed(
|
geometry = /** @type {import("../../geom/Polygon.js").default} */ (
|
||||||
this.squaredTolerance_,
|
geometry.simplifyTransformed(
|
||||||
this.userTransform_
|
this.squaredTolerance_,
|
||||||
));
|
this.userTransform_
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (!intersects(this.extent_, geometry.getExtent())) {
|
if (!intersects(this.extent_, geometry.getExtent())) {
|
||||||
return;
|
return;
|
||||||
@@ -800,10 +815,12 @@ class CanvasImmediateRenderer extends VectorContext {
|
|||||||
*/
|
*/
|
||||||
drawMultiPolygon(geometry) {
|
drawMultiPolygon(geometry) {
|
||||||
if (this.squaredTolerance_) {
|
if (this.squaredTolerance_) {
|
||||||
geometry = /** @type {import("../../geom/MultiPolygon.js").default} */ (geometry.simplifyTransformed(
|
geometry = /** @type {import("../../geom/MultiPolygon.js").default} */ (
|
||||||
this.squaredTolerance_,
|
geometry.simplifyTransformed(
|
||||||
this.userTransform_
|
this.squaredTolerance_,
|
||||||
));
|
this.userTransform_
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (!intersects(this.extent_, geometry.getExtent())) {
|
if (!intersects(this.extent_, geometry.getExtent())) {
|
||||||
return;
|
return;
|
||||||
@@ -932,7 +949,9 @@ class CanvasImmediateRenderer extends VectorContext {
|
|||||||
if (!contextTextState) {
|
if (!contextTextState) {
|
||||||
context.font = textState.font;
|
context.font = textState.font;
|
||||||
context.textAlign = /** @type {CanvasTextAlign} */ (textAlign);
|
context.textAlign = /** @type {CanvasTextAlign} */ (textAlign);
|
||||||
context.textBaseline = /** @type {CanvasTextBaseline} */ (textState.textBaseline);
|
context.textBaseline = /** @type {CanvasTextBaseline} */ (
|
||||||
|
textState.textBaseline
|
||||||
|
);
|
||||||
this.contextTextState_ = {
|
this.contextTextState_ = {
|
||||||
font: textState.font,
|
font: textState.font,
|
||||||
textAlign: textAlign,
|
textAlign: textAlign,
|
||||||
@@ -948,8 +967,12 @@ class CanvasImmediateRenderer extends VectorContext {
|
|||||||
context.textAlign = /** @type {CanvasTextAlign} */ (textAlign);
|
context.textAlign = /** @type {CanvasTextAlign} */ (textAlign);
|
||||||
}
|
}
|
||||||
if (contextTextState.textBaseline != textState.textBaseline) {
|
if (contextTextState.textBaseline != textState.textBaseline) {
|
||||||
contextTextState.textBaseline = /** @type {CanvasTextBaseline} */ (textState.textBaseline);
|
contextTextState.textBaseline = /** @type {CanvasTextBaseline} */ (
|
||||||
context.textBaseline = /** @type {CanvasTextBaseline} */ (textState.textBaseline);
|
textState.textBaseline
|
||||||
|
);
|
||||||
|
context.textBaseline = /** @type {CanvasTextBaseline} */ (
|
||||||
|
textState.textBaseline
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1082,7 +1105,8 @@ class CanvasImmediateRenderer extends VectorContext {
|
|||||||
const textStrokeStyleColor = textStrokeStyle.getColor();
|
const textStrokeStyleColor = textStrokeStyle.getColor();
|
||||||
const textStrokeStyleLineCap = textStrokeStyle.getLineCap();
|
const textStrokeStyleLineCap = textStrokeStyle.getLineCap();
|
||||||
const textStrokeStyleLineDash = textStrokeStyle.getLineDash();
|
const textStrokeStyleLineDash = textStrokeStyle.getLineDash();
|
||||||
const textStrokeStyleLineDashOffset = textStrokeStyle.getLineDashOffset();
|
const textStrokeStyleLineDashOffset =
|
||||||
|
textStrokeStyle.getLineDashOffset();
|
||||||
const textStrokeStyleLineJoin = textStrokeStyle.getLineJoin();
|
const textStrokeStyleLineJoin = textStrokeStyle.getLineJoin();
|
||||||
const textStrokeStyleWidth = textStrokeStyle.getWidth();
|
const textStrokeStyleWidth = textStrokeStyle.getWidth();
|
||||||
const textStrokeStyleMiterLimit = textStrokeStyle.getMiterLimit();
|
const textStrokeStyleMiterLimit = textStrokeStyle.getMiterLimit();
|
||||||
|
|||||||
@@ -192,13 +192,18 @@ class CanvasTextBuilder extends CanvasBuilder {
|
|||||||
if (geometryType == GeometryType.LINE_STRING) {
|
if (geometryType == GeometryType.LINE_STRING) {
|
||||||
ends = [flatCoordinates.length];
|
ends = [flatCoordinates.length];
|
||||||
} else if (geometryType == GeometryType.MULTI_LINE_STRING) {
|
} 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) {
|
} else if (geometryType == GeometryType.POLYGON) {
|
||||||
ends = /** @type {import("../../geom/Polygon.js").default} */ (geometry)
|
ends = /** @type {import("../../geom/Polygon.js").default} */ (geometry)
|
||||||
.getEnds()
|
.getEnds()
|
||||||
.slice(0, 1);
|
.slice(0, 1);
|
||||||
} else if (geometryType == GeometryType.MULTI_POLYGON) {
|
} 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 = [];
|
ends = [];
|
||||||
for (let i = 0, ii = endss.length; i < ii; ++i) {
|
for (let i = 0, ii = endss.length; i < ii; ++i) {
|
||||||
ends.push(endss[i][0]);
|
ends.push(endss[i][0]);
|
||||||
@@ -236,27 +241,45 @@ class CanvasTextBuilder extends CanvasBuilder {
|
|||||||
switch (geometryType) {
|
switch (geometryType) {
|
||||||
case GeometryType.POINT:
|
case GeometryType.POINT:
|
||||||
case GeometryType.MULTI_POINT:
|
case GeometryType.MULTI_POINT:
|
||||||
flatCoordinates = /** @type {import("../../geom/MultiPoint.js").default} */ (geometry).getFlatCoordinates();
|
flatCoordinates =
|
||||||
|
/** @type {import("../../geom/MultiPoint.js").default} */ (
|
||||||
|
geometry
|
||||||
|
).getFlatCoordinates();
|
||||||
break;
|
break;
|
||||||
case GeometryType.LINE_STRING:
|
case GeometryType.LINE_STRING:
|
||||||
flatCoordinates = /** @type {import("../../geom/LineString.js").default} */ (geometry).getFlatMidpoint();
|
flatCoordinates =
|
||||||
|
/** @type {import("../../geom/LineString.js").default} */ (
|
||||||
|
geometry
|
||||||
|
).getFlatMidpoint();
|
||||||
break;
|
break;
|
||||||
case GeometryType.CIRCLE:
|
case GeometryType.CIRCLE:
|
||||||
flatCoordinates = /** @type {import("../../geom/Circle.js").default} */ (geometry).getCenter();
|
flatCoordinates =
|
||||||
|
/** @type {import("../../geom/Circle.js").default} */ (
|
||||||
|
geometry
|
||||||
|
).getCenter();
|
||||||
break;
|
break;
|
||||||
case GeometryType.MULTI_LINE_STRING:
|
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;
|
stride = 2;
|
||||||
break;
|
break;
|
||||||
case GeometryType.POLYGON:
|
case GeometryType.POLYGON:
|
||||||
flatCoordinates = /** @type {import("../../geom/Polygon.js").default} */ (geometry).getFlatInteriorPoint();
|
flatCoordinates =
|
||||||
|
/** @type {import("../../geom/Polygon.js").default} */ (
|
||||||
|
geometry
|
||||||
|
).getFlatInteriorPoint();
|
||||||
if (!textState.overflow) {
|
if (!textState.overflow) {
|
||||||
geometryWidths.push(flatCoordinates[2] / this.resolution);
|
geometryWidths.push(flatCoordinates[2] / this.resolution);
|
||||||
}
|
}
|
||||||
stride = 3;
|
stride = 3;
|
||||||
break;
|
break;
|
||||||
case GeometryType.MULTI_POLYGON:
|
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 = [];
|
flatCoordinates = [];
|
||||||
for (let i = 0, ii = interiorPoints.length; i < ii; i += 3) {
|
for (let i = 0, ii = interiorPoints.length; i < ii; i += 3) {
|
||||||
if (!textState.overflow) {
|
if (!textState.overflow) {
|
||||||
|
|||||||
@@ -356,9 +356,9 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
|||||||
tilePixelRatio * tileSource.getGutterForProjection(projection);
|
tilePixelRatio * tileSource.getGutterForProjection(projection);
|
||||||
const tilesToDraw = tilesToDrawByZ[currentZ];
|
const tilesToDraw = tilesToDrawByZ[currentZ];
|
||||||
for (const tileCoordKey in tilesToDraw) {
|
for (const tileCoordKey in tilesToDraw) {
|
||||||
const tile = /** @type {import("../../ImageTile.js").default} */ (tilesToDraw[
|
const tile = /** @type {import("../../ImageTile.js").default} */ (
|
||||||
tileCoordKey
|
tilesToDraw[tileCoordKey]
|
||||||
]);
|
);
|
||||||
const tileCoord = tile.tileCoord;
|
const tileCoord = tile.tileCoord;
|
||||||
|
|
||||||
// Calculate integer positions and sizes so that tiles align
|
// Calculate integer positions and sizes so that tiles align
|
||||||
@@ -543,7 +543,9 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
|||||||
}.bind(null, tileSource);
|
}.bind(null, tileSource);
|
||||||
|
|
||||||
frameState.postRenderFunctions.push(
|
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);
|
vectorRenderer.useContainer(null, null, 1);
|
||||||
const context = vectorRenderer.context;
|
const context = vectorRenderer.context;
|
||||||
const imageFrameState = /** @type {import("../../PluggableMap.js").FrameState} */ (assign(
|
const imageFrameState =
|
||||||
{},
|
/** @type {import("../../PluggableMap.js").FrameState} */ (
|
||||||
frameState,
|
assign({}, frameState, {
|
||||||
{
|
declutterTree: new RBush(9),
|
||||||
declutterTree: new RBush(9),
|
extent: renderedExtent,
|
||||||
extent: renderedExtent,
|
size: [width, height],
|
||||||
size: [width, height],
|
viewState: /** @type {import("../../View.js").State} */ (
|
||||||
viewState: /** @type {import("../../View.js").State} */ (assign(
|
assign({}, frameState.viewState, {
|
||||||
{},
|
rotation: 0,
|
||||||
frameState.viewState,
|
})
|
||||||
{
|
),
|
||||||
rotation: 0,
|
})
|
||||||
}
|
);
|
||||||
)),
|
|
||||||
}
|
|
||||||
));
|
|
||||||
const image = new ImageCanvas(
|
const image = new ImageCanvas(
|
||||||
renderedExtent,
|
renderedExtent,
|
||||||
viewResolution,
|
viewResolution,
|
||||||
@@ -168,7 +165,8 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.image_) {
|
if (this.image_) {
|
||||||
this.renderedPixelToCoordinateTransform_ = frameState.pixelToCoordinateTransform.slice();
|
this.renderedPixelToCoordinateTransform_ =
|
||||||
|
frameState.pixelToCoordinateTransform.slice();
|
||||||
}
|
}
|
||||||
|
|
||||||
return !!this.image_;
|
return !!this.image_;
|
||||||
|
|||||||
@@ -242,7 +242,9 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
updateExecutorGroup_(tile, pixelRatio, projection) {
|
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 revision = layer.getRevision();
|
||||||
const renderOrder = layer.getRenderOrder() || null;
|
const renderOrder = layer.getRenderOrder() || null;
|
||||||
|
|
||||||
@@ -276,9 +278,8 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const sourceTileCoord = sourceTile.tileCoord;
|
const sourceTileCoord = sourceTile.tileCoord;
|
||||||
const sourceTileExtent = sourceTileGrid.getTileCoordExtent(
|
const sourceTileExtent =
|
||||||
sourceTileCoord
|
sourceTileGrid.getTileCoordExtent(sourceTileCoord);
|
||||||
);
|
|
||||||
const sharedExtent = getIntersection(tileExtent, sourceTileExtent);
|
const sharedExtent = getIntersection(tileExtent, sourceTileExtent);
|
||||||
const builderExtent = buffer(
|
const builderExtent = buffer(
|
||||||
sharedExtent,
|
sharedExtent,
|
||||||
@@ -443,8 +444,10 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
return undefined;
|
return undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderedTiles = /** @type {Array<import("../../VectorRenderTile.js").default>} */ (this
|
const renderedTiles =
|
||||||
.renderedTiles);
|
/** @type {Array<import("../../VectorRenderTile.js").default>} */ (
|
||||||
|
this.renderedTiles
|
||||||
|
);
|
||||||
|
|
||||||
let found;
|
let found;
|
||||||
for (let i = 0, ii = renderedTiles.length; !found && i < ii; ++i) {
|
for (let i = 0, ii = renderedTiles.length; !found && i < ii; ++i) {
|
||||||
@@ -492,7 +495,10 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
getFeatures(pixel) {
|
getFeatures(pixel) {
|
||||||
return new Promise(
|
return new Promise(
|
||||||
function (resolve, reject) {
|
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 layerUid = getUid(layer);
|
||||||
const source = layer.getSource();
|
const source = layer.getSource();
|
||||||
const projection = this.renderedProjection;
|
const projection = this.renderedProjection;
|
||||||
@@ -607,8 +613,10 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
const hifi = !(
|
const hifi = !(
|
||||||
viewHints[ViewHint.ANIMATING] || viewHints[ViewHint.INTERACTING]
|
viewHints[ViewHint.ANIMATING] || viewHints[ViewHint.INTERACTING]
|
||||||
);
|
);
|
||||||
const tiles = /** @type {Array<import("../../VectorRenderTile.js").default>} */ (this
|
const tiles =
|
||||||
.renderedTiles);
|
/** @type {Array<import("../../VectorRenderTile.js").default>} */ (
|
||||||
|
this.renderedTiles
|
||||||
|
);
|
||||||
for (let i = 0, ii = tiles.length; i < ii; ++i) {
|
for (let i = 0, ii = tiles.length; i < ii; ++i) {
|
||||||
const tile = tiles[i];
|
const tile = tiles[i];
|
||||||
const declutterExecutorGroups =
|
const declutterExecutorGroups =
|
||||||
@@ -677,10 +685,13 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
this.renderQueuedTileImages_(hifi, frameState);
|
this.renderQueuedTileImages_(hifi, frameState);
|
||||||
|
|
||||||
super.renderFrame(frameState, target);
|
super.renderFrame(frameState, target);
|
||||||
this.renderedPixelToCoordinateTransform_ = frameState.pixelToCoordinateTransform.slice();
|
this.renderedPixelToCoordinateTransform_ =
|
||||||
|
frameState.pixelToCoordinateTransform.slice();
|
||||||
this.renderedRotation_ = frameState.viewState.rotation;
|
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 renderMode = layer.getRenderMode();
|
||||||
|
|
||||||
const source = layer.getSource();
|
const source = layer.getSource();
|
||||||
@@ -703,9 +714,9 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
const clips = [];
|
const clips = [];
|
||||||
const clipZs = [];
|
const clipZs = [];
|
||||||
for (let i = tiles.length - 1; i >= 0; --i) {
|
for (let i = tiles.length - 1; i >= 0; --i) {
|
||||||
const tile = /** @type {import("../../VectorRenderTile.js").default} */ (tiles[
|
const tile = /** @type {import("../../VectorRenderTile.js").default} */ (
|
||||||
i
|
tiles[i]
|
||||||
]);
|
);
|
||||||
const transform = this.getTileRenderTransform(tile, frameState);
|
const transform = this.getTileRenderTransform(tile, frameState);
|
||||||
const executorGroups = tile.executorGroups[getUid(layer)];
|
const executorGroups = tile.executorGroups[getUid(layer)];
|
||||||
let clipped = false;
|
let clipped = false;
|
||||||
@@ -834,7 +845,9 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
tileImageNeedsRender_(tile) {
|
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) {
|
if (layer.getRenderMode() === VectorTileRenderType.VECTOR) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -853,7 +866,9 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
renderTileImage_(tile, frameState) {
|
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 replayState = tile.getReplayState(layer);
|
||||||
const revision = layer.getRevision();
|
const revision = layer.getRevision();
|
||||||
const executorGroups = tile.executorGroups[getUid(layer)];
|
const executorGroups = tile.executorGroups[getUid(layer)];
|
||||||
|
|||||||
@@ -195,7 +195,10 @@ function renderFeatureInternal(
|
|||||||
*/
|
*/
|
||||||
function renderGeometry(replayGroup, geometry, style, feature) {
|
function renderGeometry(replayGroup, geometry, style, feature) {
|
||||||
if (geometry.getType() == GeometryType.GEOMETRY_COLLECTION) {
|
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) {
|
for (let i = 0, ii = geometries.length; i < ii; ++i) {
|
||||||
renderGeometry(replayGroup, geometries[i], style, feature);
|
renderGeometry(replayGroup, geometries[i], style, feature);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -526,7 +526,9 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
|
|||||||
let hitColor;
|
let hitColor;
|
||||||
for (const featureUid in this.featureCache_) {
|
for (const featureUid in this.featureCache_) {
|
||||||
featureCache = this.featureCache_[featureUid];
|
featureCache = this.featureCache_[featureUid];
|
||||||
geometry = /** @type {import("../../geom").Point} */ (featureCache.geometry);
|
geometry = /** @type {import("../../geom").Point} */ (
|
||||||
|
featureCache.geometry
|
||||||
|
);
|
||||||
if (!geometry || geometry.getType() !== GeometryType.POINT) {
|
if (!geometry || geometry.getType() !== GeometryType.POINT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,9 +157,9 @@ class CartoDB extends XYZ {
|
|||||||
if (!client.status || (client.status >= 200 && client.status < 300)) {
|
if (!client.status || (client.status >= 200 && client.status < 300)) {
|
||||||
let response;
|
let response;
|
||||||
try {
|
try {
|
||||||
response = /** @type {CartoDBLayerInfo} */ (JSON.parse(
|
response = /** @type {CartoDBLayerInfo} */ (
|
||||||
client.responseText
|
JSON.parse(client.responseText)
|
||||||
));
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.setState(SourceState.ERROR);
|
this.setState(SourceState.ERROR);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -113,7 +113,10 @@ class ImageWMS extends ImageSource {
|
|||||||
* @private
|
* @private
|
||||||
* @type {import("./WMSServerType.js").default|undefined}
|
* @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
|
* @private
|
||||||
|
|||||||
@@ -626,15 +626,13 @@ class RasterSource extends ImageSource {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
updateFrameState_(extent, resolution, projection) {
|
updateFrameState_(extent, resolution, projection) {
|
||||||
const frameState = /** @type {import("../PluggableMap.js").FrameState} */ (assign(
|
const frameState = /** @type {import("../PluggableMap.js").FrameState} */ (
|
||||||
{},
|
assign({}, this.frameState_)
|
||||||
this.frameState_
|
);
|
||||||
));
|
|
||||||
|
|
||||||
frameState.viewState = /** @type {import("../View.js").State} */ (assign(
|
frameState.viewState = /** @type {import("../View.js").State} */ (
|
||||||
{},
|
assign({}, frameState.viewState)
|
||||||
frameState.viewState
|
);
|
||||||
));
|
|
||||||
|
|
||||||
const center = getCenter(extent);
|
const center = getCenter(extent);
|
||||||
|
|
||||||
|
|||||||
@@ -153,9 +153,9 @@ class TileSource extends Source {
|
|||||||
tileCoordKey = getKeyZXY(z, x, y);
|
tileCoordKey = getKeyZXY(z, x, y);
|
||||||
loaded = false;
|
loaded = false;
|
||||||
if (tileCache.containsKey(tileCoordKey)) {
|
if (tileCache.containsKey(tileCoordKey)) {
|
||||||
tile = /** @type {!import("../Tile.js").default} */ (tileCache.get(
|
tile = /** @type {!import("../Tile.js").default} */ (
|
||||||
tileCoordKey
|
tileCache.get(tileCoordKey)
|
||||||
));
|
);
|
||||||
loaded = tile.getState() === TileState.LOADED;
|
loaded = tile.getState() === TileState.LOADED;
|
||||||
if (loaded) {
|
if (loaded) {
|
||||||
loaded = callback(tile) !== false;
|
loaded = callback(tile) !== false;
|
||||||
|
|||||||
@@ -251,9 +251,8 @@ class TileImage extends UrlTile {
|
|||||||
} else {
|
} else {
|
||||||
const projKey = getUid(projection);
|
const projKey = getUid(projection);
|
||||||
if (!(projKey in this.tileGridForProjection)) {
|
if (!(projKey in this.tileGridForProjection)) {
|
||||||
this.tileGridForProjection[projKey] = getTileGridForProjection(
|
this.tileGridForProjection[projKey] =
|
||||||
projection
|
getTileGridForProjection(projection);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return this.tileGridForProjection[projKey];
|
return this.tileGridForProjection[projKey];
|
||||||
}
|
}
|
||||||
@@ -472,7 +471,8 @@ class TileImage extends UrlTile {
|
|||||||
* @param {string} src Source.
|
* @param {string} src Source.
|
||||||
*/
|
*/
|
||||||
function defaultTileLoadFunction(imageTile, src) {
|
function defaultTileLoadFunction(imageTile, src) {
|
||||||
/** @type {HTMLImageElement|HTMLVideoElement} */ (imageTile.getImage()).src = src;
|
/** @type {HTMLImageElement|HTMLVideoElement} */ (imageTile.getImage()).src =
|
||||||
|
src;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TileImage;
|
export default TileImage;
|
||||||
|
|||||||
@@ -127,7 +127,10 @@ class TileWMS extends TileImage {
|
|||||||
* @private
|
* @private
|
||||||
* @type {import("./WMSServerType.js").default|undefined}
|
* @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
|
* @private
|
||||||
|
|||||||
@@ -222,9 +222,9 @@ export class CustomTile extends Tile {
|
|||||||
if (!client.status || (client.status >= 200 && client.status < 300)) {
|
if (!client.status || (client.status >= 200 && client.status < 300)) {
|
||||||
let response;
|
let response;
|
||||||
try {
|
try {
|
||||||
response = /** @type {!UTFGridJSON} */ (JSON.parse(
|
response = /** @type {!UTFGridJSON} */ (
|
||||||
client.responseText
|
JSON.parse(client.responseText)
|
||||||
));
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.handleError_();
|
this.handleError_();
|
||||||
return;
|
return;
|
||||||
@@ -341,9 +341,9 @@ class UTFGrid extends TileSource {
|
|||||||
if (!client.status || (client.status >= 200 && client.status < 300)) {
|
if (!client.status || (client.status >= 200 && client.status < 300)) {
|
||||||
let response;
|
let response;
|
||||||
try {
|
try {
|
||||||
response = /** @type {import("./TileJSON.js").Config} */ (JSON.parse(
|
response = /** @type {import("./TileJSON.js").Config} */ (
|
||||||
client.responseText
|
JSON.parse(client.responseText)
|
||||||
));
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.handleTileJSONError();
|
this.handleTileJSONError();
|
||||||
return;
|
return;
|
||||||
@@ -391,13 +391,15 @@ class UTFGrid extends TileSource {
|
|||||||
if (this.tileGrid) {
|
if (this.tileGrid) {
|
||||||
const z = this.tileGrid.getZForResolution(resolution, this.zDirection);
|
const z = this.tileGrid.getZForResolution(resolution, this.zDirection);
|
||||||
const tileCoord = this.tileGrid.getTileCoordForCoordAndZ(coordinate, z);
|
const tileCoord = this.tileGrid.getTileCoordForCoordAndZ(coordinate, z);
|
||||||
const tile = /** @type {!CustomTile} */ (this.getTile(
|
const tile = /** @type {!CustomTile} */ (
|
||||||
tileCoord[0],
|
this.getTile(
|
||||||
tileCoord[1],
|
tileCoord[0],
|
||||||
tileCoord[2],
|
tileCoord[1],
|
||||||
1,
|
tileCoord[2],
|
||||||
this.getProjection()
|
1,
|
||||||
));
|
this.getProjection()
|
||||||
|
)
|
||||||
|
);
|
||||||
tile.forDataAtCoordinate(coordinate, callback, opt_request);
|
tile.forDataAtCoordinate(coordinate, callback, opt_request);
|
||||||
} else {
|
} else {
|
||||||
if (opt_request === true) {
|
if (opt_request === true) {
|
||||||
|
|||||||
@@ -474,7 +474,9 @@ class VectorSource extends Source {
|
|||||||
if (!modifyingCollection) {
|
if (!modifyingCollection) {
|
||||||
modifyingCollection = true;
|
modifyingCollection = true;
|
||||||
this.addFeature(
|
this.addFeature(
|
||||||
/** @type {import("../Feature.js").default<Geometry>} */ (evt.element)
|
/** @type {import("../Feature.js").default<Geometry>} */ (
|
||||||
|
evt.element
|
||||||
|
)
|
||||||
);
|
);
|
||||||
modifyingCollection = false;
|
modifyingCollection = false;
|
||||||
}
|
}
|
||||||
@@ -489,7 +491,9 @@ class VectorSource extends Source {
|
|||||||
if (!modifyingCollection) {
|
if (!modifyingCollection) {
|
||||||
modifyingCollection = true;
|
modifyingCollection = true;
|
||||||
this.removeFeature(
|
this.removeFeature(
|
||||||
/** @type {import("../Feature.js").default<Geometry>} */ (evt.element)
|
/** @type {import("../Feature.js").default<Geometry>} */ (
|
||||||
|
evt.element
|
||||||
|
)
|
||||||
);
|
);
|
||||||
modifyingCollection = false;
|
modifyingCollection = false;
|
||||||
}
|
}
|
||||||
@@ -668,7 +672,9 @@ class VectorSource extends Source {
|
|||||||
extend(features, getValues(this.nullGeometryFeatures_));
|
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
|
* @private
|
||||||
*/
|
*/
|
||||||
handleFeatureChange_(event) {
|
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 featureKey = getUid(feature);
|
||||||
const geometry = feature.getGeometry();
|
const geometry = feature.getGeometry();
|
||||||
if (!geometry) {
|
if (!geometry) {
|
||||||
|
|||||||
@@ -323,9 +323,8 @@ class VectorTile extends UrlTile {
|
|||||||
tile.loadingSourceTiles++;
|
tile.loadingSourceTiles++;
|
||||||
}
|
}
|
||||||
if (sourceTileState === TileState.IDLE) {
|
if (sourceTileState === TileState.IDLE) {
|
||||||
sourceTile.extent = sourceTileGrid.getTileCoordExtent(
|
sourceTile.extent =
|
||||||
sourceTileCoord
|
sourceTileGrid.getTileCoordExtent(sourceTileCoord);
|
||||||
);
|
|
||||||
sourceTile.projection = projection;
|
sourceTile.projection = projection;
|
||||||
sourceTile.resolution = sourceTileGrid.getResolution(
|
sourceTile.resolution = sourceTileGrid.getResolution(
|
||||||
sourceTileCoord[0]
|
sourceTileCoord[0]
|
||||||
@@ -471,9 +470,8 @@ class VectorTile extends UrlTile {
|
|||||||
*/
|
*/
|
||||||
updateCacheSize(tileCount, projection) {
|
updateCacheSize(tileCount, projection) {
|
||||||
super.updateCacheSize(tileCount * 2, projection);
|
super.updateCacheSize(tileCount * 2, projection);
|
||||||
this.sourceTileCache.highWaterMark = this.getTileCacheForProjection(
|
this.sourceTileCache.highWaterMark =
|
||||||
projection
|
this.getTileCacheForProjection(projection).highWaterMark;
|
||||||
).highWaterMark;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,9 @@ class WMTS extends TileImage {
|
|||||||
|
|
||||||
const requestEncoding =
|
const requestEncoding =
|
||||||
options.requestEncoding !== undefined
|
options.requestEncoding !== undefined
|
||||||
? /** @type {import("./WMTSRequestEncoding.js").default} */ (options.requestEncoding)
|
? /** @type {import("./WMTSRequestEncoding.js").default} */ (
|
||||||
|
options.requestEncoding
|
||||||
|
)
|
||||||
: WMTSRequestEncoding.KVP;
|
: WMTSRequestEncoding.KVP;
|
||||||
|
|
||||||
// FIXME: should we create a default tileGrid?
|
// FIXME: should we create a default tileGrid?
|
||||||
@@ -293,8 +295,9 @@ class WMTS extends TileImage {
|
|||||||
return p.toLowerCase() in context ? context[p.toLowerCase()] : m;
|
return p.toLowerCase() in context ? context[p.toLowerCase()] : m;
|
||||||
});
|
});
|
||||||
|
|
||||||
const tileGrid = /** @type {import("../tilegrid/WMTS.js").default} */ (this
|
const tileGrid = /** @type {import("../tilegrid/WMTS.js").default} */ (
|
||||||
.tileGrid);
|
this.tileGrid
|
||||||
|
);
|
||||||
const dimensions = this.dimensions_;
|
const dimensions = this.dimensions_;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -90,20 +90,26 @@ export function getLength(geometry, opt_options) {
|
|||||||
}
|
}
|
||||||
case GeometryType.LINE_STRING:
|
case GeometryType.LINE_STRING:
|
||||||
case GeometryType.LINEAR_RING: {
|
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);
|
length = getLengthInternal(coordinates, radius);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GeometryType.MULTI_LINE_STRING:
|
case GeometryType.MULTI_LINE_STRING:
|
||||||
case GeometryType.POLYGON: {
|
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) {
|
for (i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||||
length += getLengthInternal(coordinates[i], radius);
|
length += getLengthInternal(coordinates[i], radius);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GeometryType.MULTI_POLYGON: {
|
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) {
|
for (i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||||
coords = coordinates[i];
|
coords = coordinates[i];
|
||||||
for (j = 0, jj = coords.length; j < jj; ++j) {
|
for (j = 0, jj = coords.length; j < jj; ++j) {
|
||||||
@@ -113,7 +119,10 @@ export function getLength(geometry, opt_options) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GeometryType.GEOMETRY_COLLECTION: {
|
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) {
|
for (i = 0, ii = geometries.length; i < ii; ++i) {
|
||||||
length += getLength(geometries[i], opt_options);
|
length += getLength(geometries[i], opt_options);
|
||||||
}
|
}
|
||||||
@@ -186,7 +195,9 @@ export function getArea(geometry, opt_options) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GeometryType.POLYGON: {
|
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));
|
area = Math.abs(getAreaInternal(coordinates[0], radius));
|
||||||
for (i = 1, ii = coordinates.length; i < ii; ++i) {
|
for (i = 1, ii = coordinates.length; i < ii; ++i) {
|
||||||
area -= Math.abs(getAreaInternal(coordinates[i], radius));
|
area -= Math.abs(getAreaInternal(coordinates[i], radius));
|
||||||
@@ -194,7 +205,9 @@ export function getArea(geometry, opt_options) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GeometryType.MULTI_POLYGON: {
|
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) {
|
for (i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||||
coords = coordinates[i];
|
coords = coordinates[i];
|
||||||
area += Math.abs(getAreaInternal(coords[0], radius));
|
area += Math.abs(getAreaInternal(coords[0], radius));
|
||||||
@@ -205,7 +218,10 @@ export function getArea(geometry, opt_options) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GeometryType.GEOMETRY_COLLECTION: {
|
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) {
|
for (i = 0, ii = geometries.length; i < ii; ++i) {
|
||||||
area += getArea(geometries[i], opt_options);
|
area += getArea(geometries[i], opt_options);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,7 +213,9 @@ class Style {
|
|||||||
clone() {
|
clone() {
|
||||||
let geometry = this.getGeometry();
|
let geometry = this.getGeometry();
|
||||||
if (geometry && typeof geometry === 'object') {
|
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({
|
return new Style({
|
||||||
geometry: geometry,
|
geometry: geometry,
|
||||||
@@ -361,9 +363,9 @@ class Style {
|
|||||||
this.geometryFunction_ = geometry;
|
this.geometryFunction_ = geometry;
|
||||||
} else if (typeof geometry === 'string') {
|
} else if (typeof geometry === 'string') {
|
||||||
this.geometryFunction_ = function (feature) {
|
this.geometryFunction_ = function (feature) {
|
||||||
return /** @type {import("../geom/Geometry.js").default} */ (feature.get(
|
return /** @type {import("../geom/Geometry.js").default} */ (
|
||||||
geometry
|
feature.get(geometry)
|
||||||
));
|
);
|
||||||
};
|
};
|
||||||
} else if (!geometry) {
|
} else if (!geometry) {
|
||||||
this.geometryFunction_ = defaultGeometryFunction;
|
this.geometryFunction_ = defaultGeometryFunction;
|
||||||
|
|||||||
@@ -6,9 +6,11 @@
|
|||||||
* @return {?} Any return.
|
* @return {?} Any return.
|
||||||
*/
|
*/
|
||||||
export function abstract() {
|
export function abstract() {
|
||||||
return /** @type {?} */ ((function () {
|
return /** @type {?} */ (
|
||||||
throw new Error('Unimplemented abstract method.');
|
(function () {
|
||||||
})());
|
throw new Error('Unimplemented abstract method.');
|
||||||
|
})()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -248,9 +248,8 @@ class WebGLHelper extends Disposable {
|
|||||||
this.boundHandleWebGLContextLost_ = this.handleWebGLContextLost.bind(this);
|
this.boundHandleWebGLContextLost_ = this.handleWebGLContextLost.bind(this);
|
||||||
|
|
||||||
/** @private */
|
/** @private */
|
||||||
this.boundHandleWebGLContextRestored_ = this.handleWebGLContextRestored.bind(
|
this.boundHandleWebGLContextRestored_ =
|
||||||
this
|
this.handleWebGLContextRestored.bind(this);
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -123,9 +123,9 @@ export function makeArrayExtender(valueReader, opt_this) {
|
|||||||
objectStack
|
objectStack
|
||||||
);
|
);
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
const array = /** @type {Array<*>} */ (objectStack[
|
const array = /** @type {Array<*>} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
extend(array, value);
|
extend(array, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,9 +153,9 @@ export function makeArrayPusher(valueReader, opt_this) {
|
|||||||
objectStack
|
objectStack
|
||||||
);
|
);
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
const array = /** @type {Array<*>} */ (objectStack[
|
const array = /** @type {Array<*>} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
array.push(value);
|
array.push(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -211,9 +211,9 @@ export function makeObjectPropertyPusher(valueReader, opt_property, opt_this) {
|
|||||||
objectStack
|
objectStack
|
||||||
);
|
);
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
const object = /** @type {!Object} */ (objectStack[
|
const object = /** @type {!Object} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
const property =
|
const property =
|
||||||
opt_property !== undefined ? opt_property : node.localName;
|
opt_property !== undefined ? opt_property : node.localName;
|
||||||
let array;
|
let array;
|
||||||
@@ -250,9 +250,9 @@ export function makeObjectPropertySetter(valueReader, opt_property, opt_this) {
|
|||||||
objectStack
|
objectStack
|
||||||
);
|
);
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
const object = /** @type {!Object} */ (objectStack[
|
const object = /** @type {!Object} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
const property =
|
const property =
|
||||||
opt_property !== undefined ? opt_property : node.localName;
|
opt_property !== undefined ? opt_property : node.localName;
|
||||||
object[property] = value;
|
object[property] = value;
|
||||||
@@ -278,9 +278,9 @@ export function makeChildAppender(nodeWriter, opt_this) {
|
|||||||
value,
|
value,
|
||||||
objectStack
|
objectStack
|
||||||
);
|
);
|
||||||
const parent = /** @type {NodeStackItem} */ (objectStack[
|
const parent = /** @type {NodeStackItem} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
const parentNode = parent.node;
|
const parentNode = parent.node;
|
||||||
parentNode.appendChild(node);
|
parentNode.appendChild(node);
|
||||||
};
|
};
|
||||||
@@ -335,9 +335,9 @@ export function makeSimpleNodeFactory(opt_nodeName, opt_namespaceURI) {
|
|||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
*/
|
*/
|
||||||
function (value, objectStack, opt_nodeName) {
|
function (value, objectStack, opt_nodeName) {
|
||||||
const context = /** @type {NodeStackItem} */ (objectStack[
|
const context = /** @type {NodeStackItem} */ (
|
||||||
objectStack.length - 1
|
objectStack[objectStack.length - 1]
|
||||||
]);
|
);
|
||||||
const node = context.node;
|
const node = context.node;
|
||||||
let nodeName = fixedNodeName;
|
let nodeName = fixedNodeName;
|
||||||
if (nodeName === undefined) {
|
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]);
|
expect(fromString('rgba(255, 255, 0, 0.0)')).to.eql([255, 255, 0, 0]);
|
||||||
// opacity 0.0000000000000000 (float with 16 digits)
|
// opacity 0.0000000000000000 (float with 16 digits)
|
||||||
expect(fromString('rgba(255, 255, 0, 0.0000000000000000)')).to.eql([
|
expect(fromString('rgba(255, 255, 0, 0.0000000000000000)')).to.eql([
|
||||||
255,
|
255, 255, 0, 0,
|
||||||
255,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
]);
|
]);
|
||||||
// opacity 0.1 (simple float)
|
// opacity 0.1 (simple float)
|
||||||
expect(fromString('rgba(255, 255, 0, 0.1)')).to.eql([255, 255, 0, 0.1]);
|
expect(fromString('rgba(255, 255, 0, 0.1)')).to.eql([255, 255, 0, 0.1]);
|
||||||
// opacity 0.1111111111111111 (float with 16 digits)
|
// opacity 0.1111111111111111 (float with 16 digits)
|
||||||
expect(fromString('rgba(255, 255, 0, 0.1111111111111111)')).to.eql([
|
expect(fromString('rgba(255, 255, 0, 0.1111111111111111)')).to.eql([
|
||||||
255,
|
255, 255, 0, 0.1111111111111111,
|
||||||
255,
|
|
||||||
0,
|
|
||||||
0.1111111111111111,
|
|
||||||
]);
|
]);
|
||||||
// opacity 1
|
// opacity 1
|
||||||
expect(fromString('rgba(255, 255, 0, 1)')).to.eql([255, 255, 0, 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]);
|
expect(fromString('rgba(255, 255, 0, 1.0)')).to.eql([255, 255, 0, 1]);
|
||||||
// opacity 1.0000000000000000
|
// opacity 1.0000000000000000
|
||||||
expect(fromString('rgba(255, 255, 0, 1.0000000000000000)')).to.eql([
|
expect(fromString('rgba(255, 255, 0, 1.0000000000000000)')).to.eql([
|
||||||
255,
|
255, 255, 0, 1,
|
||||||
255,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
]);
|
]);
|
||||||
// with 30 decimal digits
|
// with 30 decimal digits
|
||||||
expect(
|
expect(
|
||||||
@@ -118,9 +109,9 @@ describe('ol.color', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('ignores whitespace before, between & after numbers (rgba)', function () {
|
it('ignores whitespace before, between & after numbers (rgba)', function () {
|
||||||
expect(
|
expect(fromString('rgba( \t 0 , 0 \n , 255 , 0.4711 )')).to.eql(
|
||||||
fromString('rgba( \t 0 , 0 \n , 255 , 0.4711 )')
|
[0, 0, 255, 0.4711]
|
||||||
).to.eql([0, 0, 255, 0.4711]);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('throws an error on invalid colors', function () {
|
it('throws an error on invalid colors', function () {
|
||||||
|
|||||||
@@ -47,9 +47,8 @@ describe('ol.control.ZoomSlider', function () {
|
|||||||
const zoomSliderContainer = zoomSliderContainers[0];
|
const zoomSliderContainer = zoomSliderContainers[0];
|
||||||
expect(zoomSliderContainer instanceof HTMLDivElement).to.be(true);
|
expect(zoomSliderContainer instanceof HTMLDivElement).to.be(true);
|
||||||
|
|
||||||
let hasUnselectableCls = zoomSliderContainer.classList.contains(
|
let hasUnselectableCls =
|
||||||
'ol-unselectable'
|
zoomSliderContainer.classList.contains('ol-unselectable');
|
||||||
);
|
|
||||||
expect(hasUnselectableCls).to.be(true);
|
expect(hasUnselectableCls).to.be(true);
|
||||||
|
|
||||||
const zoomSliderThumbs = zoomSliderContainer.querySelectorAll(
|
const zoomSliderThumbs = zoomSliderContainer.querySelectorAll(
|
||||||
@@ -60,9 +59,8 @@ describe('ol.control.ZoomSlider', function () {
|
|||||||
const zoomSliderThumb = zoomSliderThumbs[0];
|
const zoomSliderThumb = zoomSliderThumbs[0];
|
||||||
expect(zoomSliderThumb instanceof HTMLButtonElement).to.be(true);
|
expect(zoomSliderThumb instanceof HTMLButtonElement).to.be(true);
|
||||||
|
|
||||||
hasUnselectableCls = zoomSliderThumb.classList.contains(
|
hasUnselectableCls =
|
||||||
'ol-unselectable'
|
zoomSliderThumb.classList.contains('ol-unselectable');
|
||||||
);
|
|
||||||
expect(hasUnselectableCls).to.be(true);
|
expect(hasUnselectableCls).to.be(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1793,29 +1793,13 @@ describe('ol.format.GML3', function () {
|
|||||||
|
|
||||||
it('creates 3D Features with the expected geometries', function () {
|
it('creates 3D Features with the expected geometries', function () {
|
||||||
const expectedGeometry1 = [
|
const expectedGeometry1 = [
|
||||||
4.46386854,
|
4.46386854, 51.91122415, 46.04679351, 4.46382399, 51.91120839,
|
||||||
51.91122415,
|
|
||||||
46.04679351,
|
|
||||||
4.46382399,
|
|
||||||
51.91120839,
|
|
||||||
46.04679382,
|
46.04679382,
|
||||||
];
|
];
|
||||||
const expectedGeometry2 = [
|
const expectedGeometry2 = [
|
||||||
4.46385491,
|
4.46385491, 51.91119276, 46.06074531, 4.4638264, 51.91118582,
|
||||||
51.91119276,
|
46.06074609, 4.46380612, 51.91121772, 46.06074168, 4.46383463,
|
||||||
46.06074531,
|
51.91122465, 46.06074089, 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];
|
const expectedGeometry3 = [4.46383715, 51.91125849, 46.04679348];
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,7 @@ where('ArrayBuffer.isView').describe('ol.format.MVT', function () {
|
|||||||
const options = {
|
const options = {
|
||||||
featureProjection: 'EPSG:3857',
|
featureProjection: 'EPSG:3857',
|
||||||
extent: [
|
extent: [
|
||||||
1824704.739223726,
|
1824704.739223726, 6141868.096770482, 1827150.7241288517,
|
||||||
6141868.096770482,
|
|
||||||
1827150.7241288517,
|
|
||||||
6144314.081675608,
|
6144314.081675608,
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
@@ -134,9 +132,7 @@ describe('ol.format.MVT', function () {
|
|||||||
const options = {
|
const options = {
|
||||||
featureProjection: 'EPSG:3857',
|
featureProjection: 'EPSG:3857',
|
||||||
extent: [
|
extent: [
|
||||||
1824704.739223726,
|
1824704.739223726, 6141868.096770482, 1827150.7241288517,
|
||||||
6141868.096770482,
|
|
||||||
1827150.7241288517,
|
|
||||||
6144314.081675608,
|
6144314.081675608,
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -139,10 +139,7 @@ describe('ol.format.WFS', function () {
|
|||||||
expect(feature.getId()).to.equal('1');
|
expect(feature.getId()).to.equal('1');
|
||||||
expect(feature.get('name')).to.equal('My Polygon with hole');
|
expect(feature.get('name')).to.equal('My Polygon with hole');
|
||||||
expect(feature.get('boundedBy')).to.eql([
|
expect(feature.get('boundedBy')).to.eql([
|
||||||
47.003018,
|
47.003018, -0.768746, 47.925567, 0.532597,
|
||||||
-0.768746,
|
|
||||||
47.925567,
|
|
||||||
0.532597,
|
|
||||||
]);
|
]);
|
||||||
expect(feature.getGeometry()).to.be.an(MultiPolygon);
|
expect(feature.getGeometry()).to.be.an(MultiPolygon);
|
||||||
expect(feature.getGeometry().getFlatCoordinates()).to.have.length(60);
|
expect(feature.getGeometry().getFlatCoordinates()).to.have.length(60);
|
||||||
@@ -205,10 +202,7 @@ describe('ol.format.WFS', function () {
|
|||||||
});
|
});
|
||||||
it('returns the correct bounds', function () {
|
it('returns the correct bounds', function () {
|
||||||
expect(response.bounds).to.eql([
|
expect(response.bounds).to.eql([
|
||||||
3197.88,
|
3197.88, 306457.313, 280339.156, 613850.438,
|
||||||
306457.313,
|
|
||||||
280339.156,
|
|
||||||
613850.438,
|
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -117,10 +117,7 @@ describe('ol.format.WMSCapabilities', function () {
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
expect(layer.Layer[0].EX_GeographicBoundingBox).to.eql([
|
expect(layer.Layer[0].EX_GeographicBoundingBox).to.eql([
|
||||||
-71.63,
|
-71.63, 41.75, -70.78, 42.9,
|
||||||
41.75,
|
|
||||||
-70.78,
|
|
||||||
42.9,
|
|
||||||
]);
|
]);
|
||||||
expect(layer.Layer[0].Style).to.eql([
|
expect(layer.Layer[0].Style).to.eql([
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -55,10 +55,7 @@ describe('ol.format.WMSGetFeatureInfo', function () {
|
|||||||
const feature = features[0];
|
const feature = features[0];
|
||||||
expect(feature.getGeometry()).to.be(undefined);
|
expect(feature.getGeometry()).to.be(undefined);
|
||||||
expect(feature.get('boundedBy')).to.eql([
|
expect(feature.get('boundedBy')).to.eql([
|
||||||
-531138.686422,
|
-531138.686422, 5386348.414671, -117252.819653, 6144475.186022,
|
||||||
5386348.414671,
|
|
||||||
-117252.819653,
|
|
||||||
6144475.186022,
|
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -19,9 +19,7 @@ describe('ol.layer.Graticule', function () {
|
|||||||
it('creates a graticule without labels', function () {
|
it('creates a graticule without labels', function () {
|
||||||
createGraticule();
|
createGraticule();
|
||||||
const extent = [
|
const extent = [
|
||||||
-25614353.926475704,
|
-25614353.926475704, -7827151.696402049, 25614353.926475704,
|
||||||
-7827151.696402049,
|
|
||||||
25614353.926475704,
|
|
||||||
7827151.696402049,
|
7827151.696402049,
|
||||||
];
|
];
|
||||||
const projection = getProjection('EPSG:3857');
|
const projection = getProjection('EPSG:3857');
|
||||||
@@ -45,9 +43,7 @@ describe('ol.layer.Graticule', function () {
|
|||||||
layers: [graticule],
|
layers: [graticule],
|
||||||
});
|
});
|
||||||
const extent = [
|
const extent = [
|
||||||
-25614353.926475704,
|
-25614353.926475704, -7827151.696402049, 25614353.926475704,
|
||||||
-7827151.696402049,
|
|
||||||
25614353.926475704,
|
|
||||||
7827151.696402049,
|
7827151.696402049,
|
||||||
];
|
];
|
||||||
const projection = getProjection('EPSG:3857');
|
const projection = getProjection('EPSG:3857');
|
||||||
@@ -97,9 +93,7 @@ describe('ol.layer.Graticule', function () {
|
|||||||
layers: [graticule],
|
layers: [graticule],
|
||||||
});
|
});
|
||||||
const extent = [
|
const extent = [
|
||||||
-25614353.926475704,
|
-25614353.926475704, -7827151.696402049, 25614353.926475704,
|
||||||
-7827151.696402049,
|
|
||||||
25614353.926475704,
|
|
||||||
7827151.696402049,
|
7827151.696402049,
|
||||||
];
|
];
|
||||||
const projection = getProjection('EPSG:3857');
|
const projection = getProjection('EPSG:3857');
|
||||||
@@ -183,9 +177,7 @@ describe('ol.layer.Graticule', function () {
|
|||||||
latLabelStyle: latLabelStyle,
|
latLabelStyle: latLabelStyle,
|
||||||
});
|
});
|
||||||
const extent = [
|
const extent = [
|
||||||
-25614353.926475704,
|
-25614353.926475704, -7827151.696402049, 25614353.926475704,
|
||||||
-7827151.696402049,
|
|
||||||
25614353.926475704,
|
|
||||||
7827151.696402049,
|
7827151.696402049,
|
||||||
];
|
];
|
||||||
const projection = getProjection('EPSG:3857');
|
const projection = getProjection('EPSG:3857');
|
||||||
@@ -224,9 +216,7 @@ describe('ol.layer.Graticule', function () {
|
|||||||
layers: [graticule],
|
layers: [graticule],
|
||||||
});
|
});
|
||||||
const extent = [
|
const extent = [
|
||||||
-25614353.926475704,
|
-25614353.926475704, -7827151.696402049, 25614353.926475704,
|
||||||
-7827151.696402049,
|
|
||||||
25614353.926475704,
|
|
||||||
7827151.696402049,
|
7827151.696402049,
|
||||||
];
|
];
|
||||||
const projection = getProjection('EPSG:3857');
|
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