38321 lines
2.1 MiB
38321 lines
2.1 MiB
!function (t, e) {
|
||
"object" == typeof exports && "object" == typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? exports.FMapClient = e() : t.FMapClient = e()
|
||
}(window, function () {
|
||
return function (t) {
|
||
var e = {};
|
||
|
||
function i(r) {
|
||
if (e[r]) return e[r].exports;
|
||
var o = e[r] = {i: r, l: !1, exports: {}};
|
||
return t[r].call(o.exports, o, o.exports, i), o.l = !0, o.exports
|
||
}
|
||
|
||
return i.m = t, i.c = e, i.d = function (t, e, r) {
|
||
i.o(t, e) || Object.defineProperty(t, e, {enumerable: !0, get: r})
|
||
}, i.r = function (t) {
|
||
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(t, "__esModule", {value: !0})
|
||
}, i.t = function (t, e) {
|
||
if (1 & e && (t = i(t)), 8 & e) return t;
|
||
if (4 & e && "object" == typeof t && t && t.__esModule) return t;
|
||
var r = Object.create(null);
|
||
if (i.r(r), Object.defineProperty(r, "default", {
|
||
enumerable: !0,
|
||
value: t
|
||
}), 2 & e && "string" != typeof t) for (var o in t) i.d(r, o, function (e) {
|
||
return t[e]
|
||
}.bind(null, o));
|
||
return r
|
||
}, i.n = function (t) {
|
||
var e = t && t.__esModule ? function () {
|
||
return t.default
|
||
} : function () {
|
||
return t
|
||
};
|
||
return i.d(e, "a", e), e
|
||
}, i.o = function (t, e) {
|
||
return Object.prototype.hasOwnProperty.call(t, e)
|
||
}, i.p = "", i(i.s = 21)
|
||
}([, , function (t, e, i) {
|
||
(function (t, i) {
|
||
(function (e) {
|
||
"use strict";
|
||
var r = {
|
||
$version: 8,
|
||
$root: {
|
||
version: {
|
||
required: !0,
|
||
type: "enum",
|
||
values: [8],
|
||
doc: "Style specification version number. Must be 8.",
|
||
example: 8
|
||
},
|
||
name: {type: "string", doc: "A human-readable name for the style.", example: "Bright"},
|
||
metadata: {
|
||
type: "*",
|
||
doc: "Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."
|
||
},
|
||
center: {
|
||
type: "array",
|
||
value: "number",
|
||
doc: "Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
|
||
example: [-73.9749, 40.7736]
|
||
},
|
||
zoom: {
|
||
type: "number",
|
||
doc: "Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
|
||
example: 12.5
|
||
},
|
||
bearing: {
|
||
type: "number",
|
||
default: 0,
|
||
period: 360,
|
||
units: "degrees",
|
||
doc: 'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',
|
||
example: 29
|
||
},
|
||
pitch: {
|
||
type: "number",
|
||
default: 0,
|
||
units: "degrees",
|
||
doc: "Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
|
||
example: 50
|
||
},
|
||
light: {
|
||
type: "light",
|
||
doc: "The global light source.",
|
||
example: {anchor: "viewport", color: "white", intensity: .4}
|
||
},
|
||
sources: {
|
||
required: !0,
|
||
type: "sources",
|
||
doc: "Data source specifications.",
|
||
example: {"mapbox-streets": {type: "vector", url: "mapbox://mapbox.mapbox-streets-v6"}}
|
||
},
|
||
sprite: {
|
||
type: "string",
|
||
doc: "A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",
|
||
example: "mapbox://sprites/mapbox/bright-v8"
|
||
},
|
||
glyphs: {
|
||
type: "string",
|
||
doc: "A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",
|
||
example: "mapbox://fonts/mapbox/{fontstack}/{range}.pbf"
|
||
},
|
||
transition: {
|
||
type: "transition",
|
||
doc: "A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",
|
||
example: {duration: 300, delay: 0}
|
||
},
|
||
layers: {
|
||
required: !0,
|
||
type: "array",
|
||
value: "layer",
|
||
doc: "Layers will be drawn in the order of this array.",
|
||
example: [{
|
||
id: "water",
|
||
source: "mapbox-streets",
|
||
"source-layer": "water",
|
||
type: "fill",
|
||
paint: {"fill-color": "#00ffff"}
|
||
}]
|
||
}
|
||
},
|
||
sources: {
|
||
"*": {
|
||
type: "source",
|
||
doc: "Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."
|
||
}
|
||
},
|
||
source: ["source_vector", "source_raster", "source_raster_dem", "source_geojson", "source_video", "source_image"],
|
||
source_vector: {
|
||
type: {
|
||
required: !0,
|
||
type: "enum",
|
||
values: {vector: {doc: "A vector tile source."}},
|
||
doc: "The type of the source."
|
||
},
|
||
url: {
|
||
type: "string",
|
||
doc: "A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."
|
||
},
|
||
tiles: {
|
||
type: "array",
|
||
value: "string",
|
||
doc: "An array of one or more tile source URLs, as in the TileJSON spec."
|
||
},
|
||
bounds: {
|
||
type: "array",
|
||
value: "number",
|
||
length: 4,
|
||
default: [-180, -85.051129, 180, 85.051129],
|
||
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
||
},
|
||
scheme: {
|
||
type: "enum",
|
||
values: {xyz: {doc: "Slippy map tilenames scheme."}, tms: {doc: "OSGeo spec scheme."}},
|
||
default: "xyz",
|
||
doc: "Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."
|
||
},
|
||
minzoom: {
|
||
type: "number",
|
||
default: 0,
|
||
doc: "Minimum zoom level for which tiles are available, as in the TileJSON spec."
|
||
},
|
||
maxzoom: {
|
||
type: "number",
|
||
default: 22,
|
||
doc: "Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."
|
||
},
|
||
attribution: {
|
||
type: "string",
|
||
doc: "Contains an attribution to be displayed when the map is shown to a user."
|
||
},
|
||
"*": {type: "*", doc: "Other keys to configure the data source."}
|
||
},
|
||
source_raster: {
|
||
type: {
|
||
required: !0,
|
||
type: "enum",
|
||
values: {raster: {doc: "A raster tile source."}},
|
||
doc: "The type of the source."
|
||
},
|
||
url: {
|
||
type: "string",
|
||
doc: "A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."
|
||
},
|
||
tiles: {
|
||
type: "array",
|
||
value: "string",
|
||
doc: "An array of one or more tile source URLs, as in the TileJSON spec."
|
||
},
|
||
bounds: {
|
||
type: "array",
|
||
value: "number",
|
||
length: 4,
|
||
default: [-180, -85.051129, 180, 85.051129],
|
||
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
||
},
|
||
minzoom: {
|
||
type: "number",
|
||
default: 0,
|
||
doc: "Minimum zoom level for which tiles are available, as in the TileJSON spec."
|
||
},
|
||
maxzoom: {
|
||
type: "number",
|
||
default: 22,
|
||
doc: "Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."
|
||
},
|
||
tileSize: {
|
||
type: "number",
|
||
default: 512,
|
||
units: "pixels",
|
||
doc: "The minimum visual size to display tiles for this layer. Only configurable for raster layers."
|
||
},
|
||
scheme: {
|
||
type: "enum",
|
||
values: {xyz: {doc: "Slippy map tilenames scheme."}, tms: {doc: "OSGeo spec scheme."}},
|
||
default: "xyz",
|
||
doc: "Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."
|
||
},
|
||
attribution: {
|
||
type: "string",
|
||
doc: "Contains an attribution to be displayed when the map is shown to a user."
|
||
},
|
||
"*": {type: "*", doc: "Other keys to configure the data source."}
|
||
},
|
||
source_raster_dem: {
|
||
type: {
|
||
required: !0,
|
||
type: "enum",
|
||
values: {"raster-dem": {doc: "A RGB-encoded raster DEM source"}},
|
||
doc: "The type of the source."
|
||
},
|
||
url: {
|
||
type: "string",
|
||
doc: "A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."
|
||
},
|
||
tiles: {
|
||
type: "array",
|
||
value: "string",
|
||
doc: "An array of one or more tile source URLs, as in the TileJSON spec."
|
||
},
|
||
bounds: {
|
||
type: "array",
|
||
value: "number",
|
||
length: 4,
|
||
default: [-180, -85.051129, 180, 85.051129],
|
||
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
||
},
|
||
minzoom: {
|
||
type: "number",
|
||
default: 0,
|
||
doc: "Minimum zoom level for which tiles are available, as in the TileJSON spec."
|
||
},
|
||
maxzoom: {
|
||
type: "number",
|
||
default: 22,
|
||
doc: "Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."
|
||
},
|
||
tileSize: {
|
||
type: "number",
|
||
default: 512,
|
||
units: "pixels",
|
||
doc: "The minimum visual size to display tiles for this layer. Only configurable for raster layers."
|
||
},
|
||
attribution: {
|
||
type: "string",
|
||
doc: "Contains an attribution to be displayed when the map is shown to a user."
|
||
},
|
||
encoding: {
|
||
type: "enum",
|
||
values: {
|
||
terrarium: {doc: "Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},
|
||
mapbox: {doc: "Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}
|
||
},
|
||
default: "mapbox",
|
||
doc: "The encoding used by this source. Mapbox Terrain RGB is used by default"
|
||
},
|
||
"*": {type: "*", doc: "Other keys to configure the data source."}
|
||
},
|
||
source_geojson: {
|
||
type: {
|
||
required: !0,
|
||
type: "enum",
|
||
values: {geojson: {doc: "A GeoJSON data source."}},
|
||
doc: "The data type of the GeoJSON source."
|
||
},
|
||
data: {type: "*", doc: "A URL to a GeoJSON file, or inline GeoJSON."},
|
||
maxzoom: {
|
||
type: "number",
|
||
default: 18,
|
||
doc: "Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."
|
||
},
|
||
attribution: {
|
||
type: "string",
|
||
doc: "Contains an attribution to be displayed when the map is shown to a user."
|
||
},
|
||
buffer: {
|
||
type: "number",
|
||
default: 128,
|
||
maximum: 512,
|
||
minimum: 0,
|
||
doc: "Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."
|
||
},
|
||
tolerance: {
|
||
type: "number",
|
||
default: .375,
|
||
doc: "Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."
|
||
},
|
||
cluster: {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"
|
||
},
|
||
clusterRadius: {
|
||
type: "number",
|
||
default: 50,
|
||
minimum: 0,
|
||
doc: "Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."
|
||
},
|
||
clusterMaxZoom: {
|
||
type: "number",
|
||
doc: "Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered)."
|
||
},
|
||
clusterProperties: {
|
||
type: "*",
|
||
doc: 'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'
|
||
},
|
||
lineMetrics: {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."
|
||
},
|
||
generateId: {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."
|
||
}
|
||
},
|
||
source_video: {
|
||
type: {
|
||
required: !0,
|
||
type: "enum",
|
||
values: {video: {doc: "A video data source."}},
|
||
doc: "The data type of the video source."
|
||
},
|
||
urls: {
|
||
required: !0,
|
||
type: "array",
|
||
value: "string",
|
||
doc: "URLs to video content in order of preferred format."
|
||
},
|
||
coordinates: {
|
||
required: !0,
|
||
doc: "Corners of video specified in longitude, latitude pairs.",
|
||
type: "array",
|
||
length: 4,
|
||
value: {
|
||
type: "array",
|
||
length: 2,
|
||
value: "number",
|
||
doc: "A single longitude, latitude pair."
|
||
}
|
||
}
|
||
},
|
||
source_image: {
|
||
type: {
|
||
required: !0,
|
||
type: "enum",
|
||
values: {image: {doc: "An image data source."}},
|
||
doc: "The data type of the image source."
|
||
},
|
||
url: {required: !0, type: "string", doc: "URL that points to an image."},
|
||
coordinates: {
|
||
required: !0,
|
||
doc: "Corners of image specified in longitude, latitude pairs.",
|
||
type: "array",
|
||
length: 4,
|
||
value: {
|
||
type: "array",
|
||
length: 2,
|
||
value: "number",
|
||
doc: "A single longitude, latitude pair."
|
||
}
|
||
}
|
||
},
|
||
layer: {
|
||
id: {type: "string", doc: "Unique layer name.", required: !0},
|
||
type: {
|
||
type: "enum", values: {
|
||
fill: {
|
||
doc: "A filled polygon with an optional stroked border.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
}
|
||
},
|
||
line: {
|
||
doc: "A stroked line.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
}
|
||
},
|
||
symbol: {
|
||
doc: "An icon or a text label.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
}
|
||
},
|
||
circle: {
|
||
doc: "A filled circle.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
}
|
||
},
|
||
heatmap: {
|
||
doc: "A heatmap.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"fill-extrusion": {
|
||
doc: "An extruded (3D) polygon.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}
|
||
}
|
||
},
|
||
raster: {
|
||
doc: "Raster map textures such as satellite imagery.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
}
|
||
},
|
||
hillshade: {
|
||
doc: "Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
background: {
|
||
doc: "The background color or pattern of the map.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
}
|
||
}
|
||
}, doc: "Rendering type of this layer.", required: !0
|
||
},
|
||
metadata: {
|
||
type: "*",
|
||
doc: "Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."
|
||
},
|
||
source: {
|
||
type: "string",
|
||
doc: "Name of a source description to be used for this layer. Required for all layer types except `background`."
|
||
},
|
||
"source-layer": {
|
||
type: "string",
|
||
doc: "Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."
|
||
},
|
||
minzoom: {
|
||
type: "number",
|
||
minimum: 0,
|
||
maximum: 24,
|
||
doc: "The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."
|
||
},
|
||
maxzoom: {
|
||
type: "number",
|
||
minimum: 0,
|
||
maximum: 24,
|
||
doc: "The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."
|
||
},
|
||
filter: {
|
||
type: "filter",
|
||
doc: "A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."
|
||
},
|
||
layout: {type: "layout", doc: "Layout properties for the layer."},
|
||
paint: {type: "paint", doc: "Default paint properties for this layer."}
|
||
},
|
||
layout: ["layout_fill", "layout_line", "layout_circle", "layout_heatmap", "layout_fill-extrusion", "layout_symbol", "layout_raster", "layout_hillshade", "layout_background"],
|
||
layout_background: {
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
layout_fill: {
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
layout_circle: {
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
layout_heatmap: {
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
"layout_fill-extrusion": {
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
layout_line: {
|
||
"line-cap": {
|
||
type: "enum",
|
||
values: {
|
||
butt: {doc: "A cap with a squared-off end which is drawn to the exact endpoint of the line."},
|
||
round: {doc: "A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},
|
||
square: {doc: "A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}
|
||
},
|
||
default: "butt",
|
||
doc: "The display of line endings.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"line-join": {
|
||
type: "enum",
|
||
values: {
|
||
bevel: {doc: "A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},
|
||
round: {doc: "A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},
|
||
miter: {doc: "A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}
|
||
},
|
||
default: "miter",
|
||
doc: "The display of lines when joining.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.40.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"line-miter-limit": {
|
||
type: "number",
|
||
default: 2,
|
||
doc: "Used to automatically convert miter joins to bevel joins for sharp angles.",
|
||
requires: [{"line-join": "miter"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"line-round-limit": {
|
||
type: "number",
|
||
default: 1.05,
|
||
doc: "Used to automatically convert round joins to miter joins for shallow angles.",
|
||
requires: [{"line-join": "round"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
layout_symbol: {
|
||
"symbol-placement": {
|
||
type: "enum",
|
||
values: {
|
||
point: {doc: "The label is placed at the point where the geometry is located."},
|
||
line: {doc: "The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},
|
||
"line-center": {doc: "The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}
|
||
},
|
||
default: "point",
|
||
doc: "Label placement relative to its geometry.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
},
|
||
"`line-center` value": {js: "0.47.0", android: "6.4.0", ios: "4.3.0", macos: "0.10.0"},
|
||
"data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"symbol-spacing": {
|
||
type: "number",
|
||
default: 250,
|
||
minimum: 1,
|
||
units: "pixels",
|
||
doc: "Distance between two symbol anchors.",
|
||
requires: [{"symbol-placement": "line"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"symbol-avoid-edges": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"symbol-sort-key": {
|
||
type: "number",
|
||
doc: "Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key when they overlap. Features with a lower sort key will have priority over other features when doing placement.",
|
||
"sdk-support": {js: "0.53.0"},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"symbol-z-order": {
|
||
type: "enum",
|
||
values: {
|
||
auto: {doc: "If `symbol-sort-key` is set, sort based on that. Otherwise sort symbols by their position relative to the viewport."},
|
||
"viewport-y": {doc: "Symbols will be sorted by their y-position relative to the viewport."},
|
||
source: {doc: "Symbols will be rendered in the same order as the source data with no sorting applied."}
|
||
},
|
||
default: "auto",
|
||
doc: "Controls the order in which overlapping symbols in the same layer are rendered",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.49.0",
|
||
android: "6.6.0",
|
||
ios: "4.5.0",
|
||
macos: "0.12.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-allow-overlap": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, the icon will be visible even if it collides with other previously drawn symbols.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-ignore-placement": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, other symbols can be visible even if they collide with the icon.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-optional": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",
|
||
requires: ["icon-image", "text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-rotation-alignment": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},
|
||
viewport: {doc: "Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},
|
||
auto: {doc: "When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}
|
||
},
|
||
default: "auto",
|
||
doc: "In combination with `symbol-placement`, determines the rotation behavior of icons.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
},
|
||
"`auto` value": {js: "0.25.0", android: "4.2.0", ios: "3.4.0", macos: "0.3.0"},
|
||
"data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-size": {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
units: "factor of the original icon size",
|
||
doc: "Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-text-fit": {
|
||
type: "enum",
|
||
values: {
|
||
none: {doc: "The icon is displayed at its intrinsic aspect ratio."},
|
||
width: {doc: "The icon is scaled in the x-dimension to fit the width of the text."},
|
||
height: {doc: "The icon is scaled in the y-dimension to fit the height of the text."},
|
||
both: {doc: "The icon is scaled in both x- and y-dimensions."}
|
||
},
|
||
default: "none",
|
||
doc: "Scales the icon to fit around the associated text.",
|
||
requires: ["icon-image", "text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.21.0",
|
||
android: "4.2.0",
|
||
ios: "3.4.0",
|
||
macos: "0.2.1"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-text-fit-padding": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 4,
|
||
default: [0, 0, 0, 0],
|
||
units: "pixels",
|
||
doc: "Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",
|
||
requires: ["icon-image", "text-field", {"icon-text-fit": ["both", "width", "height"]}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.21.0",
|
||
android: "4.2.0",
|
||
ios: "3.4.0",
|
||
macos: "0.2.1"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-image": {
|
||
type: "string",
|
||
doc: "Name of image in sprite to use for drawing an image background.",
|
||
tokens: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-rotate": {
|
||
type: "number",
|
||
default: 0,
|
||
period: 360,
|
||
units: "degrees",
|
||
doc: "Rotates the icon clockwise.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.21.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-padding": {
|
||
type: "number",
|
||
default: 2,
|
||
minimum: 0,
|
||
units: "pixels",
|
||
doc: "Size of the additional area around the icon bounding box used for detecting symbol collisions.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-keep-upright": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, the icon may be flipped to prevent it from being rendered upside-down.",
|
||
requires: ["icon-image", {"icon-rotation-alignment": "map"}, {"symbol-placement": ["line", "line-center"]}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-offset": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 2,
|
||
default: [0, 0],
|
||
doc: "Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
center: {doc: "The center of the icon is placed closest to the anchor."},
|
||
left: {doc: "The left side of the icon is placed closest to the anchor."},
|
||
right: {doc: "The right side of the icon is placed closest to the anchor."},
|
||
top: {doc: "The top of the icon is placed closest to the anchor."},
|
||
bottom: {doc: "The bottom of the icon is placed closest to the anchor."},
|
||
"top-left": {doc: "The top left corner of the icon is placed closest to the anchor."},
|
||
"top-right": {doc: "The top right corner of the icon is placed closest to the anchor."},
|
||
"bottom-left": {doc: "The bottom left corner of the icon is placed closest to the anchor."},
|
||
"bottom-right": {doc: "The bottom right corner of the icon is placed closest to the anchor."}
|
||
},
|
||
default: "center",
|
||
doc: "Part of the icon placed closest to the anchor.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.40.0",
|
||
android: "5.2.0",
|
||
ios: "3.7.0",
|
||
macos: "0.6.0"
|
||
}, "data-driven styling": {js: "0.40.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-pitch-alignment": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The icon is aligned to the plane of the map."},
|
||
viewport: {doc: "The icon is aligned to the plane of the viewport."},
|
||
auto: {doc: "Automatically matches the value of `icon-rotation-alignment`."}
|
||
},
|
||
default: "auto",
|
||
doc: "Orientation of icon when map is pitched.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.39.0",
|
||
android: "5.2.0",
|
||
ios: "3.7.0",
|
||
macos: "0.6.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-pitch-alignment": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The text is aligned to the plane of the map."},
|
||
viewport: {doc: "The text is aligned to the plane of the viewport."},
|
||
auto: {doc: "Automatically matches the value of `text-rotation-alignment`."}
|
||
},
|
||
default: "auto",
|
||
doc: "Orientation of text when map is pitched.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.21.0",
|
||
android: "4.2.0",
|
||
ios: "3.4.0",
|
||
macos: "0.2.1"
|
||
},
|
||
"`auto` value": {js: "0.25.0", android: "4.2.0", ios: "3.4.0", macos: "0.3.0"},
|
||
"data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-rotation-alignment": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},
|
||
viewport: {doc: "Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},
|
||
auto: {doc: "When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}
|
||
},
|
||
default: "auto",
|
||
doc: "In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
},
|
||
"`auto` value": {js: "0.25.0", android: "4.2.0", ios: "3.4.0", macos: "0.3.0"},
|
||
"data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-field": {
|
||
type: "formatted",
|
||
default: "",
|
||
tokens: !0,
|
||
doc: "Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-font": {
|
||
type: "array",
|
||
value: "string",
|
||
default: ["Open Sans Regular", "Arial Unicode MS Regular"],
|
||
doc: "Font stack to use for displaying text.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.43.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-size": {
|
||
type: "number",
|
||
default: 16,
|
||
minimum: 0,
|
||
units: "pixels",
|
||
doc: "Font size.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-max-width": {
|
||
type: "number",
|
||
default: 10,
|
||
minimum: 0,
|
||
units: "ems",
|
||
doc: "The maximum line width for text wrapping.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.40.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-line-height": {
|
||
type: "number",
|
||
default: 1.2,
|
||
units: "ems",
|
||
doc: "Text leading value for multi-line text.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-letter-spacing": {
|
||
type: "number",
|
||
default: 0,
|
||
units: "ems",
|
||
doc: "Text tracking amount.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.40.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-justify": {
|
||
type: "enum",
|
||
values: {
|
||
auto: {doc: "The text is aligned towards the anchor position."},
|
||
left: {doc: "The text is aligned to the left."},
|
||
center: {doc: "The text is centered."},
|
||
right: {doc: "The text is aligned to the right."}
|
||
},
|
||
default: "center",
|
||
doc: "Text justification options.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
},
|
||
"data-driven styling": {js: "0.39.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"},
|
||
auto: {
|
||
js: "next",
|
||
android: "Not yet supported",
|
||
ios: "Not yet supported",
|
||
macos: "Not yet supported"
|
||
}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-radial-offset": {
|
||
type: "number",
|
||
units: "ems",
|
||
default: 0,
|
||
doc: "Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which doesn't support the two-dimensional `text-offset`.",
|
||
requires: [{"!": "text-offset"}],
|
||
"property-type": "data-driven",
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]}
|
||
},
|
||
"text-variable-anchor": {
|
||
type: "array",
|
||
value: "enum",
|
||
values: {
|
||
center: {doc: "The center of the text is placed closest to the anchor."},
|
||
left: {doc: "The left side of the text is placed closest to the anchor."},
|
||
right: {doc: "The right side of the text is placed closest to the anchor."},
|
||
top: {doc: "The top of the text is placed closest to the anchor."},
|
||
bottom: {doc: "The bottom of the text is placed closest to the anchor."},
|
||
"top-left": {doc: "The top left corner of the text is placed closest to the anchor."},
|
||
"top-right": {doc: "The top right corner of the text is placed closest to the anchor."},
|
||
"bottom-left": {doc: "The bottom left corner of the text is placed closest to the anchor."},
|
||
"bottom-right": {doc: "The bottom right corner of the text is placed closest to the anchor."}
|
||
},
|
||
requires: [{"!": "text-anchor"}, {"!": "text-offset"}, {"symbol-placement": ["point"]}],
|
||
doc: "To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the render will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` instead of the two-dimensional `text-offset`.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "next",
|
||
android: "Not yet supported",
|
||
ios: "Not yet supported",
|
||
macos: "Not yet supported"
|
||
},
|
||
"data-driven styling": {
|
||
js: "Not yet supported",
|
||
android: "Not yet supported",
|
||
ios: "Not yet supported",
|
||
macos: "Not yet supported"
|
||
}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-anchor": {
|
||
type: "enum",
|
||
requires: ["text-field"],
|
||
values: {
|
||
center: {doc: "The center of the text is placed closest to the anchor."},
|
||
left: {doc: "The left side of the text is placed closest to the anchor."},
|
||
right: {doc: "The right side of the text is placed closest to the anchor."},
|
||
top: {doc: "The top of the text is placed closest to the anchor."},
|
||
bottom: {doc: "The bottom of the text is placed closest to the anchor."},
|
||
"top-left": {doc: "The top left corner of the text is placed closest to the anchor."},
|
||
"top-right": {doc: "The top right corner of the text is placed closest to the anchor."},
|
||
"bottom-left": {doc: "The bottom left corner of the text is placed closest to the anchor."},
|
||
"bottom-right": {doc: "The bottom right corner of the text is placed closest to the anchor."}
|
||
},
|
||
default: "center",
|
||
doc: "Part of the text placed closest to the anchor.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.39.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-max-angle": {
|
||
type: "number",
|
||
default: 45,
|
||
units: "degrees",
|
||
doc: "Maximum angle change between adjacent characters.",
|
||
requires: ["text-field", {"symbol-placement": ["line", "line-center"]}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-rotate": {
|
||
type: "number",
|
||
default: 0,
|
||
period: 360,
|
||
units: "degrees",
|
||
doc: "Rotates the text clockwise.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-padding": {
|
||
type: "number",
|
||
default: 2,
|
||
minimum: 0,
|
||
units: "pixels",
|
||
doc: "Size of the additional area around the text bounding box used for detecting symbol collisions.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-keep-upright": {
|
||
type: "boolean",
|
||
default: !0,
|
||
doc: "If true, the text may be flipped vertically to prevent it from being rendered upside-down.",
|
||
requires: ["text-field", {"text-rotation-alignment": "map"}, {"symbol-placement": ["line", "line-center"]}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-transform": {
|
||
type: "enum",
|
||
values: {
|
||
none: {doc: "The text is not altered."},
|
||
uppercase: {doc: "Forces all letters to be displayed in uppercase."},
|
||
lowercase: {doc: "Forces all letters to be displayed in lowercase."}
|
||
},
|
||
default: "none",
|
||
doc: "Specifies how to capitalize text, similar to the CSS `text-transform` property.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-offset": {
|
||
type: "array",
|
||
doc: "Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.",
|
||
value: "number",
|
||
units: "ems",
|
||
length: 2,
|
||
default: [0, 0],
|
||
requires: ["text-field", {"!": "text-radial-offset"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-allow-overlap": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, the text will be visible even if it collides with other previously drawn symbols.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-ignore-placement": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, other symbols can be visible even if they collide with the text.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-optional": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",
|
||
requires: ["text-field", "icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
layout_raster: {
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
layout_hillshade: {
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
filter: {type: "array", value: "*", doc: "A filter selects specific features from a layer."},
|
||
filter_operator: {
|
||
type: "enum",
|
||
values: {
|
||
"==": {doc: '`["==", key, value]` equality: `feature[key] = value`'},
|
||
"!=": {doc: '`["!=", key, value]` inequality: `feature[key] ≠ value`'},
|
||
">": {doc: '`[">", key, value]` greater than: `feature[key] > value`'},
|
||
">=": {doc: '`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},
|
||
"<": {doc: '`["<", key, value]` less than: `feature[key] < value`'},
|
||
"<=": {doc: '`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},
|
||
in: {doc: '`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},
|
||
"!in": {doc: '`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},
|
||
all: {doc: '`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},
|
||
any: {doc: '`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},
|
||
none: {doc: '`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},
|
||
has: {doc: '`["has", key]` `feature[key]` exists'},
|
||
"!has": {doc: '`["!has", key]` `feature[key]` does not exist'}
|
||
},
|
||
doc: "The filter operator."
|
||
},
|
||
geometry_type: {
|
||
type: "enum",
|
||
values: {
|
||
Point: {doc: "Filter to point geometries."},
|
||
LineString: {doc: "Filter to line geometries."},
|
||
Polygon: {doc: "Filter to polygon geometries."}
|
||
},
|
||
doc: "The geometry type for the filter to select."
|
||
},
|
||
function: {
|
||
expression: {type: "expression", doc: "An expression."},
|
||
stops: {type: "array", doc: "An array of stops.", value: "function_stop"},
|
||
base: {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
doc: "The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."
|
||
},
|
||
property: {
|
||
type: "string",
|
||
doc: "The name of a feature property to use as the function input.",
|
||
default: "$zoom"
|
||
},
|
||
type: {
|
||
type: "enum",
|
||
values: {
|
||
identity: {doc: "Return the input value as the output value."},
|
||
exponential: {doc: "Generate an output by interpolating between stops just less than and just greater than the function input."},
|
||
interval: {doc: "Return the output value of the stop just less than the function input."},
|
||
categorical: {doc: "Return the output value of the stop equal to the function input."}
|
||
},
|
||
doc: "The interpolation strategy to use in function evaluation.",
|
||
default: "exponential"
|
||
},
|
||
colorSpace: {
|
||
type: "enum",
|
||
values: {
|
||
rgb: {doc: "Use the RGB color space to interpolate color values"},
|
||
lab: {doc: "Use the LAB color space to interpolate color values."},
|
||
hcl: {doc: "Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}
|
||
},
|
||
doc: "The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",
|
||
default: "rgb"
|
||
},
|
||
default: {
|
||
type: "*",
|
||
required: !1,
|
||
doc: "A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."
|
||
}
|
||
},
|
||
function_stop: {
|
||
type: "array",
|
||
minimum: 0,
|
||
maximum: 22,
|
||
value: ["number", "color"],
|
||
length: 2,
|
||
doc: "Zoom level and value pair."
|
||
},
|
||
expression: {
|
||
type: "array",
|
||
value: "*",
|
||
minimum: 1,
|
||
doc: "An expression defines a function that can be used for data-driven style properties or feature filters."
|
||
},
|
||
expression_name: {
|
||
doc: "", type: "enum", values: {
|
||
let: {
|
||
doc: 'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',
|
||
group: "Variable binding",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
var: {
|
||
doc: 'References variable bound using "let".',
|
||
group: "Variable binding",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
literal: {
|
||
doc: "Provides a literal array or object value.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
array: {
|
||
doc: "Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
at: {
|
||
doc: "Retrieves an item from an array.",
|
||
group: "Lookup",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
case: {
|
||
doc: "Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
match: {
|
||
doc: 'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n * a single literal value; or\n * an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the deprecated `"in"` operator.\n\nEach label must be unique. If the input type does not match the type of the labels, the result will be the fallback value.',
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
coalesce: {
|
||
doc: "Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
step: {
|
||
doc: 'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first input if the input is less than the first stop.',
|
||
group: "Ramps, scales, curves",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.42.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
interpolate: {
|
||
doc: 'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: interpolates using the cubic bezier curve defined by the given control points.',
|
||
group: "Ramps, scales, curves",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.42.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"interpolate-hcl": {
|
||
doc: 'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',
|
||
group: "Ramps, scales, curves",
|
||
"sdk-support": {"basic functionality": {js: "0.49.0"}}
|
||
},
|
||
"interpolate-lab": {
|
||
doc: 'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',
|
||
group: "Ramps, scales, curves",
|
||
"sdk-support": {"basic functionality": {js: "0.49.0"}}
|
||
},
|
||
ln2: {
|
||
doc: "Returns mathematical constant ln(2).",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
pi: {
|
||
doc: "Returns the mathematical constant pi.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
e: {
|
||
doc: "Returns the mathematical constant e.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
typeof: {
|
||
doc: "Returns a string describing the type of the given value.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
string: {
|
||
doc: "Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
number: {
|
||
doc: "Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
boolean: {
|
||
doc: "Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
object: {
|
||
doc: "Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
collator: {
|
||
doc: "Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.5.0",
|
||
ios: "4.2.0",
|
||
macos: "0.9.0"
|
||
}
|
||
}
|
||
},
|
||
format: {
|
||
doc: "Returns `formatted` text containing annotations for use in mixed-format `text-field` entries. If set, the `text-font` argument overrides the font specified by the root layout properties. If set, the `font-scale` argument specifies a scaling factor relative to the `text-size` specified in the root layout properties.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.48.0",
|
||
android: "6.7.0",
|
||
ios: "4.6.0",
|
||
macos: "0.12.0"
|
||
}
|
||
}
|
||
},
|
||
"number-format": {
|
||
doc: "Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",
|
||
group: "Types",
|
||
"sdk-support": {"basic functionality": {js: "0.54.0"}}
|
||
},
|
||
"to-string": {
|
||
doc: 'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"to-number": {
|
||
doc: 'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"to-boolean": {
|
||
doc: "Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"to-rgba": {
|
||
doc: "Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",
|
||
group: "Color",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"to-color": {
|
||
doc: "Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
rgb: {
|
||
doc: "Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",
|
||
group: "Color",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
rgba: {
|
||
doc: "Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",
|
||
group: "Color",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
get: {
|
||
doc: "Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",
|
||
group: "Lookup",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
has: {
|
||
doc: "Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",
|
||
group: "Lookup",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
length: {
|
||
doc: "Gets the length of an array or string.",
|
||
group: "Lookup",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
properties: {
|
||
doc: 'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',
|
||
group: "Feature data",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"feature-state": {
|
||
doc: "Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",
|
||
group: "Feature data",
|
||
"sdk-support": {"basic functionality": {js: "0.46.0"}}
|
||
},
|
||
"geometry-type": {
|
||
doc: "Gets the feature's geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.",
|
||
group: "Feature data",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
id: {
|
||
doc: "Gets the feature's id, if it has one.",
|
||
group: "Feature data",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
zoom: {
|
||
doc: 'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',
|
||
group: "Zoom",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"heatmap-density": {
|
||
doc: "Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",
|
||
group: "Heatmap",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"line-progress": {
|
||
doc: "Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",
|
||
group: "Feature data",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.5.0",
|
||
ios: "4.6.0",
|
||
macos: "0.12.0"
|
||
}
|
||
}
|
||
},
|
||
accumulated: {
|
||
doc: "Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",
|
||
group: "Feature data",
|
||
"sdk-support": {"basic functionality": {js: "0.53.0"}}
|
||
},
|
||
"+": {
|
||
doc: "Returns the sum of the inputs.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"*": {
|
||
doc: "Returns the product of the inputs.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"-": {
|
||
doc: "For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"/": {
|
||
doc: "Returns the result of floating point division of the first input by the second.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"%": {
|
||
doc: "Returns the remainder after integer division of the first input by the second.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"^": {
|
||
doc: "Returns the result of raising the first input to the power specified by the second.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
sqrt: {
|
||
doc: "Returns the square root of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.42.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
log10: {
|
||
doc: "Returns the base-ten logarithm of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
ln: {
|
||
doc: "Returns the natural logarithm of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
log2: {
|
||
doc: "Returns the base-two logarithm of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
sin: {
|
||
doc: "Returns the sine of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
cos: {
|
||
doc: "Returns the cosine of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
tan: {
|
||
doc: "Returns the tangent of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
asin: {
|
||
doc: "Returns the arcsine of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
acos: {
|
||
doc: "Returns the arccosine of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
atan: {
|
||
doc: "Returns the arctangent of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
min: {
|
||
doc: "Returns the minimum value of the inputs.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
max: {
|
||
doc: "Returns the maximum value of the inputs.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
round: {
|
||
doc: 'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
abs: {
|
||
doc: "Returns the absolute value of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
ceil: {
|
||
doc: "Returns the smallest integer that is greater than or equal to the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
floor: {
|
||
doc: "Returns the largest integer that is less than or equal to the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"==": {
|
||
doc: "Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
|
||
}
|
||
},
|
||
"!=": {
|
||
doc: "Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
|
||
}
|
||
},
|
||
">": {
|
||
doc: "Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
|
||
}
|
||
},
|
||
"<": {
|
||
doc: "Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
|
||
}
|
||
},
|
||
">=": {
|
||
doc: "Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
|
||
}
|
||
},
|
||
"<=": {
|
||
doc: "Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
|
||
}
|
||
},
|
||
all: {
|
||
doc: "Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
any: {
|
||
doc: "Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"!": {
|
||
doc: "Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"is-supported-script": {
|
||
doc: "Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",
|
||
group: "String"
|
||
},
|
||
upcase: {
|
||
doc: "Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",
|
||
group: "String",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
downcase: {
|
||
doc: "Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",
|
||
group: "String",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
concat: {
|
||
doc: "Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",
|
||
group: "String",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"resolved-locale": {
|
||
doc: "Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",
|
||
group: "String",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.5.0",
|
||
ios: "4.2.0",
|
||
macos: "0.9.0"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
light: {
|
||
anchor: {
|
||
type: "enum",
|
||
default: "viewport",
|
||
values: {
|
||
map: {doc: "The position of the light source is aligned to the rotation of the map."},
|
||
viewport: {doc: "The position of the light source is aligned to the rotation of the viewport."}
|
||
},
|
||
"property-type": "data-constant",
|
||
transition: !1,
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
doc: "Whether extruded geometries are lit relative to the map or viewport.",
|
||
example: "map",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}
|
||
}
|
||
},
|
||
position: {
|
||
type: "array",
|
||
default: [1.15, 210, 30],
|
||
length: 3,
|
||
value: "number",
|
||
"property-type": "data-constant",
|
||
transition: !0,
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
doc: "Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",
|
||
example: [1.5, 90, 80],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}
|
||
}
|
||
},
|
||
color: {
|
||
type: "color",
|
||
"property-type": "data-constant",
|
||
default: "#ffffff",
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
transition: !0,
|
||
doc: "Color tint for lighting extruded geometries.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}
|
||
}
|
||
},
|
||
intensity: {
|
||
type: "number",
|
||
"property-type": "data-constant",
|
||
default: .5,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
transition: !0,
|
||
doc: "Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
paint: ["paint_fill", "paint_line", "paint_circle", "paint_heatmap", "paint_fill-extrusion", "paint_symbol", "paint_raster", "paint_hillshade", "paint_background"],
|
||
paint_fill: {
|
||
"fill-antialias": {
|
||
type: "boolean",
|
||
default: !0,
|
||
doc: "Whether or not the fill should be antialiased.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"fill-opacity": {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
doc: "The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.21.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"fill-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
doc: "The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",
|
||
transition: !0,
|
||
requires: [{"!": "fill-pattern"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.19.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"fill-outline-color": {
|
||
type: "color",
|
||
doc: "The outline color of the fill. Matches the value of `fill-color` if unspecified.",
|
||
transition: !0,
|
||
requires: [{"!": "fill-pattern"}, {"fill-antialias": !0}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.19.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"fill-translate": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 2,
|
||
default: [0, 0],
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"fill-translate-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The fill is translated relative to the map."},
|
||
viewport: {doc: "The fill is translated relative to the viewport."}
|
||
},
|
||
doc: "Controls the frame of reference for `fill-translate`.",
|
||
default: "map",
|
||
requires: ["fill-translate"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"fill-pattern": {
|
||
type: "string",
|
||
transition: !0,
|
||
doc: "Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
},
|
||
"data-driven styling": {js: "0.49.0", android: "6.5.0", macos: "0.11.0", ios: "4.4.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "cross-faded-data-driven"
|
||
}
|
||
},
|
||
"paint_fill-extrusion": {
|
||
"fill-extrusion-opacity": {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
doc: "The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"fill-extrusion-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
doc: "The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",
|
||
transition: !0,
|
||
requires: [{"!": "fill-extrusion-pattern"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}, "data-driven styling": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"fill-extrusion-translate": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 2,
|
||
default: [0, 0],
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"fill-extrusion-translate-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The fill extrusion is translated relative to the map."},
|
||
viewport: {doc: "The fill extrusion is translated relative to the viewport."}
|
||
},
|
||
doc: "Controls the frame of reference for `fill-extrusion-translate`.",
|
||
default: "map",
|
||
requires: ["fill-extrusion-translate"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"fill-extrusion-pattern": {
|
||
type: "string",
|
||
transition: !0,
|
||
doc: "Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
},
|
||
"data-driven styling": {js: "0.49.0", android: "6.5.0", macos: "0.11.0", ios: "4.4.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "cross-faded-data-driven"
|
||
},
|
||
"fill-extrusion-height": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
units: "meters",
|
||
doc: "The height with which to extrude this layer.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}, "data-driven styling": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"fill-extrusion-base": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
units: "meters",
|
||
doc: "The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",
|
||
transition: !0,
|
||
requires: ["fill-extrusion-height"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}, "data-driven styling": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"fill-extrusion-vertical-gradient": {
|
||
type: "boolean",
|
||
default: !0,
|
||
doc: "Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",
|
||
transition: !1,
|
||
"sdk-support": {"basic functionality": {js: "0.50.0", ios: "4.7.0", macos: "0.13.0"}},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
}
|
||
},
|
||
paint_line: {
|
||
"line-opacity": {
|
||
type: "number",
|
||
doc: "The opacity at which the line will be drawn.",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"line-color": {
|
||
type: "color",
|
||
doc: "The color with which the line will be drawn.",
|
||
default: "#000000",
|
||
transition: !0,
|
||
requires: [{"!": "line-pattern"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.23.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"line-translate": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 2,
|
||
default: [0, 0],
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"line-translate-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The line is translated relative to the map."},
|
||
viewport: {doc: "The line is translated relative to the viewport."}
|
||
},
|
||
doc: "Controls the frame of reference for `line-translate`.",
|
||
default: "map",
|
||
requires: ["line-translate"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"line-width": {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Stroke thickness.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.39.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"line-gap-width": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
doc: "Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",
|
||
transition: !0,
|
||
units: "pixels",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"line-offset": {
|
||
type: "number",
|
||
default: 0,
|
||
doc: "The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",
|
||
transition: !0,
|
||
units: "pixels",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.12.1",
|
||
android: "3.0.0",
|
||
ios: "3.1.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"line-blur": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Blur applied to the line, in pixels.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"line-dasharray": {
|
||
type: "array",
|
||
value: "number",
|
||
doc: "Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "line widths",
|
||
requires: [{"!": "line-pattern"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "cross-faded"
|
||
},
|
||
"line-pattern": {
|
||
type: "string",
|
||
transition: !0,
|
||
doc: "Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
},
|
||
"data-driven styling": {js: "0.49.0", android: "6.5.0", macos: "0.11.0", ios: "4.4.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "cross-faded-data-driven"
|
||
},
|
||
"line-gradient": {
|
||
type: "color",
|
||
doc: 'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',
|
||
transition: !1,
|
||
requires: [{"!": "line-dasharray"}, {"!": "line-pattern"}, {
|
||
source: "geojson",
|
||
has: {lineMetrics: !0}
|
||
}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.5.0",
|
||
ios: "4.4.0",
|
||
macos: "0.11.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["line-progress"]},
|
||
"property-type": "color-ramp"
|
||
}
|
||
},
|
||
paint_circle: {
|
||
"circle-radius": {
|
||
type: "number",
|
||
default: 5,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Circle radius.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.18.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"circle-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
doc: "The fill color of the circle.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.18.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"circle-blur": {
|
||
type: "number",
|
||
default: 0,
|
||
doc: "Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.20.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"circle-opacity": {
|
||
type: "number",
|
||
doc: "The opacity at which the circle will be drawn.",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.20.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"circle-translate": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 2,
|
||
default: [0, 0],
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"circle-translate-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The circle is translated relative to the map."},
|
||
viewport: {doc: "The circle is translated relative to the viewport."}
|
||
},
|
||
doc: "Controls the frame of reference for `circle-translate`.",
|
||
default: "map",
|
||
requires: ["circle-translate"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"circle-pitch-scale": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "Circles are scaled according to their apparent distance to the camera."},
|
||
viewport: {doc: "Circles are not scaled."}
|
||
},
|
||
default: "map",
|
||
doc: "Controls the scaling behavior of the circle when the map is pitched.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.21.0",
|
||
android: "4.2.0",
|
||
ios: "3.4.0",
|
||
macos: "0.2.1"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"circle-pitch-alignment": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The circle is aligned to the plane of the map."},
|
||
viewport: {doc: "The circle is aligned to the plane of the viewport."}
|
||
},
|
||
default: "viewport",
|
||
doc: "Orientation of circle when map is pitched.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.39.0",
|
||
android: "5.2.0",
|
||
ios: "3.7.0",
|
||
macos: "0.6.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"circle-stroke-width": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.29.0",
|
||
android: "5.0.0",
|
||
ios: "3.5.0",
|
||
macos: "0.4.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"circle-stroke-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
doc: "The stroke color of the circle.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.29.0",
|
||
android: "5.0.0",
|
||
ios: "3.5.0",
|
||
macos: "0.4.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"circle-stroke-opacity": {
|
||
type: "number",
|
||
doc: "The opacity of the circle's stroke.",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.29.0",
|
||
android: "5.0.0",
|
||
ios: "3.5.0",
|
||
macos: "0.4.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
}
|
||
},
|
||
paint_heatmap: {
|
||
"heatmap-radius": {
|
||
type: "number",
|
||
default: 30,
|
||
minimum: 1,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {js: "0.43.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"heatmap-weight": {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
transition: !1,
|
||
doc: "A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"heatmap-intensity": {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
transition: !0,
|
||
doc: "Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"heatmap-color": {
|
||
type: "color",
|
||
default: ["interpolate", ["linear"], ["heatmap-density"], 0, "rgba(0, 0, 255, 0)", .1, "royalblue", .3, "cyan", .5, "lime", .7, "yellow", 1, "red"],
|
||
doc: 'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',
|
||
transition: !1,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["heatmap-density"]},
|
||
"property-type": "color-ramp"
|
||
},
|
||
"heatmap-opacity": {
|
||
type: "number",
|
||
doc: "The global opacity at which the heatmap layer will be drawn.",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
}
|
||
},
|
||
paint_symbol: {
|
||
"icon-opacity": {
|
||
doc: "The opacity at which the icon will be drawn.",
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
transition: !0,
|
||
doc: "The color of the icon. This can only be used with sdf icons.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-halo-color": {
|
||
type: "color",
|
||
default: "rgba(0, 0, 0, 0)",
|
||
transition: !0,
|
||
doc: "The color of the icon's halo. Icon halos can only be used with SDF icons.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-halo-width": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Distance of halo to the icon outline.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-halo-blur": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Fade out the halo towards the outside.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-translate": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 2,
|
||
default: [0, 0],
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-translate-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "Icons are translated relative to the map."},
|
||
viewport: {doc: "Icons are translated relative to the viewport."}
|
||
},
|
||
doc: "Controls the frame of reference for `icon-translate`.",
|
||
default: "map",
|
||
requires: ["icon-image", "icon-translate"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-opacity": {
|
||
type: "number",
|
||
doc: "The opacity at which the text will be drawn.",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-color": {
|
||
type: "color",
|
||
doc: "The color with which the text will be drawn.",
|
||
default: "#000000",
|
||
transition: !0,
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-halo-color": {
|
||
type: "color",
|
||
default: "rgba(0, 0, 0, 0)",
|
||
transition: !0,
|
||
doc: "The color of the text's halo, which helps it stand out from backgrounds.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-halo-width": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-halo-blur": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "The halo's fadeout distance towards the outside.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-translate": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 2,
|
||
default: [0, 0],
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-translate-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The text is translated relative to the map."},
|
||
viewport: {doc: "The text is translated relative to the viewport."}
|
||
},
|
||
doc: "Controls the frame of reference for `text-translate`.",
|
||
default: "map",
|
||
requires: ["text-field", "text-translate"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
}
|
||
},
|
||
paint_raster: {
|
||
"raster-opacity": {
|
||
type: "number",
|
||
doc: "The opacity at which the image will be drawn.",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"raster-hue-rotate": {
|
||
type: "number",
|
||
default: 0,
|
||
period: 360,
|
||
transition: !0,
|
||
units: "degrees",
|
||
doc: "Rotates hues around the color wheel.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"raster-brightness-min": {
|
||
type: "number",
|
||
doc: "Increase or reduce the brightness of the image. The value is the minimum brightness.",
|
||
default: 0,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"raster-brightness-max": {
|
||
type: "number",
|
||
doc: "Increase or reduce the brightness of the image. The value is the maximum brightness.",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"raster-saturation": {
|
||
type: "number",
|
||
doc: "Increase or reduce the saturation of the image.",
|
||
default: 0,
|
||
minimum: -1,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"raster-contrast": {
|
||
type: "number",
|
||
doc: "Increase or reduce the contrast of the image.",
|
||
default: 0,
|
||
minimum: -1,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"raster-resampling": {
|
||
type: "enum",
|
||
doc: "The resampling/interpolation method to use for overscaling, also known as texture magnification filter",
|
||
values: {
|
||
linear: {doc: "(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},
|
||
nearest: {doc: "Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}
|
||
},
|
||
default: "linear",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.47.0",
|
||
android: "6.3.0",
|
||
ios: "4.2.0",
|
||
macos: "0.9.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"raster-fade-duration": {
|
||
type: "number",
|
||
default: 300,
|
||
minimum: 0,
|
||
transition: !1,
|
||
units: "milliseconds",
|
||
doc: "Fade duration when a new tile is added.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
}
|
||
},
|
||
paint_hillshade: {
|
||
"hillshade-illumination-direction": {
|
||
type: "number",
|
||
default: 335,
|
||
minimum: 0,
|
||
maximum: 359,
|
||
doc: "The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",
|
||
transition: !1,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"hillshade-illumination-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The hillshade illumination is relative to the north direction."},
|
||
viewport: {doc: "The hillshade illumination is relative to the top of the viewport."}
|
||
},
|
||
default: "viewport",
|
||
doc: "Direction of light source when map is rotated.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"hillshade-exaggeration": {
|
||
type: "number",
|
||
doc: "Intensity of the hillshade",
|
||
default: .5,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"hillshade-shadow-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
doc: "The shading color of areas that face away from the light source.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"hillshade-highlight-color": {
|
||
type: "color",
|
||
default: "#FFFFFF",
|
||
doc: "The shading color of areas that faces towards the light source.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"hillshade-accent-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
doc: "The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
}
|
||
},
|
||
paint_background: {
|
||
"background-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
doc: "The color with which the background will be drawn.",
|
||
transition: !0,
|
||
requires: [{"!": "background-pattern"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"background-pattern": {
|
||
type: "string",
|
||
transition: !0,
|
||
doc: "Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "cross-faded"
|
||
},
|
||
"background-opacity": {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
doc: "The opacity at which the background will be drawn.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
}
|
||
},
|
||
transition: {
|
||
duration: {
|
||
type: "number",
|
||
default: 300,
|
||
minimum: 0,
|
||
units: "milliseconds",
|
||
doc: "Time allotted for transitions to complete."
|
||
},
|
||
delay: {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
units: "milliseconds",
|
||
doc: "Length of time before a transition begins."
|
||
}
|
||
},
|
||
"property-type": {
|
||
"data-driven": {
|
||
type: "property-type",
|
||
doc: "Property is interpolable and can be represented using a property expression."
|
||
},
|
||
"cross-faded": {
|
||
type: "property-type",
|
||
doc: "Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."
|
||
},
|
||
"cross-faded-data-driven": {
|
||
type: "property-type",
|
||
doc: "Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."
|
||
},
|
||
"color-ramp": {
|
||
type: "property-type",
|
||
doc: "Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."
|
||
},
|
||
"data-constant": {
|
||
type: "property-type",
|
||
doc: "Property is interpolable but cannot be represented using a property expression."
|
||
},
|
||
constant: {
|
||
type: "property-type",
|
||
doc: "Property is constant across all zoom levels and property values."
|
||
}
|
||
}
|
||
}, o = /("(?:[^\\"]|\\.)*")|[:,]/g, n = function (t, e) {
|
||
var i, r, n;
|
||
return e = e || {}, i = JSON.stringify([1], void 0, void 0 === e.indent ? 2 : e.indent).slice(2, -3), r = "" === i ? 1 / 0 : void 0 === e.maxLength ? 80 : e.maxLength, n = e.replacer, function t(e, s, a) {
|
||
var l, h, u, c, p, d, f, g, m, y, v, _;
|
||
if (e && "function" == typeof e.toJSON && (e = e.toJSON()), void 0 === (v = JSON.stringify(e, n))) return v;
|
||
if (f = r - s.length - a, v.length <= f && (m = v.replace(o, function (t, e) {
|
||
return e || t + " "
|
||
})).length <= f) return m;
|
||
if (null != n && (e = JSON.parse(v), n = void 0), "object" == typeof e && null !== e) {
|
||
if (g = s + i, u = [], h = 0, Array.isArray(e)) for (y = "[", l = "]", f = e.length; h < f; h++) u.push(t(e[h], g, h === f - 1 ? 0 : 1) || "null"); else for (y = "{", l = "}", f = (d = Object.keys(e)).length; h < f; h++) c = d[h], p = JSON.stringify(c) + ": ", void 0 !== (_ = t(e[c], g, p.length + (h === f - 1 ? 0 : 1))) && u.push(p + _);
|
||
if (u.length > 0) return [y, i + u.join(",\n" + g), l].join("\n" + s)
|
||
}
|
||
return v
|
||
}(t, "", 0)
|
||
};
|
||
|
||
function s(t, e) {
|
||
var i = {};
|
||
for (var r in e) void 0 !== t[r] && (i[r] = t[r]);
|
||
for (var o in t) void 0 === i[o] && (i[o] = t[o]);
|
||
return i
|
||
}
|
||
|
||
var a = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 !== t ? t : "undefined" != typeof self ? self : {};
|
||
|
||
function l(t, e) {
|
||
return t(e = {exports: {}}, e.exports), e.exports
|
||
}
|
||
|
||
var h = l(function (t, e) {
|
||
!function (i) {
|
||
var r = e && !e.nodeType && e, o = t && !t.nodeType && t, n = "object" == typeof a && a;
|
||
n.global !== n && n.window !== n && n.self !== n || (i = n);
|
||
var s, l, h = 2147483647, u = 36, c = 1, p = 26, d = 38, f = 700, g = 72, m = 128, y = "-",
|
||
v = /^xn--/, _ = /[^\x20-\x7E]/, x = /[\x2E\u3002\uFF0E\uFF61]/g, w = {
|
||
overflow: "Overflow: input needs wider integers to process",
|
||
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
||
"invalid-input": "Invalid input"
|
||
}, b = u - c, C = Math.floor, S = String.fromCharCode;
|
||
|
||
function E(t) {
|
||
throw RangeError(w[t])
|
||
}
|
||
|
||
function T(t, e) {
|
||
for (var i = t.length, r = []; i--;) r[i] = e(t[i]);
|
||
return r
|
||
}
|
||
|
||
function R(t, e) {
|
||
var i = t.split("@"), r = "";
|
||
return i.length > 1 && (r = i[0] + "@", t = i[1]), r + T((t = t.replace(x, ".")).split("."), e).join(".")
|
||
}
|
||
|
||
function P(t) {
|
||
for (var e, i, r = [], o = 0, n = t.length; o < n;) (e = t.charCodeAt(o++)) >= 55296 && e <= 56319 && o < n ? 56320 == (64512 & (i = t.charCodeAt(o++))) ? r.push(((1023 & e) << 10) + (1023 & i) + 65536) : (r.push(e), o--) : r.push(e);
|
||
return r
|
||
}
|
||
|
||
function L(t) {
|
||
return T(t, function (t) {
|
||
var e = "";
|
||
return t > 65535 && (e += S((t -= 65536) >>> 10 & 1023 | 55296), t = 56320 | 1023 & t), e += S(t)
|
||
}).join("")
|
||
}
|
||
|
||
function I(t, e) {
|
||
return t + 22 + 75 * (t < 26) - ((0 != e) << 5)
|
||
}
|
||
|
||
function O(t, e, i) {
|
||
var r = 0;
|
||
for (t = i ? C(t / f) : t >> 1, t += C(t / e); t > b * p >> 1; r += u) t = C(t / b);
|
||
return C(r + (b + 1) * t / (t + d))
|
||
}
|
||
|
||
function M(t) {
|
||
var e, i, r, o, n, s, a, l, d, f, v, _ = [], x = t.length, w = 0, b = m, S = g;
|
||
for ((i = t.lastIndexOf(y)) < 0 && (i = 0), r = 0; r < i; ++r) t.charCodeAt(r) >= 128 && E("not-basic"), _.push(t.charCodeAt(r));
|
||
for (o = i > 0 ? i + 1 : 0; o < x;) {
|
||
for (n = w, s = 1, a = u; o >= x && E("invalid-input"), ((l = (v = t.charCodeAt(o++)) - 48 < 10 ? v - 22 : v - 65 < 26 ? v - 65 : v - 97 < 26 ? v - 97 : u) >= u || l > C((h - w) / s)) && E("overflow"), w += l * s, !(l < (d = a <= S ? c : a >= S + p ? p : a - S)); a += u) s > C(h / (f = u - d)) && E("overflow"), s *= f;
|
||
S = O(w - n, e = _.length + 1, 0 == n), C(w / e) > h - b && E("overflow"), b += C(w / e), w %= e, _.splice(w++, 0, b)
|
||
}
|
||
return L(_)
|
||
}
|
||
|
||
function A(t) {
|
||
var e, i, r, o, n, s, a, l, d, f, v, _, x, w, b, T = [];
|
||
for (_ = (t = P(t)).length, e = m, i = 0, n = g, s = 0; s < _; ++s) (v = t[s]) < 128 && T.push(S(v));
|
||
for (r = o = T.length, o && T.push(y); r < _;) {
|
||
for (a = h, s = 0; s < _; ++s) (v = t[s]) >= e && v < a && (a = v);
|
||
for (a - e > C((h - i) / (x = r + 1)) && E("overflow"), i += (a - e) * x, e = a, s = 0; s < _; ++s) if ((v = t[s]) < e && ++i > h && E("overflow"), v == e) {
|
||
for (l = i, d = u; !(l < (f = d <= n ? c : d >= n + p ? p : d - n)); d += u) b = l - f, w = u - f, T.push(S(I(f + b % w, 0))), l = C(b / w);
|
||
T.push(S(I(l, 0))), n = O(i, x, r == o), i = 0, ++r
|
||
}
|
||
++i, ++e
|
||
}
|
||
return T.join("")
|
||
}
|
||
|
||
if (s = {
|
||
version: "1.3.2",
|
||
ucs2: {decode: P, encode: L},
|
||
decode: M,
|
||
encode: A,
|
||
toASCII: function (t) {
|
||
return R(t, function (t) {
|
||
return _.test(t) ? "xn--" + A(t) : t
|
||
})
|
||
},
|
||
toUnicode: function (t) {
|
||
return R(t, function (t) {
|
||
return v.test(t) ? M(t.slice(4).toLowerCase()) : t
|
||
})
|
||
}
|
||
}, r && o) if (t.exports == r) o.exports = s; else for (l in s) s.hasOwnProperty(l) && (r[l] = s[l]); else i.punycode = s
|
||
}(a)
|
||
}), u = {
|
||
isString: function (t) {
|
||
return "string" == typeof t
|
||
}, isObject: function (t) {
|
||
return "object" == typeof t && null !== t
|
||
}, isNull: function (t) {
|
||
return null === t
|
||
}, isNullOrUndefined: function (t) {
|
||
return null == t
|
||
}
|
||
};
|
||
|
||
function c(t, e) {
|
||
return Object.prototype.hasOwnProperty.call(t, e)
|
||
}
|
||
|
||
var p = function (t, e, i, r) {
|
||
e = e || "&", i = i || "=";
|
||
var o = {};
|
||
if ("string" != typeof t || 0 === t.length) return o;
|
||
var n = /\+/g;
|
||
t = t.split(e);
|
||
var s = 1e3;
|
||
r && "number" == typeof r.maxKeys && (s = r.maxKeys);
|
||
var a = t.length;
|
||
s > 0 && a > s && (a = s);
|
||
for (var l = 0; l < a; ++l) {
|
||
var h, u, p, d, f = t[l].replace(n, "%20"), g = f.indexOf(i);
|
||
g >= 0 ? (h = f.substr(0, g), u = f.substr(g + 1)) : (h = f, u = ""), p = decodeURIComponent(h), d = decodeURIComponent(u), c(o, p) ? Array.isArray(o[p]) ? o[p].push(d) : o[p] = [o[p], d] : o[p] = d
|
||
}
|
||
return o
|
||
}, d = function (t) {
|
||
switch (typeof t) {
|
||
case"string":
|
||
return t;
|
||
case"boolean":
|
||
return t ? "true" : "false";
|
||
case"number":
|
||
return isFinite(t) ? t : "";
|
||
default:
|
||
return ""
|
||
}
|
||
}, f = function (t, e, i, r) {
|
||
return e = e || "&", i = i || "=", null === t && (t = void 0), "object" == typeof t ? Object.keys(t).map(function (r) {
|
||
var o = encodeURIComponent(d(r)) + i;
|
||
return Array.isArray(t[r]) ? t[r].map(function (t) {
|
||
return o + encodeURIComponent(d(t))
|
||
}).join(e) : o + encodeURIComponent(d(t[r]))
|
||
}).join(e) : r ? encodeURIComponent(d(r)) + i + encodeURIComponent(d(t)) : ""
|
||
}, g = l(function (t, e) {
|
||
e.decode = e.parse = p, e.encode = e.stringify = f
|
||
}), m = (g.decode, g.parse, g.encode, g.stringify, k), y = function (t, e) {
|
||
return k(t, !1, !0).resolve(e)
|
||
}, v = function (t, e) {
|
||
if (!t) return e;
|
||
return k(t, !1, !0).resolveObject(e)
|
||
}, _ = function (t) {
|
||
u.isString(t) && (t = k(t));
|
||
if (!(t instanceof w)) return w.prototype.format.call(t);
|
||
return t.format()
|
||
}, x = w;
|
||
|
||
function w() {
|
||
this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null
|
||
}
|
||
|
||
var b = /^([a-z0-9.+-]+:)/i, C = /:[0-9]*$/, S = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
|
||
E = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"]),
|
||
T = ["'"].concat(E), R = ["%", "/", "?", ";", "#"].concat(T), P = ["/", "?", "#"],
|
||
L = /^[+a-z0-9A-Z_-]{0,63}$/, I = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
|
||
O = {javascript: !0, "javascript:": !0}, M = {javascript: !0, "javascript:": !0}, A = {
|
||
http: !0,
|
||
https: !0,
|
||
ftp: !0,
|
||
gopher: !0,
|
||
file: !0,
|
||
"http:": !0,
|
||
"https:": !0,
|
||
"ftp:": !0,
|
||
"gopher:": !0,
|
||
"file:": !0
|
||
};
|
||
|
||
function k(t, e, i) {
|
||
if (t && u.isObject(t) && t instanceof w) return t;
|
||
var r = new w;
|
||
return r.parse(t, e, i), r
|
||
}
|
||
|
||
w.prototype.parse = function (t, e, i) {
|
||
if (!u.isString(t)) throw new TypeError("Parameter 'url' must be a string, not " + typeof t);
|
||
var r = t.indexOf("?"), o = -1 !== r && r < t.indexOf("#") ? "?" : "#", n = t.split(o);
|
||
n[0] = n[0].replace(/\\/g, "/");
|
||
var s = t = n.join(o);
|
||
if (s = s.trim(), !i && 1 === t.split("#").length) {
|
||
var a = S.exec(s);
|
||
if (a) return this.path = s, this.href = s, this.pathname = a[1], a[2] ? (this.search = a[2], this.query = e ? g.parse(this.search.substr(1)) : this.search.substr(1)) : e && (this.search = "", this.query = {}), this
|
||
}
|
||
var l = b.exec(s);
|
||
if (l) {
|
||
var c = (l = l[0]).toLowerCase();
|
||
this.protocol = c, s = s.substr(l.length)
|
||
}
|
||
if (i || l || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
|
||
var p = "//" === s.substr(0, 2);
|
||
!p || l && M[l] || (s = s.substr(2), this.slashes = !0)
|
||
}
|
||
if (!M[l] && (p || l && !A[l])) {
|
||
for (var d, f, m = -1, y = 0; y < P.length; y++) {
|
||
-1 !== (v = s.indexOf(P[y])) && (-1 === m || v < m) && (m = v)
|
||
}
|
||
-1 !== (f = -1 === m ? s.lastIndexOf("@") : s.lastIndexOf("@", m)) && (d = s.slice(0, f), s = s.slice(f + 1), this.auth = decodeURIComponent(d)), m = -1;
|
||
for (y = 0; y < R.length; y++) {
|
||
var v;
|
||
-1 !== (v = s.indexOf(R[y])) && (-1 === m || v < m) && (m = v)
|
||
}
|
||
-1 === m && (m = s.length), this.host = s.slice(0, m), s = s.slice(m), this.parseHost(), this.hostname = this.hostname || "";
|
||
var _ = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
|
||
if (!_) for (var x = this.hostname.split(/\./), w = (y = 0, x.length); y < w; y++) {
|
||
var C = x[y];
|
||
if (C && !C.match(L)) {
|
||
for (var E = "", k = 0, F = C.length; k < F; k++) C.charCodeAt(k) > 127 ? E += "x" : E += C[k];
|
||
if (!E.match(L)) {
|
||
var N = x.slice(0, y), D = x.slice(y + 1), G = C.match(I);
|
||
G && (N.push(G[1]), D.unshift(G[2])), D.length && (s = "/" + D.join(".") + s), this.hostname = N.join(".");
|
||
break
|
||
}
|
||
}
|
||
}
|
||
this.hostname.length > 255 ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), _ || (this.hostname = h.toASCII(this.hostname));
|
||
var j = this.port ? ":" + this.port : "", z = this.hostname || "";
|
||
this.host = z + j, this.href += this.host, _ && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), "/" !== s[0] && (s = "/" + s))
|
||
}
|
||
if (!O[c]) for (y = 0, w = T.length; y < w; y++) {
|
||
var U = T[y];
|
||
if (-1 !== s.indexOf(U)) {
|
||
var B = encodeURIComponent(U);
|
||
B === U && (B = escape(U)), s = s.split(U).join(B)
|
||
}
|
||
}
|
||
var V = s.indexOf("#");
|
||
-1 !== V && (this.hash = s.substr(V), s = s.slice(0, V));
|
||
var Y = s.indexOf("?");
|
||
if (-1 !== Y ? (this.search = s.substr(Y), this.query = s.substr(Y + 1), e && (this.query = g.parse(this.query)), s = s.slice(0, Y)) : e && (this.search = "", this.query = {}), s && (this.pathname = s), A[c] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
|
||
j = this.pathname || "";
|
||
var W = this.search || "";
|
||
this.path = j + W
|
||
}
|
||
return this.href = this.format(), this
|
||
}, w.prototype.format = function () {
|
||
var t = this.auth || "";
|
||
t && (t = (t = encodeURIComponent(t)).replace(/%3A/i, ":"), t += "@");
|
||
var e = this.protocol || "", i = this.pathname || "", r = this.hash || "", o = !1, n = "";
|
||
this.host ? o = t + this.host : this.hostname && (o = t + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"), this.port && (o += ":" + this.port)), this.query && u.isObject(this.query) && Object.keys(this.query).length && (n = g.stringify(this.query));
|
||
var s = this.search || n && "?" + n || "";
|
||
return e && ":" !== e.substr(-1) && (e += ":"), this.slashes || (!e || A[e]) && !1 !== o ? (o = "//" + (o || ""), i && "/" !== i.charAt(0) && (i = "/" + i)) : o || (o = ""), r && "#" !== r.charAt(0) && (r = "#" + r), s && "?" !== s.charAt(0) && (s = "?" + s), e + o + (i = i.replace(/[?#]/g, function (t) {
|
||
return encodeURIComponent(t)
|
||
})) + (s = s.replace("#", "%23")) + r
|
||
}, w.prototype.resolve = function (t) {
|
||
return this.resolveObject(k(t, !1, !0)).format()
|
||
}, w.prototype.resolveObject = function (t) {
|
||
if (u.isString(t)) {
|
||
var e = new w;
|
||
e.parse(t, !1, !0), t = e
|
||
}
|
||
for (var i = new w, r = Object.keys(this), o = 0; o < r.length; o++) {
|
||
var n = r[o];
|
||
i[n] = this[n]
|
||
}
|
||
if (i.hash = t.hash, "" === t.href) return i.href = i.format(), i;
|
||
if (t.slashes && !t.protocol) {
|
||
for (var s = Object.keys(t), a = 0; a < s.length; a++) {
|
||
var l = s[a];
|
||
"protocol" !== l && (i[l] = t[l])
|
||
}
|
||
return A[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"), i.href = i.format(), i
|
||
}
|
||
if (t.protocol && t.protocol !== i.protocol) {
|
||
if (!A[t.protocol]) {
|
||
for (var h = Object.keys(t), c = 0; c < h.length; c++) {
|
||
var p = h[c];
|
||
i[p] = t[p]
|
||
}
|
||
return i.href = i.format(), i
|
||
}
|
||
if (i.protocol = t.protocol, t.host || M[t.protocol]) i.pathname = t.pathname; else {
|
||
for (var d = (t.pathname || "").split("/"); d.length && !(t.host = d.shift());) ;
|
||
t.host || (t.host = ""), t.hostname || (t.hostname = ""), "" !== d[0] && d.unshift(""), d.length < 2 && d.unshift(""), i.pathname = d.join("/")
|
||
}
|
||
if (i.search = t.search, i.query = t.query, i.host = t.host || "", i.auth = t.auth, i.hostname = t.hostname || t.host, i.port = t.port, i.pathname || i.search) {
|
||
var f = i.pathname || "", g = i.search || "";
|
||
i.path = f + g
|
||
}
|
||
return i.slashes = i.slashes || t.slashes, i.href = i.format(), i
|
||
}
|
||
var m = i.pathname && "/" === i.pathname.charAt(0),
|
||
y = t.host || t.pathname && "/" === t.pathname.charAt(0), v = y || m || i.host && t.pathname,
|
||
_ = v, x = i.pathname && i.pathname.split("/") || [],
|
||
b = (d = t.pathname && t.pathname.split("/") || [], i.protocol && !A[i.protocol]);
|
||
if (b && (i.hostname = "", i.port = null, i.host && ("" === x[0] ? x[0] = i.host : x.unshift(i.host)), i.host = "", t.protocol && (t.hostname = null, t.port = null, t.host && ("" === d[0] ? d[0] = t.host : d.unshift(t.host)), t.host = null), v = v && ("" === d[0] || "" === x[0])), y) i.host = t.host || "" === t.host ? t.host : i.host, i.hostname = t.hostname || "" === t.hostname ? t.hostname : i.hostname, i.search = t.search, i.query = t.query, x = d; else if (d.length) x || (x = []), x.pop(), x = x.concat(d), i.search = t.search, i.query = t.query; else if (!u.isNullOrUndefined(t.search)) {
|
||
if (b) i.hostname = i.host = x.shift(), (R = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@")) && (i.auth = R.shift(), i.host = i.hostname = R.shift());
|
||
return i.search = t.search, i.query = t.query, u.isNull(i.pathname) && u.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")), i.href = i.format(), i
|
||
}
|
||
if (!x.length) return i.pathname = null, i.search ? i.path = "/" + i.search : i.path = null, i.href = i.format(), i;
|
||
for (var C = x.slice(-1)[0], S = (i.host || t.host || x.length > 1) && ("." === C || ".." === C) || "" === C, E = 0, T = x.length; T >= 0; T--) "." === (C = x[T]) ? x.splice(T, 1) : ".." === C ? (x.splice(T, 1), E++) : E && (x.splice(T, 1), E--);
|
||
if (!v && !_) for (; E--; E) x.unshift("..");
|
||
!v || "" === x[0] || x[0] && "/" === x[0].charAt(0) || x.unshift(""), S && "/" !== x.join("/").substr(-1) && x.push("");
|
||
var R, P = "" === x[0] || x[0] && "/" === x[0].charAt(0);
|
||
b && (i.hostname = i.host = P ? "" : x.length ? x.shift() : "", (R = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@")) && (i.auth = R.shift(), i.host = i.hostname = R.shift()));
|
||
return (v = v || i.host && x.length) && !P && x.unshift(""), x.length ? i.pathname = x.join("/") : (i.pathname = null, i.path = null), u.isNull(i.pathname) && u.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")), i.auth = t.auth || i.auth, i.slashes = i.slashes || t.slashes, i.href = i.format(), i
|
||
}, w.prototype.parseHost = function () {
|
||
var t = this.host, e = C.exec(t);
|
||
e && (":" !== (e = e[0]) && (this.port = e.substr(1)), t = t.substr(0, t.length - e.length)), t && (this.hostname = t)
|
||
};
|
||
var F = {parse: m, resolve: y, resolveObject: v, format: _, Url: x};
|
||
|
||
function N(t) {
|
||
for (var e = 0; e < r.layout.length; e++) for (var i in r[r.layout[e]]) if (i === t) return r[r.layout[e]][i];
|
||
for (var o = 0; o < r.paint.length; o++) for (var n in r[r.paint[o]]) if (n === t) return r[r.paint[o]][n];
|
||
return null
|
||
}
|
||
|
||
function D(t, e) {
|
||
for (var i in t.sources) e(t.sources[i])
|
||
}
|
||
|
||
function G(t, e) {
|
||
for (var i = 0, r = t.layers; i < r.length; i += 1) {
|
||
e(r[i])
|
||
}
|
||
}
|
||
|
||
function j(t, e, i) {
|
||
function r(t, e) {
|
||
var r = t[e];
|
||
r && Object.keys(r).forEach(function (o) {
|
||
i({
|
||
path: [t.id, e, o], key: o, value: r[o], reference: N(o), set: function (t) {
|
||
r[o] = t
|
||
}
|
||
})
|
||
})
|
||
}
|
||
|
||
G(t, function (t) {
|
||
e.paint && r(t, "paint"), e.layout && r(t, "layout")
|
||
})
|
||
}
|
||
|
||
function z(t, e) {
|
||
for (var i in t) 0 === i.indexOf("layout") && e(t[i], i)
|
||
}
|
||
|
||
function U(t, e) {
|
||
for (var i in t) 0 === i.indexOf("paint") && e(t[i], i)
|
||
}
|
||
|
||
function B(t, e) {
|
||
return "string" == typeof e && "@" === e[0] ? B(t, t.constants[e]) : e
|
||
}
|
||
|
||
function V(t, e, i) {
|
||
t[i] = t[e], delete t[e]
|
||
}
|
||
|
||
function Y(t) {
|
||
var e, i, r;
|
||
t.version = 8, D(t, function (t) {
|
||
"video" === t.type && void 0 !== t.url && V(t, "url", "urls"), "video" === t.type && t.coordinates.forEach(function (t) {
|
||
return t.reverse()
|
||
})
|
||
}), G(t, function (t) {
|
||
z(t, function (t) {
|
||
void 0 !== t["symbol-min-distance"] && V(t, "symbol-min-distance", "symbol-spacing")
|
||
}), U(t, function (t) {
|
||
void 0 !== t["background-image"] && V(t, "background-image", "background-pattern"), void 0 !== t["line-image"] && V(t, "line-image", "line-pattern"), void 0 !== t["fill-image"] && V(t, "fill-image", "fill-pattern")
|
||
})
|
||
}), j(t, {paint: !0, layout: !0}, function (e) {
|
||
var i = B(t, e.value);
|
||
(function (t) {
|
||
return Array.isArray(t.stops)
|
||
})(i) && i.stops.forEach(function (e) {
|
||
e[1] = B(t, e[1])
|
||
}), e.set(i)
|
||
}), delete t.constants, G(t, function (t) {
|
||
z(t, function (t) {
|
||
delete t["text-max-size"], delete t["icon-max-size"]
|
||
}), U(t, function (e) {
|
||
e["text-size"] && (t.layout || (t.layout = {}), t.layout["text-size"] = e["text-size"], delete e["text-size"]), e["icon-size"] && (t.layout || (t.layout = {}), t.layout["icon-size"] = e["icon-size"], delete e["icon-size"])
|
||
})
|
||
}), t.glyphs && (t.glyphs = (e = t.glyphs, i = F.parse(e), r = i.pathname.split("/"), "mapbox:" !== i.protocol ? e : "fontstack" === i.hostname ? "mapbox://fonts/mapbox/{fontstack}/{range}.pbf" : "fonts" === i.hostname ? "mapbox://fonts/" + r[2] + "/{fontstack}/{range}.pbf" : void 0)), G(t, function (t) {
|
||
z(t, function (t) {
|
||
t["text-font"] && (t["text-font"] = function (t) {
|
||
function e(t) {
|
||
return t.split(",").map(function (t) {
|
||
return t.trim()
|
||
})
|
||
}
|
||
|
||
if (Array.isArray(t)) return t;
|
||
if ("string" == typeof t) return e(t);
|
||
if ("object" == typeof t) return t.stops.forEach(function (t) {
|
||
t[1] = e(t[1])
|
||
}), t;
|
||
throw new Error("unexpected font value")
|
||
}(t["text-font"]))
|
||
})
|
||
});
|
||
for (var o = 0, n = t.layers.length - 1; n >= 0; n--) {
|
||
if ("symbol" !== t.layers[n].type) {
|
||
o = n + 1;
|
||
break
|
||
}
|
||
}
|
||
var s = t.layers.splice(o);
|
||
return s.reverse(), t.layers = t.layers.concat(s), t
|
||
}
|
||
|
||
function W(t) {
|
||
for (var e = [], i = arguments.length - 1; i-- > 0;) e[i] = arguments[i + 1];
|
||
for (var r = 0, o = e; r < o.length; r += 1) {
|
||
var n = o[r];
|
||
for (var s in n) t[s] = n[s]
|
||
}
|
||
return t
|
||
}
|
||
|
||
var H = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, i), this.message = i, this.key = e
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(Error), X = function (t, e) {
|
||
void 0 === e && (e = []), this.parent = t, this.bindings = {};
|
||
for (var i = 0, r = e; i < r.length; i += 1) {
|
||
var o = r[i], n = o[0], s = o[1];
|
||
this.bindings[n] = s
|
||
}
|
||
};
|
||
X.prototype.concat = function (t) {
|
||
return new X(this, t)
|
||
}, X.prototype.get = function (t) {
|
||
if (this.bindings[t]) return this.bindings[t];
|
||
if (this.parent) return this.parent.get(t);
|
||
throw new Error(t + " not found in scope.")
|
||
}, X.prototype.has = function (t) {
|
||
return !!this.bindings[t] || !!this.parent && this.parent.has(t)
|
||
};
|
||
var q = {kind: "null"}, Z = {kind: "number"}, K = {kind: "string"}, J = {kind: "boolean"},
|
||
$ = {kind: "color"}, Q = {kind: "object"}, tt = {kind: "value"}, et = {kind: "collator"},
|
||
it = {kind: "formatted"};
|
||
|
||
function rt(t, e) {
|
||
return {kind: "array", itemType: t, N: e}
|
||
}
|
||
|
||
function ot(t) {
|
||
if ("array" === t.kind) {
|
||
var e = ot(t.itemType);
|
||
return "number" == typeof t.N ? "array<" + e + ", " + t.N + ">" : "value" === t.itemType.kind ? "array" : "array<" + e + ">"
|
||
}
|
||
return t.kind
|
||
}
|
||
|
||
var nt = [q, Z, K, J, $, it, Q, rt(tt)];
|
||
|
||
function st(t, e) {
|
||
if ("error" === e.kind) return null;
|
||
if ("array" === t.kind) {
|
||
if ("array" === e.kind && (0 === e.N && "value" === e.itemType.kind || !st(t.itemType, e.itemType)) && ("number" != typeof t.N || t.N === e.N)) return null
|
||
} else {
|
||
if (t.kind === e.kind) return null;
|
||
if ("value" === t.kind) for (var i = 0, r = nt; i < r.length; i += 1) {
|
||
if (!st(r[i], e)) return null
|
||
}
|
||
}
|
||
return "Expected " + ot(t) + " but found " + ot(e) + " instead."
|
||
}
|
||
|
||
var at = l(function (t, e) {
|
||
var i = {
|
||
transparent: [0, 0, 0, 0],
|
||
aliceblue: [240, 248, 255, 1],
|
||
antiquewhite: [250, 235, 215, 1],
|
||
aqua: [0, 255, 255, 1],
|
||
aquamarine: [127, 255, 212, 1],
|
||
azure: [240, 255, 255, 1],
|
||
beige: [245, 245, 220, 1],
|
||
bisque: [255, 228, 196, 1],
|
||
black: [0, 0, 0, 1],
|
||
blanchedalmond: [255, 235, 205, 1],
|
||
blue: [0, 0, 255, 1],
|
||
blueviolet: [138, 43, 226, 1],
|
||
brown: [165, 42, 42, 1],
|
||
burlywood: [222, 184, 135, 1],
|
||
cadetblue: [95, 158, 160, 1],
|
||
chartreuse: [127, 255, 0, 1],
|
||
chocolate: [210, 105, 30, 1],
|
||
coral: [255, 127, 80, 1],
|
||
cornflowerblue: [100, 149, 237, 1],
|
||
cornsilk: [255, 248, 220, 1],
|
||
crimson: [220, 20, 60, 1],
|
||
cyan: [0, 255, 255, 1],
|
||
darkblue: [0, 0, 139, 1],
|
||
darkcyan: [0, 139, 139, 1],
|
||
darkgoldenrod: [184, 134, 11, 1],
|
||
darkgray: [169, 169, 169, 1],
|
||
darkgreen: [0, 100, 0, 1],
|
||
darkgrey: [169, 169, 169, 1],
|
||
darkkhaki: [189, 183, 107, 1],
|
||
darkmagenta: [139, 0, 139, 1],
|
||
darkolivegreen: [85, 107, 47, 1],
|
||
darkorange: [255, 140, 0, 1],
|
||
darkorchid: [153, 50, 204, 1],
|
||
darkred: [139, 0, 0, 1],
|
||
darksalmon: [233, 150, 122, 1],
|
||
darkseagreen: [143, 188, 143, 1],
|
||
darkslateblue: [72, 61, 139, 1],
|
||
darkslategray: [47, 79, 79, 1],
|
||
darkslategrey: [47, 79, 79, 1],
|
||
darkturquoise: [0, 206, 209, 1],
|
||
darkviolet: [148, 0, 211, 1],
|
||
deeppink: [255, 20, 147, 1],
|
||
deepskyblue: [0, 191, 255, 1],
|
||
dimgray: [105, 105, 105, 1],
|
||
dimgrey: [105, 105, 105, 1],
|
||
dodgerblue: [30, 144, 255, 1],
|
||
firebrick: [178, 34, 34, 1],
|
||
floralwhite: [255, 250, 240, 1],
|
||
forestgreen: [34, 139, 34, 1],
|
||
fuchsia: [255, 0, 255, 1],
|
||
gainsboro: [220, 220, 220, 1],
|
||
ghostwhite: [248, 248, 255, 1],
|
||
gold: [255, 215, 0, 1],
|
||
goldenrod: [218, 165, 32, 1],
|
||
gray: [128, 128, 128, 1],
|
||
green: [0, 128, 0, 1],
|
||
greenyellow: [173, 255, 47, 1],
|
||
grey: [128, 128, 128, 1],
|
||
honeydew: [240, 255, 240, 1],
|
||
hotpink: [255, 105, 180, 1],
|
||
indianred: [205, 92, 92, 1],
|
||
indigo: [75, 0, 130, 1],
|
||
ivory: [255, 255, 240, 1],
|
||
khaki: [240, 230, 140, 1],
|
||
lavender: [230, 230, 250, 1],
|
||
lavenderblush: [255, 240, 245, 1],
|
||
lawngreen: [124, 252, 0, 1],
|
||
lemonchiffon: [255, 250, 205, 1],
|
||
lightblue: [173, 216, 230, 1],
|
||
lightcoral: [240, 128, 128, 1],
|
||
lightcyan: [224, 255, 255, 1],
|
||
lightgoldenrodyellow: [250, 250, 210, 1],
|
||
lightgray: [211, 211, 211, 1],
|
||
lightgreen: [144, 238, 144, 1],
|
||
lightgrey: [211, 211, 211, 1],
|
||
lightpink: [255, 182, 193, 1],
|
||
lightsalmon: [255, 160, 122, 1],
|
||
lightseagreen: [32, 178, 170, 1],
|
||
lightskyblue: [135, 206, 250, 1],
|
||
lightslategray: [119, 136, 153, 1],
|
||
lightslategrey: [119, 136, 153, 1],
|
||
lightsteelblue: [176, 196, 222, 1],
|
||
lightyellow: [255, 255, 224, 1],
|
||
lime: [0, 255, 0, 1],
|
||
limegreen: [50, 205, 50, 1],
|
||
linen: [250, 240, 230, 1],
|
||
magenta: [255, 0, 255, 1],
|
||
maroon: [128, 0, 0, 1],
|
||
mediumaquamarine: [102, 205, 170, 1],
|
||
mediumblue: [0, 0, 205, 1],
|
||
mediumorchid: [186, 85, 211, 1],
|
||
mediumpurple: [147, 112, 219, 1],
|
||
mediumseagreen: [60, 179, 113, 1],
|
||
mediumslateblue: [123, 104, 238, 1],
|
||
mediumspringgreen: [0, 250, 154, 1],
|
||
mediumturquoise: [72, 209, 204, 1],
|
||
mediumvioletred: [199, 21, 133, 1],
|
||
midnightblue: [25, 25, 112, 1],
|
||
mintcream: [245, 255, 250, 1],
|
||
mistyrose: [255, 228, 225, 1],
|
||
moccasin: [255, 228, 181, 1],
|
||
navajowhite: [255, 222, 173, 1],
|
||
navy: [0, 0, 128, 1],
|
||
oldlace: [253, 245, 230, 1],
|
||
olive: [128, 128, 0, 1],
|
||
olivedrab: [107, 142, 35, 1],
|
||
orange: [255, 165, 0, 1],
|
||
orangered: [255, 69, 0, 1],
|
||
orchid: [218, 112, 214, 1],
|
||
palegoldenrod: [238, 232, 170, 1],
|
||
palegreen: [152, 251, 152, 1],
|
||
paleturquoise: [175, 238, 238, 1],
|
||
palevioletred: [219, 112, 147, 1],
|
||
papayawhip: [255, 239, 213, 1],
|
||
peachpuff: [255, 218, 185, 1],
|
||
peru: [205, 133, 63, 1],
|
||
pink: [255, 192, 203, 1],
|
||
plum: [221, 160, 221, 1],
|
||
powderblue: [176, 224, 230, 1],
|
||
purple: [128, 0, 128, 1],
|
||
rebeccapurple: [102, 51, 153, 1],
|
||
red: [255, 0, 0, 1],
|
||
rosybrown: [188, 143, 143, 1],
|
||
royalblue: [65, 105, 225, 1],
|
||
saddlebrown: [139, 69, 19, 1],
|
||
salmon: [250, 128, 114, 1],
|
||
sandybrown: [244, 164, 96, 1],
|
||
seagreen: [46, 139, 87, 1],
|
||
seashell: [255, 245, 238, 1],
|
||
sienna: [160, 82, 45, 1],
|
||
silver: [192, 192, 192, 1],
|
||
skyblue: [135, 206, 235, 1],
|
||
slateblue: [106, 90, 205, 1],
|
||
slategray: [112, 128, 144, 1],
|
||
slategrey: [112, 128, 144, 1],
|
||
snow: [255, 250, 250, 1],
|
||
springgreen: [0, 255, 127, 1],
|
||
steelblue: [70, 130, 180, 1],
|
||
tan: [210, 180, 140, 1],
|
||
teal: [0, 128, 128, 1],
|
||
thistle: [216, 191, 216, 1],
|
||
tomato: [255, 99, 71, 1],
|
||
turquoise: [64, 224, 208, 1],
|
||
violet: [238, 130, 238, 1],
|
||
wheat: [245, 222, 179, 1],
|
||
white: [255, 255, 255, 1],
|
||
whitesmoke: [245, 245, 245, 1],
|
||
yellow: [255, 255, 0, 1],
|
||
yellowgreen: [154, 205, 50, 1]
|
||
};
|
||
|
||
function r(t) {
|
||
return (t = Math.round(t)) < 0 ? 0 : t > 255 ? 255 : t
|
||
}
|
||
|
||
function o(t) {
|
||
return t < 0 ? 0 : t > 1 ? 1 : t
|
||
}
|
||
|
||
function n(t) {
|
||
return "%" === t[t.length - 1] ? r(parseFloat(t) / 100 * 255) : r(parseInt(t))
|
||
}
|
||
|
||
function s(t) {
|
||
return "%" === t[t.length - 1] ? o(parseFloat(t) / 100) : o(parseFloat(t))
|
||
}
|
||
|
||
function a(t, e, i) {
|
||
return i < 0 ? i += 1 : i > 1 && (i -= 1), 6 * i < 1 ? t + (e - t) * i * 6 : 2 * i < 1 ? e : 3 * i < 2 ? t + (e - t) * (2 / 3 - i) * 6 : t
|
||
}
|
||
|
||
try {
|
||
e.parseCSSColor = function (t) {
|
||
var e, o = t.replace(/ /g, "").toLowerCase();
|
||
if (o in i) return i[o].slice();
|
||
if ("#" === o[0]) return 4 === o.length ? (e = parseInt(o.substr(1), 16)) >= 0 && e <= 4095 ? [(3840 & e) >> 4 | (3840 & e) >> 8, 240 & e | (240 & e) >> 4, 15 & e | (15 & e) << 4, 1] : null : 7 === o.length && (e = parseInt(o.substr(1), 16)) >= 0 && e <= 16777215 ? [(16711680 & e) >> 16, (65280 & e) >> 8, 255 & e, 1] : null;
|
||
var l = o.indexOf("("), h = o.indexOf(")");
|
||
if (-1 !== l && h + 1 === o.length) {
|
||
var u = o.substr(0, l), c = o.substr(l + 1, h - (l + 1)).split(","), p = 1;
|
||
switch (u) {
|
||
case"rgba":
|
||
if (4 !== c.length) return null;
|
||
p = s(c.pop());
|
||
case"rgb":
|
||
return 3 !== c.length ? null : [n(c[0]), n(c[1]), n(c[2]), p];
|
||
case"hsla":
|
||
if (4 !== c.length) return null;
|
||
p = s(c.pop());
|
||
case"hsl":
|
||
if (3 !== c.length) return null;
|
||
var d = (parseFloat(c[0]) % 360 + 360) % 360 / 360, f = s(c[1]), g = s(c[2]),
|
||
m = g <= .5 ? g * (f + 1) : g + f - g * f, y = 2 * g - m;
|
||
return [r(255 * a(y, m, d + 1 / 3)), r(255 * a(y, m, d)), r(255 * a(y, m, d - 1 / 3)), p];
|
||
default:
|
||
return null
|
||
}
|
||
}
|
||
return null
|
||
}
|
||
} catch (t) {
|
||
}
|
||
}).parseCSSColor, lt = function (t, e, i, r) {
|
||
void 0 === r && (r = 1), this.r = t, this.g = e, this.b = i, this.a = r
|
||
};
|
||
lt.parse = function (t) {
|
||
if (t) {
|
||
if (t instanceof lt) return t;
|
||
if ("string" == typeof t) {
|
||
var e = at(t);
|
||
if (e) return new lt(e[0] / 255 * e[3], e[1] / 255 * e[3], e[2] / 255 * e[3], e[3])
|
||
}
|
||
}
|
||
}, lt.prototype.toString = function () {
|
||
var t = this.toArray(), e = t[0], i = t[1], r = t[2], o = t[3];
|
||
return "rgba(" + Math.round(e) + "," + Math.round(i) + "," + Math.round(r) + "," + o + ")"
|
||
}, lt.prototype.toArray = function () {
|
||
var t = this.r, e = this.g, i = this.b, r = this.a;
|
||
return 0 === r ? [0, 0, 0, 0] : [255 * t / r, 255 * e / r, 255 * i / r, r]
|
||
}, lt.black = new lt(0, 0, 0, 1), lt.white = new lt(1, 1, 1, 1), lt.transparent = new lt(0, 0, 0, 0), lt.red = new lt(1, 0, 0, 1);
|
||
var ht = function (t, e, i) {
|
||
this.sensitivity = t ? e ? "variant" : "case" : e ? "accent" : "base", this.locale = i, this.collator = new Intl.Collator(this.locale ? this.locale : [], {
|
||
sensitivity: this.sensitivity,
|
||
usage: "search"
|
||
})
|
||
};
|
||
ht.prototype.compare = function (t, e) {
|
||
return this.collator.compare(t, e)
|
||
}, ht.prototype.resolvedLocale = function () {
|
||
return new Intl.Collator(this.locale ? this.locale : []).resolvedOptions().locale
|
||
};
|
||
var ut = function (t, e, i) {
|
||
this.text = t, this.scale = e, this.fontStack = i
|
||
}, ct = function (t) {
|
||
this.sections = t
|
||
};
|
||
|
||
function pt(t, e, i, r) {
|
||
return "number" == typeof t && t >= 0 && t <= 255 && "number" == typeof e && e >= 0 && e <= 255 && "number" == typeof i && i >= 0 && i <= 255 ? void 0 === r || "number" == typeof r && r >= 0 && r <= 1 ? null : "Invalid rgba value [" + [t, e, i, r].join(", ") + "]: 'a' must be between 0 and 1." : "Invalid rgba value [" + ("number" == typeof r ? [t, e, i, r] : [t, e, i]).join(", ") + "]: 'r', 'g', and 'b' must be between 0 and 255."
|
||
}
|
||
|
||
function dt(t) {
|
||
if (null === t) return q;
|
||
if ("string" == typeof t) return K;
|
||
if ("boolean" == typeof t) return J;
|
||
if ("number" == typeof t) return Z;
|
||
if (t instanceof lt) return $;
|
||
if (t instanceof ht) return et;
|
||
if (t instanceof ct) return it;
|
||
if (Array.isArray(t)) {
|
||
for (var e, i = t.length, r = 0, o = t; r < o.length; r += 1) {
|
||
var n = dt(o[r]);
|
||
if (e) {
|
||
if (e === n) continue;
|
||
e = tt;
|
||
break
|
||
}
|
||
e = n
|
||
}
|
||
return rt(e || tt, i)
|
||
}
|
||
return Q
|
||
}
|
||
|
||
function ft(t) {
|
||
var e = typeof t;
|
||
return null === t ? "" : "string" === e || "number" === e || "boolean" === e ? String(t) : t instanceof lt || t instanceof ct ? t.toString() : JSON.stringify(t)
|
||
}
|
||
|
||
ct.fromString = function (t) {
|
||
return new ct([new ut(t, null, null)])
|
||
}, ct.prototype.toString = function () {
|
||
return this.sections.map(function (t) {
|
||
return t.text
|
||
}).join("")
|
||
}, ct.prototype.serialize = function () {
|
||
for (var t = ["format"], e = 0, i = this.sections; e < i.length; e += 1) {
|
||
var r = i[e];
|
||
t.push(r.text);
|
||
var o = {};
|
||
r.fontStack && (o["text-font"] = ["literal", r.fontStack.split(",")]), r.scale && (o["font-scale"] = r.scale), t.push(o)
|
||
}
|
||
return t
|
||
};
|
||
var gt = function (t, e) {
|
||
this.type = t, this.value = e
|
||
};
|
||
gt.parse = function (t, e) {
|
||
if (2 !== t.length) return e.error("'literal' expression requires exactly one argument, but found " + (t.length - 1) + " instead.");
|
||
if (!function t(e) {
|
||
if (null === e) return !0;
|
||
if ("string" == typeof e) return !0;
|
||
if ("boolean" == typeof e) return !0;
|
||
if ("number" == typeof e) return !0;
|
||
if (e instanceof lt) return !0;
|
||
if (e instanceof ht) return !0;
|
||
if (e instanceof ct) return !0;
|
||
if (Array.isArray(e)) {
|
||
for (var i = 0, r = e; i < r.length; i += 1) if (!t(r[i])) return !1;
|
||
return !0
|
||
}
|
||
if ("object" == typeof e) {
|
||
for (var o in e) if (!t(e[o])) return !1;
|
||
return !0
|
||
}
|
||
return !1
|
||
}(t[1])) return e.error("invalid value");
|
||
var i = t[1], r = dt(i), o = e.expectedType;
|
||
return "array" !== r.kind || 0 !== r.N || !o || "array" !== o.kind || "number" == typeof o.N && 0 !== o.N || (r = o), new gt(r, i)
|
||
}, gt.prototype.evaluate = function () {
|
||
return this.value
|
||
}, gt.prototype.eachChild = function () {
|
||
}, gt.prototype.possibleOutputs = function () {
|
||
return [this.value]
|
||
}, gt.prototype.serialize = function () {
|
||
return "array" === this.type.kind || "object" === this.type.kind ? ["literal", this.value] : this.value instanceof lt ? ["rgba"].concat(this.value.toArray()) : this.value instanceof ct ? this.value.serialize() : this.value
|
||
};
|
||
var mt = function (t) {
|
||
this.name = "ExpressionEvaluationError", this.message = t
|
||
};
|
||
mt.prototype.toJSON = function () {
|
||
return this.message
|
||
};
|
||
var yt = {string: K, number: Z, boolean: J, object: Q}, vt = function (t, e) {
|
||
this.type = t, this.args = e
|
||
};
|
||
vt.parse = function (t, e) {
|
||
if (t.length < 2) return e.error("Expected at least one argument.");
|
||
var i, r = 1, o = t[0];
|
||
if ("array" === o) {
|
||
var n, s;
|
||
if (t.length > 2) {
|
||
var a = t[1];
|
||
if ("string" != typeof a || !(a in yt) || "object" === a) return e.error('The item type argument of "array" must be one of string, number, boolean', 1);
|
||
n = yt[a], r++
|
||
} else n = tt;
|
||
if (t.length > 3) {
|
||
if (null !== t[2] && ("number" != typeof t[2] || t[2] < 0 || t[2] !== Math.floor(t[2]))) return e.error('The length argument to "array" must be a positive integer literal', 2);
|
||
s = t[2], r++
|
||
}
|
||
i = rt(n, s)
|
||
} else i = yt[o];
|
||
for (var l = []; r < t.length; r++) {
|
||
var h = e.parse(t[r], r, tt);
|
||
if (!h) return null;
|
||
l.push(h)
|
||
}
|
||
return new vt(i, l)
|
||
}, vt.prototype.evaluate = function (t) {
|
||
for (var e = 0; e < this.args.length; e++) {
|
||
var i = this.args[e].evaluate(t);
|
||
if (!st(this.type, dt(i))) return i;
|
||
if (e === this.args.length - 1) throw new mt("Expected value to be of type " + ot(this.type) + ", but found " + ot(dt(i)) + " instead.")
|
||
}
|
||
return null
|
||
}, vt.prototype.eachChild = function (t) {
|
||
this.args.forEach(t)
|
||
}, vt.prototype.possibleOutputs = function () {
|
||
var t;
|
||
return (t = []).concat.apply(t, this.args.map(function (t) {
|
||
return t.possibleOutputs()
|
||
}))
|
||
}, vt.prototype.serialize = function () {
|
||
var t = this.type, e = [t.kind];
|
||
if ("array" === t.kind) {
|
||
var i = t.itemType;
|
||
if ("string" === i.kind || "number" === i.kind || "boolean" === i.kind) {
|
||
e.push(i.kind);
|
||
var r = t.N;
|
||
("number" == typeof r || this.args.length > 1) && e.push(r)
|
||
}
|
||
}
|
||
return e.concat(this.args.map(function (t) {
|
||
return t.serialize()
|
||
}))
|
||
};
|
||
var _t = function (t) {
|
||
this.type = it, this.sections = t
|
||
};
|
||
_t.parse = function (t, e) {
|
||
if (t.length < 3) return e.error("Expected at least two arguments.");
|
||
if ((t.length - 1) % 2 != 0) return e.error("Expected an even number of arguments.");
|
||
for (var i = [], r = 1; r < t.length - 1; r += 2) {
|
||
var o = e.parse(t[r], 1, tt);
|
||
if (!o) return null;
|
||
var n = o.type.kind;
|
||
if ("string" !== n && "value" !== n && "null" !== n) return e.error("Formatted text type must be 'string', 'value', or 'null'.");
|
||
var s = t[r + 1];
|
||
if ("object" != typeof s || Array.isArray(s)) return e.error("Format options argument must be an object.");
|
||
var a = null;
|
||
if (s["font-scale"] && !(a = e.parse(s["font-scale"], 1, Z))) return null;
|
||
var l = null;
|
||
if (s["text-font"] && !(l = e.parse(s["text-font"], 1, rt(K)))) return null;
|
||
i.push({text: o, scale: a, font: l})
|
||
}
|
||
return new _t(i)
|
||
}, _t.prototype.evaluate = function (t) {
|
||
return new ct(this.sections.map(function (e) {
|
||
return new ut(ft(e.text.evaluate(t)), e.scale ? e.scale.evaluate(t) : null, e.font ? e.font.evaluate(t).join(",") : null)
|
||
}))
|
||
}, _t.prototype.eachChild = function (t) {
|
||
for (var e = 0, i = this.sections; e < i.length; e += 1) {
|
||
var r = i[e];
|
||
t(r.text), r.scale && t(r.scale), r.font && t(r.font)
|
||
}
|
||
}, _t.prototype.possibleOutputs = function () {
|
||
return [void 0]
|
||
}, _t.prototype.serialize = function () {
|
||
for (var t = ["format"], e = 0, i = this.sections; e < i.length; e += 1) {
|
||
var r = i[e];
|
||
t.push(r.text.serialize());
|
||
var o = {};
|
||
r.scale && (o["font-scale"] = r.scale.serialize()), r.font && (o["text-font"] = r.font.serialize()), t.push(o)
|
||
}
|
||
return t
|
||
};
|
||
var xt = {"to-boolean": J, "to-color": $, "to-number": Z, "to-string": K}, wt = function (t, e) {
|
||
this.type = t, this.args = e
|
||
};
|
||
wt.parse = function (t, e) {
|
||
if (t.length < 2) return e.error("Expected at least one argument.");
|
||
var i = t[0];
|
||
if (("to-boolean" === i || "to-string" === i) && 2 !== t.length) return e.error("Expected one argument.");
|
||
for (var r = xt[i], o = [], n = 1; n < t.length; n++) {
|
||
var s = e.parse(t[n], n, tt);
|
||
if (!s) return null;
|
||
o.push(s)
|
||
}
|
||
return new wt(r, o)
|
||
}, wt.prototype.evaluate = function (t) {
|
||
if ("boolean" === this.type.kind) return Boolean(this.args[0].evaluate(t));
|
||
if ("color" === this.type.kind) {
|
||
for (var e, i, r = 0, o = this.args; r < o.length; r += 1) {
|
||
if (i = null, (e = o[r].evaluate(t)) instanceof lt) return e;
|
||
if ("string" == typeof e) {
|
||
var n = t.parseColor(e);
|
||
if (n) return n
|
||
} else if (Array.isArray(e) && !(i = e.length < 3 || e.length > 4 ? "Invalid rbga value " + JSON.stringify(e) + ": expected an array containing either three or four numeric values." : pt(e[0], e[1], e[2], e[3]))) return new lt(e[0] / 255, e[1] / 255, e[2] / 255, e[3])
|
||
}
|
||
throw new mt(i || "Could not parse color from value '" + ("string" == typeof e ? e : String(JSON.stringify(e))) + "'")
|
||
}
|
||
if ("number" === this.type.kind) {
|
||
for (var s = null, a = 0, l = this.args; a < l.length; a += 1) {
|
||
if (null === (s = l[a].evaluate(t))) return 0;
|
||
var h = Number(s);
|
||
if (!isNaN(h)) return h
|
||
}
|
||
throw new mt("Could not convert " + JSON.stringify(s) + " to number.")
|
||
}
|
||
return "formatted" === this.type.kind ? ct.fromString(ft(this.args[0].evaluate(t))) : ft(this.args[0].evaluate(t))
|
||
}, wt.prototype.eachChild = function (t) {
|
||
this.args.forEach(t)
|
||
}, wt.prototype.possibleOutputs = function () {
|
||
var t;
|
||
return (t = []).concat.apply(t, this.args.map(function (t) {
|
||
return t.possibleOutputs()
|
||
}))
|
||
}, wt.prototype.serialize = function () {
|
||
if ("formatted" === this.type.kind) return new _t([{
|
||
text: this.args[0],
|
||
scale: null,
|
||
font: null
|
||
}]).serialize();
|
||
var t = ["to-" + this.type.kind];
|
||
return this.eachChild(function (e) {
|
||
t.push(e.serialize())
|
||
}), t
|
||
};
|
||
var bt = ["Unknown", "Point", "LineString", "Polygon"], Ct = function () {
|
||
this.globals = null, this.feature = null, this.featureState = null, this._parseColorCache = {}
|
||
};
|
||
Ct.prototype.id = function () {
|
||
return this.feature && "id" in this.feature ? this.feature.id : null
|
||
}, Ct.prototype.geometryType = function () {
|
||
return this.feature ? "number" == typeof this.feature.type ? bt[this.feature.type] : this.feature.type : null
|
||
}, Ct.prototype.properties = function () {
|
||
return this.feature && this.feature.properties || {}
|
||
}, Ct.prototype.parseColor = function (t) {
|
||
var e = this._parseColorCache[t];
|
||
return e || (e = this._parseColorCache[t] = lt.parse(t)), e
|
||
};
|
||
var St = function (t, e, i, r) {
|
||
this.name = t, this.type = e, this._evaluate = i, this.args = r
|
||
};
|
||
St.prototype.evaluate = function (t) {
|
||
return this._evaluate(t, this.args)
|
||
}, St.prototype.eachChild = function (t) {
|
||
this.args.forEach(t)
|
||
}, St.prototype.possibleOutputs = function () {
|
||
return [void 0]
|
||
}, St.prototype.serialize = function () {
|
||
return [this.name].concat(this.args.map(function (t) {
|
||
return t.serialize()
|
||
}))
|
||
}, St.parse = function (t, e) {
|
||
var i, r = t[0], o = St.definitions[r];
|
||
if (!o) return e.error('Unknown expression "' + r + '". If you wanted a literal array, use ["literal", [...]].', 0);
|
||
for (var n = Array.isArray(o) ? o[0] : o.type, s = Array.isArray(o) ? [[o[1], o[2]]] : o.overloads, a = s.filter(function (e) {
|
||
var i = e[0];
|
||
return !Array.isArray(i) || i.length === t.length - 1
|
||
}), l = null, h = 0, u = a; h < u.length; h += 1) {
|
||
var c = u[h], p = c[0], d = c[1];
|
||
l = new It(e.registry, e.path, null, e.scope);
|
||
for (var f = [], g = !1, m = 1; m < t.length; m++) {
|
||
var y = t[m], v = Array.isArray(p) ? p[m - 1] : p.type, _ = l.parse(y, 1 + f.length, v);
|
||
if (!_) {
|
||
g = !0;
|
||
break
|
||
}
|
||
f.push(_)
|
||
}
|
||
if (!g) if (Array.isArray(p) && p.length !== f.length) l.error("Expected " + p.length + " arguments, but found " + f.length + " instead."); else {
|
||
for (var x = 0; x < f.length; x++) {
|
||
var w = Array.isArray(p) ? p[x] : p.type, b = f[x];
|
||
l.concat(x + 1).checkSubtype(w, b.type)
|
||
}
|
||
if (0 === l.errors.length) return new St(r, n, d, f)
|
||
}
|
||
}
|
||
if (1 === a.length) (i = e.errors).push.apply(i, l.errors); else {
|
||
for (var C = (a.length ? a : s).map(function (t) {
|
||
var e, i = t[0];
|
||
return e = i, Array.isArray(e) ? "(" + e.map(ot).join(", ") + ")" : "(" + ot(e.type) + "...)"
|
||
}).join(" | "), S = [], E = 1; E < t.length; E++) {
|
||
var T = e.parse(t[E], 1 + S.length);
|
||
if (!T) return null;
|
||
S.push(ot(T.type))
|
||
}
|
||
e.error("Expected arguments of type " + C + ", but found (" + S.join(", ") + ") instead.")
|
||
}
|
||
return null
|
||
}, St.register = function (t, e) {
|
||
for (var i in St.definitions = e, e) t[i] = St
|
||
};
|
||
var Et = function (t, e, i) {
|
||
this.type = et, this.locale = i, this.caseSensitive = t, this.diacriticSensitive = e
|
||
};
|
||
|
||
function Tt(t) {
|
||
if (t instanceof St) {
|
||
if ("get" === t.name && 1 === t.args.length) return !1;
|
||
if ("feature-state" === t.name) return !1;
|
||
if ("has" === t.name && 1 === t.args.length) return !1;
|
||
if ("properties" === t.name || "geometry-type" === t.name || "id" === t.name) return !1;
|
||
if (/^filter-/.test(t.name)) return !1
|
||
}
|
||
var e = !0;
|
||
return t.eachChild(function (t) {
|
||
e && !Tt(t) && (e = !1)
|
||
}), e
|
||
}
|
||
|
||
function Rt(t) {
|
||
if (t instanceof St && "feature-state" === t.name) return !1;
|
||
var e = !0;
|
||
return t.eachChild(function (t) {
|
||
e && !Rt(t) && (e = !1)
|
||
}), e
|
||
}
|
||
|
||
function Pt(t, e) {
|
||
if (t instanceof St && e.indexOf(t.name) >= 0) return !1;
|
||
var i = !0;
|
||
return t.eachChild(function (t) {
|
||
i && !Pt(t, e) && (i = !1)
|
||
}), i
|
||
}
|
||
|
||
Et.parse = function (t, e) {
|
||
if (2 !== t.length) return e.error("Expected one argument.");
|
||
var i = t[1];
|
||
if ("object" != typeof i || Array.isArray(i)) return e.error("Collator options argument must be an object.");
|
||
var r = e.parse(void 0 !== i["case-sensitive"] && i["case-sensitive"], 1, J);
|
||
if (!r) return null;
|
||
var o = e.parse(void 0 !== i["diacritic-sensitive"] && i["diacritic-sensitive"], 1, J);
|
||
if (!o) return null;
|
||
var n = null;
|
||
return i.locale && !(n = e.parse(i.locale, 1, K)) ? null : new Et(r, o, n)
|
||
}, Et.prototype.evaluate = function (t) {
|
||
return new ht(this.caseSensitive.evaluate(t), this.diacriticSensitive.evaluate(t), this.locale ? this.locale.evaluate(t) : null)
|
||
}, Et.prototype.eachChild = function (t) {
|
||
t(this.caseSensitive), t(this.diacriticSensitive), this.locale && t(this.locale)
|
||
}, Et.prototype.possibleOutputs = function () {
|
||
return [void 0]
|
||
}, Et.prototype.serialize = function () {
|
||
var t = {};
|
||
return t["case-sensitive"] = this.caseSensitive.serialize(), t["diacritic-sensitive"] = this.diacriticSensitive.serialize(), this.locale && (t.locale = this.locale.serialize()), ["collator", t]
|
||
};
|
||
var Lt = function (t, e) {
|
||
this.type = e.type, this.name = t, this.boundExpression = e
|
||
};
|
||
Lt.parse = function (t, e) {
|
||
if (2 !== t.length || "string" != typeof t[1]) return e.error("'var' expression requires exactly one string literal argument.");
|
||
var i = t[1];
|
||
return e.scope.has(i) ? new Lt(i, e.scope.get(i)) : e.error('Unknown variable "' + i + '". Make sure "' + i + '" has been bound in an enclosing "let" expression before using it.', 1)
|
||
}, Lt.prototype.evaluate = function (t) {
|
||
return this.boundExpression.evaluate(t)
|
||
}, Lt.prototype.eachChild = function () {
|
||
}, Lt.prototype.possibleOutputs = function () {
|
||
return [void 0]
|
||
}, Lt.prototype.serialize = function () {
|
||
return ["var", this.name]
|
||
};
|
||
var It = function (t, e, i, r, o) {
|
||
void 0 === e && (e = []), void 0 === r && (r = new X), void 0 === o && (o = []), this.registry = t, this.path = e, this.key = e.map(function (t) {
|
||
return "[" + t + "]"
|
||
}).join(""), this.scope = r, this.errors = o, this.expectedType = i
|
||
};
|
||
|
||
function Ot(t, e) {
|
||
for (var i, r, o = 0, n = t.length - 1, s = 0; o <= n;) {
|
||
if (i = t[s = Math.floor((o + n) / 2)], r = t[s + 1], e === i || e > i && e < r) return s;
|
||
if (i < e) o = s + 1; else {
|
||
if (!(i > e)) throw new mt("Input is not a number.");
|
||
n = s - 1
|
||
}
|
||
}
|
||
return Math.max(s - 1, 0)
|
||
}
|
||
|
||
It.prototype.parse = function (t, e, i, r, o) {
|
||
return void 0 === o && (o = {}), e ? this.concat(e, i, r)._parse(t, o) : this._parse(t, o)
|
||
}, It.prototype._parse = function (t, e) {
|
||
function i(t, e, i) {
|
||
return "assert" === i ? new vt(e, [t]) : "coerce" === i ? new wt(e, [t]) : t
|
||
}
|
||
|
||
if (null !== t && "string" != typeof t && "boolean" != typeof t && "number" != typeof t || (t = ["literal", t]), Array.isArray(t)) {
|
||
if (0 === t.length) return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');
|
||
var r = t[0];
|
||
if ("string" != typeof r) return this.error("Expression name must be a string, but found " + typeof r + ' instead. If you wanted a literal array, use ["literal", [...]].', 0), null;
|
||
var o = this.registry[r];
|
||
if (o) {
|
||
var n = o.parse(t, this);
|
||
if (!n) return null;
|
||
if (this.expectedType) {
|
||
var s = this.expectedType, a = n.type;
|
||
if ("string" !== s.kind && "number" !== s.kind && "boolean" !== s.kind && "object" !== s.kind && "array" !== s.kind || "value" !== a.kind) if ("color" !== s.kind && "formatted" !== s.kind || "value" !== a.kind && "string" !== a.kind) {
|
||
if (this.checkSubtype(s, a)) return null
|
||
} else n = i(n, s, e.typeAnnotation || "coerce"); else n = i(n, s, e.typeAnnotation || "assert")
|
||
}
|
||
if (!(n instanceof gt) && function t(e) {
|
||
if (e instanceof Lt) return t(e.boundExpression);
|
||
if (e instanceof St && "error" === e.name) return !1;
|
||
if (e instanceof Et) return !1;
|
||
var i = e instanceof wt || e instanceof vt;
|
||
var r = !0;
|
||
e.eachChild(function (e) {
|
||
r = i ? r && t(e) : r && e instanceof gt
|
||
});
|
||
if (!r) return !1;
|
||
return Tt(e) && Pt(e, ["zoom", "heatmap-density", "line-progress", "accumulated", "is-supported-script"])
|
||
}(n)) {
|
||
var l = new Ct;
|
||
try {
|
||
n = new gt(n.type, n.evaluate(l))
|
||
} catch (t) {
|
||
return this.error(t.message), null
|
||
}
|
||
}
|
||
return n
|
||
}
|
||
return this.error('Unknown expression "' + r + '". If you wanted a literal array, use ["literal", [...]].', 0)
|
||
}
|
||
return void 0 === t ? this.error("'undefined' value invalid. Use null instead.") : "object" == typeof t ? this.error('Bare objects invalid. Use ["literal", {...}] instead.') : this.error("Expected an array, but found " + typeof t + " instead.")
|
||
}, It.prototype.concat = function (t, e, i) {
|
||
var r = "number" == typeof t ? this.path.concat(t) : this.path,
|
||
o = i ? this.scope.concat(i) : this.scope;
|
||
return new It(this.registry, r, e || null, o, this.errors)
|
||
}, It.prototype.error = function (t) {
|
||
for (var e = [], i = arguments.length - 1; i-- > 0;) e[i] = arguments[i + 1];
|
||
var r = "" + this.key + e.map(function (t) {
|
||
return "[" + t + "]"
|
||
}).join("");
|
||
this.errors.push(new H(r, t))
|
||
}, It.prototype.checkSubtype = function (t, e) {
|
||
var i = st(t, e);
|
||
return i && this.error(i), i
|
||
};
|
||
var Mt = function (t, e, i) {
|
||
this.type = t, this.input = e, this.labels = [], this.outputs = [];
|
||
for (var r = 0, o = i; r < o.length; r += 1) {
|
||
var n = o[r], s = n[0], a = n[1];
|
||
this.labels.push(s), this.outputs.push(a)
|
||
}
|
||
};
|
||
Mt.parse = function (t, e) {
|
||
var i = t[1], r = t.slice(2);
|
||
if (t.length - 1 < 4) return e.error("Expected at least 4 arguments, but found only " + (t.length - 1) + ".");
|
||
if ((t.length - 1) % 2 != 0) return e.error("Expected an even number of arguments.");
|
||
if (!(i = e.parse(i, 1, Z))) return null;
|
||
var o = [], n = null;
|
||
e.expectedType && "value" !== e.expectedType.kind && (n = e.expectedType), r.unshift(-1 / 0);
|
||
for (var s = 0; s < r.length; s += 2) {
|
||
var a = r[s], l = r[s + 1], h = s + 1, u = s + 2;
|
||
if ("number" != typeof a) return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.', h);
|
||
if (o.length && o[o.length - 1][0] >= a) return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.', h);
|
||
var c = e.parse(l, u, n);
|
||
if (!c) return null;
|
||
n = n || c.type, o.push([a, c])
|
||
}
|
||
return new Mt(n, i, o)
|
||
}, Mt.prototype.evaluate = function (t) {
|
||
var e = this.labels, i = this.outputs;
|
||
if (1 === e.length) return i[0].evaluate(t);
|
||
var r = this.input.evaluate(t);
|
||
if (r <= e[0]) return i[0].evaluate(t);
|
||
var o = e.length;
|
||
return r >= e[o - 1] ? i[o - 1].evaluate(t) : i[Ot(e, r)].evaluate(t)
|
||
}, Mt.prototype.eachChild = function (t) {
|
||
t(this.input);
|
||
for (var e = 0, i = this.outputs; e < i.length; e += 1) {
|
||
t(i[e])
|
||
}
|
||
}, Mt.prototype.possibleOutputs = function () {
|
||
var t;
|
||
return (t = []).concat.apply(t, this.outputs.map(function (t) {
|
||
return t.possibleOutputs()
|
||
}))
|
||
}, Mt.prototype.serialize = function () {
|
||
for (var t = ["step", this.input.serialize()], e = 0; e < this.labels.length; e++) e > 0 && t.push(this.labels[e]), t.push(this.outputs[e].serialize());
|
||
return t
|
||
};
|
||
var At = kt;
|
||
|
||
function kt(t, e, i, r) {
|
||
this.cx = 3 * t, this.bx = 3 * (i - t) - this.cx, this.ax = 1 - this.cx - this.bx, this.cy = 3 * e, this.by = 3 * (r - e) - this.cy, this.ay = 1 - this.cy - this.by, this.p1x = t, this.p1y = r, this.p2x = i, this.p2y = r
|
||
}
|
||
|
||
function Ft(t, e, i) {
|
||
return t * (1 - i) + e * i
|
||
}
|
||
|
||
kt.prototype.sampleCurveX = function (t) {
|
||
return ((this.ax * t + this.bx) * t + this.cx) * t
|
||
}, kt.prototype.sampleCurveY = function (t) {
|
||
return ((this.ay * t + this.by) * t + this.cy) * t
|
||
}, kt.prototype.sampleCurveDerivativeX = function (t) {
|
||
return (3 * this.ax * t + 2 * this.bx) * t + this.cx
|
||
}, kt.prototype.solveCurveX = function (t, e) {
|
||
var i, r, o, n, s;
|
||
for (void 0 === e && (e = 1e-6), o = t, s = 0; s < 8; s++) {
|
||
if (n = this.sampleCurveX(o) - t, Math.abs(n) < e) return o;
|
||
var a = this.sampleCurveDerivativeX(o);
|
||
if (Math.abs(a) < 1e-6) break;
|
||
o -= n / a
|
||
}
|
||
if ((o = t) < (i = 0)) return i;
|
||
if (o > (r = 1)) return r;
|
||
for (; i < r;) {
|
||
if (n = this.sampleCurveX(o), Math.abs(n - t) < e) return o;
|
||
t > n ? i = o : r = o, o = .5 * (r - i) + i
|
||
}
|
||
return o
|
||
}, kt.prototype.solve = function (t, e) {
|
||
return this.sampleCurveY(this.solveCurveX(t, e))
|
||
};
|
||
var Nt = Object.freeze({
|
||
number: Ft, color: function (t, e, i) {
|
||
return new lt(Ft(t.r, e.r, i), Ft(t.g, e.g, i), Ft(t.b, e.b, i), Ft(t.a, e.a, i))
|
||
}, array: function (t, e, i) {
|
||
return t.map(function (t, r) {
|
||
return Ft(t, e[r], i)
|
||
})
|
||
}
|
||
}), Dt = .95047, Gt = 1, jt = 1.08883, zt = 4 / 29, Ut = 6 / 29, Bt = 3 * Ut * Ut, Vt = Ut * Ut * Ut,
|
||
Yt = Math.PI / 180, Wt = 180 / Math.PI;
|
||
|
||
function Ht(t) {
|
||
return t > Vt ? Math.pow(t, 1 / 3) : t / Bt + zt
|
||
}
|
||
|
||
function Xt(t) {
|
||
return t > Ut ? t * t * t : Bt * (t - zt)
|
||
}
|
||
|
||
function qt(t) {
|
||
return 255 * (t <= .0031308 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - .055)
|
||
}
|
||
|
||
function Zt(t) {
|
||
return (t /= 255) <= .04045 ? t / 12.92 : Math.pow((t + .055) / 1.055, 2.4)
|
||
}
|
||
|
||
function Kt(t) {
|
||
var e = Zt(t.r), i = Zt(t.g), r = Zt(t.b),
|
||
o = Ht((.4124564 * e + .3575761 * i + .1804375 * r) / Dt),
|
||
n = Ht((.2126729 * e + .7151522 * i + .072175 * r) / Gt);
|
||
return {
|
||
l: 116 * n - 16,
|
||
a: 500 * (o - n),
|
||
b: 200 * (n - Ht((.0193339 * e + .119192 * i + .9503041 * r) / jt)),
|
||
alpha: t.a
|
||
}
|
||
}
|
||
|
||
function Jt(t) {
|
||
var e = (t.l + 16) / 116, i = isNaN(t.a) ? e : e + t.a / 500, r = isNaN(t.b) ? e : e - t.b / 200;
|
||
return e = Gt * Xt(e), i = Dt * Xt(i), r = jt * Xt(r), new lt(qt(3.2404542 * i - 1.5371385 * e - .4985314 * r), qt(-.969266 * i + 1.8760108 * e + .041556 * r), qt(.0556434 * i - .2040259 * e + 1.0572252 * r), t.alpha)
|
||
}
|
||
|
||
function $t(t, e, i) {
|
||
var r = e - t;
|
||
return t + i * (r > 180 || r < -180 ? r - 360 * Math.round(r / 360) : r)
|
||
}
|
||
|
||
var Qt = {
|
||
forward: Kt, reverse: Jt, interpolate: function (t, e, i) {
|
||
return {
|
||
l: Ft(t.l, e.l, i),
|
||
a: Ft(t.a, e.a, i),
|
||
b: Ft(t.b, e.b, i),
|
||
alpha: Ft(t.alpha, e.alpha, i)
|
||
}
|
||
}
|
||
}, te = {
|
||
forward: function (t) {
|
||
var e = Kt(t), i = e.l, r = e.a, o = e.b, n = Math.atan2(o, r) * Wt;
|
||
return {h: n < 0 ? n + 360 : n, c: Math.sqrt(r * r + o * o), l: i, alpha: t.a}
|
||
}, reverse: function (t) {
|
||
var e = t.h * Yt, i = t.c;
|
||
return Jt({l: t.l, a: Math.cos(e) * i, b: Math.sin(e) * i, alpha: t.alpha})
|
||
}, interpolate: function (t, e, i) {
|
||
return {
|
||
h: $t(t.h, e.h, i),
|
||
c: Ft(t.c, e.c, i),
|
||
l: Ft(t.l, e.l, i),
|
||
alpha: Ft(t.alpha, e.alpha, i)
|
||
}
|
||
}
|
||
}, ee = Object.freeze({lab: Qt, hcl: te}), ie = function (t, e, i, r, o) {
|
||
this.type = t, this.operator = e, this.interpolation = i, this.input = r, this.labels = [], this.outputs = [];
|
||
for (var n = 0, s = o; n < s.length; n += 1) {
|
||
var a = s[n], l = a[0], h = a[1];
|
||
this.labels.push(l), this.outputs.push(h)
|
||
}
|
||
};
|
||
|
||
function re(t, e, i, r) {
|
||
var o = r - i, n = t - i;
|
||
return 0 === o ? 0 : 1 === e ? n / o : (Math.pow(e, n) - 1) / (Math.pow(e, o) - 1)
|
||
}
|
||
|
||
ie.interpolationFactor = function (t, e, i, r) {
|
||
var o = 0;
|
||
if ("exponential" === t.name) o = re(e, t.base, i, r); else if ("linear" === t.name) o = re(e, 1, i, r); else if ("cubic-bezier" === t.name) {
|
||
var n = t.controlPoints;
|
||
o = new At(n[0], n[1], n[2], n[3]).solve(re(e, 1, i, r))
|
||
}
|
||
return o
|
||
}, ie.parse = function (t, e) {
|
||
var i = t[0], r = t[1], o = t[2], n = t.slice(3);
|
||
if (!Array.isArray(r) || 0 === r.length) return e.error("Expected an interpolation type expression.", 1);
|
||
if ("linear" === r[0]) r = {name: "linear"}; else if ("exponential" === r[0]) {
|
||
var s = r[1];
|
||
if ("number" != typeof s) return e.error("Exponential interpolation requires a numeric base.", 1, 1);
|
||
r = {name: "exponential", base: s}
|
||
} else {
|
||
if ("cubic-bezier" !== r[0]) return e.error("Unknown interpolation type " + String(r[0]), 1, 0);
|
||
var a = r.slice(1);
|
||
if (4 !== a.length || a.some(function (t) {
|
||
return "number" != typeof t || t < 0 || t > 1
|
||
})) return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.", 1);
|
||
r = {name: "cubic-bezier", controlPoints: a}
|
||
}
|
||
if (t.length - 1 < 4) return e.error("Expected at least 4 arguments, but found only " + (t.length - 1) + ".");
|
||
if ((t.length - 1) % 2 != 0) return e.error("Expected an even number of arguments.");
|
||
if (!(o = e.parse(o, 2, Z))) return null;
|
||
var l = [], h = null;
|
||
"interpolate-hcl" === i || "interpolate-lab" === i ? h = $ : e.expectedType && "value" !== e.expectedType.kind && (h = e.expectedType);
|
||
for (var u = 0; u < n.length; u += 2) {
|
||
var c = n[u], p = n[u + 1], d = u + 3, f = u + 4;
|
||
if ("number" != typeof c) return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.', d);
|
||
if (l.length && l[l.length - 1][0] >= c) return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.', d);
|
||
var g = e.parse(p, f, h);
|
||
if (!g) return null;
|
||
h = h || g.type, l.push([c, g])
|
||
}
|
||
return "number" === h.kind || "color" === h.kind || "array" === h.kind && "number" === h.itemType.kind && "number" == typeof h.N ? new ie(h, i, r, o, l) : e.error("Type " + ot(h) + " is not interpolatable.")
|
||
}, ie.prototype.evaluate = function (t) {
|
||
var e = this.labels, i = this.outputs;
|
||
if (1 === e.length) return i[0].evaluate(t);
|
||
var r = this.input.evaluate(t);
|
||
if (r <= e[0]) return i[0].evaluate(t);
|
||
var o = e.length;
|
||
if (r >= e[o - 1]) return i[o - 1].evaluate(t);
|
||
var n = Ot(e, r), s = e[n], a = e[n + 1], l = ie.interpolationFactor(this.interpolation, r, s, a),
|
||
h = i[n].evaluate(t), u = i[n + 1].evaluate(t);
|
||
return "interpolate" === this.operator ? Nt[this.type.kind.toLowerCase()](h, u, l) : "interpolate-hcl" === this.operator ? te.reverse(te.interpolate(te.forward(h), te.forward(u), l)) : Qt.reverse(Qt.interpolate(Qt.forward(h), Qt.forward(u), l))
|
||
}, ie.prototype.eachChild = function (t) {
|
||
t(this.input);
|
||
for (var e = 0, i = this.outputs; e < i.length; e += 1) {
|
||
t(i[e])
|
||
}
|
||
}, ie.prototype.possibleOutputs = function () {
|
||
var t;
|
||
return (t = []).concat.apply(t, this.outputs.map(function (t) {
|
||
return t.possibleOutputs()
|
||
}))
|
||
}, ie.prototype.serialize = function () {
|
||
var t;
|
||
t = "linear" === this.interpolation.name ? ["linear"] : "exponential" === this.interpolation.name ? 1 === this.interpolation.base ? ["linear"] : ["exponential", this.interpolation.base] : ["cubic-bezier"].concat(this.interpolation.controlPoints);
|
||
for (var e = [this.operator, t, this.input.serialize()], i = 0; i < this.labels.length; i++) e.push(this.labels[i], this.outputs[i].serialize());
|
||
return e
|
||
};
|
||
var oe = function (t, e) {
|
||
this.type = t, this.args = e
|
||
};
|
||
oe.parse = function (t, e) {
|
||
if (t.length < 2) return e.error("Expectected at least one argument.");
|
||
var i = null, r = e.expectedType;
|
||
r && "value" !== r.kind && (i = r);
|
||
for (var o = [], n = 0, s = t.slice(1); n < s.length; n += 1) {
|
||
var a = s[n], l = e.parse(a, 1 + o.length, i, void 0, {typeAnnotation: "omit"});
|
||
if (!l) return null;
|
||
i = i || l.type, o.push(l)
|
||
}
|
||
var h = r && o.some(function (t) {
|
||
return st(r, t.type)
|
||
});
|
||
return new oe(h ? tt : i, o)
|
||
}, oe.prototype.evaluate = function (t) {
|
||
for (var e = null, i = 0, r = this.args; i < r.length; i += 1) {
|
||
if (null !== (e = r[i].evaluate(t))) break
|
||
}
|
||
return e
|
||
}, oe.prototype.eachChild = function (t) {
|
||
this.args.forEach(t)
|
||
}, oe.prototype.possibleOutputs = function () {
|
||
var t;
|
||
return (t = []).concat.apply(t, this.args.map(function (t) {
|
||
return t.possibleOutputs()
|
||
}))
|
||
}, oe.prototype.serialize = function () {
|
||
var t = ["coalesce"];
|
||
return this.eachChild(function (e) {
|
||
t.push(e.serialize())
|
||
}), t
|
||
};
|
||
var ne = function (t, e) {
|
||
this.type = e.type, this.bindings = [].concat(t), this.result = e
|
||
};
|
||
ne.prototype.evaluate = function (t) {
|
||
return this.result.evaluate(t)
|
||
}, ne.prototype.eachChild = function (t) {
|
||
for (var e = 0, i = this.bindings; e < i.length; e += 1) {
|
||
t(i[e][1])
|
||
}
|
||
t(this.result)
|
||
}, ne.parse = function (t, e) {
|
||
if (t.length < 4) return e.error("Expected at least 3 arguments, but found " + (t.length - 1) + " instead.");
|
||
for (var i = [], r = 1; r < t.length - 1; r += 2) {
|
||
var o = t[r];
|
||
if ("string" != typeof o) return e.error("Expected string, but found " + typeof o + " instead.", r);
|
||
if (/[^a-zA-Z0-9_]/.test(o)) return e.error("Variable names must contain only alphanumeric characters or '_'.", r);
|
||
var n = e.parse(t[r + 1], r + 1);
|
||
if (!n) return null;
|
||
i.push([o, n])
|
||
}
|
||
var s = e.parse(t[t.length - 1], t.length - 1, e.expectedType, i);
|
||
return s ? new ne(i, s) : null
|
||
}, ne.prototype.possibleOutputs = function () {
|
||
return this.result.possibleOutputs()
|
||
}, ne.prototype.serialize = function () {
|
||
for (var t = ["let"], e = 0, i = this.bindings; e < i.length; e += 1) {
|
||
var r = i[e], o = r[0], n = r[1];
|
||
t.push(o, n.serialize())
|
||
}
|
||
return t.push(this.result.serialize()), t
|
||
};
|
||
var se = function (t, e, i) {
|
||
this.type = t, this.index = e, this.input = i
|
||
};
|
||
se.parse = function (t, e) {
|
||
if (3 !== t.length) return e.error("Expected 2 arguments, but found " + (t.length - 1) + " instead.");
|
||
var i = e.parse(t[1], 1, Z), r = e.parse(t[2], 2, rt(e.expectedType || tt));
|
||
if (!i || !r) return null;
|
||
var o = r.type;
|
||
return new se(o.itemType, i, r)
|
||
}, se.prototype.evaluate = function (t) {
|
||
var e = this.index.evaluate(t), i = this.input.evaluate(t);
|
||
if (e < 0) throw new mt("Array index out of bounds: " + e + " < 0.");
|
||
if (e >= i.length) throw new mt("Array index out of bounds: " + e + " > " + (i.length - 1) + ".");
|
||
if (e !== Math.floor(e)) throw new mt("Array index must be an integer, but found " + e + " instead.");
|
||
return i[e]
|
||
}, se.prototype.eachChild = function (t) {
|
||
t(this.index), t(this.input)
|
||
}, se.prototype.possibleOutputs = function () {
|
||
return [void 0]
|
||
}, se.prototype.serialize = function () {
|
||
return ["at", this.index.serialize(), this.input.serialize()]
|
||
};
|
||
var ae = function (t, e, i, r, o, n) {
|
||
this.inputType = t, this.type = e, this.input = i, this.cases = r, this.outputs = o, this.otherwise = n
|
||
};
|
||
ae.parse = function (t, e) {
|
||
if (t.length < 5) return e.error("Expected at least 4 arguments, but found only " + (t.length - 1) + ".");
|
||
if (t.length % 2 != 1) return e.error("Expected an even number of arguments.");
|
||
var i, r;
|
||
e.expectedType && "value" !== e.expectedType.kind && (r = e.expectedType);
|
||
for (var o = {}, n = [], s = 2; s < t.length - 1; s += 2) {
|
||
var a = t[s], l = t[s + 1];
|
||
Array.isArray(a) || (a = [a]);
|
||
var h = e.concat(s);
|
||
if (0 === a.length) return h.error("Expected at least one branch label.");
|
||
for (var u = 0, c = a; u < c.length; u += 1) {
|
||
var p = c[u];
|
||
if ("number" != typeof p && "string" != typeof p) return h.error("Branch labels must be numbers or strings.");
|
||
if ("number" == typeof p && Math.abs(p) > Number.MAX_SAFE_INTEGER) return h.error("Branch labels must be integers no larger than " + Number.MAX_SAFE_INTEGER + ".");
|
||
if ("number" == typeof p && Math.floor(p) !== p) return h.error("Numeric branch labels must be integer values.");
|
||
if (i) {
|
||
if (h.checkSubtype(i, dt(p))) return null
|
||
} else i = dt(p);
|
||
if (void 0 !== o[String(p)]) return h.error("Branch labels must be unique.");
|
||
o[String(p)] = n.length
|
||
}
|
||
var d = e.parse(l, s, r);
|
||
if (!d) return null;
|
||
r = r || d.type, n.push(d)
|
||
}
|
||
var f = e.parse(t[1], 1, tt);
|
||
if (!f) return null;
|
||
var g = e.parse(t[t.length - 1], t.length - 1, r);
|
||
return g ? "value" !== f.type.kind && e.concat(1).checkSubtype(i, f.type) ? null : new ae(i, r, f, o, n, g) : null
|
||
}, ae.prototype.evaluate = function (t) {
|
||
var e = this.input.evaluate(t);
|
||
return (dt(e) === this.inputType && this.outputs[this.cases[e]] || this.otherwise).evaluate(t)
|
||
}, ae.prototype.eachChild = function (t) {
|
||
t(this.input), this.outputs.forEach(t), t(this.otherwise)
|
||
}, ae.prototype.possibleOutputs = function () {
|
||
var t;
|
||
return (t = []).concat.apply(t, this.outputs.map(function (t) {
|
||
return t.possibleOutputs()
|
||
})).concat(this.otherwise.possibleOutputs())
|
||
}, ae.prototype.serialize = function () {
|
||
for (var t = this, e = ["match", this.input.serialize()], i = [], r = {}, o = 0, n = Object.keys(this.cases).sort(); o < n.length; o += 1) {
|
||
var s = n[o];
|
||
void 0 === (c = r[this.cases[s]]) ? (r[this.cases[s]] = i.length, i.push([this.cases[s], [s]])) : i[c][1].push(s)
|
||
}
|
||
for (var a = function (e) {
|
||
return "number" === t.inputType.kind ? Number(e) : e
|
||
}, l = 0, h = i; l < h.length; l += 1) {
|
||
var u = h[l], c = u[0], p = u[1];
|
||
1 === p.length ? e.push(a(p[0])) : e.push(p.map(a)), e.push(this.outputs[outputIndex$1].serialize())
|
||
}
|
||
return e.push(this.otherwise.serialize()), e
|
||
};
|
||
var le = function (t, e, i) {
|
||
this.type = t, this.branches = e, this.otherwise = i
|
||
};
|
||
|
||
function he(t, e) {
|
||
return "==" === t || "!=" === t ? "boolean" === e.kind || "string" === e.kind || "number" === e.kind || "null" === e.kind || "value" === e.kind : "string" === e.kind || "number" === e.kind || "value" === e.kind
|
||
}
|
||
|
||
function ue(t, e, i, r) {
|
||
return 0 === r.compare(e, i)
|
||
}
|
||
|
||
function ce(t, e, i) {
|
||
var r = "==" !== t && "!=" !== t;
|
||
return function () {
|
||
function o(t, e, i) {
|
||
this.type = J, this.lhs = t, this.rhs = e, this.collator = i, this.hasUntypedArgument = "value" === t.type.kind || "value" === e.type.kind
|
||
}
|
||
|
||
return o.parse = function (t, e) {
|
||
if (3 !== t.length && 4 !== t.length) return e.error("Expected two or three arguments.");
|
||
var i = t[0], n = e.parse(t[1], 1, tt);
|
||
if (!n) return null;
|
||
if (!he(i, n.type)) return e.concat(1).error('"' + i + "\" comparisons are not supported for type '" + ot(n.type) + "'.");
|
||
var s = e.parse(t[2], 2, tt);
|
||
if (!s) return null;
|
||
if (!he(i, s.type)) return e.concat(2).error('"' + i + "\" comparisons are not supported for type '" + ot(s.type) + "'.");
|
||
if (n.type.kind !== s.type.kind && "value" !== n.type.kind && "value" !== s.type.kind) return e.error("Cannot compare types '" + ot(n.type) + "' and '" + ot(s.type) + "'.");
|
||
r && ("value" === n.type.kind && "value" !== s.type.kind ? n = new vt(s.type, [n]) : "value" !== n.type.kind && "value" === s.type.kind && (s = new vt(n.type, [s])));
|
||
var a = null;
|
||
if (4 === t.length) {
|
||
if ("string" !== n.type.kind && "string" !== s.type.kind && "value" !== n.type.kind && "value" !== s.type.kind) return e.error("Cannot use collator to compare non-string types.");
|
||
if (!(a = e.parse(t[3], 3, et))) return null
|
||
}
|
||
return new o(n, s, a)
|
||
}, o.prototype.evaluate = function (o) {
|
||
var n = this.lhs.evaluate(o), s = this.rhs.evaluate(o);
|
||
if (r && this.hasUntypedArgument) {
|
||
var a = dt(n), l = dt(s);
|
||
if (a.kind !== l.kind || "string" !== a.kind && "number" !== a.kind) throw new mt('Expected arguments for "' + t + '" to be (string, string) or (number, number), but found (' + a.kind + ", " + l.kind + ") instead.")
|
||
}
|
||
if (this.collator && !r && this.hasUntypedArgument) {
|
||
var h = dt(n), u = dt(s);
|
||
if ("string" !== h.kind || "string" !== u.kind) return e(o, n, s)
|
||
}
|
||
return this.collator ? i(o, n, s, this.collator.evaluate(o)) : e(o, n, s)
|
||
}, o.prototype.eachChild = function (t) {
|
||
t(this.lhs), t(this.rhs), this.collator && t(this.collator)
|
||
}, o.prototype.possibleOutputs = function () {
|
||
return [!0, !1]
|
||
}, o.prototype.serialize = function () {
|
||
var e = [t];
|
||
return this.eachChild(function (t) {
|
||
e.push(t.serialize())
|
||
}), e
|
||
}, o
|
||
}()
|
||
}
|
||
|
||
le.parse = function (t, e) {
|
||
if (t.length < 4) return e.error("Expected at least 3 arguments, but found only " + (t.length - 1) + ".");
|
||
if (t.length % 2 != 0) return e.error("Expected an odd number of arguments.");
|
||
var i;
|
||
e.expectedType && "value" !== e.expectedType.kind && (i = e.expectedType);
|
||
for (var r = [], o = 1; o < t.length - 1; o += 2) {
|
||
var n = e.parse(t[o], o, J);
|
||
if (!n) return null;
|
||
var s = e.parse(t[o + 1], o + 1, i);
|
||
if (!s) return null;
|
||
r.push([n, s]), i = i || s.type
|
||
}
|
||
var a = e.parse(t[t.length - 1], t.length - 1, i);
|
||
return a ? new le(i, r, a) : null
|
||
}, le.prototype.evaluate = function (t) {
|
||
for (var e = 0, i = this.branches; e < i.length; e += 1) {
|
||
var r = i[e], o = r[0], n = r[1];
|
||
if (o.evaluate(t)) return n.evaluate(t)
|
||
}
|
||
return this.otherwise.evaluate(t)
|
||
}, le.prototype.eachChild = function (t) {
|
||
for (var e = 0, i = this.branches; e < i.length; e += 1) {
|
||
var r = i[e], o = r[0], n = r[1];
|
||
t(o), t(n)
|
||
}
|
||
t(this.otherwise)
|
||
}, le.prototype.possibleOutputs = function () {
|
||
var t;
|
||
return (t = []).concat.apply(t, this.branches.map(function (t) {
|
||
t[0];
|
||
return t[1].possibleOutputs()
|
||
})).concat(this.otherwise.possibleOutputs())
|
||
}, le.prototype.serialize = function () {
|
||
var t = ["case"];
|
||
return this.eachChild(function (e) {
|
||
t.push(e.serialize())
|
||
}), t
|
||
};
|
||
var pe = ce("==", function (t, e, i) {
|
||
return e === i
|
||
}, ue), de = ce("!=", function (t, e, i) {
|
||
return e !== i
|
||
}, function (t, e, i, r) {
|
||
return !ue(0, e, i, r)
|
||
}), fe = ce("<", function (t, e, i) {
|
||
return e < i
|
||
}, function (t, e, i, r) {
|
||
return r.compare(e, i) < 0
|
||
}), ge = ce(">", function (t, e, i) {
|
||
return e > i
|
||
}, function (t, e, i, r) {
|
||
return r.compare(e, i) > 0
|
||
}), me = ce("<=", function (t, e, i) {
|
||
return e <= i
|
||
}, function (t, e, i, r) {
|
||
return r.compare(e, i) <= 0
|
||
}), ye = ce(">=", function (t, e, i) {
|
||
return e >= i
|
||
}, function (t, e, i, r) {
|
||
return r.compare(e, i) >= 0
|
||
}), ve = function (t, e, i, r, o) {
|
||
this.type = K, this.number = t, this.locale = e, this.currency = i, this.minFractionDigits = r, this.maxFractionDigits = o
|
||
};
|
||
ve.parse = function (t, e) {
|
||
if (3 !== t.length) return e.error("Expected two arguments.");
|
||
var i = e.parse(t[1], 1, Z);
|
||
if (!i) return null;
|
||
var r = t[2];
|
||
if ("object" != typeof r || Array.isArray(r)) return e.error("NumberFormat options argument must be an object.");
|
||
var o = null;
|
||
if (r.locale && !(o = e.parse(r.locale, 1, K))) return null;
|
||
var n = null;
|
||
if (r.currency && !(n = e.parse(r.currency, 1, K))) return null;
|
||
var s = null;
|
||
if (r["min-fraction-digits"] && !(s = e.parse(r["min-fraction-digits"], 1, Z))) return null;
|
||
var a = null;
|
||
return r["max-fraction-digits"] && !(a = e.parse(r["max-fraction-digits"], 1, Z)) ? null : new ve(i, o, n, s, a)
|
||
}, ve.prototype.evaluate = function (t) {
|
||
return new Intl.NumberFormat(this.locale ? this.locale.evaluate(t) : [], {
|
||
style: this.currency ? "currency" : "decimal",
|
||
currency: this.currency ? this.currency.evaluate(t) : void 0,
|
||
minimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(t) : void 0,
|
||
maximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(t) : void 0
|
||
}).format(this.number.evaluate(t))
|
||
}, ve.prototype.eachChild = function (t) {
|
||
t(this.number), this.locale && t(this.locale), this.currency && t(this.currency), this.minFractionDigits && t(this.minFractionDigits), this.maxFractionDigits && t(this.maxFractionDigits)
|
||
}, ve.prototype.possibleOutputs = function () {
|
||
return [void 0]
|
||
}, ve.prototype.serialize = function () {
|
||
var t = {};
|
||
return this.locale && (t.locale = this.locale.serialize()), this.currency && (t.currency = this.currency.serialize()), this.minFractionDigits && (t["min-fraction-digits"] = this.minFractionDigits.serialize()), this.maxFractionDigits && (t["max-fraction-digits"] = this.maxFractionDigits.serialize()), ["number-format", this.number.serialize(), t]
|
||
};
|
||
var _e = function (t) {
|
||
this.type = Z, this.input = t
|
||
};
|
||
_e.parse = function (t, e) {
|
||
if (2 !== t.length) return e.error("Expected 1 argument, but found " + (t.length - 1) + " instead.");
|
||
var i = e.parse(t[1], 1);
|
||
return i ? "array" !== i.type.kind && "string" !== i.type.kind && "value" !== i.type.kind ? e.error("Expected argument of type string or array, but found " + ot(i.type) + " instead.") : new _e(i) : null
|
||
}, _e.prototype.evaluate = function (t) {
|
||
var e = this.input.evaluate(t);
|
||
if ("string" == typeof e) return e.length;
|
||
if (Array.isArray(e)) return e.length;
|
||
throw new mt("Expected value to be of type string or array, but found " + ot(dt(e)) + " instead.")
|
||
}, _e.prototype.eachChild = function (t) {
|
||
t(this.input)
|
||
}, _e.prototype.possibleOutputs = function () {
|
||
return [void 0]
|
||
}, _e.prototype.serialize = function () {
|
||
var t = ["length"];
|
||
return this.eachChild(function (e) {
|
||
t.push(e.serialize())
|
||
}), t
|
||
};
|
||
var xe = {
|
||
"==": pe,
|
||
"!=": de,
|
||
">": ge,
|
||
"<": fe,
|
||
">=": ye,
|
||
"<=": me,
|
||
array: vt,
|
||
at: se,
|
||
boolean: vt,
|
||
case: le,
|
||
coalesce: oe,
|
||
collator: Et,
|
||
format: _t,
|
||
interpolate: ie,
|
||
"interpolate-hcl": ie,
|
||
"interpolate-lab": ie,
|
||
length: _e,
|
||
let: ne,
|
||
literal: gt,
|
||
match: ae,
|
||
number: vt,
|
||
"number-format": ve,
|
||
object: vt,
|
||
step: Mt,
|
||
string: vt,
|
||
"to-boolean": wt,
|
||
"to-color": wt,
|
||
"to-number": wt,
|
||
"to-string": wt,
|
||
var: Lt
|
||
};
|
||
|
||
function we(t, e) {
|
||
var i = e[0], r = e[1], o = e[2], n = e[3];
|
||
i = i.evaluate(t), r = r.evaluate(t), o = o.evaluate(t);
|
||
var s = n ? n.evaluate(t) : 1, a = pt(i, r, o, s);
|
||
if (a) throw new mt(a);
|
||
return new lt(i / 255 * s, r / 255 * s, o / 255 * s, s)
|
||
}
|
||
|
||
function be(t, e) {
|
||
return t in e
|
||
}
|
||
|
||
function Ce(t, e) {
|
||
var i = e[t];
|
||
return void 0 === i ? null : i
|
||
}
|
||
|
||
function Se(t) {
|
||
return {type: t}
|
||
}
|
||
|
||
function Ee(t) {
|
||
return {result: "success", value: t}
|
||
}
|
||
|
||
function Te(t) {
|
||
return {result: "error", value: t}
|
||
}
|
||
|
||
function Re(t) {
|
||
return "data-driven" === t["property-type"] || "cross-faded-data-driven" === t["property-type"]
|
||
}
|
||
|
||
function Pe(t) {
|
||
return !!t.expression && t.expression.parameters.indexOf("zoom") > -1
|
||
}
|
||
|
||
function Le(t) {
|
||
return !!t.expression && t.expression.interpolated
|
||
}
|
||
|
||
function Ie(t) {
|
||
return t instanceof Number ? "number" : t instanceof String ? "string" : t instanceof Boolean ? "boolean" : Array.isArray(t) ? "array" : null === t ? "null" : typeof t
|
||
}
|
||
|
||
function Oe(t) {
|
||
return "object" == typeof t && null !== t && !Array.isArray(t)
|
||
}
|
||
|
||
function Me(t) {
|
||
return t
|
||
}
|
||
|
||
function Ae(t, e) {
|
||
var i, r, o, n = "color" === e.type, s = t.stops && "object" == typeof t.stops[0][0],
|
||
a = s || void 0 !== t.property, l = s || !a, h = t.type || (Le(e) ? "exponential" : "interval");
|
||
if (n && ((t = W({}, t)).stops && (t.stops = t.stops.map(function (t) {
|
||
return [t[0], lt.parse(t[1])]
|
||
})), t.default ? t.default = lt.parse(t.default) : t.default = lt.parse(e.default)), t.colorSpace && "rgb" !== t.colorSpace && !ee[t.colorSpace]) throw new Error("Unknown color space: " + t.colorSpace);
|
||
if ("exponential" === h) i = De; else if ("interval" === h) i = Ne; else if ("categorical" === h) {
|
||
i = Fe, r = Object.create(null);
|
||
for (var u = 0, c = t.stops; u < c.length; u += 1) {
|
||
var p = c[u];
|
||
r[p[0]] = p[1]
|
||
}
|
||
o = typeof t.stops[0][0]
|
||
} else {
|
||
if ("identity" !== h) throw new Error('Unknown function type "' + h + '"');
|
||
i = Ge
|
||
}
|
||
if (s) {
|
||
for (var d = {}, f = [], g = 0; g < t.stops.length; g++) {
|
||
var m = t.stops[g], y = m[0].zoom;
|
||
void 0 === d[y] && (d[y] = {
|
||
zoom: y,
|
||
type: t.type,
|
||
property: t.property,
|
||
default: t.default,
|
||
stops: []
|
||
}, f.push(y)), d[y].stops.push([m[0].value, m[1]])
|
||
}
|
||
for (var v = [], _ = 0, x = f; _ < x.length; _ += 1) {
|
||
var w = x[_];
|
||
v.push([d[w].zoom, Ae(d[w], e)])
|
||
}
|
||
return {
|
||
kind: "composite",
|
||
interpolationFactor: ie.interpolationFactor.bind(void 0, {name: "linear"}),
|
||
zoomStops: v.map(function (t) {
|
||
return t[0]
|
||
}),
|
||
evaluate: function (i, r) {
|
||
var o = i.zoom;
|
||
return De({stops: v, base: t.base}, e, o).evaluate(o, r)
|
||
}
|
||
}
|
||
}
|
||
return l ? {
|
||
kind: "camera",
|
||
interpolationFactor: "exponential" === h ? ie.interpolationFactor.bind(void 0, {
|
||
name: "exponential",
|
||
base: void 0 !== t.base ? t.base : 1
|
||
}) : function () {
|
||
return 0
|
||
},
|
||
zoomStops: t.stops.map(function (t) {
|
||
return t[0]
|
||
}),
|
||
evaluate: function (n) {
|
||
var s = n.zoom;
|
||
return i(t, e, s, r, o)
|
||
}
|
||
} : {
|
||
kind: "source", evaluate: function (n, s) {
|
||
var a = s && s.properties ? s.properties[t.property] : void 0;
|
||
return void 0 === a ? ke(t.default, e.default) : i(t, e, a, r, o)
|
||
}
|
||
}
|
||
}
|
||
|
||
function ke(t, e, i) {
|
||
return void 0 !== t ? t : void 0 !== e ? e : void 0 !== i ? i : void 0
|
||
}
|
||
|
||
function Fe(t, e, i, r, o) {
|
||
return ke(typeof i === o ? r[i] : void 0, t.default, e.default)
|
||
}
|
||
|
||
function Ne(t, e, i) {
|
||
if ("number" !== Ie(i)) return ke(t.default, e.default);
|
||
var r = t.stops.length;
|
||
if (1 === r) return t.stops[0][1];
|
||
if (i <= t.stops[0][0]) return t.stops[0][1];
|
||
if (i >= t.stops[r - 1][0]) return t.stops[r - 1][1];
|
||
var o = je(t.stops, i);
|
||
return t.stops[o][1]
|
||
}
|
||
|
||
function De(t, e, i) {
|
||
var r = void 0 !== t.base ? t.base : 1;
|
||
if ("number" !== Ie(i)) return ke(t.default, e.default);
|
||
var o = t.stops.length;
|
||
if (1 === o) return t.stops[0][1];
|
||
if (i <= t.stops[0][0]) return t.stops[0][1];
|
||
if (i >= t.stops[o - 1][0]) return t.stops[o - 1][1];
|
||
var n = je(t.stops, i), s = function (t, e, i, r) {
|
||
var o = r - i, n = t - i;
|
||
return 0 === o ? 0 : 1 === e ? n / o : (Math.pow(e, n) - 1) / (Math.pow(e, o) - 1)
|
||
}(i, r, t.stops[n][0], t.stops[n + 1][0]), a = t.stops[n][1], l = t.stops[n + 1][1],
|
||
h = Nt[e.type] || Me;
|
||
if (t.colorSpace && "rgb" !== t.colorSpace) {
|
||
var u = ee[t.colorSpace];
|
||
h = function (t, e) {
|
||
return u.reverse(u.interpolate(u.forward(t), u.forward(e), s))
|
||
}
|
||
}
|
||
return "function" == typeof a.evaluate ? {
|
||
evaluate: function () {
|
||
for (var t = [], e = arguments.length; e--;) t[e] = arguments[e];
|
||
var i = a.evaluate.apply(void 0, t), r = l.evaluate.apply(void 0, t);
|
||
if (void 0 !== i && void 0 !== r) return h(i, r, s)
|
||
}
|
||
} : h(a, l, s)
|
||
}
|
||
|
||
function Ge(t, e, i) {
|
||
return "color" === e.type ? i = lt.parse(i) : "formatted" === e.type ? i = ct.fromString(i.toString()) : Ie(i) === e.type || "enum" === e.type && e.values[i] || (i = void 0), ke(i, t.default, e.default)
|
||
}
|
||
|
||
function je(t, e) {
|
||
for (var i, r, o = 0, n = t.length - 1, s = 0; o <= n;) {
|
||
if (i = t[s = Math.floor((o + n) / 2)][0], r = t[s + 1][0], e === i || e > i && e < r) return s;
|
||
i < e ? o = s + 1 : i > e && (n = s - 1)
|
||
}
|
||
return Math.max(s - 1, 0)
|
||
}
|
||
|
||
St.register(xe, {
|
||
error: [{kind: "error"}, [K], function (t, e) {
|
||
var i = e[0];
|
||
throw new mt(i.evaluate(t))
|
||
}],
|
||
typeof: [K, [tt], function (t, e) {
|
||
return ot(dt(e[0].evaluate(t)))
|
||
}],
|
||
"to-rgba": [rt(Z, 4), [$], function (t, e) {
|
||
return e[0].evaluate(t).toArray()
|
||
}],
|
||
rgb: [$, [Z, Z, Z], we],
|
||
rgba: [$, [Z, Z, Z, Z], we],
|
||
has: {
|
||
type: J, overloads: [[[K], function (t, e) {
|
||
return be(e[0].evaluate(t), t.properties())
|
||
}], [[K, Q], function (t, e) {
|
||
var i = e[0], r = e[1];
|
||
return be(i.evaluate(t), r.evaluate(t))
|
||
}]]
|
||
},
|
||
get: {
|
||
type: tt, overloads: [[[K], function (t, e) {
|
||
return Ce(e[0].evaluate(t), t.properties())
|
||
}], [[K, Q], function (t, e) {
|
||
var i = e[0], r = e[1];
|
||
return Ce(i.evaluate(t), r.evaluate(t))
|
||
}]]
|
||
},
|
||
"feature-state": [tt, [K], function (t, e) {
|
||
return Ce(e[0].evaluate(t), t.featureState || {})
|
||
}],
|
||
properties: [Q, [], function (t) {
|
||
return t.properties()
|
||
}],
|
||
"geometry-type": [K, [], function (t) {
|
||
return t.geometryType()
|
||
}],
|
||
id: [tt, [], function (t) {
|
||
return t.id()
|
||
}],
|
||
zoom: [Z, [], function (t) {
|
||
return t.globals.zoom
|
||
}],
|
||
"heatmap-density": [Z, [], function (t) {
|
||
return t.globals.heatmapDensity || 0
|
||
}],
|
||
"line-progress": [Z, [], function (t) {
|
||
return t.globals.lineProgress || 0
|
||
}],
|
||
accumulated: [tt, [], function (t) {
|
||
return void 0 === t.globals.accumulated ? null : t.globals.accumulated
|
||
}],
|
||
"+": [Z, Se(Z), function (t, e) {
|
||
for (var i = 0, r = 0, o = e; r < o.length; r += 1) {
|
||
i += o[r].evaluate(t)
|
||
}
|
||
return i
|
||
}],
|
||
"*": [Z, Se(Z), function (t, e) {
|
||
for (var i = 1, r = 0, o = e; r < o.length; r += 1) {
|
||
i *= o[r].evaluate(t)
|
||
}
|
||
return i
|
||
}],
|
||
"-": {
|
||
type: Z, overloads: [[[Z, Z], function (t, e) {
|
||
var i = e[0], r = e[1];
|
||
return i.evaluate(t) - r.evaluate(t)
|
||
}], [[Z], function (t, e) {
|
||
return -e[0].evaluate(t)
|
||
}]]
|
||
},
|
||
"/": [Z, [Z, Z], function (t, e) {
|
||
var i = e[0], r = e[1];
|
||
return i.evaluate(t) / r.evaluate(t)
|
||
}],
|
||
"%": [Z, [Z, Z], function (t, e) {
|
||
var i = e[0], r = e[1];
|
||
return i.evaluate(t) % r.evaluate(t)
|
||
}],
|
||
ln2: [Z, [], function () {
|
||
return Math.LN2
|
||
}],
|
||
pi: [Z, [], function () {
|
||
return Math.PI
|
||
}],
|
||
e: [Z, [], function () {
|
||
return Math.E
|
||
}],
|
||
"^": [Z, [Z, Z], function (t, e) {
|
||
var i = e[0], r = e[1];
|
||
return Math.pow(i.evaluate(t), r.evaluate(t))
|
||
}],
|
||
sqrt: [Z, [Z], function (t, e) {
|
||
var i = e[0];
|
||
return Math.sqrt(i.evaluate(t))
|
||
}],
|
||
log10: [Z, [Z], function (t, e) {
|
||
var i = e[0];
|
||
return Math.log(i.evaluate(t)) / Math.LN10
|
||
}],
|
||
ln: [Z, [Z], function (t, e) {
|
||
var i = e[0];
|
||
return Math.log(i.evaluate(t))
|
||
}],
|
||
log2: [Z, [Z], function (t, e) {
|
||
var i = e[0];
|
||
return Math.log(i.evaluate(t)) / Math.LN2
|
||
}],
|
||
sin: [Z, [Z], function (t, e) {
|
||
var i = e[0];
|
||
return Math.sin(i.evaluate(t))
|
||
}],
|
||
cos: [Z, [Z], function (t, e) {
|
||
var i = e[0];
|
||
return Math.cos(i.evaluate(t))
|
||
}],
|
||
tan: [Z, [Z], function (t, e) {
|
||
var i = e[0];
|
||
return Math.tan(i.evaluate(t))
|
||
}],
|
||
asin: [Z, [Z], function (t, e) {
|
||
var i = e[0];
|
||
return Math.asin(i.evaluate(t))
|
||
}],
|
||
acos: [Z, [Z], function (t, e) {
|
||
var i = e[0];
|
||
return Math.acos(i.evaluate(t))
|
||
}],
|
||
atan: [Z, [Z], function (t, e) {
|
||
var i = e[0];
|
||
return Math.atan(i.evaluate(t))
|
||
}],
|
||
min: [Z, Se(Z), function (t, e) {
|
||
return Math.min.apply(Math, e.map(function (e) {
|
||
return e.evaluate(t)
|
||
}))
|
||
}],
|
||
max: [Z, Se(Z), function (t, e) {
|
||
return Math.max.apply(Math, e.map(function (e) {
|
||
return e.evaluate(t)
|
||
}))
|
||
}],
|
||
abs: [Z, [Z], function (t, e) {
|
||
var i = e[0];
|
||
return Math.abs(i.evaluate(t))
|
||
}],
|
||
round: [Z, [Z], function (t, e) {
|
||
var i = e[0].evaluate(t);
|
||
return i < 0 ? -Math.round(-i) : Math.round(i)
|
||
}],
|
||
floor: [Z, [Z], function (t, e) {
|
||
var i = e[0];
|
||
return Math.floor(i.evaluate(t))
|
||
}],
|
||
ceil: [Z, [Z], function (t, e) {
|
||
var i = e[0];
|
||
return Math.ceil(i.evaluate(t))
|
||
}],
|
||
"filter-==": [J, [K, tt], function (t, e) {
|
||
var i = e[0], r = e[1];
|
||
return t.properties()[i.value] === r.value
|
||
}],
|
||
"filter-id-==": [J, [tt], function (t, e) {
|
||
var i = e[0];
|
||
return t.id() === i.value
|
||
}],
|
||
"filter-type-==": [J, [K], function (t, e) {
|
||
var i = e[0];
|
||
return t.geometryType() === i.value
|
||
}],
|
||
"filter-<": [J, [K, tt], function (t, e) {
|
||
var i = e[0], r = e[1], o = t.properties()[i.value], n = r.value;
|
||
return typeof o == typeof n && o < n
|
||
}],
|
||
"filter-id-<": [J, [tt], function (t, e) {
|
||
var i = e[0], r = t.id(), o = i.value;
|
||
return typeof r == typeof o && r < o
|
||
}],
|
||
"filter->": [J, [K, tt], function (t, e) {
|
||
var i = e[0], r = e[1], o = t.properties()[i.value], n = r.value;
|
||
return typeof o == typeof n && o > n
|
||
}],
|
||
"filter-id->": [J, [tt], function (t, e) {
|
||
var i = e[0], r = t.id(), o = i.value;
|
||
return typeof r == typeof o && r > o
|
||
}],
|
||
"filter-<=": [J, [K, tt], function (t, e) {
|
||
var i = e[0], r = e[1], o = t.properties()[i.value], n = r.value;
|
||
return typeof o == typeof n && o <= n
|
||
}],
|
||
"filter-id-<=": [J, [tt], function (t, e) {
|
||
var i = e[0], r = t.id(), o = i.value;
|
||
return typeof r == typeof o && r <= o
|
||
}],
|
||
"filter->=": [J, [K, tt], function (t, e) {
|
||
var i = e[0], r = e[1], o = t.properties()[i.value], n = r.value;
|
||
return typeof o == typeof n && o >= n
|
||
}],
|
||
"filter-id->=": [J, [tt], function (t, e) {
|
||
var i = e[0], r = t.id(), o = i.value;
|
||
return typeof r == typeof o && r >= o
|
||
}],
|
||
"filter-has": [J, [tt], function (t, e) {
|
||
return e[0].value in t.properties()
|
||
}],
|
||
"filter-has-id": [J, [], function (t) {
|
||
return null !== t.id()
|
||
}],
|
||
"filter-type-in": [J, [rt(K)], function (t, e) {
|
||
return e[0].value.indexOf(t.geometryType()) >= 0
|
||
}],
|
||
"filter-id-in": [J, [rt(tt)], function (t, e) {
|
||
return e[0].value.indexOf(t.id()) >= 0
|
||
}],
|
||
"filter-in-small": [J, [K, rt(tt)], function (t, e) {
|
||
var i = e[0];
|
||
return e[1].value.indexOf(t.properties()[i.value]) >= 0
|
||
}],
|
||
"filter-in-large": [J, [K, rt(tt)], function (t, e) {
|
||
var i = e[0], r = e[1];
|
||
return function (t, e, i, r) {
|
||
for (; i <= r;) {
|
||
var o = i + r >> 1;
|
||
if (e[o] === t) return !0;
|
||
e[o] > t ? r = o - 1 : i = o + 1
|
||
}
|
||
return !1
|
||
}(t.properties()[i.value], r.value, 0, r.value.length - 1)
|
||
}],
|
||
all: {
|
||
type: J, overloads: [[[J, J], function (t, e) {
|
||
var i = e[0], r = e[1];
|
||
return i.evaluate(t) && r.evaluate(t)
|
||
}], [Se(J), function (t, e) {
|
||
for (var i = 0, r = e; i < r.length; i += 1) {
|
||
if (!r[i].evaluate(t)) return !1
|
||
}
|
||
return !0
|
||
}]]
|
||
},
|
||
any: {
|
||
type: J, overloads: [[[J, J], function (t, e) {
|
||
var i = e[0], r = e[1];
|
||
return i.evaluate(t) || r.evaluate(t)
|
||
}], [Se(J), function (t, e) {
|
||
for (var i = 0, r = e; i < r.length; i += 1) {
|
||
if (r[i].evaluate(t)) return !0
|
||
}
|
||
return !1
|
||
}]]
|
||
},
|
||
"!": [J, [J], function (t, e) {
|
||
return !e[0].evaluate(t)
|
||
}],
|
||
"is-supported-script": [J, [K], function (t, e) {
|
||
var i = e[0], r = t.globals && t.globals.isSupportedScript;
|
||
return !r || r(i.evaluate(t))
|
||
}],
|
||
upcase: [K, [K], function (t, e) {
|
||
return e[0].evaluate(t).toUpperCase()
|
||
}],
|
||
downcase: [K, [K], function (t, e) {
|
||
return e[0].evaluate(t).toLowerCase()
|
||
}],
|
||
concat: [K, Se(tt), function (t, e) {
|
||
return e.map(function (e) {
|
||
return ft(e.evaluate(t))
|
||
}).join("")
|
||
}],
|
||
"resolved-locale": [K, [et], function (t, e) {
|
||
return e[0].evaluate(t).resolvedLocale()
|
||
}]
|
||
});
|
||
var ze = function (t, e) {
|
||
var i;
|
||
this.expression = t, this._warningHistory = {}, this._evaluator = new Ct, this._defaultValue = e ? "color" === (i = e).type && Oe(i.default) ? new lt(0, 0, 0, 0) : "color" === i.type ? lt.parse(i.default) || null : void 0 === i.default ? null : i.default : null, this._enumValues = e && "enum" === e.type ? e.values : null
|
||
};
|
||
|
||
function Ue(t) {
|
||
return Array.isArray(t) && t.length > 0 && "string" == typeof t[0] && t[0] in xe
|
||
}
|
||
|
||
function Be(t, e) {
|
||
var i = new It(xe, [], e ? function (t) {
|
||
var e = {color: $, string: K, number: Z, enum: K, boolean: J, formatted: it};
|
||
if ("array" === t.type) return rt(e[t.value] || tt, t.length);
|
||
return e[t.type]
|
||
}(e) : void 0),
|
||
r = i.parse(t, void 0, void 0, void 0, e && "string" === e.type ? {typeAnnotation: "coerce"} : void 0);
|
||
return r ? Ee(new ze(r, e)) : Te(i.errors)
|
||
}
|
||
|
||
ze.prototype.evaluateWithoutErrorHandling = function (t, e, i) {
|
||
return this._evaluator.globals = t, this._evaluator.feature = e, this._evaluator.featureState = i, this.expression.evaluate(this._evaluator)
|
||
}, ze.prototype.evaluate = function (t, e, i) {
|
||
this._evaluator.globals = t, this._evaluator.feature = e || null, this._evaluator.featureState = i || null;
|
||
try {
|
||
var r = this.expression.evaluate(this._evaluator);
|
||
if (null == r) return this._defaultValue;
|
||
if (this._enumValues && !(r in this._enumValues)) throw new mt("Expected value to be one of " + Object.keys(this._enumValues).map(function (t) {
|
||
return JSON.stringify(t)
|
||
}).join(", ") + ", but found " + JSON.stringify(r) + " instead.");
|
||
return r
|
||
} catch (t) {
|
||
return this._warningHistory[t.message] || (this._warningHistory[t.message] = !0, "undefined" != typeof console && console.warn(t.message)), this._defaultValue
|
||
}
|
||
};
|
||
var Ve = function (t, e) {
|
||
this.kind = t, this._styleExpression = e, this.isStateDependent = "constant" !== t && !Rt(e.expression)
|
||
};
|
||
Ve.prototype.evaluateWithoutErrorHandling = function (t, e, i) {
|
||
return this._styleExpression.evaluateWithoutErrorHandling(t, e, i)
|
||
}, Ve.prototype.evaluate = function (t, e, i) {
|
||
return this._styleExpression.evaluate(t, e, i)
|
||
};
|
||
var Ye = function (t, e, i) {
|
||
this.kind = t, this.zoomStops = i.labels, this._styleExpression = e, this.isStateDependent = "camera" !== t && !Rt(e.expression), i instanceof ie && (this._interpolationType = i.interpolation)
|
||
};
|
||
|
||
function We(t, e) {
|
||
if ("error" === (t = Be(t, e)).result) return t;
|
||
var i = t.value.expression, r = Tt(i);
|
||
if (!r && !Re(e)) return Te([new H("", "data expressions not supported")]);
|
||
var o = Pt(i, ["zoom"]);
|
||
if (!o && !Pe(e)) return Te([new H("", "zoom expressions not supported")]);
|
||
var n = function t(e) {
|
||
var i = null;
|
||
if (e instanceof ne) i = t(e.result); else if (e instanceof oe) for (var r = 0, o = e.args; r < o.length; r += 1) {
|
||
var n = o[r];
|
||
if (i = t(n)) break
|
||
} else (e instanceof Mt || e instanceof ie) && e.input instanceof St && "zoom" === e.input.name && (i = e);
|
||
if (i instanceof H) return i;
|
||
e.eachChild(function (e) {
|
||
var r = t(e);
|
||
r instanceof H ? i = r : !i && r ? i = new H("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') : i && r && i !== r && (i = new H("", 'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))
|
||
});
|
||
return i
|
||
}(i);
|
||
return n || o ? n instanceof H ? Te([n]) : n instanceof ie && !Le(e) ? Te([new H("", '"interpolate" expressions cannot be used with this property')]) : Ee(n ? new Ye(r ? "camera" : "composite", t.value, n) : new Ve(r ? "constant" : "source", t.value)) : Te([new H("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])
|
||
}
|
||
|
||
Ye.prototype.evaluateWithoutErrorHandling = function (t, e, i) {
|
||
return this._styleExpression.evaluateWithoutErrorHandling(t, e, i)
|
||
}, Ye.prototype.evaluate = function (t, e, i) {
|
||
return this._styleExpression.evaluate(t, e, i)
|
||
}, Ye.prototype.interpolationFactor = function (t, e, i) {
|
||
return this._interpolationType ? ie.interpolationFactor(this._interpolationType, t, e, i) : 0
|
||
};
|
||
var He = function (t, e) {
|
||
this._parameters = t, this._specification = e, W(this, Ae(this._parameters, this._specification))
|
||
};
|
||
|
||
function Xe(t) {
|
||
return "object" == typeof t ? ["literal", t] : t
|
||
}
|
||
|
||
function qe(t, e) {
|
||
var i = t.stops;
|
||
if (!i) return function (t, e) {
|
||
var i = ["get", t.property];
|
||
if (void 0 === t.default) return "string" === e.type ? ["string", i] : i;
|
||
if ("enum" === e.type) return ["match", i, Object.keys(e.values), i, t.default];
|
||
var r = ["color" === e.type ? "to-color" : e.type, i, Xe(t.default)];
|
||
return "array" === e.type && r.splice(1, 0, e.value, e.length || null), r
|
||
}(t, e);
|
||
var r = i && "object" == typeof i[0][0], o = r || void 0 !== t.property, n = r || !o;
|
||
return i = i.map(function (t) {
|
||
return !o && e.tokens && "string" == typeof t[1] ? [t[0], ei(t[1])] : [t[0], Xe(t[1])]
|
||
}), r ? function (t, e, i) {
|
||
for (var r = {}, o = {}, n = [], s = 0; s < i.length; s++) {
|
||
var a = i[s], l = a[0].zoom;
|
||
void 0 === r[l] && (r[l] = {
|
||
zoom: l,
|
||
type: t.type,
|
||
property: t.property,
|
||
default: t.default
|
||
}, o[l] = [], n.push(l)), o[l].push([a[0].value, a[1]])
|
||
}
|
||
if ("exponential" === ti({}, e)) {
|
||
for (var h = [Ze(t), ["linear"], ["zoom"]], u = 0, c = n; u < c.length; u += 1) {
|
||
var p = c[u], d = Je(r[p], e, o[p]);
|
||
Qe(h, p, d, !1)
|
||
}
|
||
return h
|
||
}
|
||
for (var f = ["step", ["zoom"]], g = 0, m = n; g < m.length; g += 1) {
|
||
var y = m[g], v = Je(r[y], e, o[y]);
|
||
Qe(f, y, v, !0)
|
||
}
|
||
return $e(f), f
|
||
}(t, e, i) : n ? function (t, e, i, r) {
|
||
void 0 === r && (r = ["zoom"]);
|
||
var o, n = ti(t, e), s = !1;
|
||
if ("interval" === n) o = ["step", r], s = !0; else {
|
||
if ("exponential" !== n) throw new Error('Unknown zoom function type "' + n + '"');
|
||
var a = void 0 !== t.base ? t.base : 1;
|
||
o = [Ze(t), ["exponential", a], r]
|
||
}
|
||
for (var l = 0, h = i; l < h.length; l += 1) {
|
||
var u = h[l];
|
||
Qe(o, u[0], u[1], s)
|
||
}
|
||
return $e(o), o
|
||
}(t, e, i) : Je(t, e, i)
|
||
}
|
||
|
||
function Ze(t) {
|
||
switch (t.colorSpace) {
|
||
case"hcl":
|
||
return "interpolate-hcl";
|
||
case"lab":
|
||
return "interpolate-lab";
|
||
default:
|
||
return "interpolate"
|
||
}
|
||
}
|
||
|
||
function Ke(t, e) {
|
||
return void 0 !== t ? t : void 0 !== e ? e : void 0
|
||
}
|
||
|
||
function Je(t, e, i) {
|
||
var r = ti(t, e), o = ["get", t.property];
|
||
if ("categorical" === r && "boolean" == typeof i[0][0]) {
|
||
for (var n = ["case"], s = 0, a = i; s < a.length; s += 1) {
|
||
var l = a[s];
|
||
n.push(["==", o, l[0]], l[1])
|
||
}
|
||
return n.push(Xe(Ke(t.default, e.default))), n
|
||
}
|
||
if ("categorical" === r) {
|
||
for (var h = ["match", o], u = 0, c = i; u < c.length; u += 1) {
|
||
var p = c[u];
|
||
Qe(h, p[0], p[1], !1)
|
||
}
|
||
return h.push(Xe(Ke(t.default, e.default))), h
|
||
}
|
||
if ("interval" === r) {
|
||
for (var d = ["step", ["number", o]], f = 0, g = i; f < g.length; f += 1) {
|
||
var m = g[f];
|
||
Qe(d, m[0], m[1], !0)
|
||
}
|
||
return $e(d), void 0 === t.default ? d : ["case", ["==", ["typeof", o], "number"], d, Xe(t.default)]
|
||
}
|
||
if ("exponential" === r) {
|
||
for (var y = void 0 !== t.base ? t.base : 1, v = [Ze(t), ["exponential", y], ["number", o]], _ = 0, x = i; _ < x.length; _ += 1) {
|
||
var w = x[_];
|
||
Qe(v, w[0], w[1], !1)
|
||
}
|
||
return void 0 === t.default ? v : ["case", ["==", ["typeof", o], "number"], v, Xe(t.default)]
|
||
}
|
||
throw new Error("Unknown property function type " + r)
|
||
}
|
||
|
||
function $e(t) {
|
||
"step" === t[0] && 3 === t.length && (t.push(0), t.push(t[3]))
|
||
}
|
||
|
||
function Qe(t, e, i, r) {
|
||
t.length > 3 && e === t[t.length - 2] || (r && 2 === t.length || t.push(e), t.push(i))
|
||
}
|
||
|
||
function ti(t, e) {
|
||
return t.type ? t.type : e.expression.interpolated ? "exponential" : "interval"
|
||
}
|
||
|
||
function ei(t) {
|
||
for (var e = ["concat"], i = /{([^{}]+)}/g, r = 0, o = i.exec(t); null !== o; o = i.exec(t)) {
|
||
var n = t.slice(r, i.lastIndex - o[0].length);
|
||
r = i.lastIndex, n.length > 0 && e.push(n), e.push(["get", o[1]])
|
||
}
|
||
if (1 === e.length) return t;
|
||
if (r < t.length) e.push(t.slice(r)); else if (2 === e.length) return ["to-string", e[1]];
|
||
return e
|
||
}
|
||
|
||
function ii(t) {
|
||
if (!0 === t || !1 === t) return !0;
|
||
if (!Array.isArray(t) || 0 === t.length) return !1;
|
||
switch (t[0]) {
|
||
case"has":
|
||
return t.length >= 2 && "$id" !== t[1] && "$type" !== t[1];
|
||
case"in":
|
||
case"!in":
|
||
case"!has":
|
||
case"none":
|
||
return !1;
|
||
case"==":
|
||
case"!=":
|
||
case">":
|
||
case">=":
|
||
case"<":
|
||
case"<=":
|
||
return 3 !== t.length || Array.isArray(t[1]) || Array.isArray(t[2]);
|
||
case"any":
|
||
case"all":
|
||
for (var e = 0, i = t.slice(1); e < i.length; e += 1) {
|
||
var r = i[e];
|
||
if (!ii(r) && "boolean" != typeof r) return !1
|
||
}
|
||
return !0;
|
||
default:
|
||
return !0
|
||
}
|
||
}
|
||
|
||
He.deserialize = function (t) {
|
||
return new He(t._parameters, t._specification)
|
||
}, He.serialize = function (t) {
|
||
return {_parameters: t._parameters, _specification: t._specification}
|
||
};
|
||
var ri = {
|
||
type: "boolean",
|
||
default: !1,
|
||
transition: !1,
|
||
"property-type": "data-driven",
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]}
|
||
};
|
||
|
||
function oi(t, e) {
|
||
return t < e ? -1 : t > e ? 1 : 0
|
||
}
|
||
|
||
function ni(t) {
|
||
if (!t) return !0;
|
||
var e, i = t[0];
|
||
return t.length <= 1 ? "any" !== i : "==" === i ? si(t[1], t[2], "==") : "!=" === i ? hi(si(t[1], t[2], "==")) : "<" === i || ">" === i || "<=" === i || ">=" === i ? si(t[1], t[2], i) : "any" === i ? (e = t.slice(1), ["any"].concat(e.map(ni))) : "all" === i ? ["all"].concat(t.slice(1).map(ni)) : "none" === i ? ["all"].concat(t.slice(1).map(ni).map(hi)) : "in" === i ? ai(t[1], t.slice(2)) : "!in" === i ? hi(ai(t[1], t.slice(2))) : "has" === i ? li(t[1]) : "!has" !== i || hi(li(t[1]))
|
||
}
|
||
|
||
function si(t, e, i) {
|
||
switch (t) {
|
||
case"$type":
|
||
return ["filter-type-" + i, e];
|
||
case"$id":
|
||
return ["filter-id-" + i, e];
|
||
default:
|
||
return ["filter-" + i, t, e]
|
||
}
|
||
}
|
||
|
||
function ai(t, e) {
|
||
if (0 === e.length) return !1;
|
||
switch (t) {
|
||
case"$type":
|
||
return ["filter-type-in", ["literal", e]];
|
||
case"$id":
|
||
return ["filter-id-in", ["literal", e]];
|
||
default:
|
||
return e.length > 200 && !e.some(function (t) {
|
||
return typeof t != typeof e[0]
|
||
}) ? ["filter-in-large", t, ["literal", e.sort(oi)]] : ["filter-in-small", t, ["literal", e]]
|
||
}
|
||
}
|
||
|
||
function li(t) {
|
||
switch (t) {
|
||
case"$type":
|
||
return !0;
|
||
case"$id":
|
||
return ["filter-has-id"];
|
||
default:
|
||
return ["filter-has", t]
|
||
}
|
||
}
|
||
|
||
function hi(t) {
|
||
return ["!", t]
|
||
}
|
||
|
||
function ui(t) {
|
||
return function t(e, i) {
|
||
var r;
|
||
if (ii(e)) return e;
|
||
if (!e) return !0;
|
||
var o = e[0];
|
||
if (e.length <= 1) return "any" !== o;
|
||
var n;
|
||
if ("==" === o || "!=" === o || "<" === o || ">" === o || "<=" === o || ">=" === o) {
|
||
var s = e, a = s[1], l = s[2];
|
||
n = function (t, e, i, r) {
|
||
var o;
|
||
if ("$type" === t) return [i, ["geometry-type"], e];
|
||
o = "$id" === t ? ["id"] : ["get", t];
|
||
if (r && null !== e) {
|
||
var n = typeof e;
|
||
r[t] = n
|
||
}
|
||
if ("==" === i && "$id" !== t && null === e) return ["all", ["has", t], ["==", o, null]];
|
||
if ("!=" === i && "$id" !== t && null === e) return ["any", ["!", ["has", t]], ["!=", o, null]];
|
||
return [i, o, e]
|
||
}(a, l, o, i)
|
||
} else {
|
||
if ("any" === o) {
|
||
var h = e.slice(1).map(function (e) {
|
||
var i = {}, r = t(e, i), o = function (t) {
|
||
var e = [];
|
||
for (var i in t) {
|
||
var r = "$id" === i ? ["id"] : ["get", i];
|
||
e.push(["==", ["typeof", r], t[i]])
|
||
}
|
||
if (0 === e.length) return !0;
|
||
if (1 === e.length) return e[0];
|
||
return ["all"].concat(e)
|
||
}(i);
|
||
return !0 === o ? r : ["case", o, r, !1]
|
||
});
|
||
return ["any"].concat(h)
|
||
}
|
||
if ("all" === o) {
|
||
var u = e.slice(1).map(function (e) {
|
||
return t(e, i)
|
||
});
|
||
return u.length > 1 ? ["all"].concat(u) : (r = []).concat.apply(r, u)
|
||
}
|
||
if ("none" === o) return ["!", t(["any"].concat(e.slice(1)), {})];
|
||
n = "in" === o ? ci(e[1], e.slice(2)) : "!in" === o ? ci(e[1], e.slice(2), !0) : "has" === o ? pi(e[1]) : "!has" !== o || ["!", pi(e[1])]
|
||
}
|
||
return n
|
||
}(t, {})
|
||
}
|
||
|
||
function ci(t, e, i) {
|
||
if (void 0 === i && (i = !1), 0 === e.length) return i;
|
||
var r;
|
||
r = "$type" === t ? ["geometry-type"] : "$id" === t ? ["id"] : ["get", t];
|
||
for (var o = !0, n = typeof e[0], s = 0, a = e; s < a.length; s += 1) {
|
||
if (typeof a[s] !== n) {
|
||
o = !1;
|
||
break
|
||
}
|
||
}
|
||
return !o || "string" !== n && "number" !== n ? [i ? "all" : "any"].concat(e.map(function (t) {
|
||
return [i ? "!=" : "==", r, t]
|
||
})) : ["match", r, e, !i, i]
|
||
}
|
||
|
||
function pi(t) {
|
||
return "$type" === t || ("$id" === t ? ["!=", ["id"], null] : ["has", t])
|
||
}
|
||
|
||
function di(t, e) {
|
||
if (Array.isArray(t)) {
|
||
if (!Array.isArray(e) || t.length !== e.length) return !1;
|
||
for (var i = 0; i < t.length; i++) if (!di(t[i], e[i])) return !1;
|
||
return !0
|
||
}
|
||
if ("object" == typeof t && null !== t && null !== e) {
|
||
if ("object" != typeof e) return !1;
|
||
if (Object.keys(t).length !== Object.keys(e).length) return !1;
|
||
for (var r in t) if (!di(t[r], e[r])) return !1;
|
||
return !0
|
||
}
|
||
return t === e
|
||
}
|
||
|
||
var fi = {
|
||
setStyle: "setStyle",
|
||
addLayer: "addLayer",
|
||
removeLayer: "removeLayer",
|
||
setPaintProperty: "setPaintProperty",
|
||
setLayoutProperty: "setLayoutProperty",
|
||
setFilter: "setFilter",
|
||
addSource: "addSource",
|
||
removeSource: "removeSource",
|
||
setGeoJSONSourceData: "setGeoJSONSourceData",
|
||
setLayerZoomRange: "setLayerZoomRange",
|
||
setLayerProperty: "setLayerProperty",
|
||
setCenter: "setCenter",
|
||
setZoom: "setZoom",
|
||
setBearing: "setBearing",
|
||
setPitch: "setPitch",
|
||
setSprite: "setSprite",
|
||
setGlyphs: "setGlyphs",
|
||
setTransition: "setTransition",
|
||
setLight: "setLight"
|
||
};
|
||
|
||
function gi(t, e, i) {
|
||
i.push({command: fi.addSource, args: [t, e[t]]})
|
||
}
|
||
|
||
function mi(t, e, i) {
|
||
e.push({command: fi.removeSource, args: [t]}), i[t] = !0
|
||
}
|
||
|
||
function yi(t, e, i, r) {
|
||
mi(t, i, r), gi(t, e, i)
|
||
}
|
||
|
||
function vi(t, e, i) {
|
||
var r;
|
||
for (r in t[i]) if (t[i].hasOwnProperty(r) && "data" !== r && !di(t[i][r], e[i][r])) return !1;
|
||
for (r in e[i]) if (e[i].hasOwnProperty(r) && "data" !== r && !di(t[i][r], e[i][r])) return !1;
|
||
return !0
|
||
}
|
||
|
||
function _i(t, e, i, r, o, n) {
|
||
var s;
|
||
for (s in e = e || {}, t = t || {}) t.hasOwnProperty(s) && (di(t[s], e[s]) || i.push({
|
||
command: n,
|
||
args: [r, s, e[s], o]
|
||
}));
|
||
for (s in e) e.hasOwnProperty(s) && !t.hasOwnProperty(s) && (di(t[s], e[s]) || i.push({
|
||
command: n,
|
||
args: [r, s, e[s], o]
|
||
}))
|
||
}
|
||
|
||
function xi(t) {
|
||
return t.id
|
||
}
|
||
|
||
function wi(t, e) {
|
||
return t[e.id] = e, t
|
||
}
|
||
|
||
var bi = function (t, e, i, r) {
|
||
this.message = (t ? t + ": " : "") + i, r && (this.identifier = r), null != e && e.__line__ && (this.line = e.__line__)
|
||
};
|
||
|
||
function Ci(t) {
|
||
this.error = t, this.message = t.message;
|
||
var e = t.message.match(/line (\d+)/);
|
||
this.line = e ? parseInt(e[1], 10) : 0
|
||
}
|
||
|
||
function Si(t) {
|
||
var e = t.key, i = t.value;
|
||
return i ? [new bi(e, i, "constants have been deprecated as of v8")] : []
|
||
}
|
||
|
||
function Ei(t) {
|
||
return t instanceof Number || t instanceof String || t instanceof Boolean ? t.valueOf() : t
|
||
}
|
||
|
||
function Ti(t) {
|
||
return Array.isArray(t) ? t.map(Ti) : Ei(t)
|
||
}
|
||
|
||
function Ri(t) {
|
||
var e = t.key, i = t.value, r = t.valueSpec || {}, o = t.objectElementValidators || {}, n = t.style,
|
||
s = t.styleSpec, a = [], l = Ie(i);
|
||
if ("object" !== l) return [new bi(e, i, "object expected, " + l + " found")];
|
||
for (var h in i) {
|
||
var u = h.split(".")[0], c = r[u] || r["*"], p = void 0;
|
||
if (o[u]) p = o[u]; else if (r[u]) p = Bi; else if (o["*"]) p = o["*"]; else {
|
||
if (!r["*"]) {
|
||
a.push(new bi(e, i[h], 'unknown property "' + h + '"'));
|
||
continue
|
||
}
|
||
p = Bi
|
||
}
|
||
a = a.concat(p({
|
||
key: (e ? e + "." : e) + h,
|
||
value: i[h],
|
||
valueSpec: c,
|
||
style: n,
|
||
styleSpec: s,
|
||
object: i,
|
||
objectKey: h
|
||
}, i))
|
||
}
|
||
for (var d in r) o[d] || r[d].required && void 0 === r[d].default && void 0 === i[d] && a.push(new bi(e, i, 'missing required property "' + d + '"'));
|
||
return a
|
||
}
|
||
|
||
function Pi(t) {
|
||
var e = t.value, i = t.valueSpec, r = t.style, o = t.styleSpec, n = t.key,
|
||
s = t.arrayElementValidator || Bi;
|
||
if ("array" !== Ie(e)) return [new bi(n, e, "array expected, " + Ie(e) + " found")];
|
||
if (i.length && e.length !== i.length) return [new bi(n, e, "array length " + i.length + " expected, length " + e.length + " found")];
|
||
if (i["min-length"] && e.length < i["min-length"]) return [new bi(n, e, "array length at least " + i["min-length"] + " expected, length " + e.length + " found")];
|
||
var a = {type: i.value, values: i.values};
|
||
o.$version < 7 && (a.function = i.function), "object" === Ie(i.value) && (a = i.value);
|
||
for (var l = [], h = 0; h < e.length; h++) l = l.concat(s({
|
||
array: e,
|
||
arrayIndex: h,
|
||
value: e[h],
|
||
valueSpec: a,
|
||
style: r,
|
||
styleSpec: o,
|
||
key: n + "[" + h + "]"
|
||
}));
|
||
return l
|
||
}
|
||
|
||
function Li(t) {
|
||
var e = t.key, i = t.value, r = t.valueSpec, o = Ie(i);
|
||
return "number" !== o ? [new bi(e, i, "number expected, " + o + " found")] : "minimum" in r && i < r.minimum ? [new bi(e, i, i + " is less than the minimum value " + r.minimum)] : "maximum" in r && i > r.maximum ? [new bi(e, i, i + " is greater than the maximum value " + r.maximum)] : []
|
||
}
|
||
|
||
function Ii(t) {
|
||
var e, i, r, o = t.valueSpec, n = Ei(t.value.type), s = {},
|
||
a = "categorical" !== n && void 0 === t.value.property, l = !a,
|
||
h = "array" === Ie(t.value.stops) && "array" === Ie(t.value.stops[0]) && "object" === Ie(t.value.stops[0][0]),
|
||
u = Ri({
|
||
key: t.key,
|
||
value: t.value,
|
||
valueSpec: t.styleSpec.function,
|
||
style: t.style,
|
||
styleSpec: t.styleSpec,
|
||
objectElementValidators: {
|
||
stops: function (t) {
|
||
if ("identity" === n) return [new bi(t.key, t.value, 'identity function may not have a "stops" property')];
|
||
var e = [], i = t.value;
|
||
e = e.concat(Pi({
|
||
key: t.key,
|
||
value: i,
|
||
valueSpec: t.valueSpec,
|
||
style: t.style,
|
||
styleSpec: t.styleSpec,
|
||
arrayElementValidator: c
|
||
})), "array" === Ie(i) && 0 === i.length && e.push(new bi(t.key, i, "array must have at least one stop"));
|
||
return e
|
||
}, default: function (t) {
|
||
return Bi({
|
||
key: t.key,
|
||
value: t.value,
|
||
valueSpec: o,
|
||
style: t.style,
|
||
styleSpec: t.styleSpec
|
||
})
|
||
}
|
||
}
|
||
});
|
||
return "identity" === n && a && u.push(new bi(t.key, t.value, 'missing required property "property"')), "identity" === n || t.value.stops || u.push(new bi(t.key, t.value, 'missing required property "stops"')), "exponential" === n && t.valueSpec.expression && !Le(t.valueSpec) && u.push(new bi(t.key, t.value, "exponential functions not supported")), t.styleSpec.$version >= 8 && (l && !Re(t.valueSpec) ? u.push(new bi(t.key, t.value, "property functions not supported")) : a && !Pe(t.valueSpec) && u.push(new bi(t.key, t.value, "zoom functions not supported"))), "categorical" !== n && !h || void 0 !== t.value.property || u.push(new bi(t.key, t.value, '"property" property is required')), u;
|
||
|
||
function c(t) {
|
||
var e = [], n = t.value, a = t.key;
|
||
if ("array" !== Ie(n)) return [new bi(a, n, "array expected, " + Ie(n) + " found")];
|
||
if (2 !== n.length) return [new bi(a, n, "array length 2 expected, length " + n.length + " found")];
|
||
if (h) {
|
||
if ("object" !== Ie(n[0])) return [new bi(a, n, "object expected, " + Ie(n[0]) + " found")];
|
||
if (void 0 === n[0].zoom) return [new bi(a, n, "object stop key must have zoom")];
|
||
if (void 0 === n[0].value) return [new bi(a, n, "object stop key must have value")];
|
||
if (r && r > Ei(n[0].zoom)) return [new bi(a, n[0].zoom, "stop zoom values must appear in ascending order")];
|
||
Ei(n[0].zoom) !== r && (r = Ei(n[0].zoom), i = void 0, s = {}), e = e.concat(Ri({
|
||
key: a + "[0]",
|
||
value: n[0],
|
||
valueSpec: {zoom: {}},
|
||
style: t.style,
|
||
styleSpec: t.styleSpec,
|
||
objectElementValidators: {zoom: Li, value: p}
|
||
}))
|
||
} else e = e.concat(p({
|
||
key: a + "[0]",
|
||
value: n[0],
|
||
valueSpec: {},
|
||
style: t.style,
|
||
styleSpec: t.styleSpec
|
||
}, n));
|
||
return Ue(Ti(n[1])) ? e.concat([new bi(a + "[1]", n[1], "expressions are not allowed in function stops.")]) : e.concat(Bi({
|
||
key: a + "[1]",
|
||
value: n[1],
|
||
valueSpec: o,
|
||
style: t.style,
|
||
styleSpec: t.styleSpec
|
||
}))
|
||
}
|
||
|
||
function p(t, r) {
|
||
var a = Ie(t.value), l = Ei(t.value), h = null !== t.value ? t.value : r;
|
||
if (e) {
|
||
if (a !== e) return [new bi(t.key, h, a + " stop domain type must match previous stop domain type " + e)]
|
||
} else e = a;
|
||
if ("number" !== a && "string" !== a && "boolean" !== a) return [new bi(t.key, h, "stop domain value must be a number, string, or boolean")];
|
||
if ("number" !== a && "categorical" !== n) {
|
||
var u = "number expected, " + a + " found";
|
||
return Re(o) && void 0 === n && (u += '\nIf you intended to use a categorical function, specify `"type": "categorical"`.'), [new bi(t.key, h, u)]
|
||
}
|
||
return "categorical" !== n || "number" !== a || isFinite(l) && Math.floor(l) === l ? "categorical" !== n && "number" === a && void 0 !== i && l < i ? [new bi(t.key, h, "stop domain values must appear in ascending order")] : (i = l, "categorical" === n && l in s ? [new bi(t.key, h, "stop domain values must be unique")] : (s[l] = !0, [])) : [new bi(t.key, h, "integer expected, found " + l)]
|
||
}
|
||
}
|
||
|
||
function Oi(t) {
|
||
var e = ("property" === t.expressionContext ? We : Be)(Ti(t.value), t.valueSpec);
|
||
if ("error" === e.result) return e.value.map(function (e) {
|
||
return new bi("" + t.key + e.key, t.value, e.message)
|
||
});
|
||
var i = e.value.expression || e.value._styleExpression.expression;
|
||
if ("property" === t.expressionContext && "text-font" === t.propertyKey && -1 !== i.possibleOutputs().indexOf(void 0)) return [new bi(t.key, t.value, 'Invalid data expression for "' + t.propertyKey + '". Output values must be contained as literals within the expression.')];
|
||
if ("property" === t.expressionContext && "layout" === t.propertyType && !Rt(i)) return [new bi(t.key, t.value, '"feature-state" data expressions are not supported with layout properties.')];
|
||
if ("filter" === t.expressionContext && !Rt(i)) return [new bi(t.key, t.value, '"feature-state" data expressions are not supported with filters.')];
|
||
if (t.expressionContext && 0 === t.expressionContext.indexOf("cluster")) {
|
||
if (!Pt(i, ["zoom", "feature-state"])) return [new bi(t.key, t.value, '"zoom" and "feature-state" expressions are not supported with cluster properties.')];
|
||
if ("cluster-initial" === t.expressionContext && !Tt(i)) return [new bi(t.key, t.value, "Feature data expressions are not supported with initial expression part of cluster properties.")]
|
||
}
|
||
return []
|
||
}
|
||
|
||
function Mi(t) {
|
||
var e = t.key, i = t.value, r = t.valueSpec, o = [];
|
||
return Array.isArray(r.values) ? -1 === r.values.indexOf(Ei(i)) && o.push(new bi(e, i, "expected one of [" + r.values.join(", ") + "], " + JSON.stringify(i) + " found")) : -1 === Object.keys(r.values).indexOf(Ei(i)) && o.push(new bi(e, i, "expected one of [" + Object.keys(r.values).join(", ") + "], " + JSON.stringify(i) + " found")), o
|
||
}
|
||
|
||
function Ai(t) {
|
||
return ii(Ti(t.value)) ? Oi(W({}, t, {
|
||
expressionContext: "filter",
|
||
valueSpec: {value: "boolean"}
|
||
})) : function t(e) {
|
||
var i = e.value;
|
||
var r = e.key;
|
||
if ("array" !== Ie(i)) return [new bi(r, i, "array expected, " + Ie(i) + " found")];
|
||
var o = e.styleSpec;
|
||
var n;
|
||
var s = [];
|
||
if (i.length < 1) return [new bi(r, i, "filter array must have at least 1 element")];
|
||
s = s.concat(Mi({
|
||
key: r + "[0]",
|
||
value: i[0],
|
||
valueSpec: o.filter_operator,
|
||
style: e.style,
|
||
styleSpec: e.styleSpec
|
||
}));
|
||
switch (Ei(i[0])) {
|
||
case"<":
|
||
case"<=":
|
||
case">":
|
||
case">=":
|
||
i.length >= 2 && "$type" === Ei(i[1]) && s.push(new bi(r, i, '"$type" cannot be use with operator "' + i[0] + '"'));
|
||
case"==":
|
||
case"!=":
|
||
3 !== i.length && s.push(new bi(r, i, 'filter array for operator "' + i[0] + '" must have 3 elements'));
|
||
case"in":
|
||
case"!in":
|
||
i.length >= 2 && "string" !== (n = Ie(i[1])) && s.push(new bi(r + "[1]", i[1], "string expected, " + n + " found"));
|
||
for (var a = 2; a < i.length; a++) n = Ie(i[a]), "$type" === Ei(i[1]) ? s = s.concat(Mi({
|
||
key: r + "[" + a + "]",
|
||
value: i[a],
|
||
valueSpec: o.geometry_type,
|
||
style: e.style,
|
||
styleSpec: e.styleSpec
|
||
})) : "string" !== n && "number" !== n && "boolean" !== n && s.push(new bi(r + "[" + a + "]", i[a], "string, number, or boolean expected, " + n + " found"));
|
||
break;
|
||
case"any":
|
||
case"all":
|
||
case"none":
|
||
for (var l = 1; l < i.length; l++) s = s.concat(t({
|
||
key: r + "[" + l + "]",
|
||
value: i[l],
|
||
style: e.style,
|
||
styleSpec: e.styleSpec
|
||
}));
|
||
break;
|
||
case"has":
|
||
case"!has":
|
||
n = Ie(i[1]), 2 !== i.length ? s.push(new bi(r, i, 'filter array for "' + i[0] + '" operator must have 2 elements')) : "string" !== n && s.push(new bi(r + "[1]", i[1], "string expected, " + n + " found"))
|
||
}
|
||
return s
|
||
}(t)
|
||
}
|
||
|
||
function ki(t, e) {
|
||
var i = t.key, r = t.style, o = t.styleSpec, n = t.value, s = t.objectKey,
|
||
a = o[e + "_" + t.layerType];
|
||
if (!a) return [];
|
||
var l = s.match(/^(.*)-transition$/);
|
||
if ("paint" === e && l && a[l[1]] && a[l[1]].transition) return Bi({
|
||
key: i,
|
||
value: n,
|
||
valueSpec: o.transition,
|
||
style: r,
|
||
styleSpec: o
|
||
});
|
||
var h, u = t.valueSpec || a[s];
|
||
if (!u) return [new bi(i, n, 'unknown property "' + s + '"')];
|
||
if ("string" === Ie(n) && Re(u) && !u.tokens && (h = /^{([^}]+)}$/.exec(n))) return [new bi(i, n, '"' + s + '" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": ' + JSON.stringify(h[1]) + " }`.")];
|
||
var c = [];
|
||
return "symbol" === t.layerType && ("text-field" === s && r && !r.glyphs && c.push(new bi(i, n, 'use of "text-field" requires a style "glyphs" property')), "text-font" === s && Oe(Ti(n)) && "identity" === Ei(n.type) && c.push(new bi(i, n, '"text-font" does not support identity functions'))), c.concat(Bi({
|
||
key: t.key,
|
||
value: n,
|
||
valueSpec: u,
|
||
style: r,
|
||
styleSpec: o,
|
||
expressionContext: "property",
|
||
propertyType: e,
|
||
propertyKey: s
|
||
}))
|
||
}
|
||
|
||
function Fi(t) {
|
||
return ki(t, "paint")
|
||
}
|
||
|
||
function Ni(t) {
|
||
return ki(t, "layout")
|
||
}
|
||
|
||
function Di(t) {
|
||
var e = [], i = t.value, r = t.key, o = t.style, n = t.styleSpec;
|
||
i.type || i.ref || e.push(new bi(r, i, 'either "type" or "ref" is required'));
|
||
var s, a = Ei(i.type), l = Ei(i.ref);
|
||
if (i.id) for (var h = Ei(i.id), u = 0; u < t.arrayIndex; u++) {
|
||
var c = o.layers[u];
|
||
Ei(c.id) === h && e.push(new bi(r, i.id, 'duplicate layer id "' + i.id + '", previously used at line ' + c.id.__line__))
|
||
}
|
||
if ("ref" in i) ["type", "source", "source-layer", "filter", "layout"].forEach(function (t) {
|
||
t in i && e.push(new bi(r, i[t], '"' + t + '" is prohibited for ref layers'))
|
||
}), o.layers.forEach(function (t) {
|
||
Ei(t.id) === l && (s = t)
|
||
}), s ? s.ref ? e.push(new bi(r, i.ref, "ref cannot reference another ref layer")) : a = Ei(s.type) : e.push(new bi(r, i.ref, 'ref layer "' + l + '" not found')); else if ("background" !== a) if (i.source) {
|
||
var p = o.sources && o.sources[i.source], d = p && Ei(p.type);
|
||
p ? "vector" === d && "raster" === a ? e.push(new bi(r, i.source, 'layer "' + i.id + '" requires a raster source')) : "raster" === d && "raster" !== a ? e.push(new bi(r, i.source, 'layer "' + i.id + '" requires a vector source')) : "vector" !== d || i["source-layer"] ? "raster-dem" === d && "hillshade" !== a ? e.push(new bi(r, i.source, "raster-dem source can only be used with layer type 'hillshade'.")) : "line" !== a || !i.paint || !i.paint["line-gradient"] || "geojson" === d && p.lineMetrics || e.push(new bi(r, i, 'layer "' + i.id + '" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')) : e.push(new bi(r, i, 'layer "' + i.id + '" must specify a "source-layer"')) : e.push(new bi(r, i.source, 'source "' + i.source + '" not found'))
|
||
} else e.push(new bi(r, i, 'missing required property "source"'));
|
||
return e = e.concat(Ri({
|
||
key: r,
|
||
value: i,
|
||
valueSpec: n.layer,
|
||
style: t.style,
|
||
styleSpec: t.styleSpec,
|
||
objectElementValidators: {
|
||
"*": function () {
|
||
return []
|
||
}, type: function () {
|
||
return Bi({
|
||
key: r + ".type",
|
||
value: i.type,
|
||
valueSpec: n.layer.type,
|
||
style: t.style,
|
||
styleSpec: t.styleSpec,
|
||
object: i,
|
||
objectKey: "type"
|
||
})
|
||
}, filter: Ai, layout: function (t) {
|
||
return Ri({
|
||
layer: i,
|
||
key: t.key,
|
||
value: t.value,
|
||
style: t.style,
|
||
styleSpec: t.styleSpec,
|
||
objectElementValidators: {
|
||
"*": function (t) {
|
||
return Ni(W({layerType: a}, t))
|
||
}
|
||
}
|
||
})
|
||
}, paint: function (t) {
|
||
return Ri({
|
||
layer: i,
|
||
key: t.key,
|
||
value: t.value,
|
||
style: t.style,
|
||
styleSpec: t.styleSpec,
|
||
objectElementValidators: {
|
||
"*": function (t) {
|
||
return Fi(W({layerType: a}, t))
|
||
}
|
||
}
|
||
})
|
||
}
|
||
}
|
||
}))
|
||
}
|
||
|
||
function Gi(t) {
|
||
var e = t.value, i = t.key, r = t.styleSpec, o = t.style;
|
||
if (!e.type) return [new bi(i, e, '"type" is required')];
|
||
var n, s = Ei(e.type);
|
||
switch (s) {
|
||
case"vector":
|
||
case"raster":
|
||
case"raster-dem":
|
||
if (n = Ri({
|
||
key: i,
|
||
value: e,
|
||
valueSpec: r["source_" + s.replace("-", "_")],
|
||
style: t.style,
|
||
styleSpec: r
|
||
}), "url" in e) for (var a in e) ["type", "url", "tileSize"].indexOf(a) < 0 && n.push(new bi(i + "." + a, e[a], 'a source with a "url" property may not include a "' + a + '" property'));
|
||
return n;
|
||
case"geojson":
|
||
if (n = Ri({
|
||
key: i,
|
||
value: e,
|
||
valueSpec: r.source_geojson,
|
||
style: o,
|
||
styleSpec: r
|
||
}), e.cluster) for (var l in e.clusterProperties) {
|
||
var h = e.clusterProperties[l], u = h[0], c = h[1],
|
||
p = "string" == typeof u ? [u, ["accumulated"], ["get", l]] : u;
|
||
n.push.apply(n, Oi({
|
||
key: i + "." + l + ".map",
|
||
value: c,
|
||
expressionContext: "cluster-map"
|
||
})), n.push.apply(n, Oi({
|
||
key: i + "." + l + ".reduce",
|
||
value: p,
|
||
expressionContext: "cluster-reduce"
|
||
}))
|
||
}
|
||
return n;
|
||
case"video":
|
||
return Ri({key: i, value: e, valueSpec: r.source_video, style: o, styleSpec: r});
|
||
case"image":
|
||
return Ri({key: i, value: e, valueSpec: r.source_image, style: o, styleSpec: r});
|
||
case"canvas":
|
||
return [new bi(i, null, "Please use runtime APIs to add canvas sources, rather than including them in stylesheets.", "source.canvas")];
|
||
default:
|
||
return Mi({
|
||
key: i + ".type",
|
||
value: e.type,
|
||
valueSpec: {values: ["vector", "raster", "raster-dem", "geojson", "video", "image"]},
|
||
style: o,
|
||
styleSpec: r
|
||
})
|
||
}
|
||
}
|
||
|
||
function ji(t) {
|
||
var e = t.value, i = t.styleSpec, r = i.light, o = t.style, n = [], s = Ie(e);
|
||
if (void 0 === e) return n;
|
||
if ("object" !== s) return n = n.concat([new bi("light", e, "object expected, " + s + " found")]);
|
||
for (var a in e) {
|
||
var l = a.match(/^(.*)-transition$/);
|
||
n = l && r[l[1]] && r[l[1]].transition ? n.concat(Bi({
|
||
key: a,
|
||
value: e[a],
|
||
valueSpec: i.transition,
|
||
style: o,
|
||
styleSpec: i
|
||
})) : r[a] ? n.concat(Bi({
|
||
key: a,
|
||
value: e[a],
|
||
valueSpec: r[a],
|
||
style: o,
|
||
styleSpec: i
|
||
})) : n.concat([new bi(a, e[a], 'unknown property "' + a + '"')])
|
||
}
|
||
return n
|
||
}
|
||
|
||
function zi(t) {
|
||
var e = t.value, i = t.key, r = Ie(e);
|
||
return "string" !== r ? [new bi(i, e, "string expected, " + r + " found")] : []
|
||
}
|
||
|
||
var Ui = {
|
||
"*": function () {
|
||
return []
|
||
},
|
||
array: Pi,
|
||
boolean: function (t) {
|
||
var e = t.value, i = t.key, r = Ie(e);
|
||
return "boolean" !== r ? [new bi(i, e, "boolean expected, " + r + " found")] : []
|
||
},
|
||
number: Li,
|
||
color: function (t) {
|
||
var e = t.key, i = t.value, r = Ie(i);
|
||
return "string" !== r ? [new bi(e, i, "color expected, " + r + " found")] : null === at(i) ? [new bi(e, i, 'color expected, "' + i + '" found')] : []
|
||
},
|
||
constants: Si,
|
||
enum: Mi,
|
||
filter: Ai,
|
||
function: Ii,
|
||
layer: Di,
|
||
object: Ri,
|
||
source: Gi,
|
||
light: ji,
|
||
string: zi,
|
||
formatted: function (t) {
|
||
return 0 === zi(t).length ? [] : Oi(t)
|
||
}
|
||
};
|
||
|
||
function Bi(t) {
|
||
var e = t.value, i = t.valueSpec, r = t.styleSpec;
|
||
return i.expression && Oe(Ei(e)) ? Ii(t) : i.expression && Ue(Ti(e)) ? Oi(t) : i.type && Ui[i.type] ? Ui[i.type](t) : Ri(W({}, t, {valueSpec: i.type ? r[i.type] : i}))
|
||
}
|
||
|
||
function Vi(t) {
|
||
var e = t.value, i = t.key, r = zi(t);
|
||
return r.length ? r : (-1 === e.indexOf("{fontstack}") && r.push(new bi(i, e, '"glyphs" url must include a "{fontstack}" token')), -1 === e.indexOf("{range}") && r.push(new bi(i, e, '"glyphs" url must include a "{range}" token')), r)
|
||
}
|
||
|
||
function Yi(t, e) {
|
||
e = e || r;
|
||
var i = [];
|
||
return i = i.concat(Bi({
|
||
key: "",
|
||
value: t,
|
||
valueSpec: e.$root,
|
||
styleSpec: e,
|
||
style: t,
|
||
objectElementValidators: {
|
||
glyphs: Vi, "*": function () {
|
||
return []
|
||
}
|
||
}
|
||
})), t.constants && (i = i.concat(Si({
|
||
key: "constants",
|
||
value: t.constants,
|
||
style: t,
|
||
styleSpec: e
|
||
}))), Wi(i)
|
||
}
|
||
|
||
function Wi(t) {
|
||
return [].concat(t).sort(function (t, e) {
|
||
return t.line - e.line
|
||
})
|
||
}
|
||
|
||
function Hi(t) {
|
||
return function () {
|
||
for (var e = [], i = arguments.length; i--;) e[i] = arguments[i];
|
||
return Wi(t.apply(this, e))
|
||
}
|
||
}
|
||
|
||
Yi.source = Hi(Gi), Yi.light = Hi(ji), Yi.layer = Hi(Di), Yi.filter = Hi(Ai), Yi.paintProperty = Hi(Fi), Yi.layoutProperty = Hi(Ni);
|
||
var Xi = l(function (t, e) {
|
||
var i = function () {
|
||
var t = function (t, e, i, r) {
|
||
for (i = i || {}, r = t.length; r--; i[t[r]] = e) ;
|
||
return i
|
||
}, e = [1, 12], i = [1, 13], r = [1, 9], o = [1, 10], n = [1, 11], s = [1, 14], a = [1, 15],
|
||
l = [14, 18, 22, 24], h = [18, 22], u = [22, 24], c = {
|
||
trace: function () {
|
||
},
|
||
yy: {},
|
||
symbols_: {
|
||
error: 2,
|
||
JSONString: 3,
|
||
STRING: 4,
|
||
JSONNumber: 5,
|
||
NUMBER: 6,
|
||
JSONNullLiteral: 7,
|
||
NULL: 8,
|
||
JSONBooleanLiteral: 9,
|
||
TRUE: 10,
|
||
FALSE: 11,
|
||
JSONText: 12,
|
||
JSONValue: 13,
|
||
EOF: 14,
|
||
JSONObject: 15,
|
||
JSONArray: 16,
|
||
"{": 17,
|
||
"}": 18,
|
||
JSONMemberList: 19,
|
||
JSONMember: 20,
|
||
":": 21,
|
||
",": 22,
|
||
"[": 23,
|
||
"]": 24,
|
||
JSONElementList: 25,
|
||
$accept: 0,
|
||
$end: 1
|
||
},
|
||
terminals_: {
|
||
2: "error",
|
||
4: "STRING",
|
||
6: "NUMBER",
|
||
8: "NULL",
|
||
10: "TRUE",
|
||
11: "FALSE",
|
||
14: "EOF",
|
||
17: "{",
|
||
18: "}",
|
||
21: ":",
|
||
22: ",",
|
||
23: "[",
|
||
24: "]"
|
||
},
|
||
productions_: [0, [3, 1], [5, 1], [7, 1], [9, 1], [9, 1], [12, 2], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [15, 2], [15, 3], [20, 3], [19, 1], [19, 3], [16, 2], [16, 3], [25, 1], [25, 3]],
|
||
performAction: function (t, e, i, r, o, n, s) {
|
||
var a = n.length - 1;
|
||
switch (o) {
|
||
case 1:
|
||
this.$ = new String(t.replace(/\\(\\|")/g, "$1").replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, "\t").replace(/\\v/g, "\v").replace(/\\f/g, "\f").replace(/\\b/g, "\b")), this.$.__line__ = this._$.first_line;
|
||
break;
|
||
case 2:
|
||
this.$ = new Number(t), this.$.__line__ = this._$.first_line;
|
||
break;
|
||
case 3:
|
||
this.$ = null;
|
||
break;
|
||
case 4:
|
||
this.$ = new Boolean(!0), this.$.__line__ = this._$.first_line;
|
||
break;
|
||
case 5:
|
||
this.$ = new Boolean(!1), this.$.__line__ = this._$.first_line;
|
||
break;
|
||
case 6:
|
||
return this.$ = n[a - 1];
|
||
case 13:
|
||
this.$ = {}, Object.defineProperty(this.$, "__line__", {
|
||
value: this._$.first_line,
|
||
enumerable: !1
|
||
});
|
||
break;
|
||
case 14:
|
||
case 19:
|
||
this.$ = n[a - 1], Object.defineProperty(this.$, "__line__", {
|
||
value: this._$.first_line,
|
||
enumerable: !1
|
||
});
|
||
break;
|
||
case 15:
|
||
this.$ = [n[a - 2], n[a]];
|
||
break;
|
||
case 16:
|
||
this.$ = {}, this.$[n[a][0]] = n[a][1];
|
||
break;
|
||
case 17:
|
||
this.$ = n[a - 2], n[a - 2][n[a][0]] = n[a][1];
|
||
break;
|
||
case 18:
|
||
this.$ = [], Object.defineProperty(this.$, "__line__", {
|
||
value: this._$.first_line,
|
||
enumerable: !1
|
||
});
|
||
break;
|
||
case 20:
|
||
this.$ = [n[a]];
|
||
break;
|
||
case 21:
|
||
this.$ = n[a - 2], n[a - 2].push(n[a])
|
||
}
|
||
},
|
||
table: [{
|
||
3: 5,
|
||
4: e,
|
||
5: 6,
|
||
6: i,
|
||
7: 3,
|
||
8: r,
|
||
9: 4,
|
||
10: o,
|
||
11: n,
|
||
12: 1,
|
||
13: 2,
|
||
15: 7,
|
||
16: 8,
|
||
17: s,
|
||
23: a
|
||
}, {1: [3]}, {14: [1, 16]}, t(l, [2, 7]), t(l, [2, 8]), t(l, [2, 9]), t(l, [2, 10]), t(l, [2, 11]), t(l, [2, 12]), t(l, [2, 3]), t(l, [2, 4]), t(l, [2, 5]), t([14, 18, 21, 22, 24], [2, 1]), t(l, [2, 2]), {
|
||
3: 20,
|
||
4: e,
|
||
18: [1, 17],
|
||
19: 18,
|
||
20: 19
|
||
}, {
|
||
3: 5,
|
||
4: e,
|
||
5: 6,
|
||
6: i,
|
||
7: 3,
|
||
8: r,
|
||
9: 4,
|
||
10: o,
|
||
11: n,
|
||
13: 23,
|
||
15: 7,
|
||
16: 8,
|
||
17: s,
|
||
23: a,
|
||
24: [1, 21],
|
||
25: 22
|
||
}, {1: [2, 6]}, t(l, [2, 13]), {
|
||
18: [1, 24],
|
||
22: [1, 25]
|
||
}, t(h, [2, 16]), {21: [1, 26]}, t(l, [2, 18]), {
|
||
22: [1, 28],
|
||
24: [1, 27]
|
||
}, t(u, [2, 20]), t(l, [2, 14]), {3: 20, 4: e, 20: 29}, {
|
||
3: 5,
|
||
4: e,
|
||
5: 6,
|
||
6: i,
|
||
7: 3,
|
||
8: r,
|
||
9: 4,
|
||
10: o,
|
||
11: n,
|
||
13: 30,
|
||
15: 7,
|
||
16: 8,
|
||
17: s,
|
||
23: a
|
||
}, t(l, [2, 19]), {
|
||
3: 5,
|
||
4: e,
|
||
5: 6,
|
||
6: i,
|
||
7: 3,
|
||
8: r,
|
||
9: 4,
|
||
10: o,
|
||
11: n,
|
||
13: 31,
|
||
15: 7,
|
||
16: 8,
|
||
17: s,
|
||
23: a
|
||
}, t(h, [2, 17]), t(h, [2, 15]), t(u, [2, 21])],
|
||
defaultActions: {16: [2, 6]},
|
||
parseError: function (t, e) {
|
||
if (!e.recoverable) throw new Error(t);
|
||
this.trace(t)
|
||
},
|
||
parse: function (t) {
|
||
var e = this, i = [0], r = [null], o = [], n = this.table, s = "", a = 0, l = 0, h = 1,
|
||
u = o.slice.call(arguments, 1), c = Object.create(this.lexer), p = {yy: {}};
|
||
for (var d in this.yy) Object.prototype.hasOwnProperty.call(this.yy, d) && (p.yy[d] = this.yy[d]);
|
||
c.setInput(t, p.yy), p.yy.lexer = c, p.yy.parser = this, void 0 === c.yylloc && (c.yylloc = {});
|
||
var f = c.yylloc;
|
||
o.push(f);
|
||
var g = c.options && c.options.ranges;
|
||
"function" == typeof p.yy.parseError ? this.parseError = p.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
||
for (var m, y, v, _, x, w, b, C, S, E, T = {}; ;) {
|
||
if (v = i[i.length - 1], this.defaultActions[v] ? _ = this.defaultActions[v] : (null == m && (E = void 0, "number" != typeof (E = c.lex() || h) && (E = e.symbols_[E] || E), m = E), _ = n[v] && n[v][m]), void 0 === _ || !_.length || !_[0]) {
|
||
var R = "";
|
||
for (w in S = [], n[v]) this.terminals_[w] && w > 2 && S.push("'" + this.terminals_[w] + "'");
|
||
R = c.showPosition ? "Parse error on line " + (a + 1) + ":\n" + c.showPosition() + "\nExpecting " + S.join(", ") + ", got '" + (this.terminals_[m] || m) + "'" : "Parse error on line " + (a + 1) + ": Unexpected " + (m == h ? "end of input" : "'" + (this.terminals_[m] || m) + "'"), this.parseError(R, {
|
||
text: c.match,
|
||
token: this.terminals_[m] || m,
|
||
line: c.yylineno,
|
||
loc: f,
|
||
expected: S
|
||
})
|
||
}
|
||
if (_[0] instanceof Array && _.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + v + ", token: " + m);
|
||
switch (_[0]) {
|
||
case 1:
|
||
i.push(m), r.push(c.yytext), o.push(c.yylloc), i.push(_[1]), m = null, y ? (m = y, y = null) : (l = c.yyleng, s = c.yytext, a = c.yylineno, f = c.yylloc);
|
||
break;
|
||
case 2:
|
||
if (b = this.productions_[_[1]][1], T.$ = r[r.length - b], T._$ = {
|
||
first_line: o[o.length - (b || 1)].first_line,
|
||
last_line: o[o.length - 1].last_line,
|
||
first_column: o[o.length - (b || 1)].first_column,
|
||
last_column: o[o.length - 1].last_column
|
||
}, g && (T._$.range = [o[o.length - (b || 1)].range[0], o[o.length - 1].range[1]]), void 0 !== (x = this.performAction.apply(T, [s, l, a, p.yy, _[1], r, o].concat(u)))) return x;
|
||
b && (i = i.slice(0, -1 * b * 2), r = r.slice(0, -1 * b), o = o.slice(0, -1 * b)), i.push(this.productions_[_[1]][0]), r.push(T.$), o.push(T._$), C = n[i[i.length - 2]][i[i.length - 1]], i.push(C);
|
||
break;
|
||
case 3:
|
||
return !0
|
||
}
|
||
}
|
||
return !0
|
||
}
|
||
}, p = {
|
||
EOF: 1,
|
||
parseError: function (t, e) {
|
||
if (!this.yy.parser) throw new Error(t);
|
||
this.yy.parser.parseError(t, e)
|
||
},
|
||
setInput: function (t, e) {
|
||
return this.yy = e || this.yy || {}, this._input = t, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
||
first_line: 1,
|
||
first_column: 0,
|
||
last_line: 1,
|
||
last_column: 0
|
||
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this
|
||
},
|
||
input: function () {
|
||
var t = this._input[0];
|
||
return this.yytext += t, this.yyleng++, this.offset++, this.match += t, this.matched += t, t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), t
|
||
},
|
||
unput: function (t) {
|
||
var e = t.length, i = t.split(/(?:\r\n?|\n)/g);
|
||
this._input = t + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - e), this.offset -= e;
|
||
var r = this.match.split(/(?:\r\n?|\n)/g);
|
||
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), i.length - 1 && (this.yylineno -= i.length - 1);
|
||
var o = this.yylloc.range;
|
||
return this.yylloc = {
|
||
first_line: this.yylloc.first_line,
|
||
last_line: this.yylineno + 1,
|
||
first_column: this.yylloc.first_column,
|
||
last_column: i ? (i.length === r.length ? this.yylloc.first_column : 0) + r[r.length - i.length].length - i[0].length : this.yylloc.first_column - e
|
||
}, this.options.ranges && (this.yylloc.range = [o[0], o[0] + this.yyleng - e]), this.yyleng = this.yytext.length, this
|
||
},
|
||
more: function () {
|
||
return this._more = !0, this
|
||
},
|
||
reject: function () {
|
||
return this.options.backtrack_lexer ? (this._backtrack = !0, this) : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
|
||
text: "",
|
||
token: null,
|
||
line: this.yylineno
|
||
})
|
||
},
|
||
less: function (t) {
|
||
this.unput(this.match.slice(t))
|
||
},
|
||
pastInput: function () {
|
||
var t = this.matched.substr(0, this.matched.length - this.match.length);
|
||
return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, "")
|
||
},
|
||
upcomingInput: function () {
|
||
var t = this.match;
|
||
return t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "")
|
||
},
|
||
showPosition: function () {
|
||
var t = this.pastInput(), e = new Array(t.length + 1).join("-");
|
||
return t + this.upcomingInput() + "\n" + e + "^"
|
||
},
|
||
test_match: function (t, e) {
|
||
var i, r, o;
|
||
if (this.options.backtrack_lexer && (o = {
|
||
yylineno: this.yylineno,
|
||
yylloc: {
|
||
first_line: this.yylloc.first_line,
|
||
last_line: this.last_line,
|
||
first_column: this.yylloc.first_column,
|
||
last_column: this.yylloc.last_column
|
||
},
|
||
yytext: this.yytext,
|
||
match: this.match,
|
||
matches: this.matches,
|
||
matched: this.matched,
|
||
yyleng: this.yyleng,
|
||
offset: this.offset,
|
||
_more: this._more,
|
||
_input: this._input,
|
||
yy: this.yy,
|
||
conditionStack: this.conditionStack.slice(0),
|
||
done: this.done
|
||
}, this.options.ranges && (o.yylloc.range = this.yylloc.range.slice(0))), (r = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += r.length), this.yylloc = {
|
||
first_line: this.yylloc.last_line,
|
||
last_line: this.yylineno + 1,
|
||
first_column: this.yylloc.last_column,
|
||
last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length
|
||
}, this.yytext += t[0], this.match += t[0], this.matches = t, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(t[0].length), this.matched += t[0], i = this.performAction.call(this, this.yy, this, e, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), i) return i;
|
||
if (this._backtrack) {
|
||
for (var n in o) this[n] = o[n];
|
||
return !1
|
||
}
|
||
return !1
|
||
},
|
||
next: function () {
|
||
if (this.done) return this.EOF;
|
||
var t, e, i, r;
|
||
this._input || (this.done = !0), this._more || (this.yytext = "", this.match = "");
|
||
for (var o = this._currentRules(), n = 0; n < o.length; n++) if ((i = this._input.match(this.rules[o[n]])) && (!e || i[0].length > e[0].length)) {
|
||
if (e = i, r = n, this.options.backtrack_lexer) {
|
||
if (!1 !== (t = this.test_match(i, o[n]))) return t;
|
||
if (this._backtrack) {
|
||
e = !1;
|
||
continue
|
||
}
|
||
return !1
|
||
}
|
||
if (!this.options.flex) break
|
||
}
|
||
return e ? !1 !== (t = this.test_match(e, o[r])) && t : "" === this._input ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
|
||
text: "",
|
||
token: null,
|
||
line: this.yylineno
|
||
})
|
||
},
|
||
lex: function () {
|
||
var t = this.next();
|
||
return t || this.lex()
|
||
},
|
||
begin: function (t) {
|
||
this.conditionStack.push(t)
|
||
},
|
||
popState: function () {
|
||
return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]
|
||
},
|
||
_currentRules: function () {
|
||
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules
|
||
},
|
||
topState: function (t) {
|
||
return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"
|
||
},
|
||
pushState: function (t) {
|
||
this.begin(t)
|
||
},
|
||
stateStackSize: function () {
|
||
return this.conditionStack.length
|
||
},
|
||
options: {},
|
||
performAction: function (t, e, i, r) {
|
||
switch (i) {
|
||
case 0:
|
||
break;
|
||
case 1:
|
||
return 6;
|
||
case 2:
|
||
return e.yytext = e.yytext.substr(1, e.yyleng - 2), 4;
|
||
case 3:
|
||
return 17;
|
||
case 4:
|
||
return 18;
|
||
case 5:
|
||
return 23;
|
||
case 6:
|
||
return 24;
|
||
case 7:
|
||
return 22;
|
||
case 8:
|
||
return 21;
|
||
case 9:
|
||
return 10;
|
||
case 10:
|
||
return 11;
|
||
case 11:
|
||
return 8;
|
||
case 12:
|
||
return 14;
|
||
case 13:
|
||
return "INVALID"
|
||
}
|
||
},
|
||
rules: [/^(?:\s+)/, /^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/, /^(?:"(?:\\[\\"bfnrt\/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/, /^(?:\{)/, /^(?:\})/, /^(?:\[)/, /^(?:\])/, /^(?:,)/, /^(?::)/, /^(?:true\b)/, /^(?:false\b)/, /^(?:null\b)/, /^(?:$)/, /^(?:.)/],
|
||
conditions: {
|
||
INITIAL: {
|
||
rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
|
||
inclusive: !0
|
||
}
|
||
}
|
||
};
|
||
|
||
function d() {
|
||
this.yy = {}
|
||
}
|
||
|
||
return c.lexer = p, d.prototype = c, c.Parser = d, new d
|
||
}();
|
||
e.parser = i, e.Parser = i.Parser, e.parse = function () {
|
||
return i.parse.apply(i, arguments)
|
||
}
|
||
});
|
||
|
||
function qi(t, e) {
|
||
if (t instanceof String || "string" == typeof t || t instanceof i) try {
|
||
t = Xi.parse(t.toString())
|
||
} catch (t) {
|
||
return [new Ci(t)]
|
||
}
|
||
return Yi(t, e = e || r)
|
||
}
|
||
|
||
Xi.parser, Xi.Parser, Xi.parse;
|
||
var Zi = {
|
||
StyleExpression: ze,
|
||
isExpression: Ue,
|
||
createExpression: Be,
|
||
createPropertyExpression: We,
|
||
normalizePropertyExpression: function (t, e) {
|
||
if (Oe(t)) return new He(t, e);
|
||
if (Ue(t)) {
|
||
var i = We(t, e);
|
||
if ("error" === i.result) throw new Error(i.value.map(function (t) {
|
||
return t.key + ": " + t.message
|
||
}).join(", "));
|
||
return i.value
|
||
}
|
||
var r = t;
|
||
return "string" == typeof t && "color" === e.type && (r = lt.parse(t)), {
|
||
kind: "constant",
|
||
evaluate: function () {
|
||
return r
|
||
}
|
||
}
|
||
},
|
||
ZoomConstantExpression: Ve,
|
||
ZoomDependentExpression: Ye,
|
||
StylePropertyFunction: He
|
||
}, Ki = {convertFunction: qe, createFunction: Ae, isFunction: Oe},
|
||
Ji = {eachSource: D, eachLayer: G, eachProperty: j};
|
||
qi.parsed = qi, qi.latest = qi, e.Color = lt, e.ParsingError = Ci, e.ValidationError = bi, e.composite = function (t) {
|
||
var e = [], i = [], r = [];
|
||
for (var o in t.sources) {
|
||
var n = t.sources[o];
|
||
if ("vector" === n.type) {
|
||
var s = /^mapbox:\/\/(.*)/.exec(n.url);
|
||
s && (e.push(o), i.push(s[1]))
|
||
}
|
||
}
|
||
if (e.length < 2) return t;
|
||
e.forEach(function (e) {
|
||
delete t.sources[e]
|
||
});
|
||
var a = i.join(",");
|
||
return t.sources[a] = {type: "vector", url: "mapbox://" + a}, t.layers.forEach(function (t) {
|
||
if (e.indexOf(t.source) >= 0 && (t.source = a, "source-layer" in t)) {
|
||
if (r.indexOf(t["source-layer"]) >= 0) throw new Error("Conflicting source layer names");
|
||
r.push(t["source-layer"])
|
||
}
|
||
}), t
|
||
}, e.diff = function (t, e) {
|
||
if (!t) return [{command: fi.setStyle, args: [e]}];
|
||
var i = [];
|
||
try {
|
||
if (!di(t.version, e.version)) return [{command: fi.setStyle, args: [e]}];
|
||
di(t.center, e.center) || i.push({
|
||
command: fi.setCenter,
|
||
args: [e.center]
|
||
}), di(t.zoom, e.zoom) || i.push({
|
||
command: fi.setZoom,
|
||
args: [e.zoom]
|
||
}), di(t.bearing, e.bearing) || i.push({
|
||
command: fi.setBearing,
|
||
args: [e.bearing]
|
||
}), di(t.pitch, e.pitch) || i.push({
|
||
command: fi.setPitch,
|
||
args: [e.pitch]
|
||
}), di(t.sprite, e.sprite) || i.push({
|
||
command: fi.setSprite,
|
||
args: [e.sprite]
|
||
}), di(t.glyphs, e.glyphs) || i.push({
|
||
command: fi.setGlyphs,
|
||
args: [e.glyphs]
|
||
}), di(t.transition, e.transition) || i.push({
|
||
command: fi.setTransition,
|
||
args: [e.transition]
|
||
}), di(t.light, e.light) || i.push({command: fi.setLight, args: [e.light]});
|
||
var r = {}, o = [];
|
||
!function (t, e, i, r) {
|
||
var o;
|
||
for (o in e = e || {}, t = t || {}) t.hasOwnProperty(o) && (e.hasOwnProperty(o) || mi(o, i, r));
|
||
for (o in e) e.hasOwnProperty(o) && (t.hasOwnProperty(o) ? di(t[o], e[o]) || ("geojson" === t[o].type && "geojson" === e[o].type && vi(t, e, o) ? i.push({
|
||
command: fi.setGeoJSONSourceData,
|
||
args: [o, e[o].data]
|
||
}) : yi(o, e, i, r)) : gi(o, e, i))
|
||
}(t.sources, e.sources, o, r);
|
||
var n = [];
|
||
t.layers && t.layers.forEach(function (t) {
|
||
r[t.source] ? i.push({command: fi.removeLayer, args: [t.id]}) : n.push(t)
|
||
}), i = i.concat(o), function (t, e, i) {
|
||
e = e || [];
|
||
var r, o, n, s, a, l, h, u = (t = t || []).map(xi), c = e.map(xi), p = t.reduce(wi, {}),
|
||
d = e.reduce(wi, {}), f = u.slice(), g = Object.create(null);
|
||
for (r = 0, o = 0; r < u.length; r++) n = u[r], d.hasOwnProperty(n) ? o++ : (i.push({
|
||
command: fi.removeLayer,
|
||
args: [n]
|
||
}), f.splice(f.indexOf(n, o), 1));
|
||
for (r = 0, o = 0; r < c.length; r++) n = c[c.length - 1 - r], f[f.length - 1 - r] !== n && (p.hasOwnProperty(n) ? (i.push({
|
||
command: fi.removeLayer,
|
||
args: [n]
|
||
}), f.splice(f.lastIndexOf(n, f.length - o), 1)) : o++, l = f[f.length - r], i.push({
|
||
command: fi.addLayer,
|
||
args: [d[n], l]
|
||
}), f.splice(f.length - r, 0, n), g[n] = !0);
|
||
for (r = 0; r < c.length; r++) if (s = p[n = c[r]], a = d[n], !g[n] && !di(s, a)) if (di(s.source, a.source) && di(s["source-layer"], a["source-layer"]) && di(s.type, a.type)) {
|
||
for (h in _i(s.layout, a.layout, i, n, null, fi.setLayoutProperty), _i(s.paint, a.paint, i, n, null, fi.setPaintProperty), di(s.filter, a.filter) || i.push({
|
||
command: fi.setFilter,
|
||
args: [n, a.filter]
|
||
}), di(s.minzoom, a.minzoom) && di(s.maxzoom, a.maxzoom) || i.push({
|
||
command: fi.setLayerZoomRange,
|
||
args: [n, a.minzoom, a.maxzoom]
|
||
}), s) s.hasOwnProperty(h) && "layout" !== h && "paint" !== h && "filter" !== h && "metadata" !== h && "minzoom" !== h && "maxzoom" !== h && (0 === h.indexOf("paint.") ? _i(s[h], a[h], i, n, h.slice(6), fi.setPaintProperty) : di(s[h], a[h]) || i.push({
|
||
command: fi.setLayerProperty,
|
||
args: [n, h, a[h]]
|
||
}));
|
||
for (h in a) a.hasOwnProperty(h) && !s.hasOwnProperty(h) && "layout" !== h && "paint" !== h && "filter" !== h && "metadata" !== h && "minzoom" !== h && "maxzoom" !== h && (0 === h.indexOf("paint.") ? _i(s[h], a[h], i, n, h.slice(6), fi.setPaintProperty) : di(s[h], a[h]) || i.push({
|
||
command: fi.setLayerProperty,
|
||
args: [n, h, a[h]]
|
||
}))
|
||
} else i.push({
|
||
command: fi.removeLayer,
|
||
args: [n]
|
||
}), l = f[f.lastIndexOf(n) + 1], i.push({command: fi.addLayer, args: [a, l]})
|
||
}(n, e.layers, i)
|
||
} catch (t) {
|
||
console.warn("Unable to compute style diff:", t), i = [{command: fi.setStyle, args: [e]}]
|
||
}
|
||
return i
|
||
}, e.expression = Zi, e.featureFilter = function (t) {
|
||
if (null == t) return function () {
|
||
return !0
|
||
};
|
||
ii(t) || (t = ni(t));
|
||
var e = Be(t, ri);
|
||
if ("error" === e.result) throw new Error(e.value.map(function (t) {
|
||
return t.key + ": " + t.message
|
||
}).join(", "));
|
||
return function (t, i) {
|
||
return e.value.evaluate(t, i)
|
||
}
|
||
}, e.format = function (t, e) {
|
||
return void 0 === e && (e = 2), (t = s(t, r.$root)).layers && (t.layers = t.layers.map(function (t) {
|
||
return s(t, r.layer)
|
||
})), n(t, {indent: e})
|
||
}, e.function = Ki, e.latest = r, e.migrate = function (t) {
|
||
var e = !1;
|
||
if (7 === t.version && (t = Y(t), e = !0), 8 === t.version && (e = function (t) {
|
||
var e = [];
|
||
return G(t, function (t) {
|
||
t.filter && (t.filter = ui(t.filter))
|
||
}), j(t, {paint: !0, layout: !0}, function (t) {
|
||
var i = t.path, r = t.value, o = t.reference, n = t.set;
|
||
Ue(r) || ("object" != typeof r || Array.isArray(r) ? o.tokens && "string" == typeof r && n(ei(r)) : (n(qe(r, o)), e.push(i.join("."))))
|
||
}), t
|
||
}(t), e = !0), !e) throw new Error("cannot migrate from", t.version);
|
||
return t
|
||
}, e.v8 = r, e.validate = qi, e.visit = Ji, Object.defineProperty(e, "__esModule", {value: !0})
|
||
})(e)
|
||
}).call(this, i(8), i(18).Buffer)
|
||
}, function (t, e, i) {
|
||
"use strict";
|
||
t.exports = o, t.exports.default = o;
|
||
var r = i(15);
|
||
|
||
function o(t, e) {
|
||
if (!(this instanceof o)) return new o(t, e);
|
||
this._maxEntries = Math.max(4, t || 9), this._minEntries = Math.max(2, Math.ceil(.4 * this._maxEntries)), e && this._initFormat(e), this.clear()
|
||
}
|
||
|
||
function n(t, e, i) {
|
||
if (!i) return e.indexOf(t);
|
||
for (var r = 0; r < e.length; r++) if (i(t, e[r])) return r;
|
||
return -1
|
||
}
|
||
|
||
function s(t, e) {
|
||
a(t, 0, t.children.length, e, t)
|
||
}
|
||
|
||
function a(t, e, i, r, o) {
|
||
o || (o = g(null)), o.minX = 1 / 0, o.minY = 1 / 0, o.maxX = -1 / 0, o.maxY = -1 / 0;
|
||
for (var n, s = e; s < i; s++) n = t.children[s], l(o, t.leaf ? r(n) : n);
|
||
return o
|
||
}
|
||
|
||
function l(t, e) {
|
||
return t.minX = Math.min(t.minX, e.minX), t.minY = Math.min(t.minY, e.minY), t.maxX = Math.max(t.maxX, e.maxX), t.maxY = Math.max(t.maxY, e.maxY), t
|
||
}
|
||
|
||
function h(t, e) {
|
||
return t.minX - e.minX
|
||
}
|
||
|
||
function u(t, e) {
|
||
return t.minY - e.minY
|
||
}
|
||
|
||
function c(t) {
|
||
return (t.maxX - t.minX) * (t.maxY - t.minY)
|
||
}
|
||
|
||
function p(t) {
|
||
return t.maxX - t.minX + (t.maxY - t.minY)
|
||
}
|
||
|
||
function d(t, e) {
|
||
return t.minX <= e.minX && t.minY <= e.minY && e.maxX <= t.maxX && e.maxY <= t.maxY
|
||
}
|
||
|
||
function f(t, e) {
|
||
return e.minX <= t.maxX && e.minY <= t.maxY && e.maxX >= t.minX && e.maxY >= t.minY
|
||
}
|
||
|
||
function g(t) {
|
||
return {children: t, height: 1, leaf: !0, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0}
|
||
}
|
||
|
||
function m(t, e, i, o, n) {
|
||
for (var s, a = [e, i]; a.length;) (i = a.pop()) - (e = a.pop()) <= o || (s = e + Math.ceil((i - e) / o / 2) * o, r(t, s, e, i, n), a.push(e, s, s, i))
|
||
}
|
||
|
||
o.prototype = {
|
||
all: function () {
|
||
return this._all(this.data, [])
|
||
}, search: function (t) {
|
||
var e = this.data, i = [], r = this.toBBox;
|
||
if (!f(t, e)) return i;
|
||
for (var o, n, s, a, l = []; e;) {
|
||
for (o = 0, n = e.children.length; o < n; o++) s = e.children[o], f(t, a = e.leaf ? r(s) : s) && (e.leaf ? i.push(s) : d(t, a) ? this._all(s, i) : l.push(s));
|
||
e = l.pop()
|
||
}
|
||
return i
|
||
}, collides: function (t) {
|
||
var e = this.data, i = this.toBBox;
|
||
if (!f(t, e)) return !1;
|
||
for (var r, o, n, s, a = []; e;) {
|
||
for (r = 0, o = e.children.length; r < o; r++) if (n = e.children[r], f(t, s = e.leaf ? i(n) : n)) {
|
||
if (e.leaf || d(t, s)) return !0;
|
||
a.push(n)
|
||
}
|
||
e = a.pop()
|
||
}
|
||
return !1
|
||
}, load: function (t) {
|
||
if (!t || !t.length) return this;
|
||
if (t.length < this._minEntries) {
|
||
for (var e = 0, i = t.length; e < i; e++) this.insert(t[e]);
|
||
return this
|
||
}
|
||
var r = this._build(t.slice(), 0, t.length - 1, 0);
|
||
if (this.data.children.length) if (this.data.height === r.height) this._splitRoot(this.data, r); else {
|
||
if (this.data.height < r.height) {
|
||
var o = this.data;
|
||
this.data = r, r = o
|
||
}
|
||
this._insert(r, this.data.height - r.height - 1, !0)
|
||
} else this.data = r;
|
||
return this
|
||
}, insert: function (t) {
|
||
return t && this._insert(t, this.data.height - 1), this
|
||
}, clear: function () {
|
||
return this.data = g([]), this
|
||
}, remove: function (t, e) {
|
||
if (!t) return this;
|
||
for (var i, r, o, s, a = this.data, l = this.toBBox(t), h = [], u = []; a || h.length;) {
|
||
if (a || (a = h.pop(), r = h[h.length - 1], i = u.pop(), s = !0), a.leaf && -1 !== (o = n(t, a.children, e))) return a.children.splice(o, 1), h.push(a), this._condense(h), this;
|
||
s || a.leaf || !d(a, l) ? r ? (i++, a = r.children[i], s = !1) : a = null : (h.push(a), u.push(i), i = 0, r = a, a = a.children[0])
|
||
}
|
||
return this
|
||
}, toBBox: function (t) {
|
||
return t
|
||
}, compareMinX: h, compareMinY: u, toJSON: function () {
|
||
return this.data
|
||
}, fromJSON: function (t) {
|
||
return this.data = t, this
|
||
}, _all: function (t, e) {
|
||
for (var i = []; t;) t.leaf ? e.push.apply(e, t.children) : i.push.apply(i, t.children), t = i.pop();
|
||
return e
|
||
}, _build: function (t, e, i, r) {
|
||
var o, n = i - e + 1, a = this._maxEntries;
|
||
if (n <= a) return s(o = g(t.slice(e, i + 1)), this.toBBox), o;
|
||
r || (r = Math.ceil(Math.log(n) / Math.log(a)), a = Math.ceil(n / Math.pow(a, r - 1))), (o = g([])).leaf = !1, o.height = r;
|
||
var l, h, u, c, p = Math.ceil(n / a), d = p * Math.ceil(Math.sqrt(a));
|
||
for (m(t, e, i, d, this.compareMinX), l = e; l <= i; l += d) for (m(t, l, u = Math.min(l + d - 1, i), p, this.compareMinY), h = l; h <= u; h += p) c = Math.min(h + p - 1, u), o.children.push(this._build(t, h, c, r - 1));
|
||
return s(o, this.toBBox), o
|
||
}, _chooseSubtree: function (t, e, i, r) {
|
||
for (var o, n, s, a, l, h, u, p, d, f; r.push(e), !e.leaf && r.length - 1 !== i;) {
|
||
for (u = p = 1 / 0, o = 0, n = e.children.length; o < n; o++) l = c(s = e.children[o]), d = t, f = s, (h = (Math.max(f.maxX, d.maxX) - Math.min(f.minX, d.minX)) * (Math.max(f.maxY, d.maxY) - Math.min(f.minY, d.minY)) - l) < p ? (p = h, u = l < u ? l : u, a = s) : h === p && l < u && (u = l, a = s);
|
||
e = a || e.children[0]
|
||
}
|
||
return e
|
||
}, _insert: function (t, e, i) {
|
||
var r = this.toBBox, o = i ? t : r(t), n = [], s = this._chooseSubtree(o, this.data, e, n);
|
||
for (s.children.push(t), l(s, o); e >= 0 && n[e].children.length > this._maxEntries;) this._split(n, e), e--;
|
||
this._adjustParentBBoxes(o, n, e)
|
||
}, _split: function (t, e) {
|
||
var i = t[e], r = i.children.length, o = this._minEntries;
|
||
this._chooseSplitAxis(i, o, r);
|
||
var n = this._chooseSplitIndex(i, o, r), a = g(i.children.splice(n, i.children.length - n));
|
||
a.height = i.height, a.leaf = i.leaf, s(i, this.toBBox), s(a, this.toBBox), e ? t[e - 1].children.push(a) : this._splitRoot(i, a)
|
||
}, _splitRoot: function (t, e) {
|
||
this.data = g([t, e]), this.data.height = t.height + 1, this.data.leaf = !1, s(this.data, this.toBBox)
|
||
}, _chooseSplitIndex: function (t, e, i) {
|
||
var r, o, n, s, l, h, u, p, d, f, g, m, y, v;
|
||
for (h = u = 1 / 0, r = e; r <= i - e; r++) o = a(t, 0, r, this.toBBox), n = a(t, r, i, this.toBBox), d = o, f = n, g = void 0, m = void 0, y = void 0, v = void 0, g = Math.max(d.minX, f.minX), m = Math.max(d.minY, f.minY), y = Math.min(d.maxX, f.maxX), v = Math.min(d.maxY, f.maxY), s = Math.max(0, y - g) * Math.max(0, v - m), l = c(o) + c(n), s < h ? (h = s, p = r, u = l < u ? l : u) : s === h && l < u && (u = l, p = r);
|
||
return p
|
||
}, _chooseSplitAxis: function (t, e, i) {
|
||
var r = t.leaf ? this.compareMinX : h, o = t.leaf ? this.compareMinY : u;
|
||
this._allDistMargin(t, e, i, r) < this._allDistMargin(t, e, i, o) && t.children.sort(r)
|
||
}, _allDistMargin: function (t, e, i, r) {
|
||
t.children.sort(r);
|
||
var o, n, s = this.toBBox, h = a(t, 0, e, s), u = a(t, i - e, i, s), c = p(h) + p(u);
|
||
for (o = e; o < i - e; o++) n = t.children[o], l(h, t.leaf ? s(n) : n), c += p(h);
|
||
for (o = i - e - 1; o >= e; o--) n = t.children[o], l(u, t.leaf ? s(n) : n), c += p(u);
|
||
return c
|
||
}, _adjustParentBBoxes: function (t, e, i) {
|
||
for (var r = i; r >= 0; r--) l(e[r], t)
|
||
}, _condense: function (t) {
|
||
for (var e, i = t.length - 1; i >= 0; i--) 0 === t[i].children.length ? i > 0 ? (e = t[i - 1].children).splice(e.indexOf(t[i]), 1) : this.clear() : s(t[i], this.toBBox)
|
||
}, _initFormat: function (t) {
|
||
var e = ["return a", " - b", ";"];
|
||
this.compareMinX = new Function("a", "b", e.join(t[0])), this.compareMinY = new Function("a", "b", e.join(t[1])), this.toBBox = new Function("a", "return {minX: a" + t[0] + ", minY: a" + t[1] + ", maxX: a" + t[2] + ", maxY: a" + t[3] + "};")
|
||
}
|
||
}
|
||
}, function (t, e) {
|
||
var i = {
|
||
thin: 100,
|
||
hairline: 100,
|
||
"ultra-light": 100,
|
||
"extra-light": 100,
|
||
light: 200,
|
||
book: 300,
|
||
regular: 400,
|
||
normal: 400,
|
||
plain: 400,
|
||
roman: 400,
|
||
standard: 400,
|
||
medium: 500,
|
||
"semi-bold": 600,
|
||
"demi-bold": 600,
|
||
bold: 700,
|
||
heavy: 800,
|
||
black: 800,
|
||
"extra-bold": 800,
|
||
"ultra-black": 900,
|
||
"extra-black": 900,
|
||
"ultra-bold": 900,
|
||
"heavy-black": 900,
|
||
fat: 900,
|
||
poster: 900
|
||
}, r = /(italic|oblique)$/i, o = {};
|
||
t.exports = function (t, e, n) {
|
||
var s = o[t];
|
||
if (!s) {
|
||
Array.isArray(t) || (t = [t]);
|
||
for (var a = "normal", l = "normal", h = [], u = 0, c = t.length; u < c; ++u) {
|
||
var p = t[u].split(" "), d = p[p.length - 1].toLowerCase();
|
||
for (var f in "normal" == d || "italic" == d || "oblique" == d ? (l = d, p.pop(), d = p[p.length - 1].toLowerCase()) : r.test(d) && (d = d.replace(r, ""), l = p[p.length - 1].replace(d, "")), i) if (d == f || d == f.replace("-", "") || d == f.replace("-", " ")) {
|
||
a = i[f], p.pop();
|
||
break
|
||
}
|
||
"number" == typeof d && (a = d);
|
||
var g = p.join(" ").replace("Klokantech Noto Sans", "Noto Sans");
|
||
-1 !== g.indexOf(" ") && (g = '"' + g + '"'), h.push(g)
|
||
}
|
||
s = o[t] = [l, a, h]
|
||
}
|
||
return s[0] + " " + s[1] + " " + e + "px" + (n ? "/" + n : "") + " " + s[2]
|
||
}
|
||
}, , function (t, e, i) {
|
||
var r, o, n;
|
||
/*!
|
||
autosize 4.0.2
|
||
license: MIT
|
||
http://www.jacklmoore.com/autosize
|
||
*/
|
||
o = [t, e], void 0 === (n = "function" == typeof (r = function (t, e) {
|
||
"use strict";
|
||
var i, r, o = "function" == typeof Map ? new Map : (i = [], r = [], {
|
||
has: function (t) {
|
||
return i.indexOf(t) > -1
|
||
}, get: function (t) {
|
||
return r[i.indexOf(t)]
|
||
}, set: function (t, e) {
|
||
-1 === i.indexOf(t) && (i.push(t), r.push(e))
|
||
}, delete: function (t) {
|
||
var e = i.indexOf(t);
|
||
e > -1 && (i.splice(e, 1), r.splice(e, 1))
|
||
}
|
||
}), n = function (t) {
|
||
return new Event(t, {bubbles: !0})
|
||
};
|
||
try {
|
||
new Event("test")
|
||
} catch (t) {
|
||
n = function (t) {
|
||
var e = document.createEvent("Event");
|
||
return e.initEvent(t, !0, !1), e
|
||
}
|
||
}
|
||
|
||
function s(t) {
|
||
if (t && t.nodeName && "TEXTAREA" === t.nodeName && !o.has(t)) {
|
||
var e = null, i = null, r = null, s = function () {
|
||
t.clientWidth !== i && c()
|
||
}, a = function (e) {
|
||
window.removeEventListener("resize", s, !1), t.removeEventListener("input", c, !1), t.removeEventListener("keyup", c, !1), t.removeEventListener("autosize:destroy", a, !1), t.removeEventListener("autosize:update", c, !1), Object.keys(e).forEach(function (i) {
|
||
t.style[i] = e[i]
|
||
}), o.delete(t)
|
||
}.bind(t, {
|
||
height: t.style.height,
|
||
resize: t.style.resize,
|
||
overflowY: t.style.overflowY,
|
||
overflowX: t.style.overflowX,
|
||
wordWrap: t.style.wordWrap
|
||
});
|
||
t.addEventListener("autosize:destroy", a, !1), "onpropertychange" in t && "oninput" in t && t.addEventListener("keyup", c, !1), window.addEventListener("resize", s, !1), t.addEventListener("input", c, !1), t.addEventListener("autosize:update", c, !1), t.style.overflowX = "hidden", t.style.wordWrap = "break-word", o.set(t, {
|
||
destroy: a,
|
||
update: c
|
||
}), "vertical" === (l = window.getComputedStyle(t, null)).resize ? t.style.resize = "none" : "both" === l.resize && (t.style.resize = "horizontal"), e = "content-box" === l.boxSizing ? -(parseFloat(l.paddingTop) + parseFloat(l.paddingBottom)) : parseFloat(l.borderTopWidth) + parseFloat(l.borderBottomWidth), isNaN(e) && (e = 0), c()
|
||
}
|
||
var l;
|
||
|
||
function h(e) {
|
||
var i = t.style.width;
|
||
t.style.width = "0px", t.offsetWidth, t.style.width = i, t.style.overflowY = e
|
||
}
|
||
|
||
function u() {
|
||
if (0 !== t.scrollHeight) {
|
||
var r = function (t) {
|
||
for (var e = []; t && t.parentNode && t.parentNode instanceof Element;) t.parentNode.scrollTop && e.push({
|
||
node: t.parentNode,
|
||
scrollTop: t.parentNode.scrollTop
|
||
}), t = t.parentNode;
|
||
return e
|
||
}(t), o = document.documentElement && document.documentElement.scrollTop;
|
||
t.style.height = "", t.style.height = t.scrollHeight + e + "px", i = t.clientWidth, r.forEach(function (t) {
|
||
t.node.scrollTop = t.scrollTop
|
||
}), o && (document.documentElement.scrollTop = o)
|
||
}
|
||
}
|
||
|
||
function c() {
|
||
u();
|
||
var e = Math.round(parseFloat(t.style.height)), i = window.getComputedStyle(t, null),
|
||
o = "content-box" === i.boxSizing ? Math.round(parseFloat(i.height)) : t.offsetHeight;
|
||
if (o < e ? "hidden" === i.overflowY && (h("scroll"), u(), o = "content-box" === i.boxSizing ? Math.round(parseFloat(window.getComputedStyle(t, null).height)) : t.offsetHeight) : "hidden" !== i.overflowY && (h("hidden"), u(), o = "content-box" === i.boxSizing ? Math.round(parseFloat(window.getComputedStyle(t, null).height)) : t.offsetHeight), r !== o) {
|
||
r = o;
|
||
var s = n("autosize:resized");
|
||
try {
|
||
t.dispatchEvent(s)
|
||
} catch (t) {
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
function a(t) {
|
||
var e = o.get(t);
|
||
e && e.destroy()
|
||
}
|
||
|
||
function l(t) {
|
||
var e = o.get(t);
|
||
e && e.update()
|
||
}
|
||
|
||
var h = null;
|
||
"undefined" == typeof window || "function" != typeof window.getComputedStyle ? ((h = function (t) {
|
||
return t
|
||
}).destroy = function (t) {
|
||
return t
|
||
}, h.update = function (t) {
|
||
return t
|
||
}) : ((h = function (t, e) {
|
||
return t && Array.prototype.forEach.call(t.length ? t : [t], function (t) {
|
||
return s(t)
|
||
}), t
|
||
}).destroy = function (t) {
|
||
return t && Array.prototype.forEach.call(t.length ? t : [t], a), t
|
||
}, h.update = function (t) {
|
||
return t && Array.prototype.forEach.call(t.length ? t : [t], l), t
|
||
}), e.default = h, t.exports = e.default
|
||
}) ? r.apply(e, o) : r) || (t.exports = n)
|
||
}, function (t, e) {
|
||
e.read = function (t, e, i, r, o) {
|
||
var n, s, a = 8 * o - r - 1, l = (1 << a) - 1, h = l >> 1, u = -7, c = i ? o - 1 : 0, p = i ? -1 : 1,
|
||
d = t[e + c];
|
||
for (c += p, n = d & (1 << -u) - 1, d >>= -u, u += a; u > 0; n = 256 * n + t[e + c], c += p, u -= 8) ;
|
||
for (s = n & (1 << -u) - 1, n >>= -u, u += r; u > 0; s = 256 * s + t[e + c], c += p, u -= 8) ;
|
||
if (0 === n) n = 1 - h; else {
|
||
if (n === l) return s ? NaN : 1 / 0 * (d ? -1 : 1);
|
||
s += Math.pow(2, r), n -= h
|
||
}
|
||
return (d ? -1 : 1) * s * Math.pow(2, n - r)
|
||
}, e.write = function (t, e, i, r, o, n) {
|
||
var s, a, l, h = 8 * n - o - 1, u = (1 << h) - 1, c = u >> 1,
|
||
p = 23 === o ? Math.pow(2, -24) - Math.pow(2, -77) : 0, d = r ? 0 : n - 1, f = r ? 1 : -1,
|
||
g = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
|
||
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (a = isNaN(e) ? 1 : 0, s = u) : (s = Math.floor(Math.log(e) / Math.LN2), e * (l = Math.pow(2, -s)) < 1 && (s--, l *= 2), (e += s + c >= 1 ? p / l : p * Math.pow(2, 1 - c)) * l >= 2 && (s++, l /= 2), s + c >= u ? (a = 0, s = u) : s + c >= 1 ? (a = (e * l - 1) * Math.pow(2, o), s += c) : (a = e * Math.pow(2, c - 1) * Math.pow(2, o), s = 0)); o >= 8; t[i + d] = 255 & a, d += f, a /= 256, o -= 8) ;
|
||
for (s = s << o | a, h += o; h > 0; t[i + d] = 255 & s, d += f, s /= 256, h -= 8) ;
|
||
t[i + d - f] |= 128 * g
|
||
}
|
||
}, function (t, e) {
|
||
var i;
|
||
i = function () {
|
||
return this
|
||
}();
|
||
try {
|
||
i = i || new Function("return this")()
|
||
} catch (t) {
|
||
"object" == typeof window && (i = window)
|
||
}
|
||
t.exports = i
|
||
}, function (t, e, i) {
|
||
"use strict";
|
||
t.exports = o;
|
||
var r = i(7);
|
||
|
||
function o(t) {
|
||
this.buf = ArrayBuffer.isView && ArrayBuffer.isView(t) ? t : new Uint8Array(t || 0), this.pos = 0, this.type = 0, this.length = this.buf.length
|
||
}
|
||
|
||
o.Varint = 0, o.Fixed64 = 1, o.Bytes = 2, o.Fixed32 = 5;
|
||
|
||
function n(t) {
|
||
return t.type === o.Bytes ? t.readVarint() + t.pos : t.pos + 1
|
||
}
|
||
|
||
function s(t, e, i) {
|
||
return i ? 4294967296 * e + (t >>> 0) : 4294967296 * (e >>> 0) + (t >>> 0)
|
||
}
|
||
|
||
function a(t, e, i) {
|
||
var r = e <= 16383 ? 1 : e <= 2097151 ? 2 : e <= 268435455 ? 3 : Math.ceil(Math.log(e) / (7 * Math.LN2));
|
||
i.realloc(r);
|
||
for (var o = i.pos - 1; o >= t; o--) i.buf[o + r] = i.buf[o]
|
||
}
|
||
|
||
function l(t, e) {
|
||
for (var i = 0; i < t.length; i++) e.writeVarint(t[i])
|
||
}
|
||
|
||
function h(t, e) {
|
||
for (var i = 0; i < t.length; i++) e.writeSVarint(t[i])
|
||
}
|
||
|
||
function u(t, e) {
|
||
for (var i = 0; i < t.length; i++) e.writeFloat(t[i])
|
||
}
|
||
|
||
function c(t, e) {
|
||
for (var i = 0; i < t.length; i++) e.writeDouble(t[i])
|
||
}
|
||
|
||
function p(t, e) {
|
||
for (var i = 0; i < t.length; i++) e.writeBoolean(t[i])
|
||
}
|
||
|
||
function d(t, e) {
|
||
for (var i = 0; i < t.length; i++) e.writeFixed32(t[i])
|
||
}
|
||
|
||
function f(t, e) {
|
||
for (var i = 0; i < t.length; i++) e.writeSFixed32(t[i])
|
||
}
|
||
|
||
function g(t, e) {
|
||
for (var i = 0; i < t.length; i++) e.writeFixed64(t[i])
|
||
}
|
||
|
||
function m(t, e) {
|
||
for (var i = 0; i < t.length; i++) e.writeSFixed64(t[i])
|
||
}
|
||
|
||
function y(t, e) {
|
||
return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + 16777216 * t[e + 3]
|
||
}
|
||
|
||
function v(t, e, i) {
|
||
t[i] = e, t[i + 1] = e >>> 8, t[i + 2] = e >>> 16, t[i + 3] = e >>> 24
|
||
}
|
||
|
||
function _(t, e) {
|
||
return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + (t[e + 3] << 24)
|
||
}
|
||
|
||
o.prototype = {
|
||
destroy: function () {
|
||
this.buf = null
|
||
}, readFields: function (t, e, i) {
|
||
for (i = i || this.length; this.pos < i;) {
|
||
var r = this.readVarint(), o = r >> 3, n = this.pos;
|
||
this.type = 7 & r, t(o, e, this), this.pos === n && this.skip(r)
|
||
}
|
||
return e
|
||
}, readMessage: function (t, e) {
|
||
return this.readFields(t, e, this.readVarint() + this.pos)
|
||
}, readFixed32: function () {
|
||
var t = y(this.buf, this.pos);
|
||
return this.pos += 4, t
|
||
}, readSFixed32: function () {
|
||
var t = _(this.buf, this.pos);
|
||
return this.pos += 4, t
|
||
}, readFixed64: function () {
|
||
var t = y(this.buf, this.pos) + 4294967296 * y(this.buf, this.pos + 4);
|
||
return this.pos += 8, t
|
||
}, readSFixed64: function () {
|
||
var t = y(this.buf, this.pos) + 4294967296 * _(this.buf, this.pos + 4);
|
||
return this.pos += 8, t
|
||
}, readFloat: function () {
|
||
var t = r.read(this.buf, this.pos, !0, 23, 4);
|
||
return this.pos += 4, t
|
||
}, readDouble: function () {
|
||
var t = r.read(this.buf, this.pos, !0, 52, 8);
|
||
return this.pos += 8, t
|
||
}, readVarint: function (t) {
|
||
var e, i, r = this.buf;
|
||
return e = 127 & (i = r[this.pos++]), i < 128 ? e : (e |= (127 & (i = r[this.pos++])) << 7, i < 128 ? e : (e |= (127 & (i = r[this.pos++])) << 14, i < 128 ? e : (e |= (127 & (i = r[this.pos++])) << 21, i < 128 ? e : function (t, e, i) {
|
||
var r, o, n = i.buf;
|
||
if (o = n[i.pos++], r = (112 & o) >> 4, o < 128) return s(t, r, e);
|
||
if (o = n[i.pos++], r |= (127 & o) << 3, o < 128) return s(t, r, e);
|
||
if (o = n[i.pos++], r |= (127 & o) << 10, o < 128) return s(t, r, e);
|
||
if (o = n[i.pos++], r |= (127 & o) << 17, o < 128) return s(t, r, e);
|
||
if (o = n[i.pos++], r |= (127 & o) << 24, o < 128) return s(t, r, e);
|
||
if (o = n[i.pos++], r |= (1 & o) << 31, o < 128) return s(t, r, e);
|
||
throw new Error("Expected varint not more than 10 bytes")
|
||
}(e |= (15 & (i = r[this.pos])) << 28, t, this))))
|
||
}, readVarint64: function () {
|
||
return this.readVarint(!0)
|
||
}, readSVarint: function () {
|
||
var t = this.readVarint();
|
||
return t % 2 == 1 ? (t + 1) / -2 : t / 2
|
||
}, readBoolean: function () {
|
||
return Boolean(this.readVarint())
|
||
}, readString: function () {
|
||
var t = this.readVarint() + this.pos, e = function (t, e, i) {
|
||
var r = "", o = e;
|
||
for (; o < i;) {
|
||
var n, s, a, l = t[o], h = null, u = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;
|
||
if (o + u > i) break;
|
||
1 === u ? l < 128 && (h = l) : 2 === u ? 128 == (192 & (n = t[o + 1])) && (h = (31 & l) << 6 | 63 & n) <= 127 && (h = null) : 3 === u ? (n = t[o + 1], s = t[o + 2], 128 == (192 & n) && 128 == (192 & s) && ((h = (15 & l) << 12 | (63 & n) << 6 | 63 & s) <= 2047 || h >= 55296 && h <= 57343) && (h = null)) : 4 === u && (n = t[o + 1], s = t[o + 2], a = t[o + 3], 128 == (192 & n) && 128 == (192 & s) && 128 == (192 & a) && ((h = (15 & l) << 18 | (63 & n) << 12 | (63 & s) << 6 | 63 & a) <= 65535 || h >= 1114112) && (h = null)), null === h ? (h = 65533, u = 1) : h > 65535 && (h -= 65536, r += String.fromCharCode(h >>> 10 & 1023 | 55296), h = 56320 | 1023 & h), r += String.fromCharCode(h), o += u
|
||
}
|
||
return r
|
||
}(this.buf, this.pos, t);
|
||
return this.pos = t, e
|
||
}, readBytes: function () {
|
||
var t = this.readVarint() + this.pos, e = this.buf.subarray(this.pos, t);
|
||
return this.pos = t, e
|
||
}, readPackedVarint: function (t, e) {
|
||
var i = n(this);
|
||
for (t = t || []; this.pos < i;) t.push(this.readVarint(e));
|
||
return t
|
||
}, readPackedSVarint: function (t) {
|
||
var e = n(this);
|
||
for (t = t || []; this.pos < e;) t.push(this.readSVarint());
|
||
return t
|
||
}, readPackedBoolean: function (t) {
|
||
var e = n(this);
|
||
for (t = t || []; this.pos < e;) t.push(this.readBoolean());
|
||
return t
|
||
}, readPackedFloat: function (t) {
|
||
var e = n(this);
|
||
for (t = t || []; this.pos < e;) t.push(this.readFloat());
|
||
return t
|
||
}, readPackedDouble: function (t) {
|
||
var e = n(this);
|
||
for (t = t || []; this.pos < e;) t.push(this.readDouble());
|
||
return t
|
||
}, readPackedFixed32: function (t) {
|
||
var e = n(this);
|
||
for (t = t || []; this.pos < e;) t.push(this.readFixed32());
|
||
return t
|
||
}, readPackedSFixed32: function (t) {
|
||
var e = n(this);
|
||
for (t = t || []; this.pos < e;) t.push(this.readSFixed32());
|
||
return t
|
||
}, readPackedFixed64: function (t) {
|
||
var e = n(this);
|
||
for (t = t || []; this.pos < e;) t.push(this.readFixed64());
|
||
return t
|
||
}, readPackedSFixed64: function (t) {
|
||
var e = n(this);
|
||
for (t = t || []; this.pos < e;) t.push(this.readSFixed64());
|
||
return t
|
||
}, skip: function (t) {
|
||
var e = 7 & t;
|
||
if (e === o.Varint) for (; this.buf[this.pos++] > 127;) ; else if (e === o.Bytes) this.pos = this.readVarint() + this.pos; else if (e === o.Fixed32) this.pos += 4; else {
|
||
if (e !== o.Fixed64) throw new Error("Unimplemented type: " + e);
|
||
this.pos += 8
|
||
}
|
||
}, writeTag: function (t, e) {
|
||
this.writeVarint(t << 3 | e)
|
||
}, realloc: function (t) {
|
||
for (var e = this.length || 16; e < this.pos + t;) e *= 2;
|
||
if (e !== this.length) {
|
||
var i = new Uint8Array(e);
|
||
i.set(this.buf), this.buf = i, this.length = e
|
||
}
|
||
}, finish: function () {
|
||
return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length)
|
||
}, writeFixed32: function (t) {
|
||
this.realloc(4), v(this.buf, t, this.pos), this.pos += 4
|
||
}, writeSFixed32: function (t) {
|
||
this.realloc(4), v(this.buf, t, this.pos), this.pos += 4
|
||
}, writeFixed64: function (t) {
|
||
this.realloc(8), v(this.buf, -1 & t, this.pos), v(this.buf, Math.floor(t * (1 / 4294967296)), this.pos + 4), this.pos += 8
|
||
}, writeSFixed64: function (t) {
|
||
this.realloc(8), v(this.buf, -1 & t, this.pos), v(this.buf, Math.floor(t * (1 / 4294967296)), this.pos + 4), this.pos += 8
|
||
}, writeVarint: function (t) {
|
||
(t = +t || 0) > 268435455 || t < 0 ? function (t, e) {
|
||
var i, r;
|
||
t >= 0 ? (i = t % 4294967296 | 0, r = t / 4294967296 | 0) : (r = ~(-t / 4294967296), 4294967295 ^ (i = ~(-t % 4294967296)) ? i = i + 1 | 0 : (i = 0, r = r + 1 | 0));
|
||
if (t >= 0x10000000000000000 || t < -0x10000000000000000) throw new Error("Given varint doesn't fit into 10 bytes");
|
||
e.realloc(10), function (t, e, i) {
|
||
i.buf[i.pos++] = 127 & t | 128, t >>>= 7, i.buf[i.pos++] = 127 & t | 128, t >>>= 7, i.buf[i.pos++] = 127 & t | 128, t >>>= 7, i.buf[i.pos++] = 127 & t | 128, t >>>= 7, i.buf[i.pos] = 127 & t
|
||
}(i, 0, e), function (t, e) {
|
||
var i = (7 & t) << 4;
|
||
if (e.buf[e.pos++] |= i | ((t >>>= 3) ? 128 : 0), !t) return;
|
||
if (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;
|
||
if (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;
|
||
if (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;
|
||
if (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;
|
||
e.buf[e.pos++] = 127 & t
|
||
}(r, e)
|
||
}(t, this) : (this.realloc(4), this.buf[this.pos++] = 127 & t | (t > 127 ? 128 : 0), t <= 127 || (this.buf[this.pos++] = 127 & (t >>>= 7) | (t > 127 ? 128 : 0), t <= 127 || (this.buf[this.pos++] = 127 & (t >>>= 7) | (t > 127 ? 128 : 0), t <= 127 || (this.buf[this.pos++] = t >>> 7 & 127))))
|
||
}, writeSVarint: function (t) {
|
||
this.writeVarint(t < 0 ? 2 * -t - 1 : 2 * t)
|
||
}, writeBoolean: function (t) {
|
||
this.writeVarint(Boolean(t))
|
||
}, writeString: function (t) {
|
||
t = String(t), this.realloc(4 * t.length), this.pos++;
|
||
var e = this.pos;
|
||
this.pos = function (t, e, i) {
|
||
for (var r, o, n = 0; n < e.length; n++) {
|
||
if ((r = e.charCodeAt(n)) > 55295 && r < 57344) {
|
||
if (!o) {
|
||
r > 56319 || n + 1 === e.length ? (t[i++] = 239, t[i++] = 191, t[i++] = 189) : o = r;
|
||
continue
|
||
}
|
||
if (r < 56320) {
|
||
t[i++] = 239, t[i++] = 191, t[i++] = 189, o = r;
|
||
continue
|
||
}
|
||
r = o - 55296 << 10 | r - 56320 | 65536, o = null
|
||
} else o && (t[i++] = 239, t[i++] = 191, t[i++] = 189, o = null);
|
||
r < 128 ? t[i++] = r : (r < 2048 ? t[i++] = r >> 6 | 192 : (r < 65536 ? t[i++] = r >> 12 | 224 : (t[i++] = r >> 18 | 240, t[i++] = r >> 12 & 63 | 128), t[i++] = r >> 6 & 63 | 128), t[i++] = 63 & r | 128)
|
||
}
|
||
return i
|
||
}(this.buf, t, this.pos);
|
||
var i = this.pos - e;
|
||
i >= 128 && a(e, i, this), this.pos = e - 1, this.writeVarint(i), this.pos += i
|
||
}, writeFloat: function (t) {
|
||
this.realloc(4), r.write(this.buf, t, this.pos, !0, 23, 4), this.pos += 4
|
||
}, writeDouble: function (t) {
|
||
this.realloc(8), r.write(this.buf, t, this.pos, !0, 52, 8), this.pos += 8
|
||
}, writeBytes: function (t) {
|
||
var e = t.length;
|
||
this.writeVarint(e), this.realloc(e);
|
||
for (var i = 0; i < e; i++) this.buf[this.pos++] = t[i]
|
||
}, writeRawMessage: function (t, e) {
|
||
this.pos++;
|
||
var i = this.pos;
|
||
t(e, this);
|
||
var r = this.pos - i;
|
||
r >= 128 && a(i, r, this), this.pos = i - 1, this.writeVarint(r), this.pos += r
|
||
}, writeMessage: function (t, e, i) {
|
||
this.writeTag(t, o.Bytes), this.writeRawMessage(e, i)
|
||
}, writePackedVarint: function (t, e) {
|
||
this.writeMessage(t, l, e)
|
||
}, writePackedSVarint: function (t, e) {
|
||
this.writeMessage(t, h, e)
|
||
}, writePackedBoolean: function (t, e) {
|
||
this.writeMessage(t, p, e)
|
||
}, writePackedFloat: function (t, e) {
|
||
this.writeMessage(t, u, e)
|
||
}, writePackedDouble: function (t, e) {
|
||
this.writeMessage(t, c, e)
|
||
}, writePackedFixed32: function (t, e) {
|
||
this.writeMessage(t, d, e)
|
||
}, writePackedSFixed32: function (t, e) {
|
||
this.writeMessage(t, f, e)
|
||
}, writePackedFixed64: function (t, e) {
|
||
this.writeMessage(t, g, e)
|
||
}, writePackedSFixed64: function (t, e) {
|
||
this.writeMessage(t, m, e)
|
||
}, writeBytesField: function (t, e) {
|
||
this.writeTag(t, o.Bytes), this.writeBytes(e)
|
||
}, writeFixed32Field: function (t, e) {
|
||
this.writeTag(t, o.Fixed32), this.writeFixed32(e)
|
||
}, writeSFixed32Field: function (t, e) {
|
||
this.writeTag(t, o.Fixed32), this.writeSFixed32(e)
|
||
}, writeFixed64Field: function (t, e) {
|
||
this.writeTag(t, o.Fixed64), this.writeFixed64(e)
|
||
}, writeSFixed64Field: function (t, e) {
|
||
this.writeTag(t, o.Fixed64), this.writeSFixed64(e)
|
||
}, writeVarintField: function (t, e) {
|
||
this.writeTag(t, o.Varint), this.writeVarint(e)
|
||
}, writeSVarintField: function (t, e) {
|
||
this.writeTag(t, o.Varint), this.writeSVarint(e)
|
||
}, writeStringField: function (t, e) {
|
||
this.writeTag(t, o.Bytes), this.writeString(e)
|
||
}, writeFloatField: function (t, e) {
|
||
this.writeTag(t, o.Fixed32), this.writeFloat(e)
|
||
}, writeDoubleField: function (t, e) {
|
||
this.writeTag(t, o.Fixed64), this.writeDouble(e)
|
||
}, writeBooleanField: function (t, e) {
|
||
this.writeVarintField(t, Boolean(e))
|
||
}
|
||
}
|
||
}, function (t, e, i) {
|
||
var r = i(16);
|
||
e.Processor = r
|
||
}, function (t) {
|
||
t.exports = {
|
||
$version: 8,
|
||
$root: {
|
||
version: {
|
||
required: !0,
|
||
type: "enum",
|
||
values: [8],
|
||
doc: "Style specification version number. Must be 8.",
|
||
example: 8
|
||
},
|
||
name: {type: "string", doc: "A human-readable name for the style.", example: "Bright"},
|
||
metadata: {
|
||
type: "*",
|
||
doc: "Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."
|
||
},
|
||
center: {
|
||
type: "array",
|
||
value: "number",
|
||
doc: "Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
|
||
example: [-73.9749, 40.7736]
|
||
},
|
||
zoom: {
|
||
type: "number",
|
||
doc: "Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
|
||
example: 12.5
|
||
},
|
||
bearing: {
|
||
type: "number",
|
||
default: 0,
|
||
period: 360,
|
||
units: "degrees",
|
||
doc: 'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',
|
||
example: 29
|
||
},
|
||
pitch: {
|
||
type: "number",
|
||
default: 0,
|
||
units: "degrees",
|
||
doc: "Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
|
||
example: 50
|
||
},
|
||
light: {
|
||
type: "light",
|
||
doc: "The global light source.",
|
||
example: {anchor: "viewport", color: "white", intensity: .4}
|
||
},
|
||
sources: {
|
||
required: !0,
|
||
type: "sources",
|
||
doc: "Data source specifications.",
|
||
example: {"mapbox-streets": {type: "vector", url: "mapbox://mapbox.mapbox-streets-v6"}}
|
||
},
|
||
sprite: {
|
||
type: "string",
|
||
doc: "A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",
|
||
example: "mapbox://sprites/mapbox/bright-v8"
|
||
},
|
||
glyphs: {
|
||
type: "string",
|
||
doc: "A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",
|
||
example: "mapbox://fonts/mapbox/{fontstack}/{range}.pbf"
|
||
},
|
||
transition: {
|
||
type: "transition",
|
||
doc: "A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",
|
||
example: {duration: 300, delay: 0}
|
||
},
|
||
layers: {
|
||
required: !0,
|
||
type: "array",
|
||
value: "layer",
|
||
doc: "Layers will be drawn in the order of this array.",
|
||
example: [{
|
||
id: "water",
|
||
source: "mapbox-streets",
|
||
"source-layer": "water",
|
||
type: "fill",
|
||
paint: {"fill-color": "#00ffff"}
|
||
}]
|
||
}
|
||
},
|
||
sources: {
|
||
"*": {
|
||
type: "source",
|
||
doc: "Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."
|
||
}
|
||
},
|
||
source: ["source_vector", "source_raster", "source_raster_dem", "source_geojson", "source_video", "source_image"],
|
||
source_vector: {
|
||
type: {
|
||
required: !0,
|
||
type: "enum",
|
||
values: {vector: {doc: "A vector tile source."}},
|
||
doc: "The type of the source."
|
||
},
|
||
url: {
|
||
type: "string",
|
||
doc: "A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."
|
||
},
|
||
tiles: {
|
||
type: "array",
|
||
value: "string",
|
||
doc: "An array of one or more tile source URLs, as in the TileJSON spec."
|
||
},
|
||
bounds: {
|
||
type: "array",
|
||
value: "number",
|
||
length: 4,
|
||
default: [-180, -85.051129, 180, 85.051129],
|
||
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
||
},
|
||
scheme: {
|
||
type: "enum",
|
||
values: {xyz: {doc: "Slippy map tilenames scheme."}, tms: {doc: "OSGeo spec scheme."}},
|
||
default: "xyz",
|
||
doc: "Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."
|
||
},
|
||
minzoom: {
|
||
type: "number",
|
||
default: 0,
|
||
doc: "Minimum zoom level for which tiles are available, as in the TileJSON spec."
|
||
},
|
||
maxzoom: {
|
||
type: "number",
|
||
default: 22,
|
||
doc: "Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."
|
||
},
|
||
attribution: {
|
||
type: "string",
|
||
doc: "Contains an attribution to be displayed when the map is shown to a user."
|
||
},
|
||
"*": {type: "*", doc: "Other keys to configure the data source."}
|
||
},
|
||
source_raster: {
|
||
type: {
|
||
required: !0,
|
||
type: "enum",
|
||
values: {raster: {doc: "A raster tile source."}},
|
||
doc: "The type of the source."
|
||
},
|
||
url: {
|
||
type: "string",
|
||
doc: "A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."
|
||
},
|
||
tiles: {
|
||
type: "array",
|
||
value: "string",
|
||
doc: "An array of one or more tile source URLs, as in the TileJSON spec."
|
||
},
|
||
bounds: {
|
||
type: "array",
|
||
value: "number",
|
||
length: 4,
|
||
default: [-180, -85.051129, 180, 85.051129],
|
||
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
||
},
|
||
minzoom: {
|
||
type: "number",
|
||
default: 0,
|
||
doc: "Minimum zoom level for which tiles are available, as in the TileJSON spec."
|
||
},
|
||
maxzoom: {
|
||
type: "number",
|
||
default: 22,
|
||
doc: "Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."
|
||
},
|
||
tileSize: {
|
||
type: "number",
|
||
default: 512,
|
||
units: "pixels",
|
||
doc: "The minimum visual size to display tiles for this layer. Only configurable for raster layers."
|
||
},
|
||
scheme: {
|
||
type: "enum",
|
||
values: {xyz: {doc: "Slippy map tilenames scheme."}, tms: {doc: "OSGeo spec scheme."}},
|
||
default: "xyz",
|
||
doc: "Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."
|
||
},
|
||
attribution: {
|
||
type: "string",
|
||
doc: "Contains an attribution to be displayed when the map is shown to a user."
|
||
},
|
||
"*": {type: "*", doc: "Other keys to configure the data source."}
|
||
},
|
||
source_raster_dem: {
|
||
type: {
|
||
required: !0,
|
||
type: "enum",
|
||
values: {"raster-dem": {doc: "A RGB-encoded raster DEM source"}},
|
||
doc: "The type of the source."
|
||
},
|
||
url: {
|
||
type: "string",
|
||
doc: "A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."
|
||
},
|
||
tiles: {
|
||
type: "array",
|
||
value: "string",
|
||
doc: "An array of one or more tile source URLs, as in the TileJSON spec."
|
||
},
|
||
bounds: {
|
||
type: "array",
|
||
value: "number",
|
||
length: 4,
|
||
default: [-180, -85.051129, 180, 85.051129],
|
||
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
||
},
|
||
minzoom: {
|
||
type: "number",
|
||
default: 0,
|
||
doc: "Minimum zoom level for which tiles are available, as in the TileJSON spec."
|
||
},
|
||
maxzoom: {
|
||
type: "number",
|
||
default: 22,
|
||
doc: "Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."
|
||
},
|
||
tileSize: {
|
||
type: "number",
|
||
default: 512,
|
||
units: "pixels",
|
||
doc: "The minimum visual size to display tiles for this layer. Only configurable for raster layers."
|
||
},
|
||
attribution: {
|
||
type: "string",
|
||
doc: "Contains an attribution to be displayed when the map is shown to a user."
|
||
},
|
||
encoding: {
|
||
type: "enum",
|
||
values: {
|
||
terrarium: {doc: "Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},
|
||
mapbox: {doc: "Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}
|
||
},
|
||
default: "mapbox",
|
||
doc: "The encoding used by this source. Mapbox Terrain RGB is used by default"
|
||
},
|
||
"*": {type: "*", doc: "Other keys to configure the data source."}
|
||
},
|
||
source_geojson: {
|
||
type: {
|
||
required: !0,
|
||
type: "enum",
|
||
values: {geojson: {doc: "A GeoJSON data source."}},
|
||
doc: "The data type of the GeoJSON source."
|
||
},
|
||
data: {type: "*", doc: "A URL to a GeoJSON file, or inline GeoJSON."},
|
||
maxzoom: {
|
||
type: "number",
|
||
default: 18,
|
||
doc: "Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."
|
||
},
|
||
attribution: {
|
||
type: "string",
|
||
doc: "Contains an attribution to be displayed when the map is shown to a user."
|
||
},
|
||
buffer: {
|
||
type: "number",
|
||
default: 128,
|
||
maximum: 512,
|
||
minimum: 0,
|
||
doc: "Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."
|
||
},
|
||
tolerance: {
|
||
type: "number",
|
||
default: .375,
|
||
doc: "Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."
|
||
},
|
||
cluster: {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"
|
||
},
|
||
clusterRadius: {
|
||
type: "number",
|
||
default: 50,
|
||
minimum: 0,
|
||
doc: "Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."
|
||
},
|
||
clusterMaxZoom: {
|
||
type: "number",
|
||
doc: "Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered)."
|
||
},
|
||
clusterProperties: {
|
||
type: "*",
|
||
doc: 'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'
|
||
},
|
||
lineMetrics: {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."
|
||
},
|
||
generateId: {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."
|
||
}
|
||
},
|
||
source_video: {
|
||
type: {
|
||
required: !0,
|
||
type: "enum",
|
||
values: {video: {doc: "A video data source."}},
|
||
doc: "The data type of the video source."
|
||
},
|
||
urls: {
|
||
required: !0,
|
||
type: "array",
|
||
value: "string",
|
||
doc: "URLs to video content in order of preferred format."
|
||
},
|
||
coordinates: {
|
||
required: !0,
|
||
doc: "Corners of video specified in longitude, latitude pairs.",
|
||
type: "array",
|
||
length: 4,
|
||
value: {type: "array", length: 2, value: "number", doc: "A single longitude, latitude pair."}
|
||
}
|
||
},
|
||
source_image: {
|
||
type: {
|
||
required: !0,
|
||
type: "enum",
|
||
values: {image: {doc: "An image data source."}},
|
||
doc: "The data type of the image source."
|
||
},
|
||
url: {required: !0, type: "string", doc: "URL that points to an image."},
|
||
coordinates: {
|
||
required: !0,
|
||
doc: "Corners of image specified in longitude, latitude pairs.",
|
||
type: "array",
|
||
length: 4,
|
||
value: {type: "array", length: 2, value: "number", doc: "A single longitude, latitude pair."}
|
||
}
|
||
},
|
||
layer: {
|
||
id: {type: "string", doc: "Unique layer name.", required: !0},
|
||
type: {
|
||
type: "enum", values: {
|
||
fill: {
|
||
doc: "A filled polygon with an optional stroked border.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
}
|
||
},
|
||
line: {
|
||
doc: "A stroked line.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
}
|
||
},
|
||
symbol: {
|
||
doc: "An icon or a text label.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
}
|
||
},
|
||
circle: {
|
||
doc: "A filled circle.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
}
|
||
},
|
||
heatmap: {
|
||
doc: "A heatmap.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"fill-extrusion": {
|
||
doc: "An extruded (3D) polygon.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}
|
||
}
|
||
},
|
||
raster: {
|
||
doc: "Raster map textures such as satellite imagery.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
}
|
||
},
|
||
hillshade: {
|
||
doc: "Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
background: {
|
||
doc: "The background color or pattern of the map.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
}
|
||
}
|
||
}, doc: "Rendering type of this layer.", required: !0
|
||
},
|
||
metadata: {
|
||
type: "*",
|
||
doc: "Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."
|
||
},
|
||
source: {
|
||
type: "string",
|
||
doc: "Name of a source description to be used for this layer. Required for all layer types except `background`."
|
||
},
|
||
"source-layer": {
|
||
type: "string",
|
||
doc: "Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."
|
||
},
|
||
minzoom: {
|
||
type: "number",
|
||
minimum: 0,
|
||
maximum: 24,
|
||
doc: "The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."
|
||
},
|
||
maxzoom: {
|
||
type: "number",
|
||
minimum: 0,
|
||
maximum: 24,
|
||
doc: "The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."
|
||
},
|
||
filter: {
|
||
type: "filter",
|
||
doc: "A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."
|
||
},
|
||
layout: {type: "layout", doc: "Layout properties for the layer."},
|
||
paint: {type: "paint", doc: "Default paint properties for this layer."}
|
||
},
|
||
layout: ["layout_fill", "layout_line", "layout_circle", "layout_heatmap", "layout_fill-extrusion", "layout_symbol", "layout_raster", "layout_hillshade", "layout_background"],
|
||
layout_background: {
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
layout_fill: {
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
layout_circle: {
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
layout_heatmap: {
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
"layout_fill-extrusion": {
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
layout_line: {
|
||
"line-cap": {
|
||
type: "enum",
|
||
values: {
|
||
butt: {doc: "A cap with a squared-off end which is drawn to the exact endpoint of the line."},
|
||
round: {doc: "A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},
|
||
square: {doc: "A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}
|
||
},
|
||
default: "butt",
|
||
doc: "The display of line endings.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"line-join": {
|
||
type: "enum",
|
||
values: {
|
||
bevel: {doc: "A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},
|
||
round: {doc: "A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},
|
||
miter: {doc: "A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}
|
||
},
|
||
default: "miter",
|
||
doc: "The display of lines when joining.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.40.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"line-miter-limit": {
|
||
type: "number",
|
||
default: 2,
|
||
doc: "Used to automatically convert miter joins to bevel joins for sharp angles.",
|
||
requires: [{"line-join": "miter"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"line-round-limit": {
|
||
type: "number",
|
||
default: 1.05,
|
||
doc: "Used to automatically convert round joins to miter joins for shallow angles.",
|
||
requires: [{"line-join": "round"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
layout_symbol: {
|
||
"symbol-placement": {
|
||
type: "enum",
|
||
values: {
|
||
point: {doc: "The label is placed at the point where the geometry is located."},
|
||
line: {doc: "The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},
|
||
"line-center": {doc: "The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}
|
||
},
|
||
default: "point",
|
||
doc: "Label placement relative to its geometry.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
},
|
||
"`line-center` value": {js: "0.47.0", android: "6.4.0", ios: "4.3.0", macos: "0.10.0"},
|
||
"data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"symbol-spacing": {
|
||
type: "number",
|
||
default: 250,
|
||
minimum: 1,
|
||
units: "pixels",
|
||
doc: "Distance between two symbol anchors.",
|
||
requires: [{"symbol-placement": "line"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"symbol-avoid-edges": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"symbol-sort-key": {
|
||
type: "number",
|
||
doc: "Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key when they overlap. Features with a lower sort key will have priority over other features when doing placement.",
|
||
"sdk-support": {js: "0.53.0"},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"symbol-z-order": {
|
||
type: "enum",
|
||
values: {
|
||
auto: {doc: "If `symbol-sort-key` is set, sort based on that. Otherwise sort symbols by their position relative to the viewport."},
|
||
"viewport-y": {doc: "Symbols will be sorted by their y-position relative to the viewport."},
|
||
source: {doc: "Symbols will be rendered in the same order as the source data with no sorting applied."}
|
||
},
|
||
default: "auto",
|
||
doc: "Controls the order in which overlapping symbols in the same layer are rendered",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.49.0",
|
||
android: "6.6.0",
|
||
ios: "4.5.0",
|
||
macos: "0.12.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-allow-overlap": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, the icon will be visible even if it collides with other previously drawn symbols.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-ignore-placement": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, other symbols can be visible even if they collide with the icon.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-optional": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",
|
||
requires: ["icon-image", "text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-rotation-alignment": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},
|
||
viewport: {doc: "Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},
|
||
auto: {doc: "When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}
|
||
},
|
||
default: "auto",
|
||
doc: "In combination with `symbol-placement`, determines the rotation behavior of icons.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
},
|
||
"`auto` value": {js: "0.25.0", android: "4.2.0", ios: "3.4.0", macos: "0.3.0"},
|
||
"data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-size": {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
units: "factor of the original icon size",
|
||
doc: "Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-text-fit": {
|
||
type: "enum",
|
||
values: {
|
||
none: {doc: "The icon is displayed at its intrinsic aspect ratio."},
|
||
width: {doc: "The icon is scaled in the x-dimension to fit the width of the text."},
|
||
height: {doc: "The icon is scaled in the y-dimension to fit the height of the text."},
|
||
both: {doc: "The icon is scaled in both x- and y-dimensions."}
|
||
},
|
||
default: "none",
|
||
doc: "Scales the icon to fit around the associated text.",
|
||
requires: ["icon-image", "text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.21.0",
|
||
android: "4.2.0",
|
||
ios: "3.4.0",
|
||
macos: "0.2.1"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-text-fit-padding": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 4,
|
||
default: [0, 0, 0, 0],
|
||
units: "pixels",
|
||
doc: "Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",
|
||
requires: ["icon-image", "text-field", {"icon-text-fit": ["both", "width", "height"]}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.21.0",
|
||
android: "4.2.0",
|
||
ios: "3.4.0",
|
||
macos: "0.2.1"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-image": {
|
||
type: "string",
|
||
doc: "Name of image in sprite to use for drawing an image background.",
|
||
tokens: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-rotate": {
|
||
type: "number",
|
||
default: 0,
|
||
period: 360,
|
||
units: "degrees",
|
||
doc: "Rotates the icon clockwise.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.21.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-padding": {
|
||
type: "number",
|
||
default: 2,
|
||
minimum: 0,
|
||
units: "pixels",
|
||
doc: "Size of the additional area around the icon bounding box used for detecting symbol collisions.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-keep-upright": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, the icon may be flipped to prevent it from being rendered upside-down.",
|
||
requires: ["icon-image", {"icon-rotation-alignment": "map"}, {"symbol-placement": ["line", "line-center"]}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-offset": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 2,
|
||
default: [0, 0],
|
||
doc: "Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
center: {doc: "The center of the icon is placed closest to the anchor."},
|
||
left: {doc: "The left side of the icon is placed closest to the anchor."},
|
||
right: {doc: "The right side of the icon is placed closest to the anchor."},
|
||
top: {doc: "The top of the icon is placed closest to the anchor."},
|
||
bottom: {doc: "The bottom of the icon is placed closest to the anchor."},
|
||
"top-left": {doc: "The top left corner of the icon is placed closest to the anchor."},
|
||
"top-right": {doc: "The top right corner of the icon is placed closest to the anchor."},
|
||
"bottom-left": {doc: "The bottom left corner of the icon is placed closest to the anchor."},
|
||
"bottom-right": {doc: "The bottom right corner of the icon is placed closest to the anchor."}
|
||
},
|
||
default: "center",
|
||
doc: "Part of the icon placed closest to the anchor.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.40.0",
|
||
android: "5.2.0",
|
||
ios: "3.7.0",
|
||
macos: "0.6.0"
|
||
}, "data-driven styling": {js: "0.40.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-pitch-alignment": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The icon is aligned to the plane of the map."},
|
||
viewport: {doc: "The icon is aligned to the plane of the viewport."},
|
||
auto: {doc: "Automatically matches the value of `icon-rotation-alignment`."}
|
||
},
|
||
default: "auto",
|
||
doc: "Orientation of icon when map is pitched.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.39.0",
|
||
android: "5.2.0",
|
||
ios: "3.7.0",
|
||
macos: "0.6.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-pitch-alignment": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The text is aligned to the plane of the map."},
|
||
viewport: {doc: "The text is aligned to the plane of the viewport."},
|
||
auto: {doc: "Automatically matches the value of `text-rotation-alignment`."}
|
||
},
|
||
default: "auto",
|
||
doc: "Orientation of text when map is pitched.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.21.0",
|
||
android: "4.2.0",
|
||
ios: "3.4.0",
|
||
macos: "0.2.1"
|
||
},
|
||
"`auto` value": {js: "0.25.0", android: "4.2.0", ios: "3.4.0", macos: "0.3.0"},
|
||
"data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-rotation-alignment": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},
|
||
viewport: {doc: "Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},
|
||
auto: {doc: "When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}
|
||
},
|
||
default: "auto",
|
||
doc: "In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
},
|
||
"`auto` value": {js: "0.25.0", android: "4.2.0", ios: "3.4.0", macos: "0.3.0"},
|
||
"data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-field": {
|
||
type: "formatted",
|
||
default: "",
|
||
tokens: !0,
|
||
doc: "Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-font": {
|
||
type: "array",
|
||
value: "string",
|
||
default: ["Open Sans Regular", "Arial Unicode MS Regular"],
|
||
doc: "Font stack to use for displaying text.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.43.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-size": {
|
||
type: "number",
|
||
default: 16,
|
||
minimum: 0,
|
||
units: "pixels",
|
||
doc: "Font size.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-max-width": {
|
||
type: "number",
|
||
default: 10,
|
||
minimum: 0,
|
||
units: "ems",
|
||
doc: "The maximum line width for text wrapping.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.40.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-line-height": {
|
||
type: "number",
|
||
default: 1.2,
|
||
units: "ems",
|
||
doc: "Text leading value for multi-line text.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-letter-spacing": {
|
||
type: "number",
|
||
default: 0,
|
||
units: "ems",
|
||
doc: "Text tracking amount.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.40.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-justify": {
|
||
type: "enum",
|
||
values: {
|
||
auto: {doc: "The text is aligned towards the anchor position."},
|
||
left: {doc: "The text is aligned to the left."},
|
||
center: {doc: "The text is centered."},
|
||
right: {doc: "The text is aligned to the right."}
|
||
},
|
||
default: "center",
|
||
doc: "Text justification options.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
},
|
||
"data-driven styling": {js: "0.39.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"},
|
||
auto: {
|
||
js: "next",
|
||
android: "Not yet supported",
|
||
ios: "Not yet supported",
|
||
macos: "Not yet supported"
|
||
}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-radial-offset": {
|
||
type: "number",
|
||
units: "ems",
|
||
default: 0,
|
||
doc: "Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which doesn't support the two-dimensional `text-offset`.",
|
||
requires: [{"!": "text-offset"}],
|
||
"property-type": "data-driven",
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]}
|
||
},
|
||
"text-variable-anchor": {
|
||
type: "array",
|
||
value: "enum",
|
||
values: {
|
||
center: {doc: "The center of the text is placed closest to the anchor."},
|
||
left: {doc: "The left side of the text is placed closest to the anchor."},
|
||
right: {doc: "The right side of the text is placed closest to the anchor."},
|
||
top: {doc: "The top of the text is placed closest to the anchor."},
|
||
bottom: {doc: "The bottom of the text is placed closest to the anchor."},
|
||
"top-left": {doc: "The top left corner of the text is placed closest to the anchor."},
|
||
"top-right": {doc: "The top right corner of the text is placed closest to the anchor."},
|
||
"bottom-left": {doc: "The bottom left corner of the text is placed closest to the anchor."},
|
||
"bottom-right": {doc: "The bottom right corner of the text is placed closest to the anchor."}
|
||
},
|
||
requires: [{"!": "text-anchor"}, {"!": "text-offset"}, {"symbol-placement": ["point"]}],
|
||
doc: "To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the render will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` instead of the two-dimensional `text-offset`.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "next",
|
||
android: "Not yet supported",
|
||
ios: "Not yet supported",
|
||
macos: "Not yet supported"
|
||
},
|
||
"data-driven styling": {
|
||
js: "Not yet supported",
|
||
android: "Not yet supported",
|
||
ios: "Not yet supported",
|
||
macos: "Not yet supported"
|
||
}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-anchor": {
|
||
type: "enum",
|
||
requires: ["text-field"],
|
||
values: {
|
||
center: {doc: "The center of the text is placed closest to the anchor."},
|
||
left: {doc: "The left side of the text is placed closest to the anchor."},
|
||
right: {doc: "The right side of the text is placed closest to the anchor."},
|
||
top: {doc: "The top of the text is placed closest to the anchor."},
|
||
bottom: {doc: "The bottom of the text is placed closest to the anchor."},
|
||
"top-left": {doc: "The top left corner of the text is placed closest to the anchor."},
|
||
"top-right": {doc: "The top right corner of the text is placed closest to the anchor."},
|
||
"bottom-left": {doc: "The bottom left corner of the text is placed closest to the anchor."},
|
||
"bottom-right": {doc: "The bottom right corner of the text is placed closest to the anchor."}
|
||
},
|
||
default: "center",
|
||
doc: "Part of the text placed closest to the anchor.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.39.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-max-angle": {
|
||
type: "number",
|
||
default: 45,
|
||
units: "degrees",
|
||
doc: "Maximum angle change between adjacent characters.",
|
||
requires: ["text-field", {"symbol-placement": ["line", "line-center"]}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-rotate": {
|
||
type: "number",
|
||
default: 0,
|
||
period: 360,
|
||
units: "degrees",
|
||
doc: "Rotates the text clockwise.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-padding": {
|
||
type: "number",
|
||
default: 2,
|
||
minimum: 0,
|
||
units: "pixels",
|
||
doc: "Size of the additional area around the text bounding box used for detecting symbol collisions.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-keep-upright": {
|
||
type: "boolean",
|
||
default: !0,
|
||
doc: "If true, the text may be flipped vertically to prevent it from being rendered upside-down.",
|
||
requires: ["text-field", {"text-rotation-alignment": "map"}, {"symbol-placement": ["line", "line-center"]}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-transform": {
|
||
type: "enum",
|
||
values: {
|
||
none: {doc: "The text is not altered."},
|
||
uppercase: {doc: "Forces all letters to be displayed in uppercase."},
|
||
lowercase: {doc: "Forces all letters to be displayed in lowercase."}
|
||
},
|
||
default: "none",
|
||
doc: "Specifies how to capitalize text, similar to the CSS `text-transform` property.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-offset": {
|
||
type: "array",
|
||
doc: "Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.",
|
||
value: "number",
|
||
units: "ems",
|
||
length: 2,
|
||
default: [0, 0],
|
||
requires: ["text-field", {"!": "text-radial-offset"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-allow-overlap": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, the text will be visible even if it collides with other previously drawn symbols.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-ignore-placement": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, other symbols can be visible even if they collide with the text.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-optional": {
|
||
type: "boolean",
|
||
default: !1,
|
||
doc: "If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",
|
||
requires: ["text-field", "icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
layout_raster: {
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
layout_hillshade: {
|
||
visibility: {
|
||
type: "enum",
|
||
values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
|
||
default: "visible",
|
||
doc: "Whether this layer is displayed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
"property-type": "constant"
|
||
}
|
||
},
|
||
filter: {type: "array", value: "*", doc: "A filter selects specific features from a layer."},
|
||
filter_operator: {
|
||
type: "enum",
|
||
values: {
|
||
"==": {doc: '`["==", key, value]` equality: `feature[key] = value`'},
|
||
"!=": {doc: '`["!=", key, value]` inequality: `feature[key] ≠ value`'},
|
||
">": {doc: '`[">", key, value]` greater than: `feature[key] > value`'},
|
||
">=": {doc: '`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},
|
||
"<": {doc: '`["<", key, value]` less than: `feature[key] < value`'},
|
||
"<=": {doc: '`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},
|
||
in: {doc: '`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},
|
||
"!in": {doc: '`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},
|
||
all: {doc: '`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},
|
||
any: {doc: '`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},
|
||
none: {doc: '`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},
|
||
has: {doc: '`["has", key]` `feature[key]` exists'},
|
||
"!has": {doc: '`["!has", key]` `feature[key]` does not exist'}
|
||
},
|
||
doc: "The filter operator."
|
||
},
|
||
geometry_type: {
|
||
type: "enum",
|
||
values: {
|
||
Point: {doc: "Filter to point geometries."},
|
||
LineString: {doc: "Filter to line geometries."},
|
||
Polygon: {doc: "Filter to polygon geometries."}
|
||
},
|
||
doc: "The geometry type for the filter to select."
|
||
},
|
||
function: {
|
||
expression: {type: "expression", doc: "An expression."},
|
||
stops: {type: "array", doc: "An array of stops.", value: "function_stop"},
|
||
base: {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
doc: "The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."
|
||
},
|
||
property: {
|
||
type: "string",
|
||
doc: "The name of a feature property to use as the function input.",
|
||
default: "$zoom"
|
||
},
|
||
type: {
|
||
type: "enum",
|
||
values: {
|
||
identity: {doc: "Return the input value as the output value."},
|
||
exponential: {doc: "Generate an output by interpolating between stops just less than and just greater than the function input."},
|
||
interval: {doc: "Return the output value of the stop just less than the function input."},
|
||
categorical: {doc: "Return the output value of the stop equal to the function input."}
|
||
},
|
||
doc: "The interpolation strategy to use in function evaluation.",
|
||
default: "exponential"
|
||
},
|
||
colorSpace: {
|
||
type: "enum",
|
||
values: {
|
||
rgb: {doc: "Use the RGB color space to interpolate color values"},
|
||
lab: {doc: "Use the LAB color space to interpolate color values."},
|
||
hcl: {doc: "Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}
|
||
},
|
||
doc: "The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",
|
||
default: "rgb"
|
||
},
|
||
default: {
|
||
type: "*",
|
||
required: !1,
|
||
doc: "A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."
|
||
}
|
||
},
|
||
function_stop: {
|
||
type: "array",
|
||
minimum: 0,
|
||
maximum: 22,
|
||
value: ["number", "color"],
|
||
length: 2,
|
||
doc: "Zoom level and value pair."
|
||
},
|
||
expression: {
|
||
type: "array",
|
||
value: "*",
|
||
minimum: 1,
|
||
doc: "An expression defines a function that can be used for data-driven style properties or feature filters."
|
||
},
|
||
expression_name: {
|
||
doc: "", type: "enum", values: {
|
||
let: {
|
||
doc: 'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',
|
||
group: "Variable binding",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
var: {
|
||
doc: 'References variable bound using "let".',
|
||
group: "Variable binding",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
literal: {
|
||
doc: "Provides a literal array or object value.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
array: {
|
||
doc: "Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
at: {
|
||
doc: "Retrieves an item from an array.",
|
||
group: "Lookup",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
case: {
|
||
doc: "Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
match: {
|
||
doc: 'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n * a single literal value; or\n * an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the deprecated `"in"` operator.\n\nEach label must be unique. If the input type does not match the type of the labels, the result will be the fallback value.',
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
coalesce: {
|
||
doc: "Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
step: {
|
||
doc: 'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first input if the input is less than the first stop.',
|
||
group: "Ramps, scales, curves",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.42.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
interpolate: {
|
||
doc: 'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: interpolates using the cubic bezier curve defined by the given control points.',
|
||
group: "Ramps, scales, curves",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.42.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"interpolate-hcl": {
|
||
doc: 'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',
|
||
group: "Ramps, scales, curves",
|
||
"sdk-support": {"basic functionality": {js: "0.49.0"}}
|
||
},
|
||
"interpolate-lab": {
|
||
doc: 'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',
|
||
group: "Ramps, scales, curves",
|
||
"sdk-support": {"basic functionality": {js: "0.49.0"}}
|
||
},
|
||
ln2: {
|
||
doc: "Returns mathematical constant ln(2).",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
pi: {
|
||
doc: "Returns the mathematical constant pi.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
e: {
|
||
doc: "Returns the mathematical constant e.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
typeof: {
|
||
doc: "Returns a string describing the type of the given value.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
string: {
|
||
doc: "Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
number: {
|
||
doc: "Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
boolean: {
|
||
doc: "Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
object: {
|
||
doc: "Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
collator: {
|
||
doc: "Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.5.0",
|
||
ios: "4.2.0",
|
||
macos: "0.9.0"
|
||
}
|
||
}
|
||
},
|
||
format: {
|
||
doc: "Returns `formatted` text containing annotations for use in mixed-format `text-field` entries. If set, the `text-font` argument overrides the font specified by the root layout properties. If set, the `font-scale` argument specifies a scaling factor relative to the `text-size` specified in the root layout properties.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.48.0",
|
||
android: "6.7.0",
|
||
ios: "4.6.0",
|
||
macos: "0.12.0"
|
||
}
|
||
}
|
||
},
|
||
"number-format": {
|
||
doc: "Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",
|
||
group: "Types",
|
||
"sdk-support": {"basic functionality": {js: "0.54.0"}}
|
||
},
|
||
"to-string": {
|
||
doc: 'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"to-number": {
|
||
doc: 'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"to-boolean": {
|
||
doc: "Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"to-rgba": {
|
||
doc: "Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",
|
||
group: "Color",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"to-color": {
|
||
doc: "Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",
|
||
group: "Types",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
rgb: {
|
||
doc: "Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",
|
||
group: "Color",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
rgba: {
|
||
doc: "Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",
|
||
group: "Color",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
get: {
|
||
doc: "Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",
|
||
group: "Lookup",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
has: {
|
||
doc: "Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",
|
||
group: "Lookup",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
length: {
|
||
doc: "Gets the length of an array or string.",
|
||
group: "Lookup",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
properties: {
|
||
doc: 'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',
|
||
group: "Feature data",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"feature-state": {
|
||
doc: "Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",
|
||
group: "Feature data",
|
||
"sdk-support": {"basic functionality": {js: "0.46.0"}}
|
||
},
|
||
"geometry-type": {
|
||
doc: "Gets the feature's geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.",
|
||
group: "Feature data",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
id: {
|
||
doc: "Gets the feature's id, if it has one.",
|
||
group: "Feature data",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
zoom: {
|
||
doc: 'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',
|
||
group: "Zoom",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"heatmap-density": {
|
||
doc: "Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",
|
||
group: "Heatmap",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"line-progress": {
|
||
doc: "Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",
|
||
group: "Feature data",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.5.0",
|
||
ios: "4.6.0",
|
||
macos: "0.12.0"
|
||
}
|
||
}
|
||
},
|
||
accumulated: {
|
||
doc: "Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",
|
||
group: "Feature data",
|
||
"sdk-support": {"basic functionality": {js: "0.53.0"}}
|
||
},
|
||
"+": {
|
||
doc: "Returns the sum of the inputs.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"*": {
|
||
doc: "Returns the product of the inputs.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"-": {
|
||
doc: "For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"/": {
|
||
doc: "Returns the result of floating point division of the first input by the second.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"%": {
|
||
doc: "Returns the remainder after integer division of the first input by the second.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"^": {
|
||
doc: "Returns the result of raising the first input to the power specified by the second.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
sqrt: {
|
||
doc: "Returns the square root of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.42.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
log10: {
|
||
doc: "Returns the base-ten logarithm of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
ln: {
|
||
doc: "Returns the natural logarithm of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
log2: {
|
||
doc: "Returns the base-two logarithm of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
sin: {
|
||
doc: "Returns the sine of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
cos: {
|
||
doc: "Returns the cosine of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
tan: {
|
||
doc: "Returns the tangent of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
asin: {
|
||
doc: "Returns the arcsine of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
acos: {
|
||
doc: "Returns the arccosine of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
atan: {
|
||
doc: "Returns the arctangent of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
min: {
|
||
doc: "Returns the minimum value of the inputs.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
max: {
|
||
doc: "Returns the maximum value of the inputs.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
round: {
|
||
doc: 'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
abs: {
|
||
doc: "Returns the absolute value of the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
ceil: {
|
||
doc: "Returns the smallest integer that is greater than or equal to the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
floor: {
|
||
doc: "Returns the largest integer that is less than or equal to the input.",
|
||
group: "Math",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"==": {
|
||
doc: "Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
|
||
}
|
||
},
|
||
"!=": {
|
||
doc: "Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
|
||
}
|
||
},
|
||
">": {
|
||
doc: "Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
|
||
}
|
||
},
|
||
"<": {
|
||
doc: "Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
|
||
}
|
||
},
|
||
">=": {
|
||
doc: "Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
|
||
}
|
||
},
|
||
"<=": {
|
||
doc: "Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
|
||
}
|
||
},
|
||
all: {
|
||
doc: "Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
any: {
|
||
doc: "Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"!": {
|
||
doc: "Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",
|
||
group: "Decision",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"is-supported-script": {
|
||
doc: "Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",
|
||
group: "String"
|
||
},
|
||
upcase: {
|
||
doc: "Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",
|
||
group: "String",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
downcase: {
|
||
doc: "Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",
|
||
group: "String",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
concat: {
|
||
doc: "Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",
|
||
group: "String",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}
|
||
}
|
||
},
|
||
"resolved-locale": {
|
||
doc: "Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",
|
||
group: "String",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.5.0",
|
||
ios: "4.2.0",
|
||
macos: "0.9.0"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
light: {
|
||
anchor: {
|
||
type: "enum",
|
||
default: "viewport",
|
||
values: {
|
||
map: {doc: "The position of the light source is aligned to the rotation of the map."},
|
||
viewport: {doc: "The position of the light source is aligned to the rotation of the viewport."}
|
||
},
|
||
"property-type": "data-constant",
|
||
transition: !1,
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
doc: "Whether extruded geometries are lit relative to the map or viewport.",
|
||
example: "map",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}
|
||
}
|
||
},
|
||
position: {
|
||
type: "array",
|
||
default: [1.15, 210, 30],
|
||
length: 3,
|
||
value: "number",
|
||
"property-type": "data-constant",
|
||
transition: !0,
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
doc: "Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",
|
||
example: [1.5, 90, 80],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}
|
||
}
|
||
},
|
||
color: {
|
||
type: "color",
|
||
"property-type": "data-constant",
|
||
default: "#ffffff",
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
transition: !0,
|
||
doc: "Color tint for lighting extruded geometries.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}
|
||
}
|
||
},
|
||
intensity: {
|
||
type: "number",
|
||
"property-type": "data-constant",
|
||
default: .5,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
transition: !0,
|
||
doc: "Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
paint: ["paint_fill", "paint_line", "paint_circle", "paint_heatmap", "paint_fill-extrusion", "paint_symbol", "paint_raster", "paint_hillshade", "paint_background"],
|
||
paint_fill: {
|
||
"fill-antialias": {
|
||
type: "boolean",
|
||
default: !0,
|
||
doc: "Whether or not the fill should be antialiased.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"fill-opacity": {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
doc: "The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.21.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"fill-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
doc: "The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",
|
||
transition: !0,
|
||
requires: [{"!": "fill-pattern"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.19.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"fill-outline-color": {
|
||
type: "color",
|
||
doc: "The outline color of the fill. Matches the value of `fill-color` if unspecified.",
|
||
transition: !0,
|
||
requires: [{"!": "fill-pattern"}, {"fill-antialias": !0}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.19.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"fill-translate": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 2,
|
||
default: [0, 0],
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"fill-translate-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The fill is translated relative to the map."},
|
||
viewport: {doc: "The fill is translated relative to the viewport."}
|
||
},
|
||
doc: "Controls the frame of reference for `fill-translate`.",
|
||
default: "map",
|
||
requires: ["fill-translate"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"fill-pattern": {
|
||
type: "string",
|
||
transition: !0,
|
||
doc: "Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.49.0", android: "6.5.0", macos: "0.11.0", ios: "4.4.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "cross-faded-data-driven"
|
||
}
|
||
},
|
||
"paint_fill-extrusion": {
|
||
"fill-extrusion-opacity": {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
doc: "The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"fill-extrusion-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
doc: "The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",
|
||
transition: !0,
|
||
requires: [{"!": "fill-extrusion-pattern"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}, "data-driven styling": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"fill-extrusion-translate": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 2,
|
||
default: [0, 0],
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"fill-extrusion-translate-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The fill extrusion is translated relative to the map."},
|
||
viewport: {doc: "The fill extrusion is translated relative to the viewport."}
|
||
},
|
||
doc: "Controls the frame of reference for `fill-extrusion-translate`.",
|
||
default: "map",
|
||
requires: ["fill-extrusion-translate"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"fill-extrusion-pattern": {
|
||
type: "string",
|
||
transition: !0,
|
||
doc: "Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}, "data-driven styling": {js: "0.49.0", android: "6.5.0", macos: "0.11.0", ios: "4.4.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "cross-faded-data-driven"
|
||
},
|
||
"fill-extrusion-height": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
units: "meters",
|
||
doc: "The height with which to extrude this layer.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}, "data-driven styling": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"fill-extrusion-base": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
units: "meters",
|
||
doc: "The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",
|
||
transition: !0,
|
||
requires: ["fill-extrusion-height"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.27.0",
|
||
android: "5.1.0",
|
||
ios: "3.6.0",
|
||
macos: "0.5.0"
|
||
}, "data-driven styling": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"fill-extrusion-vertical-gradient": {
|
||
type: "boolean",
|
||
default: !0,
|
||
doc: "Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",
|
||
transition: !1,
|
||
"sdk-support": {"basic functionality": {js: "0.50.0", ios: "4.7.0", macos: "0.13.0"}},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
}
|
||
},
|
||
paint_line: {
|
||
"line-opacity": {
|
||
type: "number",
|
||
doc: "The opacity at which the line will be drawn.",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"line-color": {
|
||
type: "color",
|
||
doc: "The color with which the line will be drawn.",
|
||
default: "#000000",
|
||
transition: !0,
|
||
requires: [{"!": "line-pattern"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.23.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"line-translate": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 2,
|
||
default: [0, 0],
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"line-translate-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The line is translated relative to the map."},
|
||
viewport: {doc: "The line is translated relative to the viewport."}
|
||
},
|
||
doc: "Controls the frame of reference for `line-translate`.",
|
||
default: "map",
|
||
requires: ["line-translate"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"line-width": {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Stroke thickness.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.39.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"line-gap-width": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
doc: "Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",
|
||
transition: !0,
|
||
units: "pixels",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"line-offset": {
|
||
type: "number",
|
||
default: 0,
|
||
doc: "The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",
|
||
transition: !0,
|
||
units: "pixels",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.12.1",
|
||
android: "3.0.0",
|
||
ios: "3.1.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"line-blur": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Blur applied to the line, in pixels.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"line-dasharray": {
|
||
type: "array",
|
||
value: "number",
|
||
doc: "Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "line widths",
|
||
requires: [{"!": "line-pattern"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "cross-faded"
|
||
},
|
||
"line-pattern": {
|
||
type: "string",
|
||
transition: !0,
|
||
doc: "Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.49.0", android: "6.5.0", macos: "0.11.0", ios: "4.4.0"}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom", "feature"]},
|
||
"property-type": "cross-faded-data-driven"
|
||
},
|
||
"line-gradient": {
|
||
type: "color",
|
||
doc: 'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',
|
||
transition: !1,
|
||
requires: [{"!": "line-dasharray"}, {"!": "line-pattern"}, {
|
||
source: "geojson",
|
||
has: {lineMetrics: !0}
|
||
}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.45.0",
|
||
android: "6.5.0",
|
||
ios: "4.4.0",
|
||
macos: "0.11.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["line-progress"]},
|
||
"property-type": "color-ramp"
|
||
}
|
||
},
|
||
paint_circle: {
|
||
"circle-radius": {
|
||
type: "number",
|
||
default: 5,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Circle radius.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.18.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"circle-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
doc: "The fill color of the circle.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.18.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"circle-blur": {
|
||
type: "number",
|
||
default: 0,
|
||
doc: "Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.20.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"circle-opacity": {
|
||
type: "number",
|
||
doc: "The opacity at which the circle will be drawn.",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.20.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"circle-translate": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 2,
|
||
default: [0, 0],
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"circle-translate-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The circle is translated relative to the map."},
|
||
viewport: {doc: "The circle is translated relative to the viewport."}
|
||
},
|
||
doc: "Controls the frame of reference for `circle-translate`.",
|
||
default: "map",
|
||
requires: ["circle-translate"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"circle-pitch-scale": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "Circles are scaled according to their apparent distance to the camera."},
|
||
viewport: {doc: "Circles are not scaled."}
|
||
},
|
||
default: "map",
|
||
doc: "Controls the scaling behavior of the circle when the map is pitched.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.21.0",
|
||
android: "4.2.0",
|
||
ios: "3.4.0",
|
||
macos: "0.2.1"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"circle-pitch-alignment": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The circle is aligned to the plane of the map."},
|
||
viewport: {doc: "The circle is aligned to the plane of the viewport."}
|
||
},
|
||
default: "viewport",
|
||
doc: "Orientation of circle when map is pitched.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.39.0",
|
||
android: "5.2.0",
|
||
ios: "3.7.0",
|
||
macos: "0.6.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"circle-stroke-width": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.29.0",
|
||
android: "5.0.0",
|
||
ios: "3.5.0",
|
||
macos: "0.4.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"circle-stroke-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
doc: "The stroke color of the circle.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.29.0",
|
||
android: "5.0.0",
|
||
ios: "3.5.0",
|
||
macos: "0.4.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"circle-stroke-opacity": {
|
||
type: "number",
|
||
doc: "The opacity of the circle's stroke.",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.29.0",
|
||
android: "5.0.0",
|
||
ios: "3.5.0",
|
||
macos: "0.4.0"
|
||
}, "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
}
|
||
},
|
||
paint_heatmap: {
|
||
"heatmap-radius": {
|
||
type: "number",
|
||
default: 30,
|
||
minimum: 1,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {js: "0.43.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"heatmap-weight": {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
transition: !1,
|
||
doc: "A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"heatmap-intensity": {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
transition: !0,
|
||
doc: "Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"heatmap-color": {
|
||
type: "color",
|
||
default: ["interpolate", ["linear"], ["heatmap-density"], 0, "rgba(0, 0, 255, 0)", .1, "royalblue", .3, "cyan", .5, "lime", .7, "yellow", 1, "red"],
|
||
doc: 'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',
|
||
transition: !1,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["heatmap-density"]},
|
||
"property-type": "color-ramp"
|
||
},
|
||
"heatmap-opacity": {
|
||
type: "number",
|
||
doc: "The global opacity at which the heatmap layer will be drawn.",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.41.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
}
|
||
},
|
||
paint_symbol: {
|
||
"icon-opacity": {
|
||
doc: "The opacity at which the icon will be drawn.",
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
transition: !0,
|
||
doc: "The color of the icon. This can only be used with sdf icons.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-halo-color": {
|
||
type: "color",
|
||
default: "rgba(0, 0, 0, 0)",
|
||
transition: !0,
|
||
doc: "The color of the icon's halo. Icon halos can only be used with SDF icons.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-halo-width": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Distance of halo to the icon outline.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-halo-blur": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Fade out the halo towards the outside.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"icon-translate": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 2,
|
||
default: [0, 0],
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",
|
||
requires: ["icon-image"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"icon-translate-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "Icons are translated relative to the map."},
|
||
viewport: {doc: "Icons are translated relative to the viewport."}
|
||
},
|
||
doc: "Controls the frame of reference for `icon-translate`.",
|
||
default: "map",
|
||
requires: ["icon-image", "icon-translate"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-opacity": {
|
||
type: "number",
|
||
doc: "The opacity at which the text will be drawn.",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-color": {
|
||
type: "color",
|
||
doc: "The color with which the text will be drawn.",
|
||
default: "#000000",
|
||
transition: !0,
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-halo-color": {
|
||
type: "color",
|
||
default: "rgba(0, 0, 0, 0)",
|
||
transition: !0,
|
||
doc: "The color of the text's halo, which helps it stand out from backgrounds.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-halo-width": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-halo-blur": {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "The halo's fadeout distance towards the outside.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
|
||
"property-type": "data-driven"
|
||
},
|
||
"text-translate": {
|
||
type: "array",
|
||
value: "number",
|
||
length: 2,
|
||
default: [0, 0],
|
||
transition: !0,
|
||
units: "pixels",
|
||
doc: "Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",
|
||
requires: ["text-field"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"text-translate-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The text is translated relative to the map."},
|
||
viewport: {doc: "The text is translated relative to the viewport."}
|
||
},
|
||
doc: "Controls the frame of reference for `text-translate`.",
|
||
default: "map",
|
||
requires: ["text-field", "text-translate"],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
}
|
||
},
|
||
paint_raster: {
|
||
"raster-opacity": {
|
||
type: "number",
|
||
doc: "The opacity at which the image will be drawn.",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"raster-hue-rotate": {
|
||
type: "number",
|
||
default: 0,
|
||
period: 360,
|
||
transition: !0,
|
||
units: "degrees",
|
||
doc: "Rotates hues around the color wheel.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"raster-brightness-min": {
|
||
type: "number",
|
||
doc: "Increase or reduce the brightness of the image. The value is the minimum brightness.",
|
||
default: 0,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"raster-brightness-max": {
|
||
type: "number",
|
||
doc: "Increase or reduce the brightness of the image. The value is the maximum brightness.",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"raster-saturation": {
|
||
type: "number",
|
||
doc: "Increase or reduce the saturation of the image.",
|
||
default: 0,
|
||
minimum: -1,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"raster-contrast": {
|
||
type: "number",
|
||
doc: "Increase or reduce the contrast of the image.",
|
||
default: 0,
|
||
minimum: -1,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"raster-resampling": {
|
||
type: "enum",
|
||
doc: "The resampling/interpolation method to use for overscaling, also known as texture magnification filter",
|
||
values: {
|
||
linear: {doc: "(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},
|
||
nearest: {doc: "Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}
|
||
},
|
||
default: "linear",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.47.0",
|
||
android: "6.3.0",
|
||
ios: "4.2.0",
|
||
macos: "0.9.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"raster-fade-duration": {
|
||
type: "number",
|
||
default: 300,
|
||
minimum: 0,
|
||
transition: !1,
|
||
units: "milliseconds",
|
||
doc: "Fade duration when a new tile is added.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
}
|
||
},
|
||
paint_hillshade: {
|
||
"hillshade-illumination-direction": {
|
||
type: "number",
|
||
default: 335,
|
||
minimum: 0,
|
||
maximum: 359,
|
||
doc: "The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",
|
||
transition: !1,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"hillshade-illumination-anchor": {
|
||
type: "enum",
|
||
values: {
|
||
map: {doc: "The hillshade illumination is relative to the north direction."},
|
||
viewport: {doc: "The hillshade illumination is relative to the top of the viewport."}
|
||
},
|
||
default: "viewport",
|
||
doc: "Direction of light source when map is rotated.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"hillshade-exaggeration": {
|
||
type: "number",
|
||
doc: "Intensity of the hillshade",
|
||
default: .5,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"hillshade-shadow-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
doc: "The shading color of areas that face away from the light source.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"hillshade-highlight-color": {
|
||
type: "color",
|
||
default: "#FFFFFF",
|
||
doc: "The shading color of areas that faces towards the light source.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"hillshade-accent-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
doc: "The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.43.0",
|
||
android: "6.0.0",
|
||
ios: "4.0.0",
|
||
macos: "0.7.0"
|
||
}, "data-driven styling": {}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
}
|
||
},
|
||
paint_background: {
|
||
"background-color": {
|
||
type: "color",
|
||
default: "#000000",
|
||
doc: "The color with which the background will be drawn.",
|
||
transition: !0,
|
||
requires: [{"!": "background-pattern"}],
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
},
|
||
"background-pattern": {
|
||
type: "string",
|
||
transition: !0,
|
||
doc: "Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
},
|
||
expression: {interpolated: !1, parameters: ["zoom"]},
|
||
"property-type": "cross-faded"
|
||
},
|
||
"background-opacity": {
|
||
type: "number",
|
||
default: 1,
|
||
minimum: 0,
|
||
maximum: 1,
|
||
doc: "The opacity at which the background will be drawn.",
|
||
transition: !0,
|
||
"sdk-support": {
|
||
"basic functionality": {
|
||
js: "0.10.0",
|
||
android: "2.0.1",
|
||
ios: "2.0.0",
|
||
macos: "0.1.0"
|
||
}
|
||
},
|
||
expression: {interpolated: !0, parameters: ["zoom"]},
|
||
"property-type": "data-constant"
|
||
}
|
||
},
|
||
transition: {
|
||
duration: {
|
||
type: "number",
|
||
default: 300,
|
||
minimum: 0,
|
||
units: "milliseconds",
|
||
doc: "Time allotted for transitions to complete."
|
||
},
|
||
delay: {
|
||
type: "number",
|
||
default: 0,
|
||
minimum: 0,
|
||
units: "milliseconds",
|
||
doc: "Length of time before a transition begins."
|
||
}
|
||
},
|
||
"property-type": {
|
||
"data-driven": {
|
||
type: "property-type",
|
||
doc: "Property is interpolable and can be represented using a property expression."
|
||
},
|
||
"cross-faded": {
|
||
type: "property-type",
|
||
doc: "Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."
|
||
},
|
||
"cross-faded-data-driven": {
|
||
type: "property-type",
|
||
doc: "Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."
|
||
},
|
||
"color-ramp": {
|
||
type: "property-type",
|
||
doc: "Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."
|
||
},
|
||
"data-constant": {
|
||
type: "property-type",
|
||
doc: "Property is interpolable but cannot be represented using a property expression."
|
||
},
|
||
constant: {
|
||
type: "property-type",
|
||
doc: "Property is constant across all zoom levels and property values."
|
||
}
|
||
}
|
||
}
|
||
}, function (t, e) {
|
||
(function () {
|
||
var e;
|
||
t.exports = {
|
||
icon: "icons/google.svg",
|
||
name: "google",
|
||
title: "Google Fonts",
|
||
link: "google.com/fonts",
|
||
getNames: function () {
|
||
return e
|
||
},
|
||
getLink: function (t) {
|
||
return "https://fonts.google.com/specimen/" + t.replace(/( )/g, "+")
|
||
},
|
||
normalizeName: function (t) {
|
||
return t
|
||
}
|
||
}, e = ["ABeeZee", "Abel", "Abril Fatface", "Aclonica", "Acme", "Actor", "Adamina", "Advent Pro", "Aguafina Script", "Akronim", "Aladin", "Aldrich", "Alef", "Alegreya", "Alegreya SC", "Alegreya Sans", "Alegreya Sans SC", "Alex Brush", "Alfa Slab One", "Alice", "Alike", "Alike Angular", "Allan", "Allerta", "Allerta Stencil", "Allura", "Almendra", "Almendra Display", "Almendra SC", "Amarante", "Amaranth", "Amatic SC", "Amethysta", "Amiri", "Amita", "Anaheim", "Andada", "Andika", "Angkor", "Annie Use Your Telescope", "Anonymous Pro", "Antic", "Antic Didone", "Antic Slab", "Anton", "Arapey", "Arbutus", "Arbutus Slab", "Architects Daughter", "Archivo Black", "Archivo Narrow", "Arimo", "Arizonia", "Armata", "Artifika", "Arvo", "Arya", "Asap", "Asar", "Asset", "Astloch", "Asul", "Atomic Age", "Aubrey", "Audiowide", "Autour One", "Average", "Average Sans", "Averia Gruesa Libre", "Averia Libre", "Averia Sans Libre", "Averia Serif Libre", "Bad Script", "Balthazar", "Bangers", "Basic", "Battambang", "Baumans", "Bayon", "Belgrano", "Belleza", "BenchNine", "Bentham", "Berkshire Swash", "Bevan", "Bigelow Rules", "Bigshot One", "Bilbo", "Bilbo Swash Caps", "Biryani", "Bitter", "Black Ops One", "Bokor", "Bonbon", "Boogaloo", "Bowlby One", "Bowlby One SC", "Brawler", "Bree Serif", "Bubblegum Sans", "Bubbler One", "Buda", "Buenard", "Butcherman", "Butterfly Kids", "Cabin", "Cabin Condensed", "Cabin Sketch", "Caesar Dressing", "Cagliostro", "Calligraffitti", "Cambay", "Cambo", "Candal", "Cantarell", "Cantata One", "Cantora One", "Capriola", "Cardo", "Carme", "Carrois Gothic", "Carrois Gothic SC", "Carter One", "Catamaran", "Caudex", "Caveat", "Caveat Brush", "Cedarville Cursive", "Ceviche One", "Changa One", "Chango", "Chau Philomene One", "Chela One", "Chelsea Market", "Chenla", "Cherry Cream Soda", "Cherry Swash", "Chewy", "Chicle", "Chivo", "Chonburi", "Cinzel", "Cinzel Decorative", "Clicker Script", "Coda", "Coda Caption", "Codystar", "Combo", "Comfortaa", "Coming Soon", "Concert One", "Condiment", "Content", "Contrail One", "Convergence", "Cookie", "Copse", "Corben", "Courgette", "Cousine", "Coustard", "Covered By Your Grace", "Crafty Girls", "Creepster", "Crete Round", "Crimson Text", "Croissant One", "Crushed", "Cuprum", "Cutive", "Cutive Mono", "Damion", "Dancing Script", "Dangrek", "Dawning of a New Day", "Days One", "Dekko", "Delius", "Delius Swash Caps", "Delius Unicase", "Della Respira", "Denk One", "Devonshire", "Dhurjati", "Didact Gothic", "Diplomata", "Diplomata SC", "Domine", "Donegal One", "Doppio One", "Dorsa", "Dosis", "Dr Sugiyama", "Droid Sans", "Droid Sans Mono", "Droid Serif", "Duru Sans", "Dynalight", "EB Garamond", "Eagle Lake", "Eater", "Economica", "Eczar", "Ek Mukta", "Electrolize", "Elsie", "Elsie Swash Caps", "Emblema One", "Emilys Candy", "Engagement", "Englebert", "Enriqueta", "Erica One", "Esteban", "Euphoria Script", "Ewert", "Exo", "Exo 2", "Expletus Sans", "Fanwood Text", "Fascinate", "Fascinate Inline", "Faster One", "Fasthand", "Fauna One", "Federant", "Federo", "Felipa", "Fenix", "Finger Paint", "Fira Mono", "Fira Sans", "Fjalla One", "Fjord One", "Flamenco", "Flavors", "Fondamento", "Fontdiner Swanky", "Forum", "Francois One", "Freckle Face", "Fredericka the Great", "Fredoka One", "Freehand", "Fresca", "Frijole", "Fruktur", "Fugaz One", "GFS Didot", "GFS Neohellenic", "Gabriela", "Gafata", "Galdeano", "Galindo", "Gentium Basic", "Gentium Book Basic", "Geo", "Geostar", "Geostar Fill", "Germania One", "Gidugu", "Gilda Display", "Give You Glory", "Glass Antiqua", "Glegoo", "Gloria Hallelujah", "Goblin One", "Gochi Hand", "Gorditas", "Goudy Bookletter 1911", "Graduate", "Grand Hotel", "Gravitas One", "Great Vibes", "Griffy", "Gruppo", "Gudea", "Gurajada", "Habibi", "Halant", "Hammersmith One", "Hanalei", "Hanalei Fill", "Handlee", "Hanuman", "Happy Monkey", "Headland One", "Henny Penny", "Herr Von Muellerhoff", "Hind", "Hind Siliguri", "Hind Vadodara", "Holtwood One SC", "Homemade Apple", "Homenaje", "IM Fell DW Pica", "IM Fell DW Pica SC", "IM Fell Double Pica", "IM Fell Double Pica SC", "IM Fell English", "IM Fell English SC", "IM Fell French Canon", "IM Fell French Canon SC", "IM Fell Great Primer", "IM Fell Great Primer SC", "Iceberg", "Iceland", "Imprima", "Inconsolata", "Inder", "Indie Flower", "Inika", "Inknut Antiqua", "Irish Grover", "Istok Web", "Italiana", "Italianno", "Itim", "Jacques Francois", "Jacques Francois Shadow", "Jaldi", "Jim Nightshade", "Jockey One", "Jolly Lodger", "Josefin Sans", "Josefin Slab", "Joti One", "Judson", "Julee", "Julius Sans One", "Junge", "Jura", "Just Another Hand", "Just Me Again Down Here", "Kadwa", "Kalam", "Kameron", "Kantumruy", "Karla", "Karma", "Kaushan Script", "Kavoon", "Kdam Thmor", "Keania One", "Kelly Slab", "Kenia", "Khand", "Khmer", "Khula", "Kite One", "Knewave", "Kotta One", "Koulen", "Kranky", "Kreon", "Kristi", "Krona One", "Kurale", "La Belle Aurore", "Laila", "Lakki Reddy", "Lancelot", "Lateef", "Lato", "League Script", "Leckerli One", "Ledger", "Lekton", "Lemon", "Libre Baskerville", "Life Savers", "Lilita One", "Lily Script One", "Limelight", "Linden Hill", "Lobster", "Lobster Two", "Londrina Outline", "Londrina Shadow", "Londrina Sketch", "Londrina Solid", "Lora", "Love Ya Like A Sister", "Loved by the King", "Lovers Quarrel", "Luckiest Guy", "Lusitana", "Lustria", "Macondo", "Macondo Swash Caps", "Magra", "Maiden Orange", "Mako", "Mallanna", "Mandali", "Marcellus", "Marcellus SC", "Marck Script", "Margarine", "Marko One", "Marmelad", "Martel", "Martel Sans", "Marvel", "Mate", "Mate SC", "Maven Pro", "McLaren", "Meddon", "MedievalSharp", "Medula One", "Megrim", "Meie Script", "Merienda", "Merienda One", "Merriweather", "Merriweather Sans", "Metal", "Metal Mania", "Metamorphous", "Metrophobic", "Michroma", "Milonga", "Miltonian", "Miltonian Tattoo", "Miniver", "Miss Fajardose", "Modak", "Modern Antiqua", "Molengo", "Molle", "Monda", "Monofett", "Monoton", "Monsieur La Doulaise", "Montaga", "Montez", "Montserrat", "Montserrat Alternates", "Montserrat Subrayada", "Moul", "Moulpali", "Mountains of Christmas", "Mouse Memoirs", "Mr Bedfort", "Mr Dafoe", "Mr De Haviland", "Mrs Saint Delafield", "Mrs Sheppards", "Muli", "Mystery Quest", "NTR", "Neucha", "Neuton", "New Rocker", "News Cycle", "Niconne", "Nixie One", "Nobile", "Nokora", "Norican", "Nosifer", "Nothing You Could Do", "Noticia Text", "Noto Sans", "Noto Serif", "Nova Cut", "Nova Flat", "Nova Mono", "Nova Oval", "Nova Round", "Nova Script", "Nova Slim", "Nova Square", "Numans", "Nunito", "Odor Mean Chey", "Offside", "Old Standard TT", "Oldenburg", "Oleo Script", "Oleo Script Swash Caps", "Open Sans", "Open Sans Condensed", "Oranienbaum", "Orbitron", "Oregano", "Orienta", "Original Surfer", "Oswald", "Over the Rainbow", "Overlock", "Overlock SC", "Ovo", "Oxygen", "Oxygen Mono", "PT Mono", "PT Sans", "PT Sans Caption", "PT Sans Narrow", "PT Serif", "PT Serif Caption", "Pacifico", "Palanquin", "Palanquin Dark", "Paprika", "Parisienne", "Passero One", "Passion One", "Pathway Gothic One", "Patrick Hand", "Patrick Hand SC", "Patua One", "Paytone One", "Peddana", "Peralta", "Permanent Marker", "Petit Formal Script", "Petrona", "Philosopher", "Piedra", "Pinyon Script", "Pirata One", "Plaster", "Play", "Playball", "Playfair Display", "Playfair Display SC", "Podkova", "Poiret One", "Poller One", "Poly", "Pompiere", "Pontano Sans", "Poppins", "Port Lligat Sans", "Port Lligat Slab", "Pragati Narrow", "Prata", "Preahvihear", "Press Start 2P", "Princess Sofia", "Prociono", "Prosto One", "Puritan", "Purple Purse", "Quando", "Quantico", "Quattrocento", "Quattrocento Sans", "Questrial", "Quicksand", "Quintessential", "Qwigley", "Racing Sans One", "Radley", "Rajdhani", "Raleway", "Raleway Dots", "Ramabhadra", "Ramaraja", "Rambla", "Rammetto One", "Ranchers", "Rancho", "Ranga", "Rationale", "Ravi Prakash", "Redressed", "Reenie Beanie", "Revalia", "Rhodium Libre", "Ribeye", "Ribeye Marrow", "Righteous", "Risque", "Roboto", "Roboto Condensed", "Roboto Mono", "Roboto Slab", "Rochester", "Rock Salt", "Rokkitt", "Romanesco", "Ropa Sans", "Rosario", "Rosarivo", "Rouge Script", "Rozha One", "Rubik", "Rubik Mono One", "Rubik One", "Ruda", "Rufina", "Ruge Boogie", "Ruluko", "Rum Raisin", "Ruslan Display", "Russo One", "Ruthie", "Rye", "Sacramento", "Sahitya", "Sail", "Salsa", "Sanchez", "Sancreek", "Sansita One", "Sarala", "Sarina", "Sarpanch", "Satisfy", "Scada", "Scheherazade", "Schoolbell", "Seaweed Script", "Sevillana", "Seymour One", "Shadows Into Light", "Shadows Into Light Two", "Shanti", "Share", "Share Tech", "Share Tech Mono", "Shojumaru", "Short Stack", "Siemreap", "Sigmar One", "Signika", "Signika Negative", "Simonetta", "Sintony", "Sirin Stencil", "Six Caps", "Skranji", "Slabo 13px", "Slabo 27px", "Slackey", "Smokum", "Smythe", "Sniglet", "Snippet", "Snowburst One", "Sofadi One", "Sofia", "Sonsie One", "Sorts Mill Goudy", "Source Code Pro", "Source Sans Pro", "Source Serif Pro", "Special Elite", "Spicy Rice", "Spinnaker", "Spirax", "Squada One", "Sree Krushnadevaraya", "Stalemate", "Stalinist One", "Stardos Stencil", "Stint Ultra Condensed", "Stint Ultra Expanded", "Stoke", "Strait", "Sue Ellen Francisco", "Sumana", "Sunshiney", "Supermercado One", "Sura", "Suranna", "Suravaram", "Suwannaphum", "Swanky and Moo Moo", "Syncopate", "Tangerine", "Taprom", "Tauri", "Teko", "Telex", "Tenali Ramakrishna", "Tenor Sans", "Text Me One", "The Girl Next Door", "Tienne", "Tillana", "Timmana", "Tinos", "Titan One", "Titillium Web", "Trade Winds", "Trocchi", "Trochut", "Trykker", "Tulpen One", "Ubuntu", "Ubuntu Condensed", "Ubuntu Mono", "Ultra", "Uncial Antiqua", "Underdog", "Unica One", "UnifrakturCook", "UnifrakturMaguntia", "Unkempt", "Unlock", "Unna", "VT323", "Vampiro One", "Varela", "Varela Round", "Vast Shadow", "Vesper Libre", "Vibur", "Vidaloka", "Viga", "Voces", "Volkhov", "Vollkorn", "Voltaire", "Waiting for the Sunrise", "Wallpoet", "Walter Turncoat", "Warnes", "Wellfleet", "Wendy One", "Wire One", "Work Sans", "Yanone Kaffeesatz", "Yantramanav", "Yellowtail", "Yeseva One", "Yesteryear", "Zeyada"]
|
||
}).call(this)
|
||
}, , , function (t, e, i) {
|
||
t.exports = function () {
|
||
"use strict";
|
||
|
||
function t(t, e, i) {
|
||
var r = t[e];
|
||
t[e] = t[i], t[i] = r
|
||
}
|
||
|
||
function e(t, e) {
|
||
return t < e ? -1 : t > e ? 1 : 0
|
||
}
|
||
|
||
return function (i, r, o, n, s) {
|
||
!function e(i, r, o, n, s) {
|
||
for (; n > o;) {
|
||
if (n - o > 600) {
|
||
var a = n - o + 1, l = r - o + 1, h = Math.log(a), u = .5 * Math.exp(2 * h / 3),
|
||
c = .5 * Math.sqrt(h * u * (a - u) / a) * (l - a / 2 < 0 ? -1 : 1),
|
||
p = Math.max(o, Math.floor(r - l * u / a + c)),
|
||
d = Math.min(n, Math.floor(r + (a - l) * u / a + c));
|
||
e(i, r, p, d, s)
|
||
}
|
||
var f = i[r], g = o, m = n;
|
||
for (t(i, o, r), s(i[n], f) > 0 && t(i, o, n); g < m;) {
|
||
for (t(i, g, m), g++, m--; s(i[g], f) < 0;) g++;
|
||
for (; s(i[m], f) > 0;) m--
|
||
}
|
||
0 === s(i[o], f) ? t(i, o, m) : t(i, ++m, n), m <= r && (o = m + 1), r <= m && (n = m - 1)
|
||
}
|
||
}(i, r, o || 0, n || i.length - 1, s || e)
|
||
}
|
||
}()
|
||
}, function (t, e, i) {
|
||
var r = i(17).newImageData;
|
||
|
||
function o(t) {
|
||
var e = !0;
|
||
try {
|
||
new ImageData(10, 10)
|
||
} catch (t) {
|
||
e = !1
|
||
}
|
||
|
||
function i(t, i, r) {
|
||
return e ? new ImageData(t, i, r) : {data: t, width: i, height: r}
|
||
}
|
||
|
||
return function (e) {
|
||
var r, o, n = e.buffers, s = e.meta, a = e.imageOps, l = e.width, h = e.height, u = n.length,
|
||
c = n[0].byteLength;
|
||
if (a) {
|
||
var p = new Array(u);
|
||
for (o = 0; o < u; ++o) p[o] = i(new Uint8ClampedArray(n[o]), l, h);
|
||
r = t(p, s).data
|
||
} else {
|
||
r = new Uint8ClampedArray(c);
|
||
var d = new Array(u), f = new Array(u);
|
||
for (o = 0; o < u; ++o) d[o] = new Uint8ClampedArray(n[o]), f[o] = [0, 0, 0, 0];
|
||
for (var g = 0; g < c; g += 4) {
|
||
for (var m = 0; m < u; ++m) {
|
||
var y = d[m];
|
||
f[m][0] = y[g], f[m][1] = y[g + 1], f[m][2] = y[g + 2], f[m][3] = y[g + 3]
|
||
}
|
||
var v = t(f, s);
|
||
r[g] = v[0], r[g + 1] = v[1], r[g + 2] = v[2], r[g + 3] = v[3]
|
||
}
|
||
}
|
||
return r.buffer
|
||
}
|
||
}
|
||
|
||
function n(t, e) {
|
||
var i = Object.keys(t.lib || {}).map(function (e) {
|
||
return "var " + e + " = " + t.lib[e].toString() + ";"
|
||
}).concat(["var __minion__ = (" + o.toString() + ")(", t.operation.toString(), ");", 'self.addEventListener("message", function(event) {', " var buffer = __minion__(event.data);", " self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);", "});"]),
|
||
r = new Blob(i, {type: "text/javascript"}), n = URL.createObjectURL(r), s = new Worker(n);
|
||
return s.addEventListener("message", e), s
|
||
}
|
||
|
||
function s(t) {
|
||
var e;
|
||
this._imageOps = !!t.imageOps;
|
||
var i = [];
|
||
if (e = 0 === t.threads ? 0 : this._imageOps ? 1 : t.threads || 1) for (var r = 0; r < e; ++r) i[r] = n(t, this._onWorkerMessage.bind(this, r)); else i[0] = function (t, e) {
|
||
var i = o(t.operation);
|
||
return {
|
||
postMessage: function (t) {
|
||
setTimeout(function () {
|
||
e({data: {buffer: i(t), meta: t.meta}})
|
||
}, 0)
|
||
}
|
||
}
|
||
}(t, this._onWorkerMessage.bind(this, 0));
|
||
this._workers = i, this._queue = [], this._maxQueueLength = t.queue || 1 / 0, this._running = 0, this._dataLookup = {}, this._job = null
|
||
}
|
||
|
||
s.prototype.process = function (t, e, i) {
|
||
this._enqueue({inputs: t, meta: e, callback: i}), this._dispatch()
|
||
}, s.prototype.destroy = function () {
|
||
for (var t in this) this[t] = null;
|
||
this._destroyed = !0
|
||
}, s.prototype._enqueue = function (t) {
|
||
for (this._queue.push(t); this._queue.length > this._maxQueueLength;) this._queue.shift().callback(null, null)
|
||
}, s.prototype._dispatch = function () {
|
||
if (0 === this._running && this._queue.length > 0) {
|
||
var t = this._job = this._queue.shift(), e = t.inputs[0].width, i = t.inputs[0].height,
|
||
r = t.inputs.map(function (t) {
|
||
return t.data.buffer
|
||
}), o = this._workers.length;
|
||
if (this._running = o, 1 === o) this._workers[0].postMessage({
|
||
buffers: r,
|
||
meta: t.meta,
|
||
imageOps: this._imageOps,
|
||
width: e,
|
||
height: i
|
||
}, r); else for (var n = t.inputs[0].data.length, s = 4 * Math.ceil(n / 4 / o), a = 0; a < o; ++a) {
|
||
for (var l = a * s, h = [], u = 0, c = r.length; u < c; ++u) h.push(r[a].slice(l, l + s));
|
||
this._workers[a].postMessage({
|
||
buffers: h,
|
||
meta: t.meta,
|
||
imageOps: this._imageOps,
|
||
width: e,
|
||
height: i
|
||
}, h)
|
||
}
|
||
}
|
||
}, s.prototype._onWorkerMessage = function (t, e) {
|
||
this._destroyed || (this._dataLookup[t] = e.data, --this._running, 0 === this._running && this._resolveJob())
|
||
}, s.prototype._resolveJob = function () {
|
||
var t, e, i = this._job, o = this._workers.length;
|
||
if (1 === o) t = new Uint8ClampedArray(this._dataLookup[0].buffer), e = this._dataLookup[0].meta; else {
|
||
var n = i.inputs[0].data.length;
|
||
t = new Uint8ClampedArray(n), e = new Array(n);
|
||
for (var s = 4 * Math.ceil(n / 4 / o), a = 0; a < o; ++a) {
|
||
var l = this._dataLookup[a].buffer, h = a * s;
|
||
t.set(new Uint8ClampedArray(l), h), e[a] = this._dataLookup[a].meta
|
||
}
|
||
}
|
||
this._job = null, this._dataLookup = {}, i.callback(null, r(t, i.inputs[0].width, i.inputs[0].height), e), this._dispatch()
|
||
}, t.exports = s
|
||
}, function (t, e) {
|
||
var i = !0;
|
||
try {
|
||
new ImageData(10, 10)
|
||
} catch (t) {
|
||
i = !1
|
||
}
|
||
var r = document.createElement("canvas").getContext("2d");
|
||
e.newImageData = function (t, e, o) {
|
||
if (i) return new ImageData(t, e, o);
|
||
var n = r.createImageData(e, o);
|
||
return n.data.set(t), n
|
||
}
|
||
}, function (t, e, i) {
|
||
"use strict";
|
||
(function (t) {
|
||
/*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||
* @license MIT
|
||
*/
|
||
var r = i(19), o = i(7), n = i(20);
|
||
|
||
function s() {
|
||
return l.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
|
||
}
|
||
|
||
function a(t, e) {
|
||
if (s() < e) throw new RangeError("Invalid typed array length");
|
||
return l.TYPED_ARRAY_SUPPORT ? (t = new Uint8Array(e)).__proto__ = l.prototype : (null === t && (t = new l(e)), t.length = e), t
|
||
}
|
||
|
||
function l(t, e, i) {
|
||
if (!(l.TYPED_ARRAY_SUPPORT || this instanceof l)) return new l(t, e, i);
|
||
if ("number" == typeof t) {
|
||
if ("string" == typeof e) throw new Error("If encoding is specified then the first argument must be a string");
|
||
return c(this, t)
|
||
}
|
||
return h(this, t, e, i)
|
||
}
|
||
|
||
function h(t, e, i, r) {
|
||
if ("number" == typeof e) throw new TypeError('"value" argument must not be a number');
|
||
return "undefined" != typeof ArrayBuffer && e instanceof ArrayBuffer ? function (t, e, i, r) {
|
||
if (e.byteLength, i < 0 || e.byteLength < i) throw new RangeError("'offset' is out of bounds");
|
||
if (e.byteLength < i + (r || 0)) throw new RangeError("'length' is out of bounds");
|
||
e = void 0 === i && void 0 === r ? new Uint8Array(e) : void 0 === r ? new Uint8Array(e, i) : new Uint8Array(e, i, r);
|
||
l.TYPED_ARRAY_SUPPORT ? (t = e).__proto__ = l.prototype : t = p(t, e);
|
||
return t
|
||
}(t, e, i, r) : "string" == typeof e ? function (t, e, i) {
|
||
"string" == typeof i && "" !== i || (i = "utf8");
|
||
if (!l.isEncoding(i)) throw new TypeError('"encoding" must be a valid string encoding');
|
||
var r = 0 | f(e, i), o = (t = a(t, r)).write(e, i);
|
||
o !== r && (t = t.slice(0, o));
|
||
return t
|
||
}(t, e, i) : function (t, e) {
|
||
if (l.isBuffer(e)) {
|
||
var i = 0 | d(e.length);
|
||
return 0 === (t = a(t, i)).length ? t : (e.copy(t, 0, 0, i), t)
|
||
}
|
||
if (e) {
|
||
if ("undefined" != typeof ArrayBuffer && e.buffer instanceof ArrayBuffer || "length" in e) return "number" != typeof e.length || (r = e.length) != r ? a(t, 0) : p(t, e);
|
||
if ("Buffer" === e.type && n(e.data)) return p(t, e.data)
|
||
}
|
||
var r;
|
||
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
|
||
}(t, e)
|
||
}
|
||
|
||
function u(t) {
|
||
if ("number" != typeof t) throw new TypeError('"size" argument must be a number');
|
||
if (t < 0) throw new RangeError('"size" argument must not be negative')
|
||
}
|
||
|
||
function c(t, e) {
|
||
if (u(e), t = a(t, e < 0 ? 0 : 0 | d(e)), !l.TYPED_ARRAY_SUPPORT) for (var i = 0; i < e; ++i) t[i] = 0;
|
||
return t
|
||
}
|
||
|
||
function p(t, e) {
|
||
var i = e.length < 0 ? 0 : 0 | d(e.length);
|
||
t = a(t, i);
|
||
for (var r = 0; r < i; r += 1) t[r] = 255 & e[r];
|
||
return t
|
||
}
|
||
|
||
function d(t) {
|
||
if (t >= s()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + s().toString(16) + " bytes");
|
||
return 0 | t
|
||
}
|
||
|
||
function f(t, e) {
|
||
if (l.isBuffer(t)) return t.length;
|
||
if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(t) || t instanceof ArrayBuffer)) return t.byteLength;
|
||
"string" != typeof t && (t = "" + t);
|
||
var i = t.length;
|
||
if (0 === i) return 0;
|
||
for (var r = !1; ;) switch (e) {
|
||
case"ascii":
|
||
case"latin1":
|
||
case"binary":
|
||
return i;
|
||
case"utf8":
|
||
case"utf-8":
|
||
case void 0:
|
||
return z(t).length;
|
||
case"ucs2":
|
||
case"ucs-2":
|
||
case"utf16le":
|
||
case"utf-16le":
|
||
return 2 * i;
|
||
case"hex":
|
||
return i >>> 1;
|
||
case"base64":
|
||
return U(t).length;
|
||
default:
|
||
if (r) return z(t).length;
|
||
e = ("" + e).toLowerCase(), r = !0
|
||
}
|
||
}
|
||
|
||
function g(t, e, i) {
|
||
var r = t[e];
|
||
t[e] = t[i], t[i] = r
|
||
}
|
||
|
||
function m(t, e, i, r, o) {
|
||
if (0 === t.length) return -1;
|
||
if ("string" == typeof i ? (r = i, i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648), i = +i, isNaN(i) && (i = o ? 0 : t.length - 1), i < 0 && (i = t.length + i), i >= t.length) {
|
||
if (o) return -1;
|
||
i = t.length - 1
|
||
} else if (i < 0) {
|
||
if (!o) return -1;
|
||
i = 0
|
||
}
|
||
if ("string" == typeof e && (e = l.from(e, r)), l.isBuffer(e)) return 0 === e.length ? -1 : y(t, e, i, r, o);
|
||
if ("number" == typeof e) return e &= 255, l.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? o ? Uint8Array.prototype.indexOf.call(t, e, i) : Uint8Array.prototype.lastIndexOf.call(t, e, i) : y(t, [e], i, r, o);
|
||
throw new TypeError("val must be string, number or Buffer")
|
||
}
|
||
|
||
function y(t, e, i, r, o) {
|
||
var n, s = 1, a = t.length, l = e.length;
|
||
if (void 0 !== r && ("ucs2" === (r = String(r).toLowerCase()) || "ucs-2" === r || "utf16le" === r || "utf-16le" === r)) {
|
||
if (t.length < 2 || e.length < 2) return -1;
|
||
s = 2, a /= 2, l /= 2, i /= 2
|
||
}
|
||
|
||
function h(t, e) {
|
||
return 1 === s ? t[e] : t.readUInt16BE(e * s)
|
||
}
|
||
|
||
if (o) {
|
||
var u = -1;
|
||
for (n = i; n < a; n++) if (h(t, n) === h(e, -1 === u ? 0 : n - u)) {
|
||
if (-1 === u && (u = n), n - u + 1 === l) return u * s
|
||
} else -1 !== u && (n -= n - u), u = -1
|
||
} else for (i + l > a && (i = a - l), n = i; n >= 0; n--) {
|
||
for (var c = !0, p = 0; p < l; p++) if (h(t, n + p) !== h(e, p)) {
|
||
c = !1;
|
||
break
|
||
}
|
||
if (c) return n
|
||
}
|
||
return -1
|
||
}
|
||
|
||
function v(t, e, i, r) {
|
||
i = Number(i) || 0;
|
||
var o = t.length - i;
|
||
r ? (r = Number(r)) > o && (r = o) : r = o;
|
||
var n = e.length;
|
||
if (n % 2 != 0) throw new TypeError("Invalid hex string");
|
||
r > n / 2 && (r = n / 2);
|
||
for (var s = 0; s < r; ++s) {
|
||
var a = parseInt(e.substr(2 * s, 2), 16);
|
||
if (isNaN(a)) return s;
|
||
t[i + s] = a
|
||
}
|
||
return s
|
||
}
|
||
|
||
function _(t, e, i, r) {
|
||
return B(z(e, t.length - i), t, i, r)
|
||
}
|
||
|
||
function x(t, e, i, r) {
|
||
return B(function (t) {
|
||
for (var e = [], i = 0; i < t.length; ++i) e.push(255 & t.charCodeAt(i));
|
||
return e
|
||
}(e), t, i, r)
|
||
}
|
||
|
||
function w(t, e, i, r) {
|
||
return x(t, e, i, r)
|
||
}
|
||
|
||
function b(t, e, i, r) {
|
||
return B(U(e), t, i, r)
|
||
}
|
||
|
||
function C(t, e, i, r) {
|
||
return B(function (t, e) {
|
||
for (var i, r, o, n = [], s = 0; s < t.length && !((e -= 2) < 0); ++s) i = t.charCodeAt(s), r = i >> 8, o = i % 256, n.push(o), n.push(r);
|
||
return n
|
||
}(e, t.length - i), t, i, r)
|
||
}
|
||
|
||
function S(t, e, i) {
|
||
return 0 === e && i === t.length ? r.fromByteArray(t) : r.fromByteArray(t.slice(e, i))
|
||
}
|
||
|
||
function E(t, e, i) {
|
||
i = Math.min(t.length, i);
|
||
for (var r = [], o = e; o < i;) {
|
||
var n, s, a, l, h = t[o], u = null, c = h > 239 ? 4 : h > 223 ? 3 : h > 191 ? 2 : 1;
|
||
if (o + c <= i) switch (c) {
|
||
case 1:
|
||
h < 128 && (u = h);
|
||
break;
|
||
case 2:
|
||
128 == (192 & (n = t[o + 1])) && (l = (31 & h) << 6 | 63 & n) > 127 && (u = l);
|
||
break;
|
||
case 3:
|
||
n = t[o + 1], s = t[o + 2], 128 == (192 & n) && 128 == (192 & s) && (l = (15 & h) << 12 | (63 & n) << 6 | 63 & s) > 2047 && (l < 55296 || l > 57343) && (u = l);
|
||
break;
|
||
case 4:
|
||
n = t[o + 1], s = t[o + 2], a = t[o + 3], 128 == (192 & n) && 128 == (192 & s) && 128 == (192 & a) && (l = (15 & h) << 18 | (63 & n) << 12 | (63 & s) << 6 | 63 & a) > 65535 && l < 1114112 && (u = l)
|
||
}
|
||
null === u ? (u = 65533, c = 1) : u > 65535 && (u -= 65536, r.push(u >>> 10 & 1023 | 55296), u = 56320 | 1023 & u), r.push(u), o += c
|
||
}
|
||
return function (t) {
|
||
var e = t.length;
|
||
if (e <= T) return String.fromCharCode.apply(String, t);
|
||
var i = "", r = 0;
|
||
for (; r < e;) i += String.fromCharCode.apply(String, t.slice(r, r += T));
|
||
return i
|
||
}(r)
|
||
}
|
||
|
||
e.Buffer = l, e.SlowBuffer = function (t) {
|
||
+t != t && (t = 0);
|
||
return l.alloc(+t)
|
||
}, e.INSPECT_MAX_BYTES = 50, l.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : function () {
|
||
try {
|
||
var t = new Uint8Array(1);
|
||
return t.__proto__ = {
|
||
__proto__: Uint8Array.prototype, foo: function () {
|
||
return 42
|
||
}
|
||
}, 42 === t.foo() && "function" == typeof t.subarray && 0 === t.subarray(1, 1).byteLength
|
||
} catch (t) {
|
||
return !1
|
||
}
|
||
}(), e.kMaxLength = s(), l.poolSize = 8192, l._augment = function (t) {
|
||
return t.__proto__ = l.prototype, t
|
||
}, l.from = function (t, e, i) {
|
||
return h(null, t, e, i)
|
||
}, l.TYPED_ARRAY_SUPPORT && (l.prototype.__proto__ = Uint8Array.prototype, l.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && l[Symbol.species] === l && Object.defineProperty(l, Symbol.species, {
|
||
value: null,
|
||
configurable: !0
|
||
})), l.alloc = function (t, e, i) {
|
||
return function (t, e, i, r) {
|
||
return u(e), e <= 0 ? a(t, e) : void 0 !== i ? "string" == typeof r ? a(t, e).fill(i, r) : a(t, e).fill(i) : a(t, e)
|
||
}(null, t, e, i)
|
||
}, l.allocUnsafe = function (t) {
|
||
return c(null, t)
|
||
}, l.allocUnsafeSlow = function (t) {
|
||
return c(null, t)
|
||
}, l.isBuffer = function (t) {
|
||
return !(null == t || !t._isBuffer)
|
||
}, l.compare = function (t, e) {
|
||
if (!l.isBuffer(t) || !l.isBuffer(e)) throw new TypeError("Arguments must be Buffers");
|
||
if (t === e) return 0;
|
||
for (var i = t.length, r = e.length, o = 0, n = Math.min(i, r); o < n; ++o) if (t[o] !== e[o]) {
|
||
i = t[o], r = e[o];
|
||
break
|
||
}
|
||
return i < r ? -1 : r < i ? 1 : 0
|
||
}, l.isEncoding = function (t) {
|
||
switch (String(t).toLowerCase()) {
|
||
case"hex":
|
||
case"utf8":
|
||
case"utf-8":
|
||
case"ascii":
|
||
case"latin1":
|
||
case"binary":
|
||
case"base64":
|
||
case"ucs2":
|
||
case"ucs-2":
|
||
case"utf16le":
|
||
case"utf-16le":
|
||
return !0;
|
||
default:
|
||
return !1
|
||
}
|
||
}, l.concat = function (t, e) {
|
||
if (!n(t)) throw new TypeError('"list" argument must be an Array of Buffers');
|
||
if (0 === t.length) return l.alloc(0);
|
||
var i;
|
||
if (void 0 === e) for (e = 0, i = 0; i < t.length; ++i) e += t[i].length;
|
||
var r = l.allocUnsafe(e), o = 0;
|
||
for (i = 0; i < t.length; ++i) {
|
||
var s = t[i];
|
||
if (!l.isBuffer(s)) throw new TypeError('"list" argument must be an Array of Buffers');
|
||
s.copy(r, o), o += s.length
|
||
}
|
||
return r
|
||
}, l.byteLength = f, l.prototype._isBuffer = !0, l.prototype.swap16 = function () {
|
||
var t = this.length;
|
||
if (t % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
|
||
for (var e = 0; e < t; e += 2) g(this, e, e + 1);
|
||
return this
|
||
}, l.prototype.swap32 = function () {
|
||
var t = this.length;
|
||
if (t % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
|
||
for (var e = 0; e < t; e += 4) g(this, e, e + 3), g(this, e + 1, e + 2);
|
||
return this
|
||
}, l.prototype.swap64 = function () {
|
||
var t = this.length;
|
||
if (t % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
|
||
for (var e = 0; e < t; e += 8) g(this, e, e + 7), g(this, e + 1, e + 6), g(this, e + 2, e + 5), g(this, e + 3, e + 4);
|
||
return this
|
||
}, l.prototype.toString = function () {
|
||
var t = 0 | this.length;
|
||
return 0 === t ? "" : 0 === arguments.length ? E(this, 0, t) : function (t, e, i) {
|
||
var r = !1;
|
||
if ((void 0 === e || e < 0) && (e = 0), e > this.length) return "";
|
||
if ((void 0 === i || i > this.length) && (i = this.length), i <= 0) return "";
|
||
if ((i >>>= 0) <= (e >>>= 0)) return "";
|
||
for (t || (t = "utf8"); ;) switch (t) {
|
||
case"hex":
|
||
return L(this, e, i);
|
||
case"utf8":
|
||
case"utf-8":
|
||
return E(this, e, i);
|
||
case"ascii":
|
||
return R(this, e, i);
|
||
case"latin1":
|
||
case"binary":
|
||
return P(this, e, i);
|
||
case"base64":
|
||
return S(this, e, i);
|
||
case"ucs2":
|
||
case"ucs-2":
|
||
case"utf16le":
|
||
case"utf-16le":
|
||
return I(this, e, i);
|
||
default:
|
||
if (r) throw new TypeError("Unknown encoding: " + t);
|
||
t = (t + "").toLowerCase(), r = !0
|
||
}
|
||
}.apply(this, arguments)
|
||
}, l.prototype.equals = function (t) {
|
||
if (!l.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
|
||
return this === t || 0 === l.compare(this, t)
|
||
}, l.prototype.inspect = function () {
|
||
var t = "", i = e.INSPECT_MAX_BYTES;
|
||
return this.length > 0 && (t = this.toString("hex", 0, i).match(/.{2}/g).join(" "), this.length > i && (t += " ... ")), "<Buffer " + t + ">"
|
||
}, l.prototype.compare = function (t, e, i, r, o) {
|
||
if (!l.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
|
||
if (void 0 === e && (e = 0), void 0 === i && (i = t ? t.length : 0), void 0 === r && (r = 0), void 0 === o && (o = this.length), e < 0 || i > t.length || r < 0 || o > this.length) throw new RangeError("out of range index");
|
||
if (r >= o && e >= i) return 0;
|
||
if (r >= o) return -1;
|
||
if (e >= i) return 1;
|
||
if (this === t) return 0;
|
||
for (var n = (o >>>= 0) - (r >>>= 0), s = (i >>>= 0) - (e >>>= 0), a = Math.min(n, s), h = this.slice(r, o), u = t.slice(e, i), c = 0; c < a; ++c) if (h[c] !== u[c]) {
|
||
n = h[c], s = u[c];
|
||
break
|
||
}
|
||
return n < s ? -1 : s < n ? 1 : 0
|
||
}, l.prototype.includes = function (t, e, i) {
|
||
return -1 !== this.indexOf(t, e, i)
|
||
}, l.prototype.indexOf = function (t, e, i) {
|
||
return m(this, t, e, i, !0)
|
||
}, l.prototype.lastIndexOf = function (t, e, i) {
|
||
return m(this, t, e, i, !1)
|
||
}, l.prototype.write = function (t, e, i, r) {
|
||
if (void 0 === e) r = "utf8", i = this.length, e = 0; else if (void 0 === i && "string" == typeof e) r = e, i = this.length, e = 0; else {
|
||
if (!isFinite(e)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
|
||
e |= 0, isFinite(i) ? (i |= 0, void 0 === r && (r = "utf8")) : (r = i, i = void 0)
|
||
}
|
||
var o = this.length - e;
|
||
if ((void 0 === i || i > o) && (i = o), t.length > 0 && (i < 0 || e < 0) || e > this.length) throw new RangeError("Attempt to write outside buffer bounds");
|
||
r || (r = "utf8");
|
||
for (var n = !1; ;) switch (r) {
|
||
case"hex":
|
||
return v(this, t, e, i);
|
||
case"utf8":
|
||
case"utf-8":
|
||
return _(this, t, e, i);
|
||
case"ascii":
|
||
return x(this, t, e, i);
|
||
case"latin1":
|
||
case"binary":
|
||
return w(this, t, e, i);
|
||
case"base64":
|
||
return b(this, t, e, i);
|
||
case"ucs2":
|
||
case"ucs-2":
|
||
case"utf16le":
|
||
case"utf-16le":
|
||
return C(this, t, e, i);
|
||
default:
|
||
if (n) throw new TypeError("Unknown encoding: " + r);
|
||
r = ("" + r).toLowerCase(), n = !0
|
||
}
|
||
}, l.prototype.toJSON = function () {
|
||
return {type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0)}
|
||
};
|
||
var T = 4096;
|
||
|
||
function R(t, e, i) {
|
||
var r = "";
|
||
i = Math.min(t.length, i);
|
||
for (var o = e; o < i; ++o) r += String.fromCharCode(127 & t[o]);
|
||
return r
|
||
}
|
||
|
||
function P(t, e, i) {
|
||
var r = "";
|
||
i = Math.min(t.length, i);
|
||
for (var o = e; o < i; ++o) r += String.fromCharCode(t[o]);
|
||
return r
|
||
}
|
||
|
||
function L(t, e, i) {
|
||
var r = t.length;
|
||
(!e || e < 0) && (e = 0), (!i || i < 0 || i > r) && (i = r);
|
||
for (var o = "", n = e; n < i; ++n) o += j(t[n]);
|
||
return o
|
||
}
|
||
|
||
function I(t, e, i) {
|
||
for (var r = t.slice(e, i), o = "", n = 0; n < r.length; n += 2) o += String.fromCharCode(r[n] + 256 * r[n + 1]);
|
||
return o
|
||
}
|
||
|
||
function O(t, e, i) {
|
||
if (t % 1 != 0 || t < 0) throw new RangeError("offset is not uint");
|
||
if (t + e > i) throw new RangeError("Trying to access beyond buffer length")
|
||
}
|
||
|
||
function M(t, e, i, r, o, n) {
|
||
if (!l.isBuffer(t)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
||
if (e > o || e < n) throw new RangeError('"value" argument is out of bounds');
|
||
if (i + r > t.length) throw new RangeError("Index out of range")
|
||
}
|
||
|
||
function A(t, e, i, r) {
|
||
e < 0 && (e = 65535 + e + 1);
|
||
for (var o = 0, n = Math.min(t.length - i, 2); o < n; ++o) t[i + o] = (e & 255 << 8 * (r ? o : 1 - o)) >>> 8 * (r ? o : 1 - o)
|
||
}
|
||
|
||
function k(t, e, i, r) {
|
||
e < 0 && (e = 4294967295 + e + 1);
|
||
for (var o = 0, n = Math.min(t.length - i, 4); o < n; ++o) t[i + o] = e >>> 8 * (r ? o : 3 - o) & 255
|
||
}
|
||
|
||
function F(t, e, i, r, o, n) {
|
||
if (i + r > t.length) throw new RangeError("Index out of range");
|
||
if (i < 0) throw new RangeError("Index out of range")
|
||
}
|
||
|
||
function N(t, e, i, r, n) {
|
||
return n || F(t, 0, i, 4), o.write(t, e, i, r, 23, 4), i + 4
|
||
}
|
||
|
||
function D(t, e, i, r, n) {
|
||
return n || F(t, 0, i, 8), o.write(t, e, i, r, 52, 8), i + 8
|
||
}
|
||
|
||
l.prototype.slice = function (t, e) {
|
||
var i, r = this.length;
|
||
if ((t = ~~t) < 0 ? (t += r) < 0 && (t = 0) : t > r && (t = r), (e = void 0 === e ? r : ~~e) < 0 ? (e += r) < 0 && (e = 0) : e > r && (e = r), e < t && (e = t), l.TYPED_ARRAY_SUPPORT) (i = this.subarray(t, e)).__proto__ = l.prototype; else {
|
||
var o = e - t;
|
||
i = new l(o, void 0);
|
||
for (var n = 0; n < o; ++n) i[n] = this[n + t]
|
||
}
|
||
return i
|
||
}, l.prototype.readUIntLE = function (t, e, i) {
|
||
t |= 0, e |= 0, i || O(t, e, this.length);
|
||
for (var r = this[t], o = 1, n = 0; ++n < e && (o *= 256);) r += this[t + n] * o;
|
||
return r
|
||
}, l.prototype.readUIntBE = function (t, e, i) {
|
||
t |= 0, e |= 0, i || O(t, e, this.length);
|
||
for (var r = this[t + --e], o = 1; e > 0 && (o *= 256);) r += this[t + --e] * o;
|
||
return r
|
||
}, l.prototype.readUInt8 = function (t, e) {
|
||
return e || O(t, 1, this.length), this[t]
|
||
}, l.prototype.readUInt16LE = function (t, e) {
|
||
return e || O(t, 2, this.length), this[t] | this[t + 1] << 8
|
||
}, l.prototype.readUInt16BE = function (t, e) {
|
||
return e || O(t, 2, this.length), this[t] << 8 | this[t + 1]
|
||
}, l.prototype.readUInt32LE = function (t, e) {
|
||
return e || O(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3]
|
||
}, l.prototype.readUInt32BE = function (t, e) {
|
||
return e || O(t, 4, this.length), 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3])
|
||
}, l.prototype.readIntLE = function (t, e, i) {
|
||
t |= 0, e |= 0, i || O(t, e, this.length);
|
||
for (var r = this[t], o = 1, n = 0; ++n < e && (o *= 256);) r += this[t + n] * o;
|
||
return r >= (o *= 128) && (r -= Math.pow(2, 8 * e)), r
|
||
}, l.prototype.readIntBE = function (t, e, i) {
|
||
t |= 0, e |= 0, i || O(t, e, this.length);
|
||
for (var r = e, o = 1, n = this[t + --r]; r > 0 && (o *= 256);) n += this[t + --r] * o;
|
||
return n >= (o *= 128) && (n -= Math.pow(2, 8 * e)), n
|
||
}, l.prototype.readInt8 = function (t, e) {
|
||
return e || O(t, 1, this.length), 128 & this[t] ? -1 * (255 - this[t] + 1) : this[t]
|
||
}, l.prototype.readInt16LE = function (t, e) {
|
||
e || O(t, 2, this.length);
|
||
var i = this[t] | this[t + 1] << 8;
|
||
return 32768 & i ? 4294901760 | i : i
|
||
}, l.prototype.readInt16BE = function (t, e) {
|
||
e || O(t, 2, this.length);
|
||
var i = this[t + 1] | this[t] << 8;
|
||
return 32768 & i ? 4294901760 | i : i
|
||
}, l.prototype.readInt32LE = function (t, e) {
|
||
return e || O(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24
|
||
}, l.prototype.readInt32BE = function (t, e) {
|
||
return e || O(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]
|
||
}, l.prototype.readFloatLE = function (t, e) {
|
||
return e || O(t, 4, this.length), o.read(this, t, !0, 23, 4)
|
||
}, l.prototype.readFloatBE = function (t, e) {
|
||
return e || O(t, 4, this.length), o.read(this, t, !1, 23, 4)
|
||
}, l.prototype.readDoubleLE = function (t, e) {
|
||
return e || O(t, 8, this.length), o.read(this, t, !0, 52, 8)
|
||
}, l.prototype.readDoubleBE = function (t, e) {
|
||
return e || O(t, 8, this.length), o.read(this, t, !1, 52, 8)
|
||
}, l.prototype.writeUIntLE = function (t, e, i, r) {
|
||
(t = +t, e |= 0, i |= 0, r) || M(this, t, e, i, Math.pow(2, 8 * i) - 1, 0);
|
||
var o = 1, n = 0;
|
||
for (this[e] = 255 & t; ++n < i && (o *= 256);) this[e + n] = t / o & 255;
|
||
return e + i
|
||
}, l.prototype.writeUIntBE = function (t, e, i, r) {
|
||
(t = +t, e |= 0, i |= 0, r) || M(this, t, e, i, Math.pow(2, 8 * i) - 1, 0);
|
||
var o = i - 1, n = 1;
|
||
for (this[e + o] = 255 & t; --o >= 0 && (n *= 256);) this[e + o] = t / n & 255;
|
||
return e + i
|
||
}, l.prototype.writeUInt8 = function (t, e, i) {
|
||
return t = +t, e |= 0, i || M(this, t, e, 1, 255, 0), l.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)), this[e] = 255 & t, e + 1
|
||
}, l.prototype.writeUInt16LE = function (t, e, i) {
|
||
return t = +t, e |= 0, i || M(this, t, e, 2, 65535, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8) : A(this, t, e, !0), e + 2
|
||
}, l.prototype.writeUInt16BE = function (t, e, i) {
|
||
return t = +t, e |= 0, i || M(this, t, e, 2, 65535, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8, this[e + 1] = 255 & t) : A(this, t, e, !1), e + 2
|
||
}, l.prototype.writeUInt32LE = function (t, e, i) {
|
||
return t = +t, e |= 0, i || M(this, t, e, 4, 4294967295, 0), l.TYPED_ARRAY_SUPPORT ? (this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = 255 & t) : k(this, t, e, !0), e + 4
|
||
}, l.prototype.writeUInt32BE = function (t, e, i) {
|
||
return t = +t, e |= 0, i || M(this, t, e, 4, 4294967295, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t) : k(this, t, e, !1), e + 4
|
||
}, l.prototype.writeIntLE = function (t, e, i, r) {
|
||
if (t = +t, e |= 0, !r) {
|
||
var o = Math.pow(2, 8 * i - 1);
|
||
M(this, t, e, i, o - 1, -o)
|
||
}
|
||
var n = 0, s = 1, a = 0;
|
||
for (this[e] = 255 & t; ++n < i && (s *= 256);) t < 0 && 0 === a && 0 !== this[e + n - 1] && (a = 1), this[e + n] = (t / s >> 0) - a & 255;
|
||
return e + i
|
||
}, l.prototype.writeIntBE = function (t, e, i, r) {
|
||
if (t = +t, e |= 0, !r) {
|
||
var o = Math.pow(2, 8 * i - 1);
|
||
M(this, t, e, i, o - 1, -o)
|
||
}
|
||
var n = i - 1, s = 1, a = 0;
|
||
for (this[e + n] = 255 & t; --n >= 0 && (s *= 256);) t < 0 && 0 === a && 0 !== this[e + n + 1] && (a = 1), this[e + n] = (t / s >> 0) - a & 255;
|
||
return e + i
|
||
}, l.prototype.writeInt8 = function (t, e, i) {
|
||
return t = +t, e |= 0, i || M(this, t, e, 1, 127, -128), l.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)), t < 0 && (t = 255 + t + 1), this[e] = 255 & t, e + 1
|
||
}, l.prototype.writeInt16LE = function (t, e, i) {
|
||
return t = +t, e |= 0, i || M(this, t, e, 2, 32767, -32768), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8) : A(this, t, e, !0), e + 2
|
||
}, l.prototype.writeInt16BE = function (t, e, i) {
|
||
return t = +t, e |= 0, i || M(this, t, e, 2, 32767, -32768), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8, this[e + 1] = 255 & t) : A(this, t, e, !1), e + 2
|
||
}, l.prototype.writeInt32LE = function (t, e, i) {
|
||
return t = +t, e |= 0, i || M(this, t, e, 4, 2147483647, -2147483648), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24) : k(this, t, e, !0), e + 4
|
||
}, l.prototype.writeInt32BE = function (t, e, i) {
|
||
return t = +t, e |= 0, i || M(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t) : k(this, t, e, !1), e + 4
|
||
}, l.prototype.writeFloatLE = function (t, e, i) {
|
||
return N(this, t, e, !0, i)
|
||
}, l.prototype.writeFloatBE = function (t, e, i) {
|
||
return N(this, t, e, !1, i)
|
||
}, l.prototype.writeDoubleLE = function (t, e, i) {
|
||
return D(this, t, e, !0, i)
|
||
}, l.prototype.writeDoubleBE = function (t, e, i) {
|
||
return D(this, t, e, !1, i)
|
||
}, l.prototype.copy = function (t, e, i, r) {
|
||
if (i || (i = 0), r || 0 === r || (r = this.length), e >= t.length && (e = t.length), e || (e = 0), r > 0 && r < i && (r = i), r === i) return 0;
|
||
if (0 === t.length || 0 === this.length) return 0;
|
||
if (e < 0) throw new RangeError("targetStart out of bounds");
|
||
if (i < 0 || i >= this.length) throw new RangeError("sourceStart out of bounds");
|
||
if (r < 0) throw new RangeError("sourceEnd out of bounds");
|
||
r > this.length && (r = this.length), t.length - e < r - i && (r = t.length - e + i);
|
||
var o, n = r - i;
|
||
if (this === t && i < e && e < r) for (o = n - 1; o >= 0; --o) t[o + e] = this[o + i]; else if (n < 1e3 || !l.TYPED_ARRAY_SUPPORT) for (o = 0; o < n; ++o) t[o + e] = this[o + i]; else Uint8Array.prototype.set.call(t, this.subarray(i, i + n), e);
|
||
return n
|
||
}, l.prototype.fill = function (t, e, i, r) {
|
||
if ("string" == typeof t) {
|
||
if ("string" == typeof e ? (r = e, e = 0, i = this.length) : "string" == typeof i && (r = i, i = this.length), 1 === t.length) {
|
||
var o = t.charCodeAt(0);
|
||
o < 256 && (t = o)
|
||
}
|
||
if (void 0 !== r && "string" != typeof r) throw new TypeError("encoding must be a string");
|
||
if ("string" == typeof r && !l.isEncoding(r)) throw new TypeError("Unknown encoding: " + r)
|
||
} else "number" == typeof t && (t &= 255);
|
||
if (e < 0 || this.length < e || this.length < i) throw new RangeError("Out of range index");
|
||
if (i <= e) return this;
|
||
var n;
|
||
if (e >>>= 0, i = void 0 === i ? this.length : i >>> 0, t || (t = 0), "number" == typeof t) for (n = e; n < i; ++n) this[n] = t; else {
|
||
var s = l.isBuffer(t) ? t : z(new l(t, r).toString()), a = s.length;
|
||
for (n = 0; n < i - e; ++n) this[n + e] = s[n % a]
|
||
}
|
||
return this
|
||
};
|
||
var G = /[^+\/0-9A-Za-z-_]/g;
|
||
|
||
function j(t) {
|
||
return t < 16 ? "0" + t.toString(16) : t.toString(16)
|
||
}
|
||
|
||
function z(t, e) {
|
||
var i;
|
||
e = e || 1 / 0;
|
||
for (var r = t.length, o = null, n = [], s = 0; s < r; ++s) {
|
||
if ((i = t.charCodeAt(s)) > 55295 && i < 57344) {
|
||
if (!o) {
|
||
if (i > 56319) {
|
||
(e -= 3) > -1 && n.push(239, 191, 189);
|
||
continue
|
||
}
|
||
if (s + 1 === r) {
|
||
(e -= 3) > -1 && n.push(239, 191, 189);
|
||
continue
|
||
}
|
||
o = i;
|
||
continue
|
||
}
|
||
if (i < 56320) {
|
||
(e -= 3) > -1 && n.push(239, 191, 189), o = i;
|
||
continue
|
||
}
|
||
i = 65536 + (o - 55296 << 10 | i - 56320)
|
||
} else o && (e -= 3) > -1 && n.push(239, 191, 189);
|
||
if (o = null, i < 128) {
|
||
if ((e -= 1) < 0) break;
|
||
n.push(i)
|
||
} else if (i < 2048) {
|
||
if ((e -= 2) < 0) break;
|
||
n.push(i >> 6 | 192, 63 & i | 128)
|
||
} else if (i < 65536) {
|
||
if ((e -= 3) < 0) break;
|
||
n.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
|
||
} else {
|
||
if (!(i < 1114112)) throw new Error("Invalid code point");
|
||
if ((e -= 4) < 0) break;
|
||
n.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
|
||
}
|
||
}
|
||
return n
|
||
}
|
||
|
||
function U(t) {
|
||
return r.toByteArray(function (t) {
|
||
if ((t = function (t) {
|
||
return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "")
|
||
}(t).replace(G, "")).length < 2) return "";
|
||
for (; t.length % 4 != 0;) t += "=";
|
||
return t
|
||
}(t))
|
||
}
|
||
|
||
function B(t, e, i, r) {
|
||
for (var o = 0; o < r && !(o + i >= e.length || o >= t.length); ++o) e[o + i] = t[o];
|
||
return o
|
||
}
|
||
}).call(this, i(8))
|
||
}, function (t, e, i) {
|
||
"use strict";
|
||
e.byteLength = function (t) {
|
||
var e = h(t), i = e[0], r = e[1];
|
||
return 3 * (i + r) / 4 - r
|
||
}, e.toByteArray = function (t) {
|
||
for (var e, i = h(t), r = i[0], s = i[1], a = new n(function (t, e, i) {
|
||
return 3 * (e + i) / 4 - i
|
||
}(0, r, s)), l = 0, u = s > 0 ? r - 4 : r, c = 0; c < u; c += 4) e = o[t.charCodeAt(c)] << 18 | o[t.charCodeAt(c + 1)] << 12 | o[t.charCodeAt(c + 2)] << 6 | o[t.charCodeAt(c + 3)], a[l++] = e >> 16 & 255, a[l++] = e >> 8 & 255, a[l++] = 255 & e;
|
||
2 === s && (e = o[t.charCodeAt(c)] << 2 | o[t.charCodeAt(c + 1)] >> 4, a[l++] = 255 & e);
|
||
1 === s && (e = o[t.charCodeAt(c)] << 10 | o[t.charCodeAt(c + 1)] << 4 | o[t.charCodeAt(c + 2)] >> 2, a[l++] = e >> 8 & 255, a[l++] = 255 & e);
|
||
return a
|
||
}, e.fromByteArray = function (t) {
|
||
for (var e, i = t.length, o = i % 3, n = [], s = 0, a = i - o; s < a; s += 16383) n.push(u(t, s, s + 16383 > a ? a : s + 16383));
|
||
1 === o ? (e = t[i - 1], n.push(r[e >> 2] + r[e << 4 & 63] + "==")) : 2 === o && (e = (t[i - 2] << 8) + t[i - 1], n.push(r[e >> 10] + r[e >> 4 & 63] + r[e << 2 & 63] + "="));
|
||
return n.join("")
|
||
};
|
||
for (var r = [], o = [], n = "undefined" != typeof Uint8Array ? Uint8Array : Array, s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", a = 0, l = s.length; a < l; ++a) r[a] = s[a], o[s.charCodeAt(a)] = a;
|
||
|
||
function h(t) {
|
||
var e = t.length;
|
||
if (e % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
|
||
var i = t.indexOf("=");
|
||
return -1 === i && (i = e), [i, i === e ? 0 : 4 - i % 4]
|
||
}
|
||
|
||
function u(t, e, i) {
|
||
for (var o, n, s = [], a = e; a < i; a += 3) o = (t[a] << 16 & 16711680) + (t[a + 1] << 8 & 65280) + (255 & t[a + 2]), s.push(r[(n = o) >> 18 & 63] + r[n >> 12 & 63] + r[n >> 6 & 63] + r[63 & n]);
|
||
return s.join("")
|
||
}
|
||
|
||
o["-".charCodeAt(0)] = 62, o["_".charCodeAt(0)] = 63
|
||
}, function (t, e) {
|
||
var i = {}.toString;
|
||
t.exports = Array.isArray || function (t) {
|
||
return "[object Array]" == i.call(t)
|
||
}
|
||
}, function (t, e, i) {
|
||
"use strict";
|
||
i.r(e);
|
||
var r = {};
|
||
i.r(r), i.d(r, "TEXTAREA", function () {
|
||
return LE
|
||
}), i.d(r, "ARC", function () {
|
||
return IE
|
||
}), i.d(r, "CURVE", function () {
|
||
return OE
|
||
}), i.d(r, "GATHERING_PLACE", function () {
|
||
return ME
|
||
}), i.d(r, "POLYLINE", function () {
|
||
return AE
|
||
}), i.d(r, "FREEHANDLINE", function () {
|
||
return kE
|
||
}), i.d(r, "POINT", function () {
|
||
return FE
|
||
}), i.d(r, "PENNANT", function () {
|
||
return NE
|
||
}), i.d(r, "RECTANGLE", function () {
|
||
return DE
|
||
}), i.d(r, "CIRCLE", function () {
|
||
return GE
|
||
}), i.d(r, "ELLIPSE", function () {
|
||
return jE
|
||
}), i.d(r, "LUNE", function () {
|
||
return zE
|
||
}), i.d(r, "SECTOR", function () {
|
||
return UE
|
||
}), i.d(r, "CLOSED_CURVE", function () {
|
||
return BE
|
||
}), i.d(r, "POLYGON", function () {
|
||
return VE
|
||
}), i.d(r, "FREE_POLYGON", function () {
|
||
return YE
|
||
}), i.d(r, "ATTACK_ARROW", function () {
|
||
return WE
|
||
}), i.d(r, "DOUBLE_ARROW", function () {
|
||
return HE
|
||
}), i.d(r, "STRAIGHT_ARROW", function () {
|
||
return XE
|
||
}), i.d(r, "FINE_ARROW", function () {
|
||
return qE
|
||
}), i.d(r, "ASSAULT_DIRECTION", function () {
|
||
return ZE
|
||
}), i.d(r, "TAILED_SQUAD_COMBAT", function () {
|
||
return $E
|
||
}), i.d(r, "TAILED_ATTACK_ARROW", function () {
|
||
return KE
|
||
}), i.d(r, "SQUAD_COMBAT", function () {
|
||
return JE
|
||
}), i.d(r, "RECTFLAG", function () {
|
||
return QE
|
||
}), i.d(r, "TRIANGLEFLAG", function () {
|
||
return tT
|
||
}), i.d(r, "CURVEFLAG", function () {
|
||
return eT
|
||
});
|
||
var o = {};
|
||
|
||
function n() {
|
||
return function () {
|
||
throw new Error("Unimplemented abstract method.")
|
||
}()
|
||
}
|
||
|
||
i.r(o), i.d(o, "Point", function () {
|
||
return iT
|
||
}), i.d(o, "Pennant", function () {
|
||
return rT
|
||
}), i.d(o, "Polyline", function () {
|
||
return oT
|
||
}), i.d(o, "Arc", function () {
|
||
return nT
|
||
}), i.d(o, "Circle", function () {
|
||
return sT
|
||
}), i.d(o, "Curve", function () {
|
||
return aT
|
||
}), i.d(o, "FreeHandLine", function () {
|
||
return lT
|
||
}), i.d(o, "RectAngle", function () {
|
||
return hT
|
||
}), i.d(o, "Ellipse", function () {
|
||
return uT
|
||
}), i.d(o, "Lune", function () {
|
||
return cT
|
||
}), i.d(o, "Sector", function () {
|
||
return pT
|
||
}), i.d(o, "ClosedCurve", function () {
|
||
return dT
|
||
}), i.d(o, "Polygon", function () {
|
||
return fT
|
||
}), i.d(o, "FreePolygon", function () {
|
||
return gT
|
||
}), i.d(o, "AttackArrow", function () {
|
||
return mT
|
||
}), i.d(o, "DoubleArrow", function () {
|
||
return yT
|
||
}), i.d(o, "StraightArrow", function () {
|
||
return vT
|
||
}), i.d(o, "FineArrow", function () {
|
||
return _T
|
||
}), i.d(o, "AssaultDirection", function () {
|
||
return xT
|
||
}), i.d(o, "TailedAttackArrow", function () {
|
||
return wT
|
||
}), i.d(o, "SquadCombat", function () {
|
||
return bT
|
||
}), i.d(o, "TailedSquadCombat", function () {
|
||
return CT
|
||
}), i.d(o, "GatheringPlace", function () {
|
||
return ST
|
||
}), i.d(o, "RectFlag", function () {
|
||
return ET
|
||
}), i.d(o, "TriangleFlag", function () {
|
||
return TT
|
||
}), i.d(o, "CurveFlag", function () {
|
||
return RT
|
||
}), i.d(o, "PlotTextBox", function () {
|
||
return PE
|
||
});
|
||
var s = 0;
|
||
|
||
function a(t) {
|
||
return t.ol_uid || (t.ol_uid = String(++s))
|
||
}
|
||
|
||
var l = "5.3.2", h = function (t) {
|
||
function e(e) {
|
||
var i = "Assertion failed. See https://openlayers.org/en/" + ("latest" === l ? l : "v" + l.split("-")[0]) + "/doc/errors/#" + e + " for details.";
|
||
t.call(this, i), this.code = e, this.name = "AssertionError", this.message = i
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(Error), u = {ADD: "add", REMOVE: "remove"}, c = {PROPERTYCHANGE: "propertychange"},
|
||
p = "function" == typeof Object.assign ? Object.assign : function (t, e) {
|
||
var i = arguments;
|
||
if (null == t) throw new TypeError("Cannot convert undefined or null to object");
|
||
for (var r = Object(t), o = 1, n = arguments.length; o < n; ++o) {
|
||
var s = i[o];
|
||
if (null != s) for (var a in s) s.hasOwnProperty(a) && (r[a] = s[a])
|
||
}
|
||
return r
|
||
};
|
||
|
||
function d(t) {
|
||
for (var e in t) delete t[e]
|
||
}
|
||
|
||
function f(t) {
|
||
var e = [];
|
||
for (var i in t) e.push(t[i]);
|
||
return e
|
||
}
|
||
|
||
function g(t) {
|
||
var e;
|
||
for (e in t) return !1;
|
||
return !e
|
||
}
|
||
|
||
function m(t) {
|
||
var e = function (e) {
|
||
var i = t.listener, r = t.bindTo || t.target;
|
||
return t.callOnce && S(t), i.call(r, e)
|
||
};
|
||
return t.boundListener = e, e
|
||
}
|
||
|
||
function y(t, e, i, r) {
|
||
for (var o, n = 0, s = t.length; n < s; ++n) if ((o = t[n]).listener === e && o.bindTo === i) return r && (o.deleteIndex = n), o
|
||
}
|
||
|
||
function v(t, e) {
|
||
var i = _(t);
|
||
return i ? i[e] : void 0
|
||
}
|
||
|
||
function _(t, e) {
|
||
var i = t.ol_lm;
|
||
return !i && e && (i = t.ol_lm = {}), i
|
||
}
|
||
|
||
function x(t, e) {
|
||
var i = v(t, e);
|
||
if (i) {
|
||
for (var r = 0, o = i.length; r < o; ++r) t.removeEventListener(e, i[r].boundListener), d(i[r]);
|
||
i.length = 0;
|
||
var n = _(t);
|
||
n && (delete n[e], 0 === Object.keys(n).length && function (t) {
|
||
delete t.ol_lm
|
||
}(t))
|
||
}
|
||
}
|
||
|
||
function w(t, e, i, r, o) {
|
||
var n = _(t, !0), s = n[e];
|
||
s || (s = n[e] = []);
|
||
var a = y(s, i, r, !1);
|
||
return a ? o || (a.callOnce = !1) : (a = {
|
||
bindTo: r,
|
||
callOnce: !!o,
|
||
listener: i,
|
||
target: t,
|
||
type: e
|
||
}, t.addEventListener(e, m(a)), s.push(a)), a
|
||
}
|
||
|
||
function b(t, e, i, r) {
|
||
return w(t, e, i, r, !0)
|
||
}
|
||
|
||
function C(t, e, i, r) {
|
||
var o = v(t, e);
|
||
if (o) {
|
||
var n = y(o, i, r, !0);
|
||
n && S(n)
|
||
}
|
||
}
|
||
|
||
function S(t) {
|
||
if (t && t.target) {
|
||
t.target.removeEventListener(t.type, t.boundListener);
|
||
var e = v(t.target, t.type);
|
||
if (e) {
|
||
var i = "deleteIndex" in t ? t.deleteIndex : e.indexOf(t);
|
||
-1 !== i && e.splice(i, 1), 0 === e.length && x(t.target, t.type)
|
||
}
|
||
d(t)
|
||
}
|
||
}
|
||
|
||
function E(t) {
|
||
var e = _(t);
|
||
if (e) for (var i in e) x(t, i)
|
||
}
|
||
|
||
var T = function () {
|
||
this.disposed_ = !1
|
||
};
|
||
T.prototype.dispose = function () {
|
||
this.disposed_ || (this.disposed_ = !0, this.disposeInternal())
|
||
}, T.prototype.disposeInternal = function () {
|
||
};
|
||
var R = T;
|
||
|
||
function P() {
|
||
return !0
|
||
}
|
||
|
||
function L() {
|
||
return !1
|
||
}
|
||
|
||
function I() {
|
||
}
|
||
|
||
var O = function (t) {
|
||
this.propagationStopped, this.type = t, this.target = null
|
||
};
|
||
|
||
function M(t) {
|
||
t.stopPropagation()
|
||
}
|
||
|
||
O.prototype.preventDefault = function () {
|
||
this.propagationStopped = !0
|
||
}, O.prototype.stopPropagation = function () {
|
||
this.propagationStopped = !0
|
||
};
|
||
var A = O, k = function (t) {
|
||
function e() {
|
||
t.call(this), this.pendingRemovals_ = {}, this.dispatching_ = {}, this.listeners_ = {}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.addEventListener = function (t, e) {
|
||
var i = this.listeners_[t];
|
||
i || (i = this.listeners_[t] = []), -1 === i.indexOf(e) && i.push(e)
|
||
}, e.prototype.dispatchEvent = function (t) {
|
||
var e = "string" == typeof t ? new A(t) : t, i = e.type;
|
||
e.target = this;
|
||
var r, o = this.listeners_[i];
|
||
if (o) {
|
||
i in this.dispatching_ || (this.dispatching_[i] = 0, this.pendingRemovals_[i] = 0), ++this.dispatching_[i];
|
||
for (var n = 0, s = o.length; n < s; ++n) if (!1 === o[n].call(this, e) || e.propagationStopped) {
|
||
r = !1;
|
||
break
|
||
}
|
||
if (--this.dispatching_[i], 0 === this.dispatching_[i]) {
|
||
var a = this.pendingRemovals_[i];
|
||
for (delete this.pendingRemovals_[i]; a--;) this.removeEventListener(i, I);
|
||
delete this.dispatching_[i]
|
||
}
|
||
return r
|
||
}
|
||
}, e.prototype.disposeInternal = function () {
|
||
E(this)
|
||
}, e.prototype.getListeners = function (t) {
|
||
return this.listeners_[t]
|
||
}, e.prototype.hasListener = function (t) {
|
||
return t ? t in this.listeners_ : Object.keys(this.listeners_).length > 0
|
||
}, e.prototype.removeEventListener = function (t, e) {
|
||
var i = this.listeners_[t];
|
||
if (i) {
|
||
var r = i.indexOf(e);
|
||
t in this.pendingRemovals_ ? (i[r] = I, ++this.pendingRemovals_[t]) : (i.splice(r, 1), 0 === i.length && delete this.listeners_[t])
|
||
}
|
||
}, e
|
||
}(R), F = {
|
||
CHANGE: "change",
|
||
CLEAR: "clear",
|
||
CONTEXTMENU: "contextmenu",
|
||
CLICK: "click",
|
||
DBLCLICK: "dblclick",
|
||
DRAGENTER: "dragenter",
|
||
DRAGOVER: "dragover",
|
||
DROP: "drop",
|
||
ERROR: "error",
|
||
KEYDOWN: "keydown",
|
||
KEYPRESS: "keypress",
|
||
LOAD: "load",
|
||
MOUSEDOWN: "mousedown",
|
||
MOUSEMOVE: "mousemove",
|
||
MOUSEOUT: "mouseout",
|
||
MOUSEUP: "mouseup",
|
||
MOUSEWHEEL: "mousewheel",
|
||
MSPOINTERDOWN: "MSPointerDown",
|
||
RESIZE: "resize",
|
||
TOUCHSTART: "touchstart",
|
||
TOUCHMOVE: "touchmove",
|
||
TOUCHEND: "touchend",
|
||
WHEEL: "wheel"
|
||
};
|
||
|
||
function N(t) {
|
||
if (Array.isArray(t)) for (var e = 0, i = t.length; e < i; ++e) S(t[e]); else S(t)
|
||
}
|
||
|
||
var D = function (t) {
|
||
function e() {
|
||
t.call(this), this.revision_ = 0
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.changed = function () {
|
||
++this.revision_, this.dispatchEvent(F.CHANGE)
|
||
}, e.prototype.getRevision = function () {
|
||
return this.revision_
|
||
}, e.prototype.on = function (t, e) {
|
||
if (Array.isArray(t)) {
|
||
for (var i = t.length, r = new Array(i), o = 0; o < i; ++o) r[o] = w(this, t[o], e);
|
||
return r
|
||
}
|
||
return w(this, t, e)
|
||
}, e.prototype.once = function (t, e) {
|
||
if (Array.isArray(t)) {
|
||
for (var i = t.length, r = new Array(i), o = 0; o < i; ++o) r[o] = b(this, t[o], e);
|
||
return r
|
||
}
|
||
return b(this, t, e)
|
||
}, e.prototype.un = function (t, e) {
|
||
if (Array.isArray(t)) for (var i = 0, r = t.length; i < r; ++i) C(this, t[i], e); else C(this, t, e)
|
||
}, e
|
||
}(k), G = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, e), this.key = i, this.oldValue = r
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A), j = {};
|
||
|
||
function z(t) {
|
||
return j.hasOwnProperty(t) ? j[t] : j[t] = "change:" + t
|
||
}
|
||
|
||
var U = function (t) {
|
||
function e(e) {
|
||
t.call(this), a(this), this.values_ = {}, void 0 !== e && this.setProperties(e)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.get = function (t) {
|
||
var e;
|
||
return this.values_.hasOwnProperty(t) && (e = this.values_[t]), e
|
||
}, e.prototype.getKeys = function () {
|
||
return Object.keys(this.values_)
|
||
}, e.prototype.getProperties = function () {
|
||
return p({}, this.values_)
|
||
}, e.prototype.notify = function (t, e) {
|
||
var i;
|
||
i = z(t), this.dispatchEvent(new G(i, t, e)), i = c.PROPERTYCHANGE, this.dispatchEvent(new G(i, t, e))
|
||
}, e.prototype.set = function (t, e, i) {
|
||
if (i) this.values_[t] = e; else {
|
||
var r = this.values_[t];
|
||
this.values_[t] = e, r !== e && this.notify(t, r)
|
||
}
|
||
}, e.prototype.setProperties = function (t, e) {
|
||
for (var i in t) this.set(i, t[i], e)
|
||
}, e.prototype.unset = function (t, e) {
|
||
if (t in this.values_) {
|
||
var i = this.values_[t];
|
||
delete this.values_[t], e || this.notify(t, i)
|
||
}
|
||
}, e
|
||
}(D), B = "length", V = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e), this.element = i
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A), Y = function (t) {
|
||
function e(e, i) {
|
||
t.call(this);
|
||
var r = i || {};
|
||
if (this.unique_ = !!r.unique, this.array_ = e || [], this.unique_) for (var o = 0, n = this.array_.length; o < n; ++o) this.assertUnique_(this.array_[o], o);
|
||
this.updateLength_()
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.clear = function () {
|
||
for (; this.getLength() > 0;) this.pop()
|
||
}, e.prototype.extend = function (t) {
|
||
for (var e = 0, i = t.length; e < i; ++e) this.push(t[e]);
|
||
return this
|
||
}, e.prototype.forEach = function (t) {
|
||
for (var e = this.array_, i = 0, r = e.length; i < r; ++i) t(e[i], i, e)
|
||
}, e.prototype.getArray = function () {
|
||
return this.array_
|
||
}, e.prototype.item = function (t) {
|
||
return this.array_[t]
|
||
}, e.prototype.getLength = function () {
|
||
return this.get(B)
|
||
}, e.prototype.insertAt = function (t, e) {
|
||
this.unique_ && this.assertUnique_(e), this.array_.splice(t, 0, e), this.updateLength_(), this.dispatchEvent(new V(u.ADD, e))
|
||
}, e.prototype.pop = function () {
|
||
return this.removeAt(this.getLength() - 1)
|
||
}, e.prototype.push = function (t) {
|
||
this.unique_ && this.assertUnique_(t);
|
||
var e = this.getLength();
|
||
return this.insertAt(e, t), this.getLength()
|
||
}, e.prototype.remove = function (t) {
|
||
for (var e = this.array_, i = 0, r = e.length; i < r; ++i) if (e[i] === t) return this.removeAt(i)
|
||
}, e.prototype.removeAt = function (t) {
|
||
var e = this.array_[t];
|
||
return this.array_.splice(t, 1), this.updateLength_(), this.dispatchEvent(new V(u.REMOVE, e)), e
|
||
}, e.prototype.setAt = function (t, e) {
|
||
var i = this.getLength();
|
||
if (t < i) {
|
||
this.unique_ && this.assertUnique_(e, t);
|
||
var r = this.array_[t];
|
||
this.array_[t] = e, this.dispatchEvent(new V(u.REMOVE, r)), this.dispatchEvent(new V(u.ADD, e))
|
||
} else {
|
||
for (var o = i; o < t; ++o) this.insertAt(o, void 0);
|
||
this.insertAt(t, e)
|
||
}
|
||
}, e.prototype.updateLength_ = function () {
|
||
this.set(B, this.array_.length)
|
||
}, e.prototype.assertUnique_ = function (t, e) {
|
||
for (var i = 0, r = this.array_.length; i < r; ++i) if (this.array_[i] === t && i !== e) throw new h(58)
|
||
}, e
|
||
}(U);
|
||
|
||
function W(t, e) {
|
||
if (!t) throw new h(e)
|
||
}
|
||
|
||
function H(t) {
|
||
return "function" == typeof t ? t : (Array.isArray(t) ? e = t : (W("function" == typeof t.getZIndex, 41), e = [t]), function () {
|
||
return e
|
||
});
|
||
var e
|
||
}
|
||
|
||
var X = function (t) {
|
||
function e(e) {
|
||
if (t.call(this), this.id_ = void 0, this.geometryName_ = "geometry", this.style_ = null, this.styleFunction_ = void 0, this.geometryChangeKey_ = null, w(this, z(this.geometryName_), this.handleGeometryChanged_, this), e) if ("function" == typeof e.getSimplifiedGeometry) {
|
||
var i = e;
|
||
this.setGeometry(i)
|
||
} else {
|
||
var r = e;
|
||
this.setProperties(r)
|
||
}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.clone = function () {
|
||
var t = new e(this.getProperties());
|
||
t.setGeometryName(this.getGeometryName());
|
||
var i = this.getGeometry();
|
||
i && t.setGeometry(i.clone());
|
||
var r = this.getStyle();
|
||
return r && t.setStyle(r), t
|
||
}, e.prototype.getGeometry = function () {
|
||
return this.get(this.geometryName_)
|
||
}, e.prototype.getId = function () {
|
||
return this.id_
|
||
}, e.prototype.getGeometryName = function () {
|
||
return this.geometryName_
|
||
}, e.prototype.getStyle = function () {
|
||
return this.style_
|
||
}, e.prototype.getStyleFunction = function () {
|
||
return this.styleFunction_
|
||
}, e.prototype.handleGeometryChange_ = function () {
|
||
this.changed()
|
||
}, e.prototype.handleGeometryChanged_ = function () {
|
||
this.geometryChangeKey_ && (S(this.geometryChangeKey_), this.geometryChangeKey_ = null);
|
||
var t = this.getGeometry();
|
||
t && (this.geometryChangeKey_ = w(t, F.CHANGE, this.handleGeometryChange_, this)), this.changed()
|
||
}, e.prototype.setGeometry = function (t) {
|
||
this.set(this.geometryName_, t)
|
||
}, e.prototype.setStyle = function (t) {
|
||
this.style_ = t, this.styleFunction_ = t ? H(t) : void 0, this.changed()
|
||
}, e.prototype.setId = function (t) {
|
||
this.id_ = t, this.changed()
|
||
}, e.prototype.setGeometryName = function (t) {
|
||
C(this, z(this.geometryName_), this.handleGeometryChanged_, this), this.geometryName_ = t, w(this, z(this.geometryName_), this.handleGeometryChanged_, this), this.handleGeometryChanged_()
|
||
}, e
|
||
}(U);
|
||
|
||
function q(t, e, i) {
|
||
for (var r, o, n = i || Z, s = 0, a = t.length, l = !1; s < a;) (o = +n(t[r = s + (a - s >> 1)], e)) < 0 ? s = r + 1 : (a = r, l = !o);
|
||
return l ? s : ~s
|
||
}
|
||
|
||
function Z(t, e) {
|
||
return t > e ? 1 : t < e ? -1 : 0
|
||
}
|
||
|
||
function K(t, e) {
|
||
return t.indexOf(e) >= 0
|
||
}
|
||
|
||
function J(t, e, i) {
|
||
var r, o = t.length;
|
||
if (t[0] <= e) return 0;
|
||
if (e <= t[o - 1]) return o - 1;
|
||
if (i > 0) {
|
||
for (r = 1; r < o; ++r) if (t[r] < e) return r - 1
|
||
} else if (i < 0) {
|
||
for (r = 1; r < o; ++r) if (t[r] <= e) return r
|
||
} else for (r = 1; r < o; ++r) {
|
||
if (t[r] == e) return r;
|
||
if (t[r] < e) return t[r - 1] - e < e - t[r] ? r - 1 : r
|
||
}
|
||
return o - 1
|
||
}
|
||
|
||
function $(t, e, i) {
|
||
for (; e < i;) {
|
||
var r = t[e];
|
||
t[e] = t[i], t[i] = r, ++e, --i
|
||
}
|
||
}
|
||
|
||
function Q(t, e) {
|
||
for (var i = Array.isArray(e) ? e : [e], r = i.length, o = 0; o < r; o++) t[t.length] = i[o]
|
||
}
|
||
|
||
function tt(t, e) {
|
||
var i = t.indexOf(e), r = i > -1;
|
||
return r && t.splice(i, 1), r
|
||
}
|
||
|
||
function et(t, e) {
|
||
for (var i, r = t.length >>> 0, o = 0; o < r; o++) if (e(i = t[o], o, t)) return i;
|
||
return null
|
||
}
|
||
|
||
function it(t, e) {
|
||
var i = t.length;
|
||
if (i !== e.length) return !1;
|
||
for (var r = 0; r < i; r++) if (t[r] !== e[r]) return !1;
|
||
return !0
|
||
}
|
||
|
||
function rt(t, e) {
|
||
var i, r = t.length, o = Array(t.length);
|
||
for (i = 0; i < r; i++) o[i] = {index: i, value: t[i]};
|
||
for (o.sort(function (t, i) {
|
||
return e(t.value, i.value) || t.index - i.index
|
||
}), i = 0; i < t.length; i++) t[i] = o[i].value
|
||
}
|
||
|
||
function ot(t, e) {
|
||
var i;
|
||
return !t.every(function (r, o) {
|
||
return i = o, !e(r, o, t)
|
||
}) ? i : -1
|
||
}
|
||
|
||
function nt(t, e, i) {
|
||
var r = e || Z;
|
||
return t.every(function (e, o) {
|
||
if (0 === o) return !0;
|
||
var n = r(t[o - 1], e);
|
||
return !(n > 0 || i && 0 === n)
|
||
})
|
||
}
|
||
|
||
var st = {
|
||
BOTTOM_LEFT: "bottom-left",
|
||
BOTTOM_RIGHT: "bottom-right",
|
||
TOP_LEFT: "top-left",
|
||
TOP_RIGHT: "top-right"
|
||
}, at = {UNKNOWN: 0, INTERSECTING: 1, ABOVE: 2, RIGHT: 4, BELOW: 8, LEFT: 16};
|
||
|
||
function lt(t) {
|
||
for (var e = mt(), i = 0, r = t.length; i < r; ++i) St(e, t[i]);
|
||
return e
|
||
}
|
||
|
||
function ht(t, e, i) {
|
||
return i ? (i[0] = t[0] - e, i[1] = t[1] - e, i[2] = t[2] + e, i[3] = t[3] + e, i) : [t[0] - e, t[1] - e, t[2] + e, t[3] + e]
|
||
}
|
||
|
||
function ut(t, e) {
|
||
return e ? (e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e) : t.slice()
|
||
}
|
||
|
||
function ct(t, e, i) {
|
||
var r, o;
|
||
return (r = e < t[0] ? t[0] - e : t[2] < e ? e - t[2] : 0) * r + (o = i < t[1] ? t[1] - i : t[3] < i ? i - t[3] : 0) * o
|
||
}
|
||
|
||
function pt(t, e) {
|
||
return ft(t, e[0], e[1])
|
||
}
|
||
|
||
function dt(t, e) {
|
||
return t[0] <= e[0] && e[2] <= t[2] && t[1] <= e[1] && e[3] <= t[3]
|
||
}
|
||
|
||
function ft(t, e, i) {
|
||
return t[0] <= e && e <= t[2] && t[1] <= i && i <= t[3]
|
||
}
|
||
|
||
function gt(t, e) {
|
||
var i = t[0], r = t[1], o = t[2], n = t[3], s = e[0], a = e[1], l = at.UNKNOWN;
|
||
return s < i ? l |= at.LEFT : s > o && (l |= at.RIGHT), a < r ? l |= at.BELOW : a > n && (l |= at.ABOVE), l === at.UNKNOWN && (l = at.INTERSECTING), l
|
||
}
|
||
|
||
function mt() {
|
||
return [1 / 0, 1 / 0, -1 / 0, -1 / 0]
|
||
}
|
||
|
||
function yt(t, e, i, r, o) {
|
||
return o ? (o[0] = t, o[1] = e, o[2] = i, o[3] = r, o) : [t, e, i, r]
|
||
}
|
||
|
||
function vt(t) {
|
||
return yt(1 / 0, 1 / 0, -1 / 0, -1 / 0, t)
|
||
}
|
||
|
||
function _t(t, e) {
|
||
var i = t[0], r = t[1];
|
||
return yt(i, r, i, r, e)
|
||
}
|
||
|
||
function xt(t, e) {
|
||
return Et(vt(e), t)
|
||
}
|
||
|
||
function wt(t, e, i, r, o) {
|
||
return Tt(vt(o), t, e, i, r)
|
||
}
|
||
|
||
function bt(t, e) {
|
||
return t[0] == e[0] && t[2] == e[2] && t[1] == e[1] && t[3] == e[3]
|
||
}
|
||
|
||
function Ct(t, e) {
|
||
return e[0] < t[0] && (t[0] = e[0]), e[2] > t[2] && (t[2] = e[2]), e[1] < t[1] && (t[1] = e[1]), e[3] > t[3] && (t[3] = e[3]), t
|
||
}
|
||
|
||
function St(t, e) {
|
||
e[0] < t[0] && (t[0] = e[0]), e[0] > t[2] && (t[2] = e[0]), e[1] < t[1] && (t[1] = e[1]), e[1] > t[3] && (t[3] = e[1])
|
||
}
|
||
|
||
function Et(t, e) {
|
||
for (var i = 0, r = e.length; i < r; ++i) St(t, e[i]);
|
||
return t
|
||
}
|
||
|
||
function Tt(t, e, i, r, o) {
|
||
for (; i < r; i += o) Pt(t, e[i], e[i + 1]);
|
||
return t
|
||
}
|
||
|
||
function Rt(t, e) {
|
||
for (var i = 0, r = e.length; i < r; ++i) Et(t, e[i]);
|
||
return t
|
||
}
|
||
|
||
function Pt(t, e, i) {
|
||
t[0] = Math.min(t[0], e), t[1] = Math.min(t[1], i), t[2] = Math.max(t[2], e), t[3] = Math.max(t[3], i)
|
||
}
|
||
|
||
function Lt(t, e, i) {
|
||
var r;
|
||
return (r = e.call(i, Ot(t))) ? r : (r = e.call(i, Mt(t))) ? r : (r = e.call(i, zt(t))) ? r : (r = e.call(i, jt(t))) || !1
|
||
}
|
||
|
||
function It(t) {
|
||
var e = 0;
|
||
return Vt(t) || (e = Ut(t) * Nt(t)), e
|
||
}
|
||
|
||
function Ot(t) {
|
||
return [t[0], t[1]]
|
||
}
|
||
|
||
function Mt(t) {
|
||
return [t[2], t[1]]
|
||
}
|
||
|
||
function At(t) {
|
||
return [(t[0] + t[2]) / 2, (t[1] + t[3]) / 2]
|
||
}
|
||
|
||
function kt(t, e) {
|
||
var i;
|
||
return e === st.BOTTOM_LEFT ? i = Ot(t) : e === st.BOTTOM_RIGHT ? i = Mt(t) : e === st.TOP_LEFT ? i = jt(t) : e === st.TOP_RIGHT ? i = zt(t) : W(!1, 13), i
|
||
}
|
||
|
||
function Ft(t, e, i, r, o) {
|
||
var n = e * r[0] / 2, s = e * r[1] / 2, a = Math.cos(i), l = Math.sin(i), h = n * a, u = n * l, c = s * a,
|
||
p = s * l, d = t[0], f = t[1], g = d - h + p, m = d - h - p, y = d + h - p, v = d + h + p,
|
||
_ = f - u - c, x = f - u + c, w = f + u + c, b = f + u - c;
|
||
return yt(Math.min(g, m, y, v), Math.min(_, x, w, b), Math.max(g, m, y, v), Math.max(_, x, w, b), o)
|
||
}
|
||
|
||
function Nt(t) {
|
||
return t[3] - t[1]
|
||
}
|
||
|
||
function Dt(t, e, i) {
|
||
var r = i || [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
||
return Bt(t, e) ? (t[0] > e[0] ? r[0] = t[0] : r[0] = e[0], t[1] > e[1] ? r[1] = t[1] : r[1] = e[1], t[2] < e[2] ? r[2] = t[2] : r[2] = e[2], t[3] < e[3] ? r[3] = t[3] : r[3] = e[3]) : vt(r), r
|
||
}
|
||
|
||
function Gt(t) {
|
||
return [t[2] - t[0], t[3] - t[1]]
|
||
}
|
||
|
||
function jt(t) {
|
||
return [t[0], t[3]]
|
||
}
|
||
|
||
function zt(t) {
|
||
return [t[2], t[3]]
|
||
}
|
||
|
||
function Ut(t) {
|
||
return t[2] - t[0]
|
||
}
|
||
|
||
function Bt(t, e) {
|
||
return t[0] <= e[2] && t[2] >= e[0] && t[1] <= e[3] && t[3] >= e[1]
|
||
}
|
||
|
||
function Vt(t) {
|
||
return t[2] < t[0] || t[3] < t[1]
|
||
}
|
||
|
||
function Yt(t, e) {
|
||
return e ? (e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e) : t
|
||
}
|
||
|
||
function Wt(t, e) {
|
||
var i = (t[2] - t[0]) / 2 * (e - 1), r = (t[3] - t[1]) / 2 * (e - 1);
|
||
t[0] -= i, t[2] += i, t[1] -= r, t[3] += r
|
||
}
|
||
|
||
function Ht(t, e, i) {
|
||
var r = !1, o = gt(t, e), n = gt(t, i);
|
||
if (o === at.INTERSECTING || n === at.INTERSECTING) r = !0; else {
|
||
var s, a, l = t[0], h = t[1], u = t[2], c = t[3], p = e[0], d = e[1], f = i[0], g = i[1],
|
||
m = (g - d) / (f - p);
|
||
n & at.ABOVE && !(o & at.ABOVE) && (r = (s = f - (g - c) / m) >= l && s <= u), r || !(n & at.RIGHT) || o & at.RIGHT || (r = (a = g - (f - u) * m) >= h && a <= c), r || !(n & at.BELOW) || o & at.BELOW || (r = (s = f - (g - h) / m) >= l && s <= u), r || !(n & at.LEFT) || o & at.LEFT || (r = (a = g - (f - l) * m) >= h && a <= c)
|
||
}
|
||
return r
|
||
}
|
||
|
||
function Xt(t, e, i) {
|
||
var r = [t[0], t[1], t[0], t[3], t[2], t[1], t[2], t[3]];
|
||
return e(r, r, 2), function (t, e, i) {
|
||
return yt(Math.min.apply(null, t), Math.min.apply(null, e), Math.max.apply(null, t), Math.max.apply(null, e), i)
|
||
}([r[0], r[2], r[4], r[6]], [r[1], r[3], r[5], r[7]], i)
|
||
}
|
||
|
||
var qt = {XY: "XY", XYZ: "XYZ", XYM: "XYM", XYZM: "XYZM"}, Zt = {
|
||
POINT: "Point",
|
||
LINE_STRING: "LineString",
|
||
LINEAR_RING: "LinearRing",
|
||
POLYGON: "Polygon",
|
||
MULTI_POINT: "MultiPoint",
|
||
MULTI_LINE_STRING: "MultiLineString",
|
||
MULTI_POLYGON: "MultiPolygon",
|
||
GEOMETRY_COLLECTION: "GeometryCollection",
|
||
CIRCLE: "Circle"
|
||
};
|
||
|
||
function Kt(t, e, i, r, o, n) {
|
||
for (var s = n || [], a = 0, l = e; l < i; l += r) {
|
||
var h = t[l], u = t[l + 1];
|
||
s[a++] = o[0] * h + o[2] * u + o[4], s[a++] = o[1] * h + o[3] * u + o[5]
|
||
}
|
||
return n && s.length != a && (s.length = a), s
|
||
}
|
||
|
||
function Jt(t, e, i, r, o, n, s) {
|
||
for (var a = s || [], l = Math.cos(o), h = Math.sin(o), u = n[0], c = n[1], p = 0, d = e; d < i; d += r) {
|
||
var f = t[d] - u, g = t[d + 1] - c;
|
||
a[p++] = u + f * l - g * h, a[p++] = c + f * h + g * l;
|
||
for (var m = d + 2; m < d + r; ++m) a[p++] = t[m]
|
||
}
|
||
return s && a.length != p && (a.length = p), a
|
||
}
|
||
|
||
function $t(t, e, i, r, o, n, s, a) {
|
||
for (var l = a || [], h = s[0], u = s[1], c = 0, p = e; p < i; p += r) {
|
||
var d = t[p] - h, f = t[p + 1] - u;
|
||
l[c++] = h + o * d, l[c++] = u + n * f;
|
||
for (var g = p + 2; g < p + r; ++g) l[c++] = t[g]
|
||
}
|
||
return a && l.length != c && (l.length = c), l
|
||
}
|
||
|
||
function Qt(t, e, i, r, o, n, s) {
|
||
for (var a = s || [], l = 0, h = e; h < i; h += r) {
|
||
a[l++] = t[h] + o, a[l++] = t[h + 1] + n;
|
||
for (var u = h + 2; u < h + r; ++u) a[l++] = t[u]
|
||
}
|
||
return s && a.length != l && (a.length = l), a
|
||
}
|
||
|
||
function te(t, e, i) {
|
||
return Math.min(Math.max(t, e), i)
|
||
}
|
||
|
||
var ee = "cosh" in Math ? Math.cosh : function (t) {
|
||
var e = Math.exp(t);
|
||
return (e + 1 / e) / 2
|
||
};
|
||
|
||
function ie(t) {
|
||
return W(0 < t, 29), Math.pow(2, Math.ceil(Math.log(t) / Math.LN2))
|
||
}
|
||
|
||
function re(t, e, i, r, o, n) {
|
||
var s = o - i, a = n - r;
|
||
if (0 !== s || 0 !== a) {
|
||
var l = ((t - i) * s + (e - r) * a) / (s * s + a * a);
|
||
l > 1 ? (i = o, r = n) : l > 0 && (i += s * l, r += a * l)
|
||
}
|
||
return oe(t, e, i, r)
|
||
}
|
||
|
||
function oe(t, e, i, r) {
|
||
var o = i - t, n = r - e;
|
||
return o * o + n * n
|
||
}
|
||
|
||
function ne(t) {
|
||
for (var e = t.length, i = 0; i < e; i++) {
|
||
for (var r = i, o = Math.abs(t[i][i]), n = i + 1; n < e; n++) {
|
||
var s = Math.abs(t[n][i]);
|
||
s > o && (o = s, r = n)
|
||
}
|
||
if (0 === o) return null;
|
||
var a = t[r];
|
||
t[r] = t[i], t[i] = a;
|
||
for (var l = i + 1; l < e; l++) for (var h = -t[l][i] / t[i][i], u = i; u < e + 1; u++) i == u ? t[l][u] = 0 : t[l][u] += h * t[i][u]
|
||
}
|
||
for (var c = new Array(e), p = e - 1; p >= 0; p--) {
|
||
c[p] = t[p][e] / t[p][p];
|
||
for (var d = p - 1; d >= 0; d--) t[d][e] -= t[d][p] * c[p]
|
||
}
|
||
return c
|
||
}
|
||
|
||
function se(t) {
|
||
return 180 * t / Math.PI
|
||
}
|
||
|
||
function ae(t) {
|
||
return t * Math.PI / 180
|
||
}
|
||
|
||
function le(t, e) {
|
||
var i = t % e;
|
||
return i * e < 0 ? i + e : i
|
||
}
|
||
|
||
function he(t, e, i) {
|
||
return t + i * (e - t)
|
||
}
|
||
|
||
/**
|
||
* @license
|
||
* Latitude/longitude spherical geodesy formulae taken from
|
||
* http://www.movable-type.co.uk/scripts/latlong.html
|
||
* Licensed under CC-BY-3.0.
|
||
*/var ue = 6371008.8;
|
||
|
||
function ce(t, e, i) {
|
||
var r = i || ue, o = ae(t[1]), n = ae(e[1]), s = (n - o) / 2, a = ae(e[0] - t[0]) / 2,
|
||
l = Math.sin(s) * Math.sin(s) + Math.sin(a) * Math.sin(a) * Math.cos(o) * Math.cos(n);
|
||
return 2 * r * Math.atan2(Math.sqrt(l), Math.sqrt(1 - l))
|
||
}
|
||
|
||
function pe(t, e) {
|
||
for (var i = 0, r = 0, o = t.length; r < o - 1; ++r) i += ce(t[r], t[r + 1], e);
|
||
return i
|
||
}
|
||
|
||
function de(t, e) {
|
||
for (var i = 0, r = t.length, o = t[r - 1][0], n = t[r - 1][1], s = 0; s < r; s++) {
|
||
var a = t[s][0], l = t[s][1];
|
||
i += ae(a - o) * (2 + Math.sin(ae(n)) + Math.sin(ae(l))), o = a, n = l
|
||
}
|
||
return i * e * e / 2
|
||
}
|
||
|
||
function fe(t, e) {
|
||
var i = e || {}, r = i.radius || ue, o = i.projection || "EPSG:3857", n = t.getType();
|
||
n !== Zt.GEOMETRY_COLLECTION && (t = t.clone().transform(o, "EPSG:4326"));
|
||
var s, a, l, h, u, c, p = 0;
|
||
switch (n) {
|
||
case Zt.POINT:
|
||
case Zt.MULTI_POINT:
|
||
case Zt.LINE_STRING:
|
||
case Zt.MULTI_LINE_STRING:
|
||
case Zt.LINEAR_RING:
|
||
break;
|
||
case Zt.POLYGON:
|
||
for (s = t.getCoordinates(), p = Math.abs(de(s[0], r)), l = 1, h = s.length; l < h; ++l) p -= Math.abs(de(s[l], r));
|
||
break;
|
||
case Zt.MULTI_POLYGON:
|
||
for (l = 0, h = (s = t.getCoordinates()).length; l < h; ++l) for (a = s[l], p += Math.abs(de(a[0], r)), u = 1, c = a.length; u < c; ++u) p -= Math.abs(de(a[u], r));
|
||
break;
|
||
case Zt.GEOMETRY_COLLECTION:
|
||
var d = t.getGeometries();
|
||
for (l = 0, h = d.length; l < h; ++l) p += fe(d[l], e);
|
||
break;
|
||
default:
|
||
throw new Error("Unsupported geometry type: " + n)
|
||
}
|
||
return p
|
||
}
|
||
|
||
function ge(t, e, i, r) {
|
||
var o = r || ue, n = ae(t[1]), s = ae(t[0]), a = e / o,
|
||
l = Math.asin(Math.sin(n) * Math.cos(a) + Math.cos(n) * Math.sin(a) * Math.cos(i));
|
||
return [se(s + Math.atan2(Math.sin(i) * Math.sin(a) * Math.cos(n), Math.cos(a) - Math.sin(n) * Math.sin(l))), se(l)]
|
||
}
|
||
|
||
var me = {
|
||
DEGREES: "degrees",
|
||
FEET: "ft",
|
||
METERS: "m",
|
||
PIXELS: "pixels",
|
||
TILE_PIXELS: "tile-pixels",
|
||
USFEET: "us-ft"
|
||
}, ye = {};
|
||
ye[me.DEGREES] = 2 * Math.PI * 6370997 / 360, ye[me.FEET] = .3048, ye[me.METERS] = 1, ye[me.USFEET] = 1200 / 3937;
|
||
var ve = me, _e = function (t) {
|
||
this.code_ = t.code, this.units_ = t.units, this.extent_ = void 0 !== t.extent ? t.extent : null, this.worldExtent_ = void 0 !== t.worldExtent ? t.worldExtent : null, this.axisOrientation_ = void 0 !== t.axisOrientation ? t.axisOrientation : "enu", this.global_ = void 0 !== t.global && t.global, this.canWrapX_ = !(!this.global_ || !this.extent_), this.getPointResolutionFunc_ = t.getPointResolution, this.defaultTileGrid_ = null, this.metersPerUnit_ = t.metersPerUnit
|
||
};
|
||
_e.prototype.canWrapX = function () {
|
||
return this.canWrapX_
|
||
}, _e.prototype.getCode = function () {
|
||
return this.code_
|
||
}, _e.prototype.getExtent = function () {
|
||
return this.extent_
|
||
}, _e.prototype.getUnits = function () {
|
||
return this.units_
|
||
}, _e.prototype.getMetersPerUnit = function () {
|
||
return this.metersPerUnit_ || ye[this.units_]
|
||
}, _e.prototype.getWorldExtent = function () {
|
||
return this.worldExtent_
|
||
}, _e.prototype.getAxisOrientation = function () {
|
||
return this.axisOrientation_
|
||
}, _e.prototype.isGlobal = function () {
|
||
return this.global_
|
||
}, _e.prototype.setGlobal = function (t) {
|
||
this.global_ = t, this.canWrapX_ = !(!t || !this.extent_)
|
||
}, _e.prototype.getDefaultTileGrid = function () {
|
||
return this.defaultTileGrid_
|
||
}, _e.prototype.setDefaultTileGrid = function (t) {
|
||
this.defaultTileGrid_ = t
|
||
}, _e.prototype.setExtent = function (t) {
|
||
this.extent_ = t, this.canWrapX_ = !(!this.global_ || !t)
|
||
}, _e.prototype.setWorldExtent = function (t) {
|
||
this.worldExtent_ = t
|
||
}, _e.prototype.setGetPointResolution = function (t) {
|
||
this.getPointResolutionFunc_ = t
|
||
}, _e.prototype.getPointResolutionFunc = function () {
|
||
return this.getPointResolutionFunc_
|
||
};
|
||
var xe = _e, we = 6378137, be = Math.PI * we, Ce = [-be, -be, be, be], Se = [-180, -85, 180, 85],
|
||
Ee = function (t) {
|
||
function e(e) {
|
||
t.call(this, {
|
||
code: e,
|
||
units: ve.METERS,
|
||
extent: Ce,
|
||
global: !0,
|
||
worldExtent: Se,
|
||
getPointResolution: function (t, e) {
|
||
return t / ee(e[1] / we)
|
||
}
|
||
})
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(xe),
|
||
Te = [new Ee("EPSG:3857"), new Ee("EPSG:102100"), new Ee("EPSG:102113"), new Ee("EPSG:900913"), new Ee("urn:ogc:def:crs:EPSG:6.18:3:3857"), new Ee("urn:ogc:def:crs:EPSG::3857"), new Ee("http://www.opengis.net/gml/srs/epsg.xml#3857")];
|
||
|
||
function Re(t, e, i) {
|
||
var r = t.length, o = i > 1 ? i : 2, n = e;
|
||
void 0 === n && (n = o > 2 ? t.slice() : new Array(r));
|
||
for (var s = be, a = 0; a < r; a += o) {
|
||
n[a] = s * t[a] / 180;
|
||
var l = we * Math.log(Math.tan(Math.PI * (t[a + 1] + 90) / 360));
|
||
l > s ? l = s : l < -s && (l = -s), n[a + 1] = l
|
||
}
|
||
return n
|
||
}
|
||
|
||
function Pe(t, e, i) {
|
||
var r = t.length, o = i > 1 ? i : 2, n = e;
|
||
void 0 === n && (n = o > 2 ? t.slice() : new Array(r));
|
||
for (var s = 0; s < r; s += o) n[s] = 180 * t[s] / be, n[s + 1] = 360 * Math.atan(Math.exp(t[s + 1] / we)) / Math.PI - 90;
|
||
return n
|
||
}
|
||
|
||
var Le = [-180, -90, 180, 90], Ie = 6378137 * Math.PI / 180, Oe = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, {
|
||
code: e,
|
||
units: ve.DEGREES,
|
||
extent: Le,
|
||
axisOrientation: i,
|
||
global: !0,
|
||
metersPerUnit: Ie,
|
||
worldExtent: Le
|
||
})
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(xe),
|
||
Me = [new Oe("CRS:84"), new Oe("EPSG:4326", "neu"), new Oe("urn:ogc:def:crs:EPSG::4326", "neu"), new Oe("urn:ogc:def:crs:EPSG:6.6:4326", "neu"), new Oe("urn:ogc:def:crs:OGC:1.3:CRS84"), new Oe("urn:ogc:def:crs:OGC:2:84"), new Oe("http://www.opengis.net/gml/srs/epsg.xml#4326", "neu"), new Oe("urn:x-ogc:def:crs:EPSG:4326", "neu")],
|
||
Ae = {};
|
||
|
||
function ke() {
|
||
Ae = {}
|
||
}
|
||
|
||
function Fe(t) {
|
||
return Ae[t] || null
|
||
}
|
||
|
||
function Ne(t, e) {
|
||
Ae[t] = e
|
||
}
|
||
|
||
var De = {};
|
||
|
||
function Ge() {
|
||
De = {}
|
||
}
|
||
|
||
function je(t, e, i) {
|
||
var r = t.getCode(), o = e.getCode();
|
||
r in De || (De[r] = {}), De[r][o] = i
|
||
}
|
||
|
||
function ze(t, e) {
|
||
var i;
|
||
return t in De && e in De[t] && (i = De[t][e]), i
|
||
}
|
||
|
||
function Ue(t, e, i) {
|
||
var r;
|
||
if (void 0 !== e) {
|
||
for (var o = 0, n = t.length; o < n; ++o) e[o] = t[o];
|
||
r = e
|
||
} else r = t.slice();
|
||
return r
|
||
}
|
||
|
||
function Be(t, e, i) {
|
||
if (void 0 !== e && t !== e) {
|
||
for (var r = 0, o = t.length; r < o; ++r) e[r] = t[r];
|
||
t = e
|
||
}
|
||
return t
|
||
}
|
||
|
||
function Ve(t) {
|
||
Ne(t.getCode(), t), je(t, t, Ue)
|
||
}
|
||
|
||
function Ye(t) {
|
||
t.forEach(Ve)
|
||
}
|
||
|
||
function We(t) {
|
||
return "string" == typeof t ? Fe(t) : t || null
|
||
}
|
||
|
||
function He(t, e, i, r) {
|
||
var o, n = (t = We(t)).getPointResolutionFunc();
|
||
if (n) o = n(e, i); else if (t.getUnits() == ve.DEGREES && !r || r == ve.DEGREES) o = e; else {
|
||
var s = ti(t, We("EPSG:4326")),
|
||
a = [i[0] - e / 2, i[1], i[0] + e / 2, i[1], i[0], i[1] - e / 2, i[0], i[1] + e / 2];
|
||
o = (ce((a = s(a, a, 2)).slice(0, 2), a.slice(2, 4)) + ce(a.slice(4, 6), a.slice(6, 8))) / 2;
|
||
var l = r ? ye[r] : t.getMetersPerUnit();
|
||
void 0 !== l && (o /= l)
|
||
}
|
||
return o
|
||
}
|
||
|
||
function Xe(t) {
|
||
Ye(t), t.forEach(function (e) {
|
||
t.forEach(function (t) {
|
||
e !== t && je(e, t, Ue)
|
||
})
|
||
})
|
||
}
|
||
|
||
function qe(t, e, i, r) {
|
||
t.forEach(function (t) {
|
||
e.forEach(function (e) {
|
||
je(t, e, i), je(e, t, r)
|
||
})
|
||
})
|
||
}
|
||
|
||
function Ze(t, e) {
|
||
return t ? "string" == typeof t ? We(t) : t : We(e)
|
||
}
|
||
|
||
function Ke(t) {
|
||
return function (e, i, r) {
|
||
for (var o = e.length, n = void 0 !== r ? r : 2, s = void 0 !== i ? i : new Array(o), a = 0; a < o; a += n) {
|
||
var l = t([e[a], e[a + 1]]);
|
||
s[a] = l[0], s[a + 1] = l[1];
|
||
for (var h = n - 1; h >= 2; --h) s[a + h] = e[a + h]
|
||
}
|
||
return s
|
||
}
|
||
}
|
||
|
||
function Je(t, e, i, r) {
|
||
var o = We(t), n = We(e);
|
||
je(o, n, Ke(i)), je(n, o, Ke(r))
|
||
}
|
||
|
||
function $e(t, e) {
|
||
return ii(t, "EPSG:4326", void 0 !== e ? e : "EPSG:3857")
|
||
}
|
||
|
||
function Qe(t, e) {
|
||
if (t === e) return !0;
|
||
var i = t.getUnits() === e.getUnits();
|
||
return t.getCode() === e.getCode() ? i : ti(t, e) === Ue && i
|
||
}
|
||
|
||
function ti(t, e) {
|
||
var i = ze(t.getCode(), e.getCode());
|
||
return i || (i = Be), i
|
||
}
|
||
|
||
function ei(t, e) {
|
||
return ti(We(t), We(e))
|
||
}
|
||
|
||
function ii(t, e, i) {
|
||
return ei(e, i)(t, void 0, t.length)
|
||
}
|
||
|
||
function ri(t, e, i) {
|
||
return Xt(t, ei(e, i))
|
||
}
|
||
|
||
function oi() {
|
||
Xe(Te), Xe(Me), qe(Me, Te, Re, Pe)
|
||
}
|
||
|
||
oi();
|
||
var ni = new Array(6);
|
||
|
||
function si() {
|
||
return [1, 0, 0, 1, 0, 0]
|
||
}
|
||
|
||
function ai(t) {
|
||
return hi(t, 1, 0, 0, 1, 0, 0)
|
||
}
|
||
|
||
function li(t, e) {
|
||
var i = t[0], r = t[1], o = t[2], n = t[3], s = t[4], a = t[5], l = e[0], h = e[1], u = e[2], c = e[3],
|
||
p = e[4], d = e[5];
|
||
return t[0] = i * l + o * h, t[1] = r * l + n * h, t[2] = i * u + o * c, t[3] = r * u + n * c, t[4] = i * p + o * d + s, t[5] = r * p + n * d + a, t
|
||
}
|
||
|
||
function hi(t, e, i, r, o, n, s) {
|
||
return t[0] = e, t[1] = i, t[2] = r, t[3] = o, t[4] = n, t[5] = s, t
|
||
}
|
||
|
||
function ui(t, e) {
|
||
return t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t[4] = e[4], t[5] = e[5], t
|
||
}
|
||
|
||
function ci(t, e) {
|
||
var i = e[0], r = e[1];
|
||
return e[0] = t[0] * i + t[2] * r + t[4], e[1] = t[1] * i + t[3] * r + t[5], e
|
||
}
|
||
|
||
function pi(t, e) {
|
||
var i = Math.cos(e), r = Math.sin(e);
|
||
return li(t, hi(ni, i, r, -r, i, 0, 0))
|
||
}
|
||
|
||
function di(t, e, i) {
|
||
return li(t, hi(ni, e, 0, 0, i, 0, 0))
|
||
}
|
||
|
||
function fi(t, e, i) {
|
||
return li(t, hi(ni, 1, 0, 0, 1, e, i))
|
||
}
|
||
|
||
function gi(t, e, i, r, o, n, s, a) {
|
||
var l = Math.sin(n), h = Math.cos(n);
|
||
return t[0] = r * h, t[1] = o * l, t[2] = -r * l, t[3] = o * h, t[4] = s * r * h - a * r * l + e, t[5] = s * o * l + a * o * h + i, t
|
||
}
|
||
|
||
function mi(t) {
|
||
var e = yi(t);
|
||
W(0 !== e, 32);
|
||
var i = t[0], r = t[1], o = t[2], n = t[3], s = t[4], a = t[5];
|
||
return t[0] = n / e, t[1] = -r / e, t[2] = -o / e, t[3] = i / e, t[4] = (o * a - n * s) / e, t[5] = -(i * a - r * s) / e, t
|
||
}
|
||
|
||
function yi(t) {
|
||
return t[0] * t[3] - t[1] * t[2]
|
||
}
|
||
|
||
var vi = [1, 0, 0, 1, 0, 0], _i = function (t) {
|
||
function e() {
|
||
t.call(this), this.extent_ = [1 / 0, 1 / 0, -1 / 0, -1 / 0], this.extentRevision_ = -1, this.simplifiedGeometryCache = {}, this.simplifiedGeometryMaxMinSquaredTolerance = 0, this.simplifiedGeometryRevision = 0
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.clone = function () {
|
||
return n()
|
||
}, e.prototype.closestPointXY = function (t, e, i, r) {
|
||
return n()
|
||
}, e.prototype.containsXY = function (t, e) {
|
||
return !1
|
||
}, e.prototype.getClosestPoint = function (t, e) {
|
||
var i = e || [NaN, NaN];
|
||
return this.closestPointXY(t[0], t[1], i, 1 / 0), i
|
||
}, e.prototype.intersectsCoordinate = function (t) {
|
||
return this.containsXY(t[0], t[1])
|
||
}, e.prototype.computeExtent = function (t) {
|
||
return n()
|
||
}, e.prototype.getExtent = function (t) {
|
||
return this.extentRevision_ != this.getRevision() && (this.extent_ = this.computeExtent(this.extent_), this.extentRevision_ = this.getRevision()), Yt(this.extent_, t)
|
||
}, e.prototype.rotate = function (t, e) {
|
||
n()
|
||
}, e.prototype.scale = function (t, e, i) {
|
||
n()
|
||
}, e.prototype.simplify = function (t) {
|
||
return this.getSimplifiedGeometry(t * t)
|
||
}, e.prototype.getSimplifiedGeometry = function (t) {
|
||
return n()
|
||
}, e.prototype.getType = function () {
|
||
return n()
|
||
}, e.prototype.applyTransform = function (t) {
|
||
n()
|
||
}, e.prototype.intersectsExtent = function (t) {
|
||
return n()
|
||
}, e.prototype.translate = function (t, e) {
|
||
n()
|
||
}, e.prototype.transform = function (t, e) {
|
||
var i = We(t), r = i.getUnits() == ve.TILE_PIXELS ? function (t, r, o) {
|
||
var n = i.getExtent(), s = i.getWorldExtent(), a = Nt(s) / Nt(n);
|
||
return gi(vi, s[0], s[3], a, -a, 0, 0, 0), Kt(t, 0, t.length, o, vi, r), ei(i, e)(t, r, o)
|
||
} : ei(i, e);
|
||
return this.applyTransform(r), this
|
||
}, e
|
||
}(U);
|
||
|
||
function xi(t) {
|
||
var e;
|
||
return t == qt.XY ? e = 2 : t == qt.XYZ || t == qt.XYM ? e = 3 : t == qt.XYZM && (e = 4), e
|
||
}
|
||
|
||
function wi(t, e, i) {
|
||
var r = t.getFlatCoordinates();
|
||
if (r) {
|
||
var o = t.getStride();
|
||
return Kt(r, 0, r.length, o, e, i)
|
||
}
|
||
return null
|
||
}
|
||
|
||
var bi = function (t) {
|
||
function e() {
|
||
t.call(this), this.layout = qt.XY, this.stride = 2, this.flatCoordinates = null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.computeExtent = function (t) {
|
||
return wt(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, t)
|
||
}, e.prototype.getCoordinates = function () {
|
||
return n()
|
||
}, e.prototype.getFirstCoordinate = function () {
|
||
return this.flatCoordinates.slice(0, this.stride)
|
||
}, e.prototype.getFlatCoordinates = function () {
|
||
return this.flatCoordinates
|
||
}, e.prototype.getLastCoordinate = function () {
|
||
return this.flatCoordinates.slice(this.flatCoordinates.length - this.stride)
|
||
}, e.prototype.getLayout = function () {
|
||
return this.layout
|
||
}, e.prototype.getSimplifiedGeometry = function (t) {
|
||
if (this.simplifiedGeometryRevision != this.getRevision() && (d(this.simplifiedGeometryCache), this.simplifiedGeometryMaxMinSquaredTolerance = 0, this.simplifiedGeometryRevision = this.getRevision()), t < 0 || 0 !== this.simplifiedGeometryMaxMinSquaredTolerance && t <= this.simplifiedGeometryMaxMinSquaredTolerance) return this;
|
||
var e = t.toString();
|
||
if (this.simplifiedGeometryCache.hasOwnProperty(e)) return this.simplifiedGeometryCache[e];
|
||
var i = this.getSimplifiedGeometryInternal(t);
|
||
return i.getFlatCoordinates().length < this.flatCoordinates.length ? (this.simplifiedGeometryCache[e] = i, i) : (this.simplifiedGeometryMaxMinSquaredTolerance = t, this)
|
||
}, e.prototype.getSimplifiedGeometryInternal = function (t) {
|
||
return this
|
||
}, e.prototype.getStride = function () {
|
||
return this.stride
|
||
}, e.prototype.setFlatCoordinates = function (t, e) {
|
||
this.stride = xi(t), this.layout = t, this.flatCoordinates = e
|
||
}, e.prototype.setCoordinates = function (t, e) {
|
||
n()
|
||
}, e.prototype.setLayout = function (t, e, i) {
|
||
var r;
|
||
if (t) r = xi(t); else {
|
||
for (var o = 0; o < i; ++o) {
|
||
if (0 === e.length) return this.layout = qt.XY, void (this.stride = 2);
|
||
e = e[0]
|
||
}
|
||
t = function (t) {
|
||
var e;
|
||
2 == t ? e = qt.XY : 3 == t ? e = qt.XYZ : 4 == t && (e = qt.XYZM);
|
||
return e
|
||
}(r = e.length)
|
||
}
|
||
this.layout = t, this.stride = r
|
||
}, e.prototype.applyTransform = function (t) {
|
||
this.flatCoordinates && (t(this.flatCoordinates, this.flatCoordinates, this.stride), this.changed())
|
||
}, e.prototype.rotate = function (t, e) {
|
||
var i = this.getFlatCoordinates();
|
||
if (i) {
|
||
var r = this.getStride();
|
||
Jt(i, 0, i.length, r, t, e, i), this.changed()
|
||
}
|
||
}, e.prototype.scale = function (t, e, i) {
|
||
var r = e;
|
||
void 0 === r && (r = t);
|
||
var o = i;
|
||
o || (o = At(this.getExtent()));
|
||
var n = this.getFlatCoordinates();
|
||
if (n) {
|
||
var s = this.getStride();
|
||
$t(n, 0, n.length, s, t, r, o, n), this.changed()
|
||
}
|
||
}, e.prototype.translate = function (t, e) {
|
||
var i = this.getFlatCoordinates();
|
||
if (i) {
|
||
var r = this.getStride();
|
||
Qt(i, 0, i.length, r, t, e, i), this.changed()
|
||
}
|
||
}, e
|
||
}(_i);
|
||
|
||
function Ci(t, e, i, r) {
|
||
for (var o = 0, n = t[i - r], s = t[i - r + 1]; e < i; e += r) {
|
||
var a = t[e], l = t[e + 1];
|
||
o += s * a - n * l, n = a, s = l
|
||
}
|
||
return o / 2
|
||
}
|
||
|
||
function Si(t, e, i, r) {
|
||
for (var o = 0, n = 0, s = i.length; n < s; ++n) {
|
||
var a = i[n];
|
||
o += Ci(t, e, a, r), e = a
|
||
}
|
||
return o
|
||
}
|
||
|
||
function Ei(t, e, i, r) {
|
||
for (var o = 0, n = 0, s = i.length; n < s; ++n) {
|
||
var a = i[n];
|
||
o += Si(t, e, a, r), e = a[a.length - 1]
|
||
}
|
||
return o
|
||
}
|
||
|
||
function Ti(t, e, i, r, o, n, s) {
|
||
var a, l = t[e], h = t[e + 1], u = t[i] - l, c = t[i + 1] - h;
|
||
if (0 === u && 0 === c) a = e; else {
|
||
var p = ((o - l) * u + (n - h) * c) / (u * u + c * c);
|
||
if (p > 1) a = i; else {
|
||
if (p > 0) {
|
||
for (var d = 0; d < r; ++d) s[d] = he(t[e + d], t[i + d], p);
|
||
return void (s.length = r)
|
||
}
|
||
a = e
|
||
}
|
||
}
|
||
for (var f = 0; f < r; ++f) s[f] = t[a + f];
|
||
s.length = r
|
||
}
|
||
|
||
function Ri(t, e, i, r, o) {
|
||
var n = t[e], s = t[e + 1];
|
||
for (e += r; e < i; e += r) {
|
||
var a = t[e], l = t[e + 1], h = oe(n, s, a, l);
|
||
h > o && (o = h), n = a, s = l
|
||
}
|
||
return o
|
||
}
|
||
|
||
function Pi(t, e, i, r, o) {
|
||
for (var n = 0, s = i.length; n < s; ++n) {
|
||
var a = i[n];
|
||
o = Ri(t, e, a, r, o), e = a
|
||
}
|
||
return o
|
||
}
|
||
|
||
function Li(t, e, i, r, o) {
|
||
for (var n = 0, s = i.length; n < s; ++n) {
|
||
var a = i[n];
|
||
o = Pi(t, e, a, r, o), e = a[a.length - 1]
|
||
}
|
||
return o
|
||
}
|
||
|
||
function Ii(t, e, i, r, o, n, s, a, l, h, u) {
|
||
if (e == i) return h;
|
||
var c, p;
|
||
if (0 === o) {
|
||
if ((p = oe(s, a, t[e], t[e + 1])) < h) {
|
||
for (c = 0; c < r; ++c) l[c] = t[e + c];
|
||
return l.length = r, p
|
||
}
|
||
return h
|
||
}
|
||
for (var d = u || [NaN, NaN], f = e + r; f < i;) if (Ti(t, f - r, f, r, s, a, d), (p = oe(s, a, d[0], d[1])) < h) {
|
||
for (h = p, c = 0; c < r; ++c) l[c] = d[c];
|
||
l.length = r, f += r
|
||
} else f += r * Math.max((Math.sqrt(p) - Math.sqrt(h)) / o | 0, 1);
|
||
if (n && (Ti(t, i - r, e, r, s, a, d), (p = oe(s, a, d[0], d[1])) < h)) {
|
||
for (h = p, c = 0; c < r; ++c) l[c] = d[c];
|
||
l.length = r
|
||
}
|
||
return h
|
||
}
|
||
|
||
function Oi(t, e, i, r, o, n, s, a, l, h, u) {
|
||
for (var c = u || [NaN, NaN], p = 0, d = i.length; p < d; ++p) {
|
||
var f = i[p];
|
||
h = Ii(t, e, f, r, o, n, s, a, l, h, c), e = f
|
||
}
|
||
return h
|
||
}
|
||
|
||
function Mi(t, e, i, r, o, n, s, a, l, h, u) {
|
||
for (var c = u || [NaN, NaN], p = 0, d = i.length; p < d; ++p) {
|
||
var f = i[p];
|
||
h = Oi(t, e, f, r, o, n, s, a, l, h, c), e = f[f.length - 1]
|
||
}
|
||
return h
|
||
}
|
||
|
||
function Ai(t, e, i, r) {
|
||
for (var o = 0, n = i.length; o < n; ++o) t[e++] = i[o];
|
||
return e
|
||
}
|
||
|
||
function ki(t, e, i, r) {
|
||
for (var o = 0, n = i.length; o < n; ++o) for (var s = i[o], a = 0; a < r; ++a) t[e++] = s[a];
|
||
return e
|
||
}
|
||
|
||
function Fi(t, e, i, r, o) {
|
||
for (var n = o || [], s = 0, a = 0, l = i.length; a < l; ++a) {
|
||
var h = ki(t, e, i[a], r);
|
||
n[s++] = h, e = h
|
||
}
|
||
return n.length = s, n
|
||
}
|
||
|
||
function Ni(t, e, i, r, o) {
|
||
for (var n = o || [], s = 0, a = 0, l = i.length; a < l; ++a) {
|
||
var h = Fi(t, e, i[a], r, n[s]);
|
||
n[s++] = h, e = h[h.length - 1]
|
||
}
|
||
return n.length = s, n
|
||
}
|
||
|
||
function Di(t, e, i, r, o) {
|
||
for (var n = void 0 !== o ? o : [], s = 0, a = e; a < i; a += r) n[s++] = t.slice(a, a + r);
|
||
return n.length = s, n
|
||
}
|
||
|
||
function Gi(t, e, i, r, o) {
|
||
for (var n = void 0 !== o ? o : [], s = 0, a = 0, l = i.length; a < l; ++a) {
|
||
var h = i[a];
|
||
n[s++] = Di(t, e, h, r, n[s]), e = h
|
||
}
|
||
return n.length = s, n
|
||
}
|
||
|
||
function ji(t, e, i, r, o) {
|
||
for (var n = void 0 !== o ? o : [], s = 0, a = 0, l = i.length; a < l; ++a) {
|
||
var h = i[a];
|
||
n[s++] = Gi(t, e, h, r, n[s]), e = h[h.length - 1]
|
||
}
|
||
return n.length = s, n
|
||
}
|
||
|
||
function zi(t, e, i, r, o, n, s) {
|
||
var a = (i - e) / r;
|
||
if (a < 3) {
|
||
for (; e < i; e += r) n[s++] = t[e], n[s++] = t[e + 1];
|
||
return s
|
||
}
|
||
var l = new Array(a);
|
||
l[0] = 1, l[a - 1] = 1;
|
||
for (var h = [e, i - r], u = 0; h.length > 0;) {
|
||
for (var c = h.pop(), p = h.pop(), d = 0, f = t[p], g = t[p + 1], m = t[c], y = t[c + 1], v = p + r; v < c; v += r) {
|
||
var _ = re(t[v], t[v + 1], f, g, m, y);
|
||
_ > d && (u = v, d = _)
|
||
}
|
||
d > o && (l[(u - e) / r] = 1, p + r < u && h.push(p, u), u + r < c && h.push(u, c))
|
||
}
|
||
for (var x = 0; x < a; ++x) l[x] && (n[s++] = t[e + x * r], n[s++] = t[e + x * r + 1]);
|
||
return s
|
||
}
|
||
|
||
function Ui(t, e, i, r, o, n, s, a) {
|
||
for (var l = 0, h = i.length; l < h; ++l) {
|
||
var u = i[l];
|
||
s = zi(t, e, u, r, o, n, s), a.push(s), e = u
|
||
}
|
||
return s
|
||
}
|
||
|
||
function Bi(t, e, i, r, o, n, s) {
|
||
if (i <= e + r) {
|
||
for (; e < i; e += r) n[s++] = t[e], n[s++] = t[e + 1];
|
||
return s
|
||
}
|
||
var a = t[e], l = t[e + 1];
|
||
n[s++] = a, n[s++] = l;
|
||
var h = a, u = l;
|
||
for (e += r; e < i; e += r) oe(a, l, h = t[e], u = t[e + 1]) > o && (n[s++] = h, n[s++] = u, a = h, l = u);
|
||
return h == a && u == l || (n[s++] = h, n[s++] = u), s
|
||
}
|
||
|
||
function Vi(t, e) {
|
||
return e * Math.round(t / e)
|
||
}
|
||
|
||
function Yi(t, e, i, r, o, n, s) {
|
||
if (e == i) return s;
|
||
var a, l, h = Vi(t[e], o), u = Vi(t[e + 1], o);
|
||
e += r, n[s++] = h, n[s++] = u;
|
||
do {
|
||
if (a = Vi(t[e], o), l = Vi(t[e + 1], o), (e += r) == i) return n[s++] = a, n[s++] = l, s
|
||
} while (a == h && l == u);
|
||
for (; e < i;) {
|
||
var c = Vi(t[e], o), p = Vi(t[e + 1], o);
|
||
if (e += r, c != a || p != l) {
|
||
var d = a - h, f = l - u, g = c - h, m = p - u;
|
||
d * m == f * g && (d < 0 && g < d || d == g || d > 0 && g > d) && (f < 0 && m < f || f == m || f > 0 && m > f) ? (a = c, l = p) : (n[s++] = a, n[s++] = l, h = a, u = l, a = c, l = p)
|
||
}
|
||
}
|
||
return n[s++] = a, n[s++] = l, s
|
||
}
|
||
|
||
function Wi(t, e, i, r, o, n, s, a) {
|
||
for (var l = 0, h = i.length; l < h; ++l) {
|
||
var u = i[l];
|
||
s = Yi(t, e, u, r, o, n, s), a.push(s), e = u
|
||
}
|
||
return s
|
||
}
|
||
|
||
function Hi(t, e, i, r, o, n, s, a) {
|
||
for (var l = 0, h = i.length; l < h; ++l) {
|
||
var u = i[l], c = [];
|
||
s = Wi(t, e, u, r, o, n, s, c), a.push(c), e = u[u.length - 1]
|
||
}
|
||
return s
|
||
}
|
||
|
||
var Xi = function (t) {
|
||
function e(e, i) {
|
||
t.call(this), this.maxDelta_ = -1, this.maxDeltaRevision_ = -1, void 0 === i || Array.isArray(e[0]) ? this.setCoordinates(e, i) : this.setFlatCoordinates(i, e)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.clone = function () {
|
||
return new e(this.flatCoordinates.slice(), this.layout)
|
||
}, e.prototype.closestPointXY = function (t, e, i, r) {
|
||
return r < ct(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(Ri(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, 0)), this.maxDeltaRevision_ = this.getRevision()), Ii(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, this.maxDelta_, !0, t, e, i, r))
|
||
}, e.prototype.getArea = function () {
|
||
return Ci(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride)
|
||
}, e.prototype.getCoordinates = function () {
|
||
return Di(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride)
|
||
}, e.prototype.getSimplifiedGeometryInternal = function (t) {
|
||
var i = [];
|
||
return i.length = zi(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, t, i, 0), new e(i, qt.XY)
|
||
}, e.prototype.getType = function () {
|
||
return Zt.LINEAR_RING
|
||
}, e.prototype.intersectsExtent = function (t) {
|
||
return !1
|
||
}, e.prototype.setCoordinates = function (t, e) {
|
||
this.setLayout(e, t, 1), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = ki(this.flatCoordinates, 0, t, this.stride), this.changed()
|
||
}, e
|
||
}(bi), qi = function (t) {
|
||
function e(e, i) {
|
||
t.call(this), this.setCoordinates(e, i)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.clone = function () {
|
||
return new e(this.flatCoordinates.slice(), this.layout)
|
||
}, e.prototype.closestPointXY = function (t, e, i, r) {
|
||
var o = this.flatCoordinates, n = oe(t, e, o[0], o[1]);
|
||
if (n < r) {
|
||
for (var s = this.stride, a = 0; a < s; ++a) i[a] = o[a];
|
||
return i.length = s, n
|
||
}
|
||
return r
|
||
}, e.prototype.getCoordinates = function () {
|
||
return this.flatCoordinates ? this.flatCoordinates.slice() : []
|
||
}, e.prototype.computeExtent = function (t) {
|
||
return _t(this.flatCoordinates, t)
|
||
}, e.prototype.getType = function () {
|
||
return Zt.POINT
|
||
}, e.prototype.intersectsExtent = function (t) {
|
||
return ft(t, this.flatCoordinates[0], this.flatCoordinates[1])
|
||
}, e.prototype.setCoordinates = function (t, e) {
|
||
this.setLayout(e, t, 0), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = Ai(this.flatCoordinates, 0, t, this.stride), this.changed()
|
||
}, e
|
||
}(bi);
|
||
|
||
function Zi(t, e, i, r, o) {
|
||
return !Lt(o, function (o) {
|
||
return !Ki(t, e, i, r, o[0], o[1])
|
||
})
|
||
}
|
||
|
||
function Ki(t, e, i, r, o, n) {
|
||
for (var s = 0, a = t[i - r], l = t[i - r + 1]; e < i; e += r) {
|
||
var h = t[e], u = t[e + 1];
|
||
l <= n ? u > n && (h - a) * (n - l) - (o - a) * (u - l) > 0 && s++ : u <= n && (h - a) * (n - l) - (o - a) * (u - l) < 0 && s--, a = h, l = u
|
||
}
|
||
return 0 !== s
|
||
}
|
||
|
||
function Ji(t, e, i, r, o, n) {
|
||
if (0 === i.length) return !1;
|
||
if (!Ki(t, e, i[0], r, o, n)) return !1;
|
||
for (var s = 1, a = i.length; s < a; ++s) if (Ki(t, i[s - 1], i[s], r, o, n)) return !1;
|
||
return !0
|
||
}
|
||
|
||
function $i(t, e, i, r, o, n) {
|
||
if (0 === i.length) return !1;
|
||
for (var s = 0, a = i.length; s < a; ++s) {
|
||
var l = i[s];
|
||
if (Ji(t, e, l, r, o, n)) return !0;
|
||
e = l[l.length - 1]
|
||
}
|
||
return !1
|
||
}
|
||
|
||
function Qi(t, e, i, r, o, n, s) {
|
||
for (var a, l, h, u, c, p, d, f = o[n + 1], g = [], m = 0, y = i.length; m < y; ++m) {
|
||
var v = i[m];
|
||
for (u = t[v - r], p = t[v - r + 1], a = e; a < v; a += r) c = t[a], d = t[a + 1], (f <= p && d <= f || p <= f && f <= d) && (h = (f - p) / (d - p) * (c - u) + u, g.push(h)), u = c, p = d
|
||
}
|
||
var _ = NaN, x = -1 / 0;
|
||
for (g.sort(Z), u = g[0], a = 1, l = g.length; a < l; ++a) {
|
||
c = g[a];
|
||
var w = Math.abs(c - u);
|
||
w > x && Ji(t, e, i, r, h = (u + c) / 2, f) && (_ = h, x = w), u = c
|
||
}
|
||
return isNaN(_) && (_ = o[n]), s ? (s.push(_, f, x), s) : [_, f, x]
|
||
}
|
||
|
||
function tr(t, e, i, r, o) {
|
||
for (var n = [], s = 0, a = i.length; s < a; ++s) {
|
||
var l = i[s];
|
||
n = Qi(t, e, l, r, o, 2 * s, n), e = l[l.length - 1]
|
||
}
|
||
return n
|
||
}
|
||
|
||
function er(t, e, i, r, o, n) {
|
||
for (var s, a = [t[e], t[e + 1]], l = []; e + r < i; e += r) {
|
||
if (l[0] = t[e + r], l[1] = t[e + r + 1], s = o.call(n, a, l)) return s;
|
||
a[0] = l[0], a[1] = l[1]
|
||
}
|
||
return !1
|
||
}
|
||
|
||
function ir(t, e, i, r, o) {
|
||
var n = Tt([1 / 0, 1 / 0, -1 / 0, -1 / 0], t, e, i, r);
|
||
return !!Bt(o, n) && (!!dt(o, n) || (n[0] >= o[0] && n[2] <= o[2] || (n[1] >= o[1] && n[3] <= o[3] || er(t, e, i, r, function (t, e) {
|
||
return Ht(o, t, e)
|
||
}))))
|
||
}
|
||
|
||
function rr(t, e, i, r, o) {
|
||
for (var n = 0, s = i.length; n < s; ++n) {
|
||
if (ir(t, e, i[n], r, o)) return !0;
|
||
e = i[n]
|
||
}
|
||
return !1
|
||
}
|
||
|
||
function or(t, e, i, r, o) {
|
||
return !!ir(t, e, i, r, o) || (!!Ki(t, e, i, r, o[0], o[1]) || (!!Ki(t, e, i, r, o[0], o[3]) || (!!Ki(t, e, i, r, o[2], o[1]) || !!Ki(t, e, i, r, o[2], o[3]))))
|
||
}
|
||
|
||
function nr(t, e, i, r, o) {
|
||
if (!or(t, e, i[0], r, o)) return !1;
|
||
if (1 === i.length) return !0;
|
||
for (var n = 1, s = i.length; n < s; ++n) if (Zi(t, i[n - 1], i[n], r, o) && !ir(t, i[n - 1], i[n], r, o)) return !1;
|
||
return !0
|
||
}
|
||
|
||
function sr(t, e, i, r, o) {
|
||
for (var n = 0, s = i.length; n < s; ++n) {
|
||
var a = i[n];
|
||
if (nr(t, e, a, r, o)) return !0;
|
||
e = a[a.length - 1]
|
||
}
|
||
return !1
|
||
}
|
||
|
||
function ar(t, e, i, r) {
|
||
for (; e < i - r;) {
|
||
for (var o = 0; o < r; ++o) {
|
||
var n = t[e + o];
|
||
t[e + o] = t[i - r + o], t[i - r + o] = n
|
||
}
|
||
e += r, i -= r
|
||
}
|
||
}
|
||
|
||
function lr(t, e, i, r) {
|
||
for (var o = 0, n = t[i - r], s = t[i - r + 1]; e < i; e += r) {
|
||
var a = t[e], l = t[e + 1];
|
||
o += (a - n) * (l + s), n = a, s = l
|
||
}
|
||
return o > 0
|
||
}
|
||
|
||
function hr(t, e, i, r, o) {
|
||
for (var n = void 0 !== o && o, s = 0, a = i.length; s < a; ++s) {
|
||
var l = i[s], h = lr(t, e, l, r);
|
||
if (0 === s) {
|
||
if (n && h || !n && !h) return !1
|
||
} else if (n && !h || !n && h) return !1;
|
||
e = l
|
||
}
|
||
return !0
|
||
}
|
||
|
||
function ur(t, e, i, r, o) {
|
||
for (var n = 0, s = i.length; n < s; ++n) if (!hr(t, e, i[n], r, o)) return !1;
|
||
return !0
|
||
}
|
||
|
||
function cr(t, e, i, r, o) {
|
||
for (var n = void 0 !== o && o, s = 0, a = i.length; s < a; ++s) {
|
||
var l = i[s], h = lr(t, e, l, r);
|
||
(0 === s ? n && h || !n && !h : n && !h || !n && h) && ar(t, e, l, r), e = l
|
||
}
|
||
return e
|
||
}
|
||
|
||
function pr(t, e, i, r, o) {
|
||
for (var n = 0, s = i.length; n < s; ++n) e = cr(t, e, i[n], r, o);
|
||
return e
|
||
}
|
||
|
||
var dr = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this), this.ends_ = [], this.flatInteriorPointRevision_ = -1, this.flatInteriorPoint_ = null, this.maxDelta_ = -1, this.maxDeltaRevision_ = -1, this.orientedRevision_ = -1, this.orientedFlatCoordinates_ = null, void 0 !== i && r ? (this.setFlatCoordinates(i, e), this.ends_ = r) : this.setCoordinates(e, i)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.appendLinearRing = function (t) {
|
||
this.flatCoordinates ? Q(this.flatCoordinates, t.getFlatCoordinates()) : this.flatCoordinates = t.getFlatCoordinates().slice(), this.ends_.push(this.flatCoordinates.length), this.changed()
|
||
}, e.prototype.clone = function () {
|
||
return new e(this.flatCoordinates.slice(), this.layout, this.ends_.slice())
|
||
}, e.prototype.closestPointXY = function (t, e, i, r) {
|
||
return r < ct(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(Pi(this.flatCoordinates, 0, this.ends_, this.stride, 0)), this.maxDeltaRevision_ = this.getRevision()), Oi(this.flatCoordinates, 0, this.ends_, this.stride, this.maxDelta_, !0, t, e, i, r))
|
||
}, e.prototype.containsXY = function (t, e) {
|
||
return Ji(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, t, e)
|
||
}, e.prototype.getArea = function () {
|
||
return Si(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride)
|
||
}, e.prototype.getCoordinates = function (t) {
|
||
var e;
|
||
return void 0 !== t ? cr(e = this.getOrientedFlatCoordinates().slice(), 0, this.ends_, this.stride, t) : e = this.flatCoordinates, Gi(e, 0, this.ends_, this.stride)
|
||
}, e.prototype.getEnds = function () {
|
||
return this.ends_
|
||
}, e.prototype.getFlatInteriorPoint = function () {
|
||
if (this.flatInteriorPointRevision_ != this.getRevision()) {
|
||
var t = At(this.getExtent());
|
||
this.flatInteriorPoint_ = Qi(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, t, 0), this.flatInteriorPointRevision_ = this.getRevision()
|
||
}
|
||
return this.flatInteriorPoint_
|
||
}, e.prototype.getInteriorPoint = function () {
|
||
return new qi(this.getFlatInteriorPoint(), qt.XYM)
|
||
}, e.prototype.getLinearRingCount = function () {
|
||
return this.ends_.length
|
||
}, e.prototype.getLinearRing = function (t) {
|
||
return t < 0 || this.ends_.length <= t ? null : new Xi(this.flatCoordinates.slice(0 === t ? 0 : this.ends_[t - 1], this.ends_[t]), this.layout)
|
||
}, e.prototype.getLinearRings = function () {
|
||
for (var t = this.layout, e = this.flatCoordinates, i = this.ends_, r = [], o = 0, n = 0, s = i.length; n < s; ++n) {
|
||
var a = i[n], l = new Xi(e.slice(o, a), t);
|
||
r.push(l), o = a
|
||
}
|
||
return r
|
||
}, e.prototype.getOrientedFlatCoordinates = function () {
|
||
if (this.orientedRevision_ != this.getRevision()) {
|
||
var t = this.flatCoordinates;
|
||
hr(t, 0, this.ends_, this.stride) ? this.orientedFlatCoordinates_ = t : (this.orientedFlatCoordinates_ = t.slice(), this.orientedFlatCoordinates_.length = cr(this.orientedFlatCoordinates_, 0, this.ends_, this.stride)), this.orientedRevision_ = this.getRevision()
|
||
}
|
||
return this.orientedFlatCoordinates_
|
||
}, e.prototype.getSimplifiedGeometryInternal = function (t) {
|
||
var i = [], r = [];
|
||
return i.length = Wi(this.flatCoordinates, 0, this.ends_, this.stride, Math.sqrt(t), i, 0, r), new e(i, qt.XY, r)
|
||
}, e.prototype.getType = function () {
|
||
return Zt.POLYGON
|
||
}, e.prototype.intersectsExtent = function (t) {
|
||
return nr(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, t)
|
||
}, e.prototype.setCoordinates = function (t, e) {
|
||
this.setLayout(e, t, 2), this.flatCoordinates || (this.flatCoordinates = []);
|
||
var i = Fi(this.flatCoordinates, 0, t, this.stride, this.ends_);
|
||
this.flatCoordinates.length = 0 === i.length ? 0 : i[i.length - 1], this.changed()
|
||
}, e
|
||
}(bi), fr = dr;
|
||
|
||
function gr(t, e, i, r) {
|
||
for (var o = i || 32, n = [], s = 0; s < o; ++s) Q(n, ge(t, e, 2 * Math.PI * s / o, r));
|
||
return n.push(n[0], n[1]), new dr(n, qt.XY, [n.length])
|
||
}
|
||
|
||
function mr(t) {
|
||
var e = t[0], i = t[1], r = t[2], o = t[3], n = [e, i, e, o, r, o, r, i, e, i];
|
||
return new dr(n, qt.XY, [n.length])
|
||
}
|
||
|
||
function yr(t, e, i) {
|
||
for (var r = e || 32, o = t.getStride(), n = t.getLayout(), s = t.getCenter(), a = o * (r + 1), l = new Array(a), h = 0; h < a; h += o) {
|
||
l[h] = 0, l[h + 1] = 0;
|
||
for (var u = 2; u < o; u++) l[h + u] = s[u]
|
||
}
|
||
var c = [l.length], p = new dr(l, n, c);
|
||
return vr(p, s, t.getRadius(), i), p
|
||
}
|
||
|
||
function vr(t, e, i, r) {
|
||
for (var o = t.getFlatCoordinates(), n = t.getStride(), s = o.length / n - 1, a = r || 0, l = 0; l <= s; ++l) {
|
||
var h = l * n, u = a + 2 * le(l, s) * Math.PI / s;
|
||
o[h] = e[0] + i * Math.cos(u), o[h + 1] = e[1] + i * Math.sin(u)
|
||
}
|
||
t.changed()
|
||
}
|
||
|
||
var _r = "undefined" != typeof navigator ? navigator.userAgent.toLowerCase() : "",
|
||
xr = -1 !== _r.indexOf("firefox"), wr = -1 !== _r.indexOf("safari") && -1 == _r.indexOf("chrom"),
|
||
br = -1 !== _r.indexOf("webkit") && -1 == _r.indexOf("edge"), Cr = -1 !== _r.indexOf("macintosh"),
|
||
Sr = window.devicePixelRatio || 1, Er = function () {
|
||
var t = !1;
|
||
try {
|
||
t = !!document.createElement("canvas").getContext("2d").setLineDash
|
||
} catch (t) {
|
||
}
|
||
return t
|
||
}(), Tr = "geolocation" in navigator, Rr = "ontouchstart" in window, Pr = "PointerEvent" in window,
|
||
Lr = !!navigator.msPointerEnabled, Ir = {
|
||
ACCURACY: "accuracy",
|
||
ACCURACY_GEOMETRY: "accuracyGeometry",
|
||
ALTITUDE: "altitude",
|
||
ALTITUDE_ACCURACY: "altitudeAccuracy",
|
||
HEADING: "heading",
|
||
POSITION: "position",
|
||
PROJECTION: "projection",
|
||
SPEED: "speed",
|
||
TRACKING: "tracking",
|
||
TRACKING_OPTIONS: "trackingOptions"
|
||
}, Or = function (t) {
|
||
function e(e) {
|
||
t.call(this, F.ERROR), this.code = e.code, this.message = e.message
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A), Mr = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = e || {};
|
||
this.position_ = null, this.transform_ = Be, this.watchId_ = void 0, w(this, z(Ir.PROJECTION), this.handleProjectionChanged_, this), w(this, z(Ir.TRACKING), this.handleTrackingChanged_, this), void 0 !== i.projection && this.setProjection(i.projection), void 0 !== i.trackingOptions && this.setTrackingOptions(i.trackingOptions), this.setTracking(void 0 !== i.tracking && i.tracking)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.disposeInternal = function () {
|
||
this.setTracking(!1), t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.handleProjectionChanged_ = function () {
|
||
var t = this.getProjection();
|
||
t && (this.transform_ = ti(We("EPSG:4326"), t), this.position_ && this.set(Ir.POSITION, this.transform_(this.position_)))
|
||
}, e.prototype.handleTrackingChanged_ = function () {
|
||
if (Tr) {
|
||
var t = this.getTracking();
|
||
t && void 0 === this.watchId_ ? this.watchId_ = navigator.geolocation.watchPosition(this.positionChange_.bind(this), this.positionError_.bind(this), this.getTrackingOptions()) : t || void 0 === this.watchId_ || (navigator.geolocation.clearWatch(this.watchId_), this.watchId_ = void 0)
|
||
}
|
||
}, e.prototype.positionChange_ = function (t) {
|
||
var e = t.coords;
|
||
this.set(Ir.ACCURACY, e.accuracy), this.set(Ir.ALTITUDE, null === e.altitude ? void 0 : e.altitude), this.set(Ir.ALTITUDE_ACCURACY, null === e.altitudeAccuracy ? void 0 : e.altitudeAccuracy), this.set(Ir.HEADING, null === e.heading ? void 0 : ae(e.heading)), this.position_ ? (this.position_[0] = e.longitude, this.position_[1] = e.latitude) : this.position_ = [e.longitude, e.latitude];
|
||
var i = this.transform_(this.position_);
|
||
this.set(Ir.POSITION, i), this.set(Ir.SPEED, null === e.speed ? void 0 : e.speed);
|
||
var r = gr(this.position_, e.accuracy);
|
||
r.applyTransform(this.transform_), this.set(Ir.ACCURACY_GEOMETRY, r), this.changed()
|
||
}, e.prototype.positionError_ = function (t) {
|
||
this.setTracking(!1), this.dispatchEvent(new Or(t))
|
||
}, e.prototype.getAccuracy = function () {
|
||
return this.get(Ir.ACCURACY)
|
||
}, e.prototype.getAccuracyGeometry = function () {
|
||
return this.get(Ir.ACCURACY_GEOMETRY) || null
|
||
}, e.prototype.getAltitude = function () {
|
||
return this.get(Ir.ALTITUDE)
|
||
}, e.prototype.getAltitudeAccuracy = function () {
|
||
return this.get(Ir.ALTITUDE_ACCURACY)
|
||
}, e.prototype.getHeading = function () {
|
||
return this.get(Ir.HEADING)
|
||
}, e.prototype.getPosition = function () {
|
||
return this.get(Ir.POSITION)
|
||
}, e.prototype.getProjection = function () {
|
||
return this.get(Ir.PROJECTION)
|
||
}, e.prototype.getSpeed = function () {
|
||
return this.get(Ir.SPEED)
|
||
}, e.prototype.getTracking = function () {
|
||
return this.get(Ir.TRACKING)
|
||
}, e.prototype.getTrackingOptions = function () {
|
||
return this.get(Ir.TRACKING_OPTIONS)
|
||
}, e.prototype.setProjection = function (t) {
|
||
this.set(Ir.PROJECTION, We(t))
|
||
}, e.prototype.setTracking = function (t) {
|
||
this.set(Ir.TRACKING, t)
|
||
}, e.prototype.setTrackingOptions = function (t) {
|
||
this.set(Ir.TRACKING_OPTIONS, t)
|
||
}, e
|
||
}(U);
|
||
|
||
function Ar(t, e, i) {
|
||
var r = void 0 !== i ? t.toFixed(i) : "" + t, o = r.indexOf(".");
|
||
return (o = -1 === o ? r.length : o) > e ? r : new Array(1 + e - o).join("0") + r
|
||
}
|
||
|
||
function kr(t, e) {
|
||
for (var i = ("" + t).split("."), r = ("" + e).split("."), o = 0; o < Math.max(i.length, r.length); o++) {
|
||
var n = parseInt(i[o] || "0", 10), s = parseInt(r[o] || "0", 10);
|
||
if (n > s) return 1;
|
||
if (s > n) return -1
|
||
}
|
||
return 0
|
||
}
|
||
|
||
function Fr(t, e) {
|
||
return t[0] += e[0], t[1] += e[1], t
|
||
}
|
||
|
||
function Nr(t, e) {
|
||
var i = e.getRadius(), r = e.getCenter(), o = r[0], n = r[1], s = t[0] - o, a = t[1] - n;
|
||
0 === s && 0 === a && (s = 1);
|
||
var l = Math.sqrt(s * s + a * a);
|
||
return [o + i * s / l, n + i * a / l]
|
||
}
|
||
|
||
function Dr(t, e) {
|
||
var i, r, o = t[0], n = t[1], s = e[0], a = e[1], l = s[0], h = s[1], u = a[0], c = a[1], p = u - l,
|
||
d = c - h, f = 0 === p && 0 === d ? 0 : (p * (o - l) + d * (n - h)) / (p * p + d * d || 0);
|
||
return f <= 0 ? (i = l, r = h) : f >= 1 ? (i = u, r = c) : (i = l + f * p, r = h + f * d), [i, r]
|
||
}
|
||
|
||
function Gr(t, e, i) {
|
||
var r = le(e + 180, 360) - 180, o = Math.abs(3600 * r), n = i || 0, s = Math.pow(10, n),
|
||
a = Math.floor(o / 3600), l = Math.floor((o - 3600 * a) / 60), h = o - 3600 * a - 60 * l;
|
||
return (h = Math.ceil(h * s) / s) >= 60 && (h = 0, l += 1), l >= 60 && (l = 0, a += 1), a + "° " + Ar(l, 2) + "′ " + Ar(h, 2, n) + "″" + (0 == r ? "" : " " + t.charAt(r < 0 ? 1 : 0))
|
||
}
|
||
|
||
function jr(t, e, i) {
|
||
return t ? e.replace("{x}", t[0].toFixed(i)).replace("{y}", t[1].toFixed(i)) : ""
|
||
}
|
||
|
||
function zr(t, e) {
|
||
for (var i = !0, r = t.length - 1; r >= 0; --r) if (t[r] != e[r]) {
|
||
i = !1;
|
||
break
|
||
}
|
||
return i
|
||
}
|
||
|
||
function Ur(t, e) {
|
||
var i = Math.cos(e), r = Math.sin(e), o = t[0] * i - t[1] * r, n = t[1] * i + t[0] * r;
|
||
return t[0] = o, t[1] = n, t
|
||
}
|
||
|
||
function Br(t, e) {
|
||
return t[0] *= e, t[1] *= e, t
|
||
}
|
||
|
||
function Vr(t, e) {
|
||
var i = t[0] - e[0], r = t[1] - e[1];
|
||
return i * i + r * r
|
||
}
|
||
|
||
function Yr(t, e) {
|
||
return Math.sqrt(Vr(t, e))
|
||
}
|
||
|
||
function Wr(t, e) {
|
||
return Vr(t, Dr(t, e))
|
||
}
|
||
|
||
function Hr(t, e) {
|
||
return jr(t, "{x}, {y}", e)
|
||
}
|
||
|
||
function Xr(t, e, i, r, o, n) {
|
||
var s = NaN, a = NaN, l = (i - e) / r;
|
||
if (1 === l) s = t[e], a = t[e + 1]; else if (2 == l) s = (1 - o) * t[e] + o * t[e + r], a = (1 - o) * t[e + 1] + o * t[e + r + 1]; else if (0 !== l) {
|
||
for (var h = t[e], u = t[e + 1], c = 0, p = [0], d = e + r; d < i; d += r) {
|
||
var f = t[d], g = t[d + 1];
|
||
c += Math.sqrt((f - h) * (f - h) + (g - u) * (g - u)), p.push(c), h = f, u = g
|
||
}
|
||
var m = o * c, y = q(p, m);
|
||
if (y < 0) {
|
||
var v = (m - p[-y - 2]) / (p[-y - 1] - p[-y - 2]), _ = e + (-y - 2) * r;
|
||
s = he(t[_], t[_ + r], v), a = he(t[_ + 1], t[_ + r + 1], v)
|
||
} else s = t[e + y * r], a = t[e + y * r + 1]
|
||
}
|
||
return n ? (n[0] = s, n[1] = a, n) : [s, a]
|
||
}
|
||
|
||
function qr(t, e, i, r, o, n) {
|
||
if (i == e) return null;
|
||
var s;
|
||
if (o < t[e + r - 1]) return n ? ((s = t.slice(e, e + r))[r - 1] = o, s) : null;
|
||
if (t[i - 1] < o) return n ? ((s = t.slice(i - r, i))[r - 1] = o, s) : null;
|
||
if (o == t[e + r - 1]) return t.slice(e, e + r);
|
||
for (var a = e / r, l = i / r; a < l;) {
|
||
var h = a + l >> 1;
|
||
o < t[(h + 1) * r - 1] ? l = h : a = h + 1
|
||
}
|
||
var u = t[a * r - 1];
|
||
if (o == u) return t.slice((a - 1) * r, (a - 1) * r + r);
|
||
var c = (o - u) / (t[(a + 1) * r - 1] - u);
|
||
s = [];
|
||
for (var p = 0; p < r - 1; ++p) s.push(he(t[(a - 1) * r + p], t[a * r + p], c));
|
||
return s.push(o), s
|
||
}
|
||
|
||
function Zr(t, e, i, r, o, n, s) {
|
||
if (s) return qr(t, e, i[i.length - 1], r, o, n);
|
||
var a;
|
||
if (o < t[r - 1]) return n ? ((a = t.slice(0, r))[r - 1] = o, a) : null;
|
||
if (t[t.length - 1] < o) return n ? ((a = t.slice(t.length - r))[r - 1] = o, a) : null;
|
||
for (var l = 0, h = i.length; l < h; ++l) {
|
||
var u = i[l];
|
||
if (e != u) {
|
||
if (o < t[e + r - 1]) return null;
|
||
if (o <= t[u - 1]) return qr(t, e, u, r, o, !1);
|
||
e = u
|
||
}
|
||
}
|
||
return null
|
||
}
|
||
|
||
function Kr(t, e, i, r) {
|
||
for (var o = t[e], n = t[e + 1], s = 0, a = e + r; a < i; a += r) {
|
||
var l = t[a], h = t[a + 1];
|
||
s += Math.sqrt((l - o) * (l - o) + (h - n) * (h - n)), o = l, n = h
|
||
}
|
||
return s
|
||
}
|
||
|
||
var Jr = function (t) {
|
||
function e(e, i) {
|
||
t.call(this), this.flatMidpoint_ = null, this.flatMidpointRevision_ = -1, this.maxDelta_ = -1, this.maxDeltaRevision_ = -1, void 0 === i || Array.isArray(e[0]) ? this.setCoordinates(e, i) : this.setFlatCoordinates(i, e)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.appendCoordinate = function (t) {
|
||
this.flatCoordinates ? Q(this.flatCoordinates, t) : this.flatCoordinates = t.slice(), this.changed()
|
||
}, e.prototype.clone = function () {
|
||
return new e(this.flatCoordinates.slice(), this.layout)
|
||
}, e.prototype.closestPointXY = function (t, e, i, r) {
|
||
return r < ct(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(Ri(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, 0)), this.maxDeltaRevision_ = this.getRevision()), Ii(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, this.maxDelta_, !1, t, e, i, r))
|
||
}, e.prototype.forEachSegment = function (t) {
|
||
return er(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, t)
|
||
}, e.prototype.getCoordinateAtM = function (t, e) {
|
||
if (this.layout != qt.XYM && this.layout != qt.XYZM) return null;
|
||
var i = void 0 !== e && e;
|
||
return qr(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, t, i)
|
||
}, e.prototype.getCoordinates = function () {
|
||
return Di(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride)
|
||
}, e.prototype.getCoordinateAt = function (t, e) {
|
||
return Xr(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, t, e)
|
||
}, e.prototype.getLength = function () {
|
||
return Kr(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride)
|
||
}, e.prototype.getFlatMidpoint = function () {
|
||
return this.flatMidpointRevision_ != this.getRevision() && (this.flatMidpoint_ = this.getCoordinateAt(.5, this.flatMidpoint_), this.flatMidpointRevision_ = this.getRevision()), this.flatMidpoint_
|
||
}, e.prototype.getSimplifiedGeometryInternal = function (t) {
|
||
var i = [];
|
||
return i.length = zi(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, t, i, 0), new e(i, qt.XY)
|
||
}, e.prototype.getType = function () {
|
||
return Zt.LINE_STRING
|
||
}, e.prototype.intersectsExtent = function (t) {
|
||
return ir(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, t)
|
||
}, e.prototype.setCoordinates = function (t, e) {
|
||
this.setLayout(e, t, 1), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = ki(this.flatCoordinates, 0, t, this.stride), this.changed()
|
||
}, e
|
||
}(bi);
|
||
|
||
function $r(t, e, i) {
|
||
for (var r, o, n, s, a, l, h = [], u = t(0), c = t(1), p = e(u), d = e(c), f = [c, u], g = [d, p], m = [1, 0], y = {}, v = 1e5; --v > 0 && m.length > 0;) n = m.pop(), u = f.pop(), p = g.pop(), (l = n.toString()) in y || (h.push(p[0], p[1]), y[l] = !0), s = m.pop(), c = f.pop(), d = g.pop(), re((o = e(r = t(a = (n + s) / 2)))[0], o[1], p[0], p[1], d[0], d[1]) < i ? (h.push(d[0], d[1]), y[l = s.toString()] = !0) : (m.push(s, a, a, n), g.push(d, o, o, p), f.push(c, r, r, u));
|
||
return h
|
||
}
|
||
|
||
function Qr(t, e, i, r, o) {
|
||
return $r(function (r) {
|
||
return [t, e + (i - e) * r]
|
||
}, ei(We("EPSG:4326"), r), o)
|
||
}
|
||
|
||
function to(t, e, i, r, o) {
|
||
return $r(function (r) {
|
||
return [e + (i - e) * r, t]
|
||
}, ei(We("EPSG:4326"), r), o)
|
||
}
|
||
|
||
var eo = {
|
||
POSTCOMPOSE: "postcompose",
|
||
PRECOMPOSE: "precompose",
|
||
RENDER: "render",
|
||
RENDERCOMPLETE: "rendercomplete"
|
||
}, io = /^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i, ro = /^([a-z]*)$/i;
|
||
|
||
function oo(t) {
|
||
return "string" == typeof t ? t : uo(t)
|
||
}
|
||
|
||
var no, so, ao = (no = {}, so = 0, function (t) {
|
||
var e;
|
||
if (no.hasOwnProperty(t)) e = no[t]; else {
|
||
if (so >= 1024) {
|
||
var i = 0;
|
||
for (var r in no) 0 == (3 & i++) && (delete no[r], --so)
|
||
}
|
||
e = function (t) {
|
||
var e, i, r, o, n;
|
||
if (ro.exec(t) && (t = function (t) {
|
||
var e = document.createElement("div");
|
||
if (e.style.color = t, "" !== e.style.color) {
|
||
document.body.appendChild(e);
|
||
var i = getComputedStyle(e).color;
|
||
return document.body.removeChild(e), i
|
||
}
|
||
return ""
|
||
}(t)), io.exec(t)) {
|
||
var s, a = t.length - 1;
|
||
s = a <= 4 ? 1 : 2;
|
||
var l = 4 === a || 8 === a;
|
||
e = parseInt(t.substr(1 + 0 * s, s), 16), i = parseInt(t.substr(1 + 1 * s, s), 16), r = parseInt(t.substr(1 + 2 * s, s), 16), o = l ? parseInt(t.substr(1 + 3 * s, s), 16) : 255, 1 == s && (e = (e << 4) + e, i = (i << 4) + i, r = (r << 4) + r, l && (o = (o << 4) + o)), n = [e, i, r, o / 255]
|
||
} else 0 == t.indexOf("rgba(") ? ho(n = t.slice(5, -1).split(",").map(Number)) : 0 == t.indexOf("rgb(") ? ((n = t.slice(4, -1).split(",").map(Number)).push(1), ho(n)) : W(!1, 14);
|
||
return n
|
||
}(t), no[t] = e, ++so
|
||
}
|
||
return e
|
||
});
|
||
|
||
function lo(t) {
|
||
return Array.isArray(t) ? t : ao(t)
|
||
}
|
||
|
||
function ho(t) {
|
||
return t[0] = te(t[0] + .5 | 0, 0, 255), t[1] = te(t[1] + .5 | 0, 0, 255), t[2] = te(t[2] + .5 | 0, 0, 255), t[3] = te(t[3], 0, 1), t
|
||
}
|
||
|
||
function uo(t) {
|
||
var e = t[0];
|
||
e != (0 | e) && (e = e + .5 | 0);
|
||
var i = t[1];
|
||
i != (0 | i) && (i = i + .5 | 0);
|
||
var r = t[2];
|
||
return r != (0 | r) && (r = r + .5 | 0), "rgba(" + e + "," + i + "," + r + "," + (void 0 === t[3] ? 1 : t[3]) + ")"
|
||
}
|
||
|
||
var co = function (t) {
|
||
var e = t || {};
|
||
this.color_ = void 0 !== e.color ? e.color : null, this.checksum_ = void 0
|
||
};
|
||
co.prototype.clone = function () {
|
||
var t = this.getColor();
|
||
return new co({color: Array.isArray(t) ? t.slice() : t || void 0})
|
||
}, co.prototype.getColor = function () {
|
||
return this.color_
|
||
}, co.prototype.setColor = function (t) {
|
||
this.color_ = t, this.checksum_ = void 0
|
||
}, co.prototype.getChecksum = function () {
|
||
if (void 0 === this.checksum_) {
|
||
var t = this.color_;
|
||
t ? Array.isArray(t) || "string" == typeof t ? this.checksum_ = "f" + oo(t) : this.checksum_ = a(this.color_) : this.checksum_ = "f-"
|
||
}
|
||
return this.checksum_
|
||
};
|
||
var po = co, fo = function (t) {
|
||
var e = t || {};
|
||
this.color_ = void 0 !== e.color ? e.color : null, this.lineCap_ = e.lineCap, this.lineDash_ = void 0 !== e.lineDash ? e.lineDash : null, this.lineDashOffset_ = e.lineDashOffset, this.lineJoin_ = e.lineJoin, this.miterLimit_ = e.miterLimit, this.width_ = e.width, this.checksum_ = void 0
|
||
};
|
||
fo.prototype.clone = function () {
|
||
var t = this.getColor();
|
||
return new fo({
|
||
color: Array.isArray(t) ? t.slice() : t || void 0,
|
||
lineCap: this.getLineCap(),
|
||
lineDash: this.getLineDash() ? this.getLineDash().slice() : void 0,
|
||
lineDashOffset: this.getLineDashOffset(),
|
||
lineJoin: this.getLineJoin(),
|
||
miterLimit: this.getMiterLimit(),
|
||
width: this.getWidth()
|
||
})
|
||
}, fo.prototype.getColor = function () {
|
||
return this.color_
|
||
}, fo.prototype.getLineCap = function () {
|
||
return this.lineCap_
|
||
}, fo.prototype.getLineDash = function () {
|
||
return this.lineDash_
|
||
}, fo.prototype.getLineDashOffset = function () {
|
||
return this.lineDashOffset_
|
||
}, fo.prototype.getLineJoin = function () {
|
||
return this.lineJoin_
|
||
}, fo.prototype.getMiterLimit = function () {
|
||
return this.miterLimit_
|
||
}, fo.prototype.getWidth = function () {
|
||
return this.width_
|
||
}, fo.prototype.setColor = function (t) {
|
||
this.color_ = t, this.checksum_ = void 0
|
||
}, fo.prototype.setLineCap = function (t) {
|
||
this.lineCap_ = t, this.checksum_ = void 0
|
||
}, fo.prototype.setLineDash = function (t) {
|
||
this.lineDash_ = t, this.checksum_ = void 0
|
||
}, fo.prototype.setLineDashOffset = function (t) {
|
||
this.lineDashOffset_ = t, this.checksum_ = void 0
|
||
}, fo.prototype.setLineJoin = function (t) {
|
||
this.lineJoin_ = t, this.checksum_ = void 0
|
||
}, fo.prototype.setMiterLimit = function (t) {
|
||
this.miterLimit_ = t, this.checksum_ = void 0
|
||
}, fo.prototype.setWidth = function (t) {
|
||
this.width_ = t, this.checksum_ = void 0
|
||
}, fo.prototype.getChecksum = function () {
|
||
return void 0 === this.checksum_ && (this.checksum_ = "s", this.color_ ? "string" == typeof this.color_ ? this.checksum_ += this.color_ : this.checksum_ += a(this.color_) : this.checksum_ += "-", this.checksum_ += "," + (void 0 !== this.lineCap_ ? this.lineCap_.toString() : "-") + "," + (this.lineDash_ ? this.lineDash_.toString() : "-") + "," + (void 0 !== this.lineDashOffset_ ? this.lineDashOffset_ : "-") + "," + (void 0 !== this.lineJoin_ ? this.lineJoin_ : "-") + "," + (void 0 !== this.miterLimit_ ? this.miterLimit_.toString() : "-") + "," + (void 0 !== this.width_ ? this.width_.toString() : "-")), this.checksum_
|
||
};
|
||
var go = fo, mo = {POINT: "point", LINE: "line"}, yo = function (t) {
|
||
var e = t || {};
|
||
this.font_ = e.font, this.rotation_ = e.rotation, this.rotateWithView_ = e.rotateWithView, this.scale_ = e.scale, this.text_ = e.text, this.textAlign_ = e.textAlign, this.textBaseline_ = e.textBaseline, this.fill_ = void 0 !== e.fill ? e.fill : new po({color: "#333"}), this.maxAngle_ = void 0 !== e.maxAngle ? e.maxAngle : Math.PI / 4, this.placement_ = void 0 !== e.placement ? e.placement : mo.POINT, this.overflow_ = !!e.overflow, this.stroke_ = void 0 !== e.stroke ? e.stroke : null, this.offsetX_ = void 0 !== e.offsetX ? e.offsetX : 0, this.offsetY_ = void 0 !== e.offsetY ? e.offsetY : 0, this.backgroundFill_ = e.backgroundFill ? e.backgroundFill : null, this.backgroundStroke_ = e.backgroundStroke ? e.backgroundStroke : null, this.padding_ = void 0 === e.padding ? null : e.padding
|
||
};
|
||
yo.prototype.clone = function () {
|
||
return new yo({
|
||
font: this.getFont(),
|
||
placement: this.getPlacement(),
|
||
maxAngle: this.getMaxAngle(),
|
||
overflow: this.getOverflow(),
|
||
rotation: this.getRotation(),
|
||
rotateWithView: this.getRotateWithView(),
|
||
scale: this.getScale(),
|
||
text: this.getText(),
|
||
textAlign: this.getTextAlign(),
|
||
textBaseline: this.getTextBaseline(),
|
||
fill: this.getFill() ? this.getFill().clone() : void 0,
|
||
stroke: this.getStroke() ? this.getStroke().clone() : void 0,
|
||
offsetX: this.getOffsetX(),
|
||
offsetY: this.getOffsetY(),
|
||
backgroundFill: this.getBackgroundFill() ? this.getBackgroundFill().clone() : void 0,
|
||
backgroundStroke: this.getBackgroundStroke() ? this.getBackgroundStroke().clone() : void 0
|
||
})
|
||
}, yo.prototype.getOverflow = function () {
|
||
return this.overflow_
|
||
}, yo.prototype.getFont = function () {
|
||
return this.font_
|
||
}, yo.prototype.getMaxAngle = function () {
|
||
return this.maxAngle_
|
||
}, yo.prototype.getPlacement = function () {
|
||
return this.placement_
|
||
}, yo.prototype.getOffsetX = function () {
|
||
return this.offsetX_
|
||
}, yo.prototype.getOffsetY = function () {
|
||
return this.offsetY_
|
||
}, yo.prototype.getFill = function () {
|
||
return this.fill_
|
||
}, yo.prototype.getRotateWithView = function () {
|
||
return this.rotateWithView_
|
||
}, yo.prototype.getRotation = function () {
|
||
return this.rotation_
|
||
}, yo.prototype.getScale = function () {
|
||
return this.scale_
|
||
}, yo.prototype.getStroke = function () {
|
||
return this.stroke_
|
||
}, yo.prototype.getText = function () {
|
||
return this.text_
|
||
}, yo.prototype.getTextAlign = function () {
|
||
return this.textAlign_
|
||
}, yo.prototype.getTextBaseline = function () {
|
||
return this.textBaseline_
|
||
}, yo.prototype.getBackgroundFill = function () {
|
||
return this.backgroundFill_
|
||
}, yo.prototype.getBackgroundStroke = function () {
|
||
return this.backgroundStroke_
|
||
}, yo.prototype.getPadding = function () {
|
||
return this.padding_
|
||
}, yo.prototype.setOverflow = function (t) {
|
||
this.overflow_ = t
|
||
}, yo.prototype.setFont = function (t) {
|
||
this.font_ = t
|
||
}, yo.prototype.setMaxAngle = function (t) {
|
||
this.maxAngle_ = t
|
||
}, yo.prototype.setOffsetX = function (t) {
|
||
this.offsetX_ = t
|
||
}, yo.prototype.setOffsetY = function (t) {
|
||
this.offsetY_ = t
|
||
}, yo.prototype.setPlacement = function (t) {
|
||
this.placement_ = t
|
||
}, yo.prototype.setFill = function (t) {
|
||
this.fill_ = t
|
||
}, yo.prototype.setRotation = function (t) {
|
||
this.rotation_ = t
|
||
}, yo.prototype.setScale = function (t) {
|
||
this.scale_ = t
|
||
}, yo.prototype.setStroke = function (t) {
|
||
this.stroke_ = t
|
||
}, yo.prototype.setText = function (t) {
|
||
this.text_ = t
|
||
}, yo.prototype.setTextAlign = function (t) {
|
||
this.textAlign_ = t
|
||
}, yo.prototype.setTextBaseline = function (t) {
|
||
this.textBaseline_ = t
|
||
}, yo.prototype.setBackgroundFill = function (t) {
|
||
this.backgroundFill_ = t
|
||
}, yo.prototype.setBackgroundStroke = function (t) {
|
||
this.backgroundStroke_ = t
|
||
}, yo.prototype.setPadding = function (t) {
|
||
this.padding_ = t
|
||
};
|
||
var vo = yo, _o = new go({color: "rgba(0,0,0,0.2)"}),
|
||
xo = [90, 45, 30, 20, 10, 5, 2, 1, .5, .2, .1, .05, .01, .005, .002, .001], wo = function (t) {
|
||
var e = t || {};
|
||
this.map_ = null, this.postcomposeListenerKey_ = null, this.projection_ = null, this.maxLat_ = 1 / 0, this.maxLon_ = 1 / 0, this.minLat_ = -1 / 0, this.minLon_ = -1 / 0, this.maxLatP_ = 1 / 0, this.maxLonP_ = 1 / 0, this.minLatP_ = -1 / 0, this.minLonP_ = -1 / 0, this.targetSize_ = void 0 !== e.targetSize ? e.targetSize : 100, this.maxLines_ = void 0 !== e.maxLines ? e.maxLines : 100, this.meridians_ = [], this.parallels_ = [], this.strokeStyle_ = void 0 !== e.strokeStyle ? e.strokeStyle : _o, this.fromLonLatTransform_ = void 0, this.toLonLatTransform_ = void 0, this.projectionCenterLonLat_ = null, this.meridiansLabels_ = null, this.parallelsLabels_ = null, 1 == e.showLabels && (this.lonLabelFormatter_ = null == e.lonLabelFormatter ? Gr.bind(this, "EW") : e.lonLabelFormatter, this.latLabelFormatter_ = null == e.latLabelFormatter ? Gr.bind(this, "NS") : e.latLabelFormatter, this.lonLabelPosition_ = null == e.lonLabelPosition ? 0 : e.lonLabelPosition, this.latLabelPosition_ = null == e.latLabelPosition ? 1 : e.latLabelPosition, this.lonLabelStyle_ = void 0 !== e.lonLabelStyle ? e.lonLabelStyle : new vo({
|
||
font: "12px Calibri,sans-serif",
|
||
textBaseline: "bottom",
|
||
fill: new po({color: "rgba(0,0,0,1)"}),
|
||
stroke: new go({color: "rgba(255,255,255,1)", width: 3})
|
||
}), this.latLabelStyle_ = void 0 !== e.latLabelStyle ? e.latLabelStyle : new vo({
|
||
font: "12px Calibri,sans-serif",
|
||
textAlign: "end",
|
||
fill: new po({color: "rgba(0,0,0,1)"}),
|
||
stroke: new go({color: "rgba(255,255,255,1)", width: 3})
|
||
}), this.meridiansLabels_ = [], this.parallelsLabels_ = []), this.intervals_ = void 0 !== e.intervals ? e.intervals : xo, this.setMap(void 0 !== e.map ? e.map : null)
|
||
};
|
||
wo.prototype.addMeridian_ = function (t, e, i, r, o, n) {
|
||
var s = this.getMeridian_(t, e, i, r, n);
|
||
if (Bt(s.getExtent(), o)) {
|
||
if (this.meridiansLabels_) {
|
||
var a = this.getMeridianPoint_(s, o, n);
|
||
this.meridiansLabels_[n] = {geom: a, text: this.lonLabelFormatter_(t)}
|
||
}
|
||
this.meridians_[n++] = s
|
||
}
|
||
return n
|
||
}, wo.prototype.getMeridianPoint_ = function (t, e, i) {
|
||
var r, o = t.getFlatCoordinates(), n = Math.max(e[1], o[1]), s = Math.min(e[3], o[o.length - 1]),
|
||
a = te(e[1] + Math.abs(e[1] - e[3]) * this.lonLabelPosition_, n, s), l = [o[0], a];
|
||
return i in this.meridiansLabels_ ? (r = this.meridiansLabels_[i].geom).setCoordinates(l) : r = new qi(l), r
|
||
}, wo.prototype.addParallel_ = function (t, e, i, r, o, n) {
|
||
var s = this.getParallel_(t, e, i, r, n);
|
||
if (Bt(s.getExtent(), o)) {
|
||
if (this.parallelsLabels_) {
|
||
var a = this.getParallelPoint_(s, o, n);
|
||
this.parallelsLabels_[n] = {geom: a, text: this.latLabelFormatter_(t)}
|
||
}
|
||
this.parallels_[n++] = s
|
||
}
|
||
return n
|
||
}, wo.prototype.getParallelPoint_ = function (t, e, i) {
|
||
var r, o = t.getFlatCoordinates(), n = Math.max(e[0], o[0]), s = Math.min(e[2], o[o.length - 2]),
|
||
a = [te(e[0] + Math.abs(e[0] - e[2]) * this.latLabelPosition_, n, s), o[1]];
|
||
return i in this.parallelsLabels_ ? (r = this.parallelsLabels_[i].geom).setCoordinates(a) : r = new qi(a), r
|
||
}, wo.prototype.createGraticule_ = function (t, e, i, r) {
|
||
var o = this.getInterval_(i);
|
||
if (-1 == o) return this.meridians_.length = this.parallels_.length = 0, this.meridiansLabels_ && (this.meridiansLabels_.length = 0), void (this.parallelsLabels_ && (this.parallelsLabels_.length = 0));
|
||
var n, s, a, l, h = this.toLonLatTransform_(e), u = h[0], c = h[1], p = this.maxLines_,
|
||
d = [Math.max(t[0], this.minLonP_), Math.max(t[1], this.minLatP_), Math.min(t[2], this.maxLonP_), Math.min(t[3], this.maxLatP_)],
|
||
f = (d = ri(d, this.projection_, "EPSG:4326"))[3], g = d[2], m = d[1], y = d[0];
|
||
for (l = te(u = Math.floor(u / o) * o, this.minLon_, this.maxLon_), s = this.addMeridian_(l, m, f, r, t, 0), n = 0; l != this.minLon_ && n++ < p;) l = Math.max(l - o, this.minLon_), s = this.addMeridian_(l, m, f, r, t, s);
|
||
for (l = te(u, this.minLon_, this.maxLon_), n = 0; l != this.maxLon_ && n++ < p;) l = Math.min(l + o, this.maxLon_), s = this.addMeridian_(l, m, f, r, t, s);
|
||
for (this.meridians_.length = s, this.meridiansLabels_ && (this.meridiansLabels_.length = s), a = te(c = Math.floor(c / o) * o, this.minLat_, this.maxLat_), s = this.addParallel_(a, y, g, r, t, 0), n = 0; a != this.minLat_ && n++ < p;) a = Math.max(a - o, this.minLat_), s = this.addParallel_(a, y, g, r, t, s);
|
||
for (a = te(c, this.minLat_, this.maxLat_), n = 0; a != this.maxLat_ && n++ < p;) a = Math.min(a + o, this.maxLat_), s = this.addParallel_(a, y, g, r, t, s);
|
||
this.parallels_.length = s, this.parallelsLabels_ && (this.parallelsLabels_.length = s)
|
||
}, wo.prototype.getInterval_ = function (t) {
|
||
for (var e = this.projectionCenterLonLat_[0], i = this.projectionCenterLonLat_[1], r = -1, o = Math.pow(this.targetSize_ * t, 2), n = [], s = [], a = 0, l = this.intervals_.length; a < l; ++a) {
|
||
var h = this.intervals_[a] / 2;
|
||
if (n[0] = e - h, n[1] = i - h, s[0] = e + h, s[1] = i + h, this.fromLonLatTransform_(n, n), this.fromLonLatTransform_(s, s), Math.pow(s[0] - n[0], 2) + Math.pow(s[1] - n[1], 2) <= o) break;
|
||
r = this.intervals_[a]
|
||
}
|
||
return r
|
||
}, wo.prototype.getMap = function () {
|
||
return this.map_
|
||
}, wo.prototype.getMeridian_ = function (t, e, i, r, o) {
|
||
var n = Qr(t, e, i, this.projection_, r), s = this.meridians_[o];
|
||
return s ? (s.setFlatCoordinates(qt.XY, n), s.changed()) : s = this.meridians_[o] = new Jr(n, qt.XY), s
|
||
}, wo.prototype.getMeridians = function () {
|
||
return this.meridians_
|
||
}, wo.prototype.getParallel_ = function (t, e, i, r, o) {
|
||
var n = to(t, e, i, this.projection_, r), s = this.parallels_[o];
|
||
return s ? (s.setFlatCoordinates(qt.XY, n), s.changed()) : s = new Jr(n, qt.XY), s
|
||
}, wo.prototype.getParallels = function () {
|
||
return this.parallels_
|
||
}, wo.prototype.handlePostCompose_ = function (t) {
|
||
var e, i, r, o, n = t.vectorContext, s = t.frameState, a = s.extent, l = s.viewState, h = l.center,
|
||
u = l.projection, c = l.resolution, p = s.pixelRatio, d = c * c / (4 * p * p);
|
||
for ((!this.projection_ || !Qe(this.projection_, u)) && this.updateProjectionInfo_(u), this.createGraticule_(a, h, c, d), n.setFillStrokeStyle(null, this.strokeStyle_), e = 0, i = this.meridians_.length; e < i; ++e) r = this.meridians_[e], n.drawGeometry(r);
|
||
for (e = 0, i = this.parallels_.length; e < i; ++e) r = this.parallels_[e], n.drawGeometry(r);
|
||
if (this.meridiansLabels_) for (e = 0, i = this.meridiansLabels_.length; e < i; ++e) o = this.meridiansLabels_[e], this.lonLabelStyle_.setText(o.text), n.setTextStyle(this.lonLabelStyle_), n.drawGeometry(o.geom);
|
||
if (this.parallelsLabels_) for (e = 0, i = this.parallelsLabels_.length; e < i; ++e) o = this.parallelsLabels_[e], this.latLabelStyle_.setText(o.text), n.setTextStyle(this.latLabelStyle_), n.drawGeometry(o.geom)
|
||
}, wo.prototype.updateProjectionInfo_ = function (t) {
|
||
var e = We("EPSG:4326"), i = t.getWorldExtent(), r = ri(i, e, t);
|
||
this.maxLat_ = i[3], this.maxLon_ = i[2], this.minLat_ = i[1], this.minLon_ = i[0], this.maxLatP_ = r[3], this.maxLonP_ = r[2], this.minLatP_ = r[1], this.minLonP_ = r[0], this.fromLonLatTransform_ = ei(e, t), this.toLonLatTransform_ = ei(t, e), this.projectionCenterLonLat_ = this.toLonLatTransform_(At(t.getExtent())), this.projection_ = t
|
||
}, wo.prototype.setMap = function (t) {
|
||
this.map_ && (S(this.postcomposeListenerKey_), this.postcomposeListenerKey_ = null, this.map_.render()), t && (this.postcomposeListenerKey_ = w(t, eo.POSTCOMPOSE, this.handlePostCompose_, this), t.render()), this.map_ = t
|
||
};
|
||
var bo = wo, Co = function (t) {
|
||
function e(e, i, r, o) {
|
||
t.call(this), this.extent = e, this.pixelRatio_ = r, this.resolution = i, this.state = o
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.changed = function () {
|
||
this.dispatchEvent(F.CHANGE)
|
||
}, e.prototype.getExtent = function () {
|
||
return this.extent
|
||
}, e.prototype.getImage = function () {
|
||
return n()
|
||
}, e.prototype.getPixelRatio = function () {
|
||
return this.pixelRatio_
|
||
}, e.prototype.getResolution = function () {
|
||
return this.resolution
|
||
}, e.prototype.getState = function () {
|
||
return this.state
|
||
}, e.prototype.load = function () {
|
||
n()
|
||
}, e
|
||
}(k), So = {IDLE: 0, LOADING: 1, LOADED: 2, ERROR: 3}, Eo = function (t) {
|
||
function e(e, i, r, o, n, s) {
|
||
t.call(this, e, i, r, So.IDLE), this.src_ = o, this.image_ = new Image, null !== n && (this.image_.crossOrigin = n), this.imageListenerKeys_ = null, this.state = So.IDLE, this.imageLoadFunction_ = s
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getImage = function () {
|
||
return this.image_
|
||
}, e.prototype.handleImageError_ = function () {
|
||
this.state = So.ERROR, this.unlistenImage_(), this.changed()
|
||
}, e.prototype.handleImageLoad_ = function () {
|
||
void 0 === this.resolution && (this.resolution = Nt(this.extent) / this.image_.height), this.state = So.LOADED, this.unlistenImage_(), this.changed()
|
||
}, e.prototype.load = function () {
|
||
this.state != So.IDLE && this.state != So.ERROR || (this.state = So.LOADING, this.changed(), this.imageListenerKeys_ = [b(this.image_, F.ERROR, this.handleImageError_, this), b(this.image_, F.LOAD, this.handleImageLoad_, this)], this.imageLoadFunction_(this, this.src_))
|
||
}, e.prototype.setImage = function (t) {
|
||
this.image_ = t
|
||
}, e.prototype.unlistenImage_ = function () {
|
||
this.imageListenerKeys_.forEach(S), this.imageListenerKeys_ = null
|
||
}, e
|
||
}(Co), To = function (t) {
|
||
function e(e, i, r, o, n) {
|
||
var s = void 0 !== n ? So.IDLE : So.LOADED;
|
||
t.call(this, e, i, r, s), this.loader_ = void 0 !== n ? n : null, this.canvas_ = o, this.error_ = null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getError = function () {
|
||
return this.error_
|
||
}, e.prototype.handleLoad_ = function (t) {
|
||
t ? (this.error_ = t, this.state = So.ERROR) : this.state = So.LOADED, this.changed()
|
||
}, e.prototype.load = function () {
|
||
this.state == So.IDLE && (this.state = So.LOADING, this.changed(), this.loader_(this.handleLoad_.bind(this)))
|
||
}, e.prototype.getImage = function () {
|
||
return this.canvas_
|
||
}, e
|
||
}(Co), Ro = {IDLE: 0, LOADING: 1, LOADED: 2, ERROR: 3, EMPTY: 4, ABORT: 5};
|
||
|
||
function Po(t) {
|
||
return Math.pow(t, 3)
|
||
}
|
||
|
||
function Lo(t) {
|
||
return 1 - Po(1 - t)
|
||
}
|
||
|
||
function Io(t) {
|
||
return 3 * t * t - 2 * t * t * t
|
||
}
|
||
|
||
function Oo(t) {
|
||
return t
|
||
}
|
||
|
||
var Mo = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this);
|
||
var o = r || {};
|
||
this.tileCoord = e, this.state = i, this.interimTile = null, this.key = "", this.transition_ = void 0 === o.transition ? 250 : o.transition, this.transitionStarts_ = {}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.changed = function () {
|
||
this.dispatchEvent(F.CHANGE)
|
||
}, e.prototype.getKey = function () {
|
||
return this.key + "/" + this.tileCoord
|
||
}, e.prototype.getInterimTile = function () {
|
||
if (!this.interimTile) return this;
|
||
var t = this.interimTile;
|
||
do {
|
||
if (t.getState() == Ro.LOADED) return t;
|
||
t = t.interimTile
|
||
} while (t);
|
||
return this
|
||
}, e.prototype.refreshInterimChain = function () {
|
||
if (this.interimTile) {
|
||
var t = this.interimTile, e = this;
|
||
do {
|
||
if (t.getState() == Ro.LOADED) {
|
||
t.interimTile = null;
|
||
break
|
||
}
|
||
t.getState() == Ro.LOADING ? e = t : t.getState() == Ro.IDLE ? e.interimTile = t.interimTile : e = t, t = e.interimTile
|
||
} while (t)
|
||
}
|
||
}, e.prototype.getTileCoord = function () {
|
||
return this.tileCoord
|
||
}, e.prototype.getState = function () {
|
||
return this.state
|
||
}, e.prototype.setState = function (t) {
|
||
this.state = t, this.changed()
|
||
}, e.prototype.load = function () {
|
||
}, e.prototype.getAlpha = function (t, e) {
|
||
if (!this.transition_) return 1;
|
||
var i = this.transitionStarts_[t];
|
||
if (i) {
|
||
if (-1 === i) return 1
|
||
} else i = e, this.transitionStarts_[t] = i;
|
||
var r = e - i + 1e3 / 60;
|
||
return r >= this.transition_ ? 1 : Po(r / this.transition_)
|
||
}, e.prototype.inTransition = function (t) {
|
||
return !!this.transition_ && -1 !== this.transitionStarts_[t]
|
||
}, e.prototype.endTransition = function (t) {
|
||
this.transition_ && (this.transitionStarts_[t] = -1)
|
||
}, e
|
||
}(k);
|
||
|
||
function Ao(t, e) {
|
||
var i = document.createElement("canvas");
|
||
return t && (i.width = t), e && (i.height = e), i.getContext("2d")
|
||
}
|
||
|
||
function ko(t) {
|
||
var e = t.offsetWidth, i = getComputedStyle(t);
|
||
return e += parseInt(i.marginLeft, 10) + parseInt(i.marginRight, 10)
|
||
}
|
||
|
||
function Fo(t) {
|
||
var e = t.offsetHeight, i = getComputedStyle(t);
|
||
return e += parseInt(i.marginTop, 10) + parseInt(i.marginBottom, 10)
|
||
}
|
||
|
||
function No(t, e) {
|
||
var i = e.parentNode;
|
||
i && i.replaceChild(t, e)
|
||
}
|
||
|
||
function Do(t) {
|
||
return t && t.parentNode ? t.parentNode.removeChild(t) : null
|
||
}
|
||
|
||
function Go(t) {
|
||
for (; t.lastChild;) t.removeChild(t.lastChild)
|
||
}
|
||
|
||
function jo() {
|
||
var t = Ao(1, 1);
|
||
return t.fillStyle = "rgba(0,0,0,0)", t.fillRect(0, 0, 1, 1), t.canvas
|
||
}
|
||
|
||
var zo = function (t) {
|
||
function e(e, i, r, o, n, s) {
|
||
t.call(this, e, i, s), this.crossOrigin_ = o, this.src_ = r, this.image_ = new Image, null !== o && (this.image_.crossOrigin = o), this.imageListenerKeys_ = null, this.tileLoadFunction_ = n
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.disposeInternal = function () {
|
||
this.state == Ro.LOADING && (this.unlistenImage_(), this.image_ = jo()), this.interimTile && this.interimTile.dispose(), this.state = Ro.ABORT, this.changed(), t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.getImage = function () {
|
||
return this.image_
|
||
}, e.prototype.getKey = function () {
|
||
return this.src_
|
||
}, e.prototype.handleImageError_ = function () {
|
||
this.state = Ro.ERROR, this.unlistenImage_(), this.image_ = jo(), this.changed()
|
||
}, e.prototype.handleImageLoad_ = function () {
|
||
var t = this.image_;
|
||
t.naturalWidth && t.naturalHeight ? this.state = Ro.LOADED : this.state = Ro.EMPTY, this.unlistenImage_(), this.changed()
|
||
}, e.prototype.load = function () {
|
||
this.state == Ro.ERROR && (this.state = Ro.IDLE, this.image_ = new Image, null !== this.crossOrigin_ && (this.image_.crossOrigin = this.crossOrigin_)), this.state == Ro.IDLE && (this.state = Ro.LOADING, this.changed(), this.imageListenerKeys_ = [b(this.image_, F.ERROR, this.handleImageError_, this), b(this.image_, F.LOAD, this.handleImageLoad_, this)], this.tileLoadFunction_(this, this.src_))
|
||
}, e.prototype.unlistenImage_ = function () {
|
||
this.imageListenerKeys_.forEach(S), this.imageListenerKeys_ = null
|
||
}, e
|
||
}(Mo), Uo = function (t, e, i) {
|
||
this.decay_ = t, this.minVelocity_ = e, this.delay_ = i, this.points_ = [], this.angle_ = 0, this.initialVelocity_ = 0
|
||
};
|
||
Uo.prototype.begin = function () {
|
||
this.points_.length = 0, this.angle_ = 0, this.initialVelocity_ = 0
|
||
}, Uo.prototype.update = function (t, e) {
|
||
this.points_.push(t, e, Date.now())
|
||
}, Uo.prototype.end = function () {
|
||
if (this.points_.length < 6) return !1;
|
||
var t = Date.now() - this.delay_, e = this.points_.length - 3;
|
||
if (this.points_[e + 2] < t) return !1;
|
||
for (var i = e - 3; i > 0 && this.points_[i + 2] > t;) i -= 3;
|
||
var r = this.points_[e + 2] - this.points_[i + 2];
|
||
if (r < 1e3 / 60) return !1;
|
||
var o = this.points_[e] - this.points_[i], n = this.points_[e + 1] - this.points_[i + 1];
|
||
return this.angle_ = Math.atan2(n, o), this.initialVelocity_ = Math.sqrt(o * o + n * n) / r, this.initialVelocity_ > this.minVelocity_
|
||
}, Uo.prototype.getDistance = function () {
|
||
return (this.minVelocity_ - this.initialVelocity_) / this.decay_
|
||
}, Uo.prototype.getAngle = function () {
|
||
return this.angle_
|
||
};
|
||
var Bo = Uo, Vo = {IMAGE: "IMAGE", TILE: "TILE", VECTOR_TILE: "VECTOR_TILE", VECTOR: "VECTOR"},
|
||
Yo = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, e), this.map = i, this.frameState = void 0 !== r ? r : null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A), Wo = function (t) {
|
||
function e(e, i, r, o, n) {
|
||
t.call(this, e, i, n), this.originalEvent = r, this.pixel = i.getEventPixel(r), this.coordinate = i.getCoordinateFromPixel(this.pixel), this.dragging = void 0 !== o && o
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.preventDefault = function () {
|
||
t.prototype.preventDefault.call(this), this.originalEvent.preventDefault()
|
||
}, e.prototype.stopPropagation = function () {
|
||
t.prototype.stopPropagation.call(this), this.originalEvent.stopPropagation()
|
||
}, e
|
||
}(Yo), Ho = {
|
||
SINGLECLICK: "singleclick",
|
||
CLICK: F.CLICK,
|
||
DBLCLICK: F.DBLCLICK,
|
||
POINTERDRAG: "pointerdrag",
|
||
POINTERMOVE: "pointermove",
|
||
POINTERDOWN: "pointerdown",
|
||
POINTERUP: "pointerup",
|
||
POINTEROVER: "pointerover",
|
||
POINTEROUT: "pointerout",
|
||
POINTERENTER: "pointerenter",
|
||
POINTERLEAVE: "pointerleave",
|
||
POINTERCANCEL: "pointercancel"
|
||
}, Xo = function (t) {
|
||
function e(e, i, r, o, n) {
|
||
t.call(this, e, i, r.originalEvent, o, n), this.pointerEvent = r
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(Wo), qo = {
|
||
POINTERMOVE: "pointermove",
|
||
POINTERDOWN: "pointerdown",
|
||
POINTERUP: "pointerup",
|
||
POINTEROVER: "pointerover",
|
||
POINTEROUT: "pointerout",
|
||
POINTERENTER: "pointerenter",
|
||
POINTERLEAVE: "pointerleave",
|
||
POINTERCANCEL: "pointercancel"
|
||
}, Zo = function (t, e) {
|
||
this.dispatcher = t, this.mapping_ = e
|
||
};
|
||
Zo.prototype.getEvents = function () {
|
||
return Object.keys(this.mapping_)
|
||
}, Zo.prototype.getHandlerForEvent = function (t) {
|
||
return this.mapping_[t]
|
||
};
|
||
var Ko = Zo, Jo = 1, $o = "mouse";
|
||
|
||
function Qo(t) {
|
||
if (!this.isEventSimulatedFromTouch_(t)) {
|
||
Jo.toString() in this.pointerMap && this.cancel(t);
|
||
var e = nn(t, this.dispatcher);
|
||
this.pointerMap[Jo.toString()] = t, this.dispatcher.down(e, t)
|
||
}
|
||
}
|
||
|
||
function tn(t) {
|
||
if (!this.isEventSimulatedFromTouch_(t)) {
|
||
var e = nn(t, this.dispatcher);
|
||
this.dispatcher.move(e, t)
|
||
}
|
||
}
|
||
|
||
function en(t) {
|
||
if (!this.isEventSimulatedFromTouch_(t)) {
|
||
var e = this.pointerMap[Jo.toString()];
|
||
if (e && e.button === t.button) {
|
||
var i = nn(t, this.dispatcher);
|
||
this.dispatcher.up(i, t), this.cleanupMouse()
|
||
}
|
||
}
|
||
}
|
||
|
||
function rn(t) {
|
||
if (!this.isEventSimulatedFromTouch_(t)) {
|
||
var e = nn(t, this.dispatcher);
|
||
this.dispatcher.enterOver(e, t)
|
||
}
|
||
}
|
||
|
||
function on(t) {
|
||
if (!this.isEventSimulatedFromTouch_(t)) {
|
||
var e = nn(t, this.dispatcher);
|
||
this.dispatcher.leaveOut(e, t)
|
||
}
|
||
}
|
||
|
||
function nn(t, e) {
|
||
var i = e.cloneEvent(t, t), r = i.preventDefault;
|
||
return i.preventDefault = function () {
|
||
t.preventDefault(), r()
|
||
}, i.pointerId = Jo, i.isPrimary = !0, i.pointerType = $o, i
|
||
}
|
||
|
||
var sn = function (t) {
|
||
function e(e) {
|
||
var i = {mousedown: Qo, mousemove: tn, mouseup: en, mouseover: rn, mouseout: on};
|
||
t.call(this, e, i), this.pointerMap = e.pointerMap, this.lastTouches = []
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.isEventSimulatedFromTouch_ = function (t) {
|
||
for (var e = this.lastTouches, i = t.clientX, r = t.clientY, o = 0, n = e.length, s = void 0; o < n && (s = e[o]); o++) {
|
||
var a = Math.abs(i - s[0]), l = Math.abs(r - s[1]);
|
||
if (a <= 25 && l <= 25) return !0
|
||
}
|
||
return !1
|
||
}, e.prototype.cancel = function (t) {
|
||
var e = nn(t, this.dispatcher);
|
||
this.dispatcher.cancel(e, t), this.cleanupMouse()
|
||
}, e.prototype.cleanupMouse = function () {
|
||
delete this.pointerMap[Jo.toString()]
|
||
}, e
|
||
}(Ko), an = ["", "unavailable", "touch", "pen", "mouse"];
|
||
|
||
function ln(t) {
|
||
this.pointerMap[t.pointerId.toString()] = t;
|
||
var e = this.prepareEvent_(t);
|
||
this.dispatcher.down(e, t)
|
||
}
|
||
|
||
function hn(t) {
|
||
var e = this.prepareEvent_(t);
|
||
this.dispatcher.move(e, t)
|
||
}
|
||
|
||
function un(t) {
|
||
var e = this.prepareEvent_(t);
|
||
this.dispatcher.up(e, t), this.cleanup(t.pointerId)
|
||
}
|
||
|
||
function cn(t) {
|
||
var e = this.prepareEvent_(t);
|
||
this.dispatcher.leaveOut(e, t)
|
||
}
|
||
|
||
function pn(t) {
|
||
var e = this.prepareEvent_(t);
|
||
this.dispatcher.enterOver(e, t)
|
||
}
|
||
|
||
function dn(t) {
|
||
var e = this.prepareEvent_(t);
|
||
this.dispatcher.cancel(e, t), this.cleanup(t.pointerId)
|
||
}
|
||
|
||
function fn(t) {
|
||
var e = this.dispatcher.makeEvent("lostpointercapture", t, t);
|
||
this.dispatcher.dispatchEvent(e)
|
||
}
|
||
|
||
function gn(t) {
|
||
var e = this.dispatcher.makeEvent("gotpointercapture", t, t);
|
||
this.dispatcher.dispatchEvent(e)
|
||
}
|
||
|
||
var mn = function (t) {
|
||
function e(e) {
|
||
var i = {
|
||
MSPointerDown: ln,
|
||
MSPointerMove: hn,
|
||
MSPointerUp: un,
|
||
MSPointerOut: cn,
|
||
MSPointerOver: pn,
|
||
MSPointerCancel: dn,
|
||
MSGotPointerCapture: gn,
|
||
MSLostPointerCapture: fn
|
||
};
|
||
t.call(this, e, i), this.pointerMap = e.pointerMap
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.prepareEvent_ = function (t) {
|
||
var e = t;
|
||
return "number" == typeof t.pointerType && ((e = this.dispatcher.cloneEvent(t, t)).pointerType = an[t.pointerType]), e
|
||
}, e.prototype.cleanup = function (t) {
|
||
delete this.pointerMap[t.toString()]
|
||
}, e
|
||
}(Ko);
|
||
|
||
function yn(t) {
|
||
this.dispatcher.fireNativeEvent(t)
|
||
}
|
||
|
||
function vn(t) {
|
||
this.dispatcher.fireNativeEvent(t)
|
||
}
|
||
|
||
function _n(t) {
|
||
this.dispatcher.fireNativeEvent(t)
|
||
}
|
||
|
||
function xn(t) {
|
||
this.dispatcher.fireNativeEvent(t)
|
||
}
|
||
|
||
function wn(t) {
|
||
this.dispatcher.fireNativeEvent(t)
|
||
}
|
||
|
||
function bn(t) {
|
||
this.dispatcher.fireNativeEvent(t)
|
||
}
|
||
|
||
function Cn(t) {
|
||
this.dispatcher.fireNativeEvent(t)
|
||
}
|
||
|
||
function Sn(t) {
|
||
this.dispatcher.fireNativeEvent(t)
|
||
}
|
||
|
||
var En = function (t) {
|
||
function e(e) {
|
||
var i = {
|
||
pointerdown: yn,
|
||
pointermove: vn,
|
||
pointerup: _n,
|
||
pointerout: xn,
|
||
pointerover: wn,
|
||
pointercancel: bn,
|
||
gotpointercapture: Sn,
|
||
lostpointercapture: Cn
|
||
};
|
||
t.call(this, e, i)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(Ko), Tn = !1, Rn = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, e), this.originalEvent = i;
|
||
var o = r || {};
|
||
this.buttons = function (t) {
|
||
var e;
|
||
if (t.buttons || Tn) e = t.buttons; else switch (t.which) {
|
||
case 1:
|
||
e = 1;
|
||
break;
|
||
case 2:
|
||
e = 4;
|
||
break;
|
||
case 3:
|
||
e = 2;
|
||
break;
|
||
default:
|
||
e = 0
|
||
}
|
||
return e
|
||
}(o), this.pressure = function (t, e) {
|
||
var i = 0;
|
||
i = t.pressure ? t.pressure : e ? .5 : 0;
|
||
return i
|
||
}(o, this.buttons), this.bubbles = "bubbles" in o && o.bubbles, this.cancelable = "cancelable" in o && o.cancelable, this.view = "view" in o ? o.view : null, this.detail = "detail" in o ? o.detail : null, this.screenX = "screenX" in o ? o.screenX : 0, this.screenY = "screenY" in o ? o.screenY : 0, this.clientX = "clientX" in o ? o.clientX : 0, this.clientY = "clientY" in o ? o.clientY : 0, this.ctrlKey = "ctrlKey" in o && o.ctrlKey, this.altKey = "altKey" in o && o.altKey, this.shiftKey = "shiftKey" in o && o.shiftKey, this.metaKey = "metaKey" in o && o.metaKey, this.button = "button" in o ? o.button : 0, this.relatedTarget = "relatedTarget" in o ? o.relatedTarget : null, this.pointerId = "pointerId" in o ? o.pointerId : 0, this.width = "width" in o ? o.width : 0, this.height = "height" in o ? o.height : 0, this.tiltX = "tiltX" in o ? o.tiltX : 0, this.tiltY = "tiltY" in o ? o.tiltY : 0, this.pointerType = "pointerType" in o ? o.pointerType : "", this.hwTimestamp = "hwTimestamp" in o ? o.hwTimestamp : 0, this.isPrimary = "isPrimary" in o && o.isPrimary, i.preventDefault && (this.preventDefault = function () {
|
||
i.preventDefault()
|
||
})
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A);
|
||
!function () {
|
||
try {
|
||
var t = new MouseEvent("click", {buttons: 1});
|
||
Tn = 1 === t.buttons
|
||
} catch (t) {
|
||
}
|
||
}();
|
||
var Pn = Rn;
|
||
|
||
function Ln(t) {
|
||
this.vacuumTouches_(t), this.setPrimaryTouch_(t.changedTouches[0]), this.dedupSynthMouse_(t), this.clickCount_++, this.processTouches_(t, this.overDown_)
|
||
}
|
||
|
||
function In(t) {
|
||
this.processTouches_(t, this.moveOverOut_)
|
||
}
|
||
|
||
function On(t) {
|
||
this.dedupSynthMouse_(t), this.processTouches_(t, this.upOut_)
|
||
}
|
||
|
||
function Mn(t) {
|
||
this.processTouches_(t, this.cancelOut_)
|
||
}
|
||
|
||
var An = function (t) {
|
||
function e(e, i) {
|
||
var r = {touchstart: Ln, touchmove: In, touchend: On, touchcancel: Mn};
|
||
t.call(this, e, r), this.pointerMap = e.pointerMap, this.mouseSource = i, this.firstTouchId_ = void 0, this.clickCount_ = 0, this.resetId_, this.dedupTimeout_ = 2500
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.isPrimaryTouch_ = function (t) {
|
||
return this.firstTouchId_ === t.identifier
|
||
}, e.prototype.setPrimaryTouch_ = function (t) {
|
||
var e = Object.keys(this.pointerMap).length;
|
||
(0 === e || 1 === e && Jo.toString() in this.pointerMap) && (this.firstTouchId_ = t.identifier, this.cancelResetClickCount_())
|
||
}, e.prototype.removePrimaryPointer_ = function (t) {
|
||
t.isPrimary && (this.firstTouchId_ = void 0, this.resetClickCount_())
|
||
}, e.prototype.resetClickCount_ = function () {
|
||
this.resetId_ = setTimeout(this.resetClickCountHandler_.bind(this), 200)
|
||
}, e.prototype.resetClickCountHandler_ = function () {
|
||
this.clickCount_ = 0, this.resetId_ = void 0
|
||
}, e.prototype.cancelResetClickCount_ = function () {
|
||
void 0 !== this.resetId_ && clearTimeout(this.resetId_)
|
||
}, e.prototype.touchToPointer_ = function (t, e) {
|
||
var i = this.dispatcher.cloneEvent(t, e);
|
||
return i.pointerId = e.identifier + 2, i.bubbles = !0, i.cancelable = !0, i.detail = this.clickCount_, i.button = 0, i.buttons = 1, i.width = e.radiusX || 0, i.height = e.radiusY || 0, i.pressure = e.force || .5, i.isPrimary = this.isPrimaryTouch_(e), i.pointerType = "touch", i.clientX = e.clientX, i.clientY = e.clientY, i.screenX = e.screenX, i.screenY = e.screenY, i
|
||
}, e.prototype.processTouches_ = function (t, e) {
|
||
var i = Array.prototype.slice.call(t.changedTouches), r = i.length;
|
||
|
||
function o() {
|
||
t.preventDefault()
|
||
}
|
||
|
||
for (var n = 0; n < r; ++n) {
|
||
var s = this.touchToPointer_(t, i[n]);
|
||
s.preventDefault = o, e.call(this, t, s)
|
||
}
|
||
}, e.prototype.findTouch_ = function (t, e) {
|
||
for (var i = t.length, r = 0; r < i; r++) {
|
||
if (t[r].identifier === e) return !0
|
||
}
|
||
return !1
|
||
}, e.prototype.vacuumTouches_ = function (t) {
|
||
var e = t.touches, i = Object.keys(this.pointerMap), r = i.length;
|
||
if (r >= e.length) {
|
||
for (var o = [], n = 0; n < r; ++n) {
|
||
var s = Number(i[n]), a = this.pointerMap[s];
|
||
s == Jo || this.findTouch_(e, s - 2) || o.push(a.out)
|
||
}
|
||
for (var l = 0; l < o.length; ++l) this.cancelOut_(t, o[l])
|
||
}
|
||
}, e.prototype.overDown_ = function (t, e) {
|
||
this.pointerMap[e.pointerId] = {
|
||
target: e.target,
|
||
out: e,
|
||
outTarget: e.target
|
||
}, this.dispatcher.over(e, t), this.dispatcher.enter(e, t), this.dispatcher.down(e, t)
|
||
}, e.prototype.moveOverOut_ = function (t, e) {
|
||
var i = e, r = this.pointerMap[i.pointerId];
|
||
if (r) {
|
||
var o = r.out, n = r.outTarget;
|
||
this.dispatcher.move(i, t), o && n !== i.target && (o.relatedTarget = i.target, i.relatedTarget = n, o.target = n, i.target ? (this.dispatcher.leaveOut(o, t), this.dispatcher.enterOver(i, t)) : (i.target = n, i.relatedTarget = null, this.cancelOut_(t, i))), r.out = i, r.outTarget = i.target
|
||
}
|
||
}, e.prototype.upOut_ = function (t, e) {
|
||
this.dispatcher.up(e, t), this.dispatcher.out(e, t), this.dispatcher.leave(e, t), this.cleanUpPointer_(e)
|
||
}, e.prototype.cancelOut_ = function (t, e) {
|
||
this.dispatcher.cancel(e, t), this.dispatcher.out(e, t), this.dispatcher.leave(e, t), this.cleanUpPointer_(e)
|
||
}, e.prototype.cleanUpPointer_ = function (t) {
|
||
delete this.pointerMap[t.pointerId], this.removePrimaryPointer_(t)
|
||
}, e.prototype.dedupSynthMouse_ = function (t) {
|
||
var e = this.mouseSource.lastTouches, i = t.changedTouches[0];
|
||
if (this.isPrimaryTouch_(i)) {
|
||
var r = [i.clientX, i.clientY];
|
||
e.push(r), setTimeout(function () {
|
||
tt(e, r)
|
||
}, this.dedupTimeout_)
|
||
}
|
||
}, e
|
||
}(Ko),
|
||
kn = [["bubbles", !1], ["cancelable", !1], ["view", null], ["detail", null], ["screenX", 0], ["screenY", 0], ["clientX", 0], ["clientY", 0], ["ctrlKey", !1], ["altKey", !1], ["shiftKey", !1], ["metaKey", !1], ["button", 0], ["relatedTarget", null], ["buttons", 0], ["pointerId", 0], ["width", 0], ["height", 0], ["pressure", 0], ["tiltX", 0], ["tiltY", 0], ["pointerType", ""], ["hwTimestamp", 0], ["isPrimary", !1], ["type", ""], ["target", null], ["currentTarget", null], ["which", 0]],
|
||
Fn = function (t) {
|
||
function e(e) {
|
||
t.call(this), this.element_ = e, this.pointerMap = {}, this.eventMap_ = {}, this.eventSourceList_ = [], this.registerSources()
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.registerSources = function () {
|
||
if (Pr) this.registerSource("native", new En(this)); else if (Lr) this.registerSource("ms", new mn(this)); else {
|
||
var t = new sn(this);
|
||
this.registerSource("mouse", t), Rr && this.registerSource("touch", new An(this, t))
|
||
}
|
||
this.register_()
|
||
}, e.prototype.registerSource = function (t, e) {
|
||
var i = e, r = i.getEvents();
|
||
r && (r.forEach(function (t) {
|
||
var e = i.getHandlerForEvent(t);
|
||
e && (this.eventMap_[t] = e.bind(i))
|
||
}.bind(this)), this.eventSourceList_.push(i))
|
||
}, e.prototype.register_ = function () {
|
||
for (var t = this.eventSourceList_.length, e = 0; e < t; e++) {
|
||
var i = this.eventSourceList_[e];
|
||
this.addEvents_(i.getEvents())
|
||
}
|
||
}, e.prototype.unregister_ = function () {
|
||
for (var t = this.eventSourceList_.length, e = 0; e < t; e++) {
|
||
var i = this.eventSourceList_[e];
|
||
this.removeEvents_(i.getEvents())
|
||
}
|
||
}, e.prototype.eventHandler_ = function (t) {
|
||
var e = t.type, i = this.eventMap_[e];
|
||
i && i(t)
|
||
}, e.prototype.addEvents_ = function (t) {
|
||
t.forEach(function (t) {
|
||
w(this.element_, t, this.eventHandler_, this)
|
||
}.bind(this))
|
||
}, e.prototype.removeEvents_ = function (t) {
|
||
t.forEach(function (t) {
|
||
C(this.element_, t, this.eventHandler_, this)
|
||
}.bind(this))
|
||
}, e.prototype.cloneEvent = function (t, e) {
|
||
for (var i = {}, r = 0, o = kn.length; r < o; r++) {
|
||
var n = kn[r][0];
|
||
i[n] = t[n] || e[n] || kn[r][1]
|
||
}
|
||
return i
|
||
}, e.prototype.down = function (t, e) {
|
||
this.fireEvent(qo.POINTERDOWN, t, e)
|
||
}, e.prototype.move = function (t, e) {
|
||
this.fireEvent(qo.POINTERMOVE, t, e)
|
||
}, e.prototype.up = function (t, e) {
|
||
this.fireEvent(qo.POINTERUP, t, e)
|
||
}, e.prototype.enter = function (t, e) {
|
||
t.bubbles = !1, this.fireEvent(qo.POINTERENTER, t, e)
|
||
}, e.prototype.leave = function (t, e) {
|
||
t.bubbles = !1, this.fireEvent(qo.POINTERLEAVE, t, e)
|
||
}, e.prototype.over = function (t, e) {
|
||
t.bubbles = !0, this.fireEvent(qo.POINTEROVER, t, e)
|
||
}, e.prototype.out = function (t, e) {
|
||
t.bubbles = !0, this.fireEvent(qo.POINTEROUT, t, e)
|
||
}, e.prototype.cancel = function (t, e) {
|
||
this.fireEvent(qo.POINTERCANCEL, t, e)
|
||
}, e.prototype.leaveOut = function (t, e) {
|
||
this.out(t, e), this.contains_(t.target, t.relatedTarget) || this.leave(t, e)
|
||
}, e.prototype.enterOver = function (t, e) {
|
||
this.over(t, e), this.contains_(t.target, t.relatedTarget) || this.enter(t, e)
|
||
}, e.prototype.contains_ = function (t, e) {
|
||
return !(!t || !e) && t.contains(e)
|
||
}, e.prototype.makeEvent = function (t, e, i) {
|
||
return new Pn(t, i, e)
|
||
}, e.prototype.fireEvent = function (t, e, i) {
|
||
var r = this.makeEvent(t, e, i);
|
||
this.dispatchEvent(r)
|
||
}, e.prototype.fireNativeEvent = function (t) {
|
||
var e = this.makeEvent(t.type, t, t);
|
||
this.dispatchEvent(e)
|
||
}, e.prototype.wrapMouseEvent = function (t, e) {
|
||
return this.makeEvent(t, nn(e, this), e)
|
||
}, e.prototype.disposeInternal = function () {
|
||
this.unregister_(), t.prototype.disposeInternal.call(this)
|
||
}, e
|
||
}(k), Nn = function (t) {
|
||
function e(e, i) {
|
||
t.call(this), this.map_ = e, this.clickTimeoutId_, this.dragging_ = !1, this.dragListenerKeys_ = [], this.moveTolerance_ = i ? i * Sr : Sr, this.down_ = null;
|
||
var r = this.map_.getViewport();
|
||
this.activePointers_ = 0, this.trackedTouches_ = {}, this.pointerEventHandler_ = new Fn(r), this.documentPointerEventHandler_ = null, this.pointerdownListenerKey_ = w(this.pointerEventHandler_, qo.POINTERDOWN, this.handlePointerDown_, this), this.relayedListenerKey_ = w(this.pointerEventHandler_, qo.POINTERMOVE, this.relayEvent_, this)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.emulateClick_ = function (t) {
|
||
var e = new Xo(Ho.CLICK, this.map_, t);
|
||
this.dispatchEvent(e), void 0 !== this.clickTimeoutId_ ? (clearTimeout(this.clickTimeoutId_), this.clickTimeoutId_ = void 0, e = new Xo(Ho.DBLCLICK, this.map_, t), this.dispatchEvent(e)) : this.clickTimeoutId_ = setTimeout(function () {
|
||
this.clickTimeoutId_ = void 0;
|
||
var e = new Xo(Ho.SINGLECLICK, this.map_, t);
|
||
this.dispatchEvent(e)
|
||
}.bind(this), 250)
|
||
}, e.prototype.updateActivePointers_ = function (t) {
|
||
var e = t;
|
||
e.type == Ho.POINTERUP || e.type == Ho.POINTERCANCEL ? delete this.trackedTouches_[e.pointerId] : e.type == Ho.POINTERDOWN && (this.trackedTouches_[e.pointerId] = !0), this.activePointers_ = Object.keys(this.trackedTouches_).length
|
||
}, e.prototype.handlePointerUp_ = function (t) {
|
||
this.updateActivePointers_(t);
|
||
var e = new Xo(Ho.POINTERUP, this.map_, t);
|
||
this.dispatchEvent(e), e.propagationStopped || this.dragging_ || !this.isMouseActionButton_(t) || this.emulateClick_(this.down_), 0 === this.activePointers_ && (this.dragListenerKeys_.forEach(S), this.dragListenerKeys_.length = 0, this.dragging_ = !1, this.down_ = null, this.documentPointerEventHandler_.dispose(), this.documentPointerEventHandler_ = null)
|
||
}, e.prototype.isMouseActionButton_ = function (t) {
|
||
return 0 === t.button
|
||
}, e.prototype.handlePointerDown_ = function (t) {
|
||
this.updateActivePointers_(t);
|
||
var e = new Xo(Ho.POINTERDOWN, this.map_, t);
|
||
this.dispatchEvent(e), this.down_ = t, 0 === this.dragListenerKeys_.length && (this.documentPointerEventHandler_ = new Fn(document), this.dragListenerKeys_.push(w(this.documentPointerEventHandler_, Ho.POINTERMOVE, this.handlePointerMove_, this), w(this.documentPointerEventHandler_, Ho.POINTERUP, this.handlePointerUp_, this), w(this.pointerEventHandler_, Ho.POINTERCANCEL, this.handlePointerUp_, this)))
|
||
}, e.prototype.handlePointerMove_ = function (t) {
|
||
if (this.isMoving_(t)) {
|
||
this.dragging_ = !0;
|
||
var e = new Xo(Ho.POINTERDRAG, this.map_, t, this.dragging_);
|
||
this.dispatchEvent(e)
|
||
}
|
||
t.preventDefault()
|
||
}, e.prototype.relayEvent_ = function (t) {
|
||
var e = !(!this.down_ || !this.isMoving_(t));
|
||
this.dispatchEvent(new Xo(t.type, this.map_, t, e))
|
||
}, e.prototype.isMoving_ = function (t) {
|
||
return this.dragging_ || Math.abs(t.clientX - this.down_.clientX) > this.moveTolerance_ || Math.abs(t.clientY - this.down_.clientY) > this.moveTolerance_
|
||
}, e.prototype.disposeInternal = function () {
|
||
this.relayedListenerKey_ && (S(this.relayedListenerKey_), this.relayedListenerKey_ = null), this.pointerdownListenerKey_ && (S(this.pointerdownListenerKey_), this.pointerdownListenerKey_ = null), this.dragListenerKeys_.forEach(S), this.dragListenerKeys_.length = 0, this.documentPointerEventHandler_ && (this.documentPointerEventHandler_.dispose(), this.documentPointerEventHandler_ = null), this.pointerEventHandler_ && (this.pointerEventHandler_.dispose(), this.pointerEventHandler_ = null), t.prototype.disposeInternal.call(this)
|
||
}, e
|
||
}(k), Dn = {POSTRENDER: "postrender", MOVESTART: "movestart", MOVEEND: "moveend"},
|
||
Gn = {LAYERGROUP: "layergroup", SIZE: "size", TARGET: "target", VIEW: "view"}, jn = function (t, e) {
|
||
this.priorityFunction_ = t, this.keyFunction_ = e, this.elements_ = [], this.priorities_ = [], this.queuedElements_ = {}
|
||
};
|
||
jn.prototype.clear = function () {
|
||
this.elements_.length = 0, this.priorities_.length = 0, d(this.queuedElements_)
|
||
}, jn.prototype.dequeue = function () {
|
||
var t = this.elements_, e = this.priorities_, i = t[0];
|
||
1 == t.length ? (t.length = 0, e.length = 0) : (t[0] = t.pop(), e[0] = e.pop(), this.siftUp_(0));
|
||
var r = this.keyFunction_(i);
|
||
return delete this.queuedElements_[r], i
|
||
}, jn.prototype.enqueue = function (t) {
|
||
W(!(this.keyFunction_(t) in this.queuedElements_), 31);
|
||
var e = this.priorityFunction_(t);
|
||
return e != 1 / 0 && (this.elements_.push(t), this.priorities_.push(e), this.queuedElements_[this.keyFunction_(t)] = !0, this.siftDown_(0, this.elements_.length - 1), !0)
|
||
}, jn.prototype.getCount = function () {
|
||
return this.elements_.length
|
||
}, jn.prototype.getLeftChildIndex_ = function (t) {
|
||
return 2 * t + 1
|
||
}, jn.prototype.getRightChildIndex_ = function (t) {
|
||
return 2 * t + 2
|
||
}, jn.prototype.getParentIndex_ = function (t) {
|
||
return t - 1 >> 1
|
||
}, jn.prototype.heapify_ = function () {
|
||
var t;
|
||
for (t = (this.elements_.length >> 1) - 1; t >= 0; t--) this.siftUp_(t)
|
||
}, jn.prototype.isEmpty = function () {
|
||
return 0 === this.elements_.length
|
||
}, jn.prototype.isKeyQueued = function (t) {
|
||
return t in this.queuedElements_
|
||
}, jn.prototype.isQueued = function (t) {
|
||
return this.isKeyQueued(this.keyFunction_(t))
|
||
}, jn.prototype.siftUp_ = function (t) {
|
||
for (var e = this.elements_, i = this.priorities_, r = e.length, o = e[t], n = i[t], s = t; t < r >> 1;) {
|
||
var a = this.getLeftChildIndex_(t), l = this.getRightChildIndex_(t), h = l < r && i[l] < i[a] ? l : a;
|
||
e[t] = e[h], i[t] = i[h], t = h
|
||
}
|
||
e[t] = o, i[t] = n, this.siftDown_(s, t)
|
||
}, jn.prototype.siftDown_ = function (t, e) {
|
||
for (var i = this.elements_, r = this.priorities_, o = i[e], n = r[e]; e > t;) {
|
||
var s = this.getParentIndex_(e);
|
||
if (!(r[s] > n)) break;
|
||
i[e] = i[s], r[e] = r[s], e = s
|
||
}
|
||
i[e] = o, r[e] = n
|
||
}, jn.prototype.reprioritize = function () {
|
||
var t, e, i, r = this.priorityFunction_, o = this.elements_, n = this.priorities_, s = 0, a = o.length;
|
||
for (e = 0; e < a; ++e) (i = r(t = o[e])) == 1 / 0 ? delete this.queuedElements_[this.keyFunction_(t)] : (n[s] = i, o[s++] = t);
|
||
o.length = s, n.length = s, this.heapify_()
|
||
};
|
||
var zn = jn, Un = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, function (t) {
|
||
return e.apply(null, t)
|
||
}, function (t) {
|
||
return t[0].getKey()
|
||
}), this.tileChangeCallback_ = i, this.tilesLoading_ = 0, this.tilesLoadingKeys_ = {}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.enqueue = function (e) {
|
||
var i = t.prototype.enqueue.call(this, e);
|
||
i && w(e[0], F.CHANGE, this.handleTileChange, this);
|
||
return i
|
||
}, e.prototype.getTilesLoading = function () {
|
||
return this.tilesLoading_
|
||
}, e.prototype.handleTileChange = function (t) {
|
||
var e = t.target, i = e.getState();
|
||
if (i === Ro.LOADED || i === Ro.ERROR || i === Ro.EMPTY || i === Ro.ABORT) {
|
||
C(e, F.CHANGE, this.handleTileChange, this);
|
||
var r = e.getKey();
|
||
r in this.tilesLoadingKeys_ && (delete this.tilesLoadingKeys_[r], --this.tilesLoading_), this.tileChangeCallback_()
|
||
}
|
||
}, e.prototype.loadMoreTiles = function (t, e) {
|
||
for (var i, r, o, n = 0, s = !1; this.tilesLoading_ < t && n < e && this.getCount() > 0;) o = (r = this.dequeue()[0]).getKey(), (i = r.getState()) === Ro.ABORT ? s = !0 : i !== Ro.IDLE || o in this.tilesLoadingKeys_ || (this.tilesLoadingKeys_[o] = !0, ++this.tilesLoading_, ++n, r.load());
|
||
0 === n && s && this.tileChangeCallback_()
|
||
}, e
|
||
}(zn), Bn = 42, Vn = 256;
|
||
|
||
function Yn(t) {
|
||
return function (e) {
|
||
return e ? [te(e[0], t[0], t[2]), te(e[1], t[1], t[3])] : void 0
|
||
}
|
||
}
|
||
|
||
function Wn(t) {
|
||
return t
|
||
}
|
||
|
||
function Hn(t) {
|
||
return function (e, i, r) {
|
||
if (void 0 !== e) {
|
||
var o = J(t, e, r);
|
||
o = te(o + i, 0, t.length - 1);
|
||
var n = Math.floor(o);
|
||
if (o != n && n < t.length - 1) {
|
||
var s = t[n] / t[n + 1];
|
||
return t[n] / Math.pow(s, o - n)
|
||
}
|
||
return t[n]
|
||
}
|
||
}
|
||
}
|
||
|
||
function Xn(t, e, i) {
|
||
return function (r, o, n) {
|
||
if (void 0 !== r) {
|
||
var s = -n / 2 + .5, a = Math.floor(Math.log(e / r) / Math.log(t) + s), l = Math.max(a + o, 0);
|
||
return void 0 !== i && (l = Math.min(l, i)), e / Math.pow(t, l)
|
||
}
|
||
}
|
||
}
|
||
|
||
function qn(t, e) {
|
||
return void 0 !== t ? 0 : void 0
|
||
}
|
||
|
||
function Zn(t, e) {
|
||
return void 0 !== t ? t + e : void 0
|
||
}
|
||
|
||
function Kn(t) {
|
||
var e = 2 * Math.PI / t;
|
||
return function (t, i) {
|
||
return void 0 !== t ? t = Math.floor((t + i) / e + .5) * e : void 0
|
||
}
|
||
}
|
||
|
||
function Jn(t) {
|
||
var e = t || ae(5);
|
||
return function (t, i) {
|
||
return void 0 !== t ? Math.abs(t + i) <= e ? 0 : t + i : void 0
|
||
}
|
||
}
|
||
|
||
var $n = {ANIMATING: 0, INTERACTING: 1},
|
||
Qn = {CENTER: "center", RESOLUTION: "resolution", ROTATION: "rotation"}, ts = 0;
|
||
|
||
function es(t, e) {
|
||
setTimeout(function () {
|
||
t(e)
|
||
}, 0)
|
||
}
|
||
|
||
function is(t) {
|
||
return void 0 !== t.extent ? Yn(t.extent) : Wn
|
||
}
|
||
|
||
function rs(t) {
|
||
var e, i, r, o = void 0 !== t.minZoom ? t.minZoom : ts, n = void 0 !== t.maxZoom ? t.maxZoom : 28,
|
||
s = void 0 !== t.zoomFactor ? t.zoomFactor : 2;
|
||
if (void 0 !== t.resolutions) {
|
||
var a = t.resolutions;
|
||
i = a[o], r = void 0 !== a[n] ? a[n] : a[a.length - 1], e = Hn(a)
|
||
} else {
|
||
var l = Ze(t.projection, "EPSG:3857"), h = l.getExtent(),
|
||
u = (h ? Math.max(Ut(h), Nt(h)) : 360 * ye[ve.DEGREES] / l.getMetersPerUnit()) / Vn / Math.pow(2, ts),
|
||
c = u / Math.pow(2, 28 - ts);
|
||
void 0 !== (i = t.maxResolution) ? o = 0 : i = u / Math.pow(s, o), void 0 === (r = t.minResolution) && (r = void 0 !== t.maxZoom ? void 0 !== t.maxResolution ? i / Math.pow(s, n) : u / Math.pow(s, n) : c), n = o + Math.floor(Math.log(i / r) / Math.log(s)), r = i / Math.pow(s, n - o), e = Xn(s, i, n - o)
|
||
}
|
||
return {constraint: e, maxResolution: i, minResolution: r, minZoom: o, zoomFactor: s}
|
||
}
|
||
|
||
function os(t) {
|
||
if (void 0 === t.enableRotation || t.enableRotation) {
|
||
var e = t.constrainRotation;
|
||
return void 0 === e || !0 === e ? Jn() : !1 === e ? Zn : "number" == typeof e ? Kn(e) : Zn
|
||
}
|
||
return qn
|
||
}
|
||
|
||
function ns(t) {
|
||
return !(t.sourceCenter && t.targetCenter && !zr(t.sourceCenter, t.targetCenter)) && (t.sourceResolution === t.targetResolution && t.sourceRotation === t.targetRotation)
|
||
}
|
||
|
||
var ss = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = p({}, e);
|
||
this.hints_ = [0, 0], this.animations_ = [], this.updateAnimationKey_, this.updateAnimations_ = this.updateAnimations_.bind(this), this.projection_ = Ze(i.projection, "EPSG:3857"), this.applyOptions_(i)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.applyOptions_ = function (t) {
|
||
var e = {};
|
||
e[Qn.CENTER] = void 0 !== t.center ? t.center : null;
|
||
var i = rs(t);
|
||
this.maxResolution_ = i.maxResolution, this.minResolution_ = i.minResolution, this.zoomFactor_ = i.zoomFactor, this.resolutions_ = t.resolutions, this.minZoom_ = i.minZoom;
|
||
var r = is(t), o = i.constraint, n = os(t);
|
||
this.constraints_ = {
|
||
center: r,
|
||
resolution: o,
|
||
rotation: n
|
||
}, void 0 !== t.resolution ? e[Qn.RESOLUTION] = t.resolution : void 0 !== t.zoom && (e[Qn.RESOLUTION] = this.constrainResolution(this.maxResolution_, t.zoom - this.minZoom_), this.resolutions_ && (e[Qn.RESOLUTION] = te(Number(this.getResolution() || e[Qn.RESOLUTION]), this.minResolution_, this.maxResolution_))), e[Qn.ROTATION] = void 0 !== t.rotation ? t.rotation : 0, this.setProperties(e), this.options_ = t
|
||
}, e.prototype.getUpdatedOptions_ = function (t) {
|
||
var e = p({}, this.options_);
|
||
return void 0 !== e.resolution ? e.resolution = this.getResolution() : e.zoom = this.getZoom(), e.center = this.getCenter(), e.rotation = this.getRotation(), p({}, e, t)
|
||
}, e.prototype.animate = function (t) {
|
||
var e, i = arguments, r = arguments.length;
|
||
if (r > 1 && "function" == typeof arguments[r - 1] && (e = arguments[r - 1], --r), !this.isDef()) {
|
||
var o = arguments[r - 1];
|
||
return o.center && this.setCenter(o.center), void 0 !== o.zoom && this.setZoom(o.zoom), void 0 !== o.rotation && this.setRotation(o.rotation), void (e && es(e, !0))
|
||
}
|
||
for (var n = Date.now(), s = this.getCenter().slice(), a = this.getResolution(), l = this.getRotation(), h = [], u = 0; u < r; ++u) {
|
||
var c = i[u], p = {
|
||
start: n,
|
||
complete: !1,
|
||
anchor: c.anchor,
|
||
duration: void 0 !== c.duration ? c.duration : 1e3,
|
||
easing: c.easing || Io
|
||
};
|
||
if (c.center && (p.sourceCenter = s, p.targetCenter = c.center, s = p.targetCenter), void 0 !== c.zoom ? (p.sourceResolution = a, p.targetResolution = this.constrainResolution(this.maxResolution_, c.zoom - this.minZoom_, 0), a = p.targetResolution) : c.resolution && (p.sourceResolution = a, p.targetResolution = c.resolution, a = p.targetResolution), void 0 !== c.rotation) {
|
||
p.sourceRotation = l;
|
||
var d = le(c.rotation - l + Math.PI, 2 * Math.PI) - Math.PI;
|
||
p.targetRotation = l + d, l = p.targetRotation
|
||
}
|
||
p.callback = e, ns(p) ? p.complete = !0 : n += p.duration, h.push(p)
|
||
}
|
||
this.animations_.push(h), this.setHint($n.ANIMATING, 1), this.updateAnimations_()
|
||
}, e.prototype.getAnimating = function () {
|
||
return this.hints_[$n.ANIMATING] > 0
|
||
}, e.prototype.getInteracting = function () {
|
||
return this.hints_[$n.INTERACTING] > 0
|
||
}, e.prototype.cancelAnimations = function () {
|
||
this.setHint($n.ANIMATING, -this.hints_[$n.ANIMATING]);
|
||
for (var t = 0, e = this.animations_.length; t < e; ++t) {
|
||
var i = this.animations_[t];
|
||
i[0].callback && es(i[0].callback, !1)
|
||
}
|
||
this.animations_.length = 0
|
||
}, e.prototype.updateAnimations_ = function () {
|
||
if (void 0 !== this.updateAnimationKey_ && (cancelAnimationFrame(this.updateAnimationKey_), this.updateAnimationKey_ = void 0), this.getAnimating()) {
|
||
for (var t = Date.now(), e = !1, i = this.animations_.length - 1; i >= 0; --i) {
|
||
for (var r = this.animations_[i], o = !0, n = 0, s = r.length; n < s; ++n) {
|
||
var a = r[n];
|
||
if (!a.complete) {
|
||
var l = t - a.start, h = a.duration > 0 ? l / a.duration : 1;
|
||
h >= 1 ? (a.complete = !0, h = 1) : o = !1;
|
||
var u = a.easing(h);
|
||
if (a.sourceCenter) {
|
||
var c = a.sourceCenter[0], p = a.sourceCenter[1],
|
||
d = c + u * (a.targetCenter[0] - c), f = p + u * (a.targetCenter[1] - p);
|
||
this.set(Qn.CENTER, [d, f])
|
||
}
|
||
if (a.sourceResolution && a.targetResolution) {
|
||
var g = 1 === u ? a.targetResolution : a.sourceResolution + u * (a.targetResolution - a.sourceResolution);
|
||
a.anchor && this.set(Qn.CENTER, this.calculateCenterZoom(g, a.anchor)), this.set(Qn.RESOLUTION, g)
|
||
}
|
||
if (void 0 !== a.sourceRotation && void 0 !== a.targetRotation) {
|
||
var m = 1 === u ? le(a.targetRotation + Math.PI, 2 * Math.PI) - Math.PI : a.sourceRotation + u * (a.targetRotation - a.sourceRotation);
|
||
a.anchor && this.set(Qn.CENTER, this.calculateCenterRotate(m, a.anchor)), this.set(Qn.ROTATION, m)
|
||
}
|
||
if (e = !0, !a.complete) break
|
||
}
|
||
}
|
||
if (o) {
|
||
this.animations_[i] = null, this.setHint($n.ANIMATING, -1);
|
||
var y = r[0].callback;
|
||
y && es(y, !0)
|
||
}
|
||
}
|
||
this.animations_ = this.animations_.filter(Boolean), e && void 0 === this.updateAnimationKey_ && (this.updateAnimationKey_ = requestAnimationFrame(this.updateAnimations_))
|
||
}
|
||
}, e.prototype.calculateCenterRotate = function (t, e) {
|
||
var i, r = this.getCenter();
|
||
return void 0 !== r && (Ur(i = [r[0] - e[0], r[1] - e[1]], t - this.getRotation()), Fr(i, e)), i
|
||
}, e.prototype.calculateCenterZoom = function (t, e) {
|
||
var i, r = this.getCenter(), o = this.getResolution();
|
||
void 0 !== r && void 0 !== o && (i = [e[0] - t * (e[0] - r[0]) / o, e[1] - t * (e[1] - r[1]) / o]);
|
||
return i
|
||
}, e.prototype.getSizeFromViewport_ = function () {
|
||
var t = [100, 100], e = '.ol-viewport[data-view="' + a(this) + '"]', i = document.querySelector(e);
|
||
if (i) {
|
||
var r = getComputedStyle(i);
|
||
t[0] = parseInt(r.width, 10), t[1] = parseInt(r.height, 10)
|
||
}
|
||
return t
|
||
}, e.prototype.constrainCenter = function (t) {
|
||
return this.constraints_.center(t)
|
||
}, e.prototype.constrainResolution = function (t, e, i) {
|
||
var r = e || 0, o = i || 0;
|
||
return this.constraints_.resolution(t, r, o)
|
||
}, e.prototype.constrainRotation = function (t, e) {
|
||
var i = e || 0;
|
||
return this.constraints_.rotation(t, i)
|
||
}, e.prototype.getCenter = function () {
|
||
return this.get(Qn.CENTER)
|
||
}, e.prototype.getConstraints = function () {
|
||
return this.constraints_
|
||
}, e.prototype.getHints = function (t) {
|
||
return void 0 !== t ? (t[0] = this.hints_[0], t[1] = this.hints_[1], t) : this.hints_.slice()
|
||
}, e.prototype.calculateExtent = function (t) {
|
||
var e = t || this.getSizeFromViewport_(), i = this.getCenter();
|
||
W(i, 1);
|
||
var r = this.getResolution();
|
||
W(void 0 !== r, 2);
|
||
var o = this.getRotation();
|
||
return W(void 0 !== o, 3), Ft(i, r, o, e)
|
||
}, e.prototype.getMaxResolution = function () {
|
||
return this.maxResolution_
|
||
}, e.prototype.getMinResolution = function () {
|
||
return this.minResolution_
|
||
}, e.prototype.getMaxZoom = function () {
|
||
return this.getZoomForResolution(this.minResolution_)
|
||
}, e.prototype.setMaxZoom = function (t) {
|
||
this.applyOptions_(this.getUpdatedOptions_({maxZoom: t}))
|
||
}, e.prototype.getMinZoom = function () {
|
||
return this.getZoomForResolution(this.maxResolution_)
|
||
}, e.prototype.setMinZoom = function (t) {
|
||
this.applyOptions_(this.getUpdatedOptions_({minZoom: t}))
|
||
}, e.prototype.getProjection = function () {
|
||
return this.projection_
|
||
}, e.prototype.getResolution = function () {
|
||
return this.get(Qn.RESOLUTION)
|
||
}, e.prototype.getResolutions = function () {
|
||
return this.resolutions_
|
||
}, e.prototype.getResolutionForExtent = function (t, e) {
|
||
var i = e || this.getSizeFromViewport_(), r = Ut(t) / i[0], o = Nt(t) / i[1];
|
||
return Math.max(r, o)
|
||
}, e.prototype.getResolutionForValueFunction = function (t) {
|
||
var e = t || 2, i = this.maxResolution_, r = this.minResolution_, o = Math.log(i / r) / Math.log(e);
|
||
return function (t) {
|
||
return i / Math.pow(e, t * o)
|
||
}
|
||
}, e.prototype.getRotation = function () {
|
||
return this.get(Qn.ROTATION)
|
||
}, e.prototype.getValueForResolutionFunction = function (t) {
|
||
var e = t || 2, i = this.maxResolution_, r = this.minResolution_, o = Math.log(i / r) / Math.log(e);
|
||
return function (t) {
|
||
return Math.log(i / t) / Math.log(e) / o
|
||
}
|
||
}, e.prototype.getState = function (t) {
|
||
var e = this.getCenter(), i = this.getProjection(), r = this.getResolution(), o = r / t,
|
||
n = this.getRotation();
|
||
return {
|
||
center: [Math.round(e[0] / o) * o, Math.round(e[1] / o) * o],
|
||
projection: void 0 !== i ? i : null,
|
||
resolution: r,
|
||
rotation: n,
|
||
zoom: this.getZoom()
|
||
}
|
||
}, e.prototype.getZoom = function () {
|
||
var t, e = this.getResolution();
|
||
return void 0 !== e && (t = this.getZoomForResolution(e)), t
|
||
}, e.prototype.getZoomForResolution = function (t) {
|
||
var e, i, r = this.minZoom_ || 0;
|
||
if (this.resolutions_) {
|
||
var o = J(this.resolutions_, t, 1);
|
||
r = o, e = this.resolutions_[o], i = o == this.resolutions_.length - 1 ? 2 : e / this.resolutions_[o + 1]
|
||
} else e = this.maxResolution_, i = this.zoomFactor_;
|
||
return r + Math.log(e / t) / Math.log(i)
|
||
}, e.prototype.getResolutionForZoom = function (t) {
|
||
return this.constrainResolution(this.maxResolution_, t - this.minZoom_, 0)
|
||
}, e.prototype.fit = function (t, e) {
|
||
var i, r = e || {}, o = r.size;
|
||
o || (o = this.getSizeFromViewport_()), W(Array.isArray(t) || "function" == typeof t.getSimplifiedGeometry, 24), Array.isArray(t) ? (W(!Vt(t), 25), i = mr(t)) : t.getType() === Zt.CIRCLE ? (i = mr(t = t.getExtent())).rotate(this.getRotation(), At(t)) : i = t;
|
||
var n, s = void 0 !== r.padding ? r.padding : [0, 0, 0, 0],
|
||
a = void 0 === r.constrainResolution || r.constrainResolution,
|
||
l = void 0 !== r.nearest && r.nearest;
|
||
n = void 0 !== r.minResolution ? r.minResolution : void 0 !== r.maxZoom ? this.constrainResolution(this.maxResolution_, r.maxZoom - this.minZoom_, 0) : 0;
|
||
for (var h = i.getFlatCoordinates(), u = this.getRotation(), c = Math.cos(-u), p = Math.sin(-u), d = 1 / 0, f = 1 / 0, g = -1 / 0, m = -1 / 0, y = i.getStride(), v = 0, _ = h.length; v < _; v += y) {
|
||
var x = h[v] * c - h[v + 1] * p, w = h[v] * p + h[v + 1] * c;
|
||
d = Math.min(d, x), f = Math.min(f, w), g = Math.max(g, x), m = Math.max(m, w)
|
||
}
|
||
var b = this.getResolutionForExtent([d, f, g, m], [o[0] - s[1] - s[3], o[1] - s[0] - s[2]]);
|
||
if (b = isNaN(b) ? n : Math.max(b, n), a) {
|
||
var C = this.constrainResolution(b, 0, 0);
|
||
!l && C < b && (C = this.constrainResolution(C, -1, 0)), b = C
|
||
}
|
||
p = -p;
|
||
var S = (d + g) / 2, E = (f + m) / 2,
|
||
T = [(S += (s[1] - s[3]) / 2 * b) * c - (E += (s[0] - s[2]) / 2 * b) * p, E * c + S * p],
|
||
R = r.callback ? r.callback : I;
|
||
void 0 !== r.duration ? this.animate({
|
||
resolution: b,
|
||
center: T,
|
||
duration: r.duration,
|
||
easing: r.easing
|
||
}, R) : (this.setResolution(b), this.setCenter(T), es(R, !0))
|
||
}, e.prototype.centerOn = function (t, e, i) {
|
||
var r = this.getRotation(), o = Math.cos(-r), n = Math.sin(-r), s = t[0] * o - t[1] * n,
|
||
a = t[1] * o + t[0] * n, l = this.getResolution(),
|
||
h = (s += (e[0] / 2 - i[0]) * l) * o - (a += (i[1] - e[1] / 2) * l) * (n = -n), u = a * o + s * n;
|
||
this.setCenter([h, u])
|
||
}, e.prototype.isDef = function () {
|
||
return !!this.getCenter() && void 0 !== this.getResolution()
|
||
}, e.prototype.rotate = function (t, e) {
|
||
if (void 0 !== e) {
|
||
var i = this.calculateCenterRotate(t, e);
|
||
this.setCenter(i)
|
||
}
|
||
this.setRotation(t)
|
||
}, e.prototype.setCenter = function (t) {
|
||
this.set(Qn.CENTER, t), this.getAnimating() && this.cancelAnimations()
|
||
}, e.prototype.setHint = function (t, e) {
|
||
return this.hints_[t] += e, this.changed(), this.hints_[t]
|
||
}, e.prototype.setResolution = function (t) {
|
||
this.set(Qn.RESOLUTION, t), this.getAnimating() && this.cancelAnimations()
|
||
}, e.prototype.setRotation = function (t) {
|
||
this.set(Qn.ROTATION, t), this.getAnimating() && this.cancelAnimations()
|
||
}, e.prototype.setZoom = function (t) {
|
||
this.setResolution(this.getResolutionForZoom(t))
|
||
}, e
|
||
}(U), as = {
|
||
OPACITY: "opacity",
|
||
VISIBLE: "visible",
|
||
EXTENT: "extent",
|
||
Z_INDEX: "zIndex",
|
||
MAX_RESOLUTION: "maxResolution",
|
||
MIN_RESOLUTION: "minResolution",
|
||
SOURCE: "source"
|
||
}, ls = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = p({}, e);
|
||
i[as.OPACITY] = void 0 !== e.opacity ? e.opacity : 1, i[as.VISIBLE] = void 0 === e.visible || e.visible, i[as.Z_INDEX] = e.zIndex, i[as.MAX_RESOLUTION] = void 0 !== e.maxResolution ? e.maxResolution : 1 / 0, i[as.MIN_RESOLUTION] = void 0 !== e.minResolution ? e.minResolution : 0, this.setProperties(i), this.state_ = null, this.type
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getType = function () {
|
||
return this.type
|
||
}, e.prototype.getLayerState = function () {
|
||
var t = this.state_ || {layer: this, managed: !0};
|
||
return t.opacity = te(this.getOpacity(), 0, 1), t.sourceState = this.getSourceState(), t.visible = this.getVisible(), t.extent = this.getExtent(), t.zIndex = this.getZIndex() || 0, t.maxResolution = this.getMaxResolution(), t.minResolution = Math.max(this.getMinResolution(), 0), this.state_ = t, t
|
||
}, e.prototype.getLayersArray = function (t) {
|
||
return n()
|
||
}, e.prototype.getLayerStatesArray = function (t) {
|
||
return n()
|
||
}, e.prototype.getExtent = function () {
|
||
return this.get(as.EXTENT)
|
||
}, e.prototype.getMaxResolution = function () {
|
||
return this.get(as.MAX_RESOLUTION)
|
||
}, e.prototype.getMinResolution = function () {
|
||
return this.get(as.MIN_RESOLUTION)
|
||
}, e.prototype.getOpacity = function () {
|
||
return this.get(as.OPACITY)
|
||
}, e.prototype.getSourceState = function () {
|
||
return n()
|
||
}, e.prototype.getVisible = function () {
|
||
return this.get(as.VISIBLE)
|
||
}, e.prototype.getZIndex = function () {
|
||
return this.get(as.Z_INDEX)
|
||
}, e.prototype.setExtent = function (t) {
|
||
this.set(as.EXTENT, t)
|
||
}, e.prototype.setMaxResolution = function (t) {
|
||
this.set(as.MAX_RESOLUTION, t)
|
||
}, e.prototype.setMinResolution = function (t) {
|
||
this.set(as.MIN_RESOLUTION, t)
|
||
}, e.prototype.setOpacity = function (t) {
|
||
this.set(as.OPACITY, t)
|
||
}, e.prototype.setVisible = function (t) {
|
||
this.set(as.VISIBLE, t)
|
||
}, e.prototype.setZIndex = function (t) {
|
||
this.set(as.Z_INDEX, t)
|
||
}, e
|
||
}(U), hs = {UNDEFINED: "undefined", LOADING: "loading", READY: "ready", ERROR: "error"},
|
||
us = {LAYERS: "layers"}, cs = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = p({}, i);
|
||
delete r.layers;
|
||
var o = i.layers;
|
||
t.call(this, r), this.layersListenerKeys_ = [], this.listenerKeys_ = {}, w(this, z(us.LAYERS), this.handleLayersChanged_, this), o ? Array.isArray(o) ? o = new Y(o.slice(), {unique: !0}) : W("function" == typeof o.getArray, 43) : o = new Y(void 0, {unique: !0}), this.setLayers(o)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleLayerChange_ = function () {
|
||
this.changed()
|
||
}, e.prototype.handleLayersChanged_ = function () {
|
||
this.layersListenerKeys_.forEach(S), this.layersListenerKeys_.length = 0;
|
||
var t = this.getLayers();
|
||
for (var e in this.layersListenerKeys_.push(w(t, u.ADD, this.handleLayersAdd_, this), w(t, u.REMOVE, this.handleLayersRemove_, this)), this.listenerKeys_) this.listenerKeys_[e].forEach(S);
|
||
d(this.listenerKeys_);
|
||
for (var i = t.getArray(), r = 0, o = i.length; r < o; r++) {
|
||
var n = i[r];
|
||
this.listenerKeys_[a(n)] = [w(n, c.PROPERTYCHANGE, this.handleLayerChange_, this), w(n, F.CHANGE, this.handleLayerChange_, this)]
|
||
}
|
||
this.changed()
|
||
}, e.prototype.handleLayersAdd_ = function (t) {
|
||
var e = t.element;
|
||
this.listenerKeys_[a(e)] = [w(e, c.PROPERTYCHANGE, this.handleLayerChange_, this), w(e, F.CHANGE, this.handleLayerChange_, this)], this.changed()
|
||
}, e.prototype.handleLayersRemove_ = function (t) {
|
||
var e = a(t.element);
|
||
this.listenerKeys_[e].forEach(S), delete this.listenerKeys_[e], this.changed()
|
||
}, e.prototype.getLayers = function () {
|
||
return this.get(us.LAYERS)
|
||
}, e.prototype.setLayers = function (t) {
|
||
this.set(us.LAYERS, t)
|
||
}, e.prototype.getLayersArray = function (t) {
|
||
var e = void 0 !== t ? t : [];
|
||
return this.getLayers().forEach(function (t) {
|
||
t.getLayersArray(e)
|
||
}), e
|
||
}, e.prototype.getLayerStatesArray = function (t) {
|
||
var e = void 0 !== t ? t : [], i = e.length;
|
||
this.getLayers().forEach(function (t) {
|
||
t.getLayerStatesArray(e)
|
||
});
|
||
for (var r = this.getLayerState(), o = i, n = e.length; o < n; o++) {
|
||
var s = e[o];
|
||
s.opacity *= r.opacity, s.visible = s.visible && r.visible, s.maxResolution = Math.min(s.maxResolution, r.maxResolution), s.minResolution = Math.max(s.minResolution, r.minResolution), void 0 !== r.extent && (void 0 !== s.extent ? s.extent = Dt(s.extent, r.extent) : s.extent = r.extent)
|
||
}
|
||
return e
|
||
}, e.prototype.getSourceState = function () {
|
||
return hs.READY
|
||
}, e
|
||
}(ls);
|
||
|
||
function ps(t, e, i) {
|
||
return void 0 === i && (i = [0, 0]), i[0] = t[0] + 2 * e, i[1] = t[1] + 2 * e, i
|
||
}
|
||
|
||
function ds(t) {
|
||
return t[0] > 0 && t[1] > 0
|
||
}
|
||
|
||
function fs(t, e, i) {
|
||
return void 0 === i && (i = [0, 0]), i[0] = t[0] * e + .5 | 0, i[1] = t[1] * e + .5 | 0, i
|
||
}
|
||
|
||
function gs(t, e) {
|
||
return Array.isArray(t) ? t : (void 0 === e ? e = [t, t] : e[0] = e[1] = t, e)
|
||
}
|
||
|
||
var ms = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = function (t) {
|
||
var e = null;
|
||
void 0 !== t.keyboardEventTarget && (e = "string" == typeof t.keyboardEventTarget ? document.getElementById(t.keyboardEventTarget) : t.keyboardEventTarget);
|
||
var i, r, o, n = {},
|
||
s = t.layers && "function" == typeof t.layers.getLayers ? t.layers : new cs({layers: t.layers});
|
||
n[Gn.LAYERGROUP] = s, n[Gn.TARGET] = t.target, n[Gn.VIEW] = void 0 !== t.view ? t.view : new ss, void 0 !== t.controls && (Array.isArray(t.controls) ? i = new Y(t.controls.slice()) : (W("function" == typeof t.controls.getArray, 47), i = t.controls));
|
||
void 0 !== t.interactions && (Array.isArray(t.interactions) ? r = new Y(t.interactions.slice()) : (W("function" == typeof t.interactions.getArray, 48), r = t.interactions));
|
||
void 0 !== t.overlays ? Array.isArray(t.overlays) ? o = new Y(t.overlays.slice()) : (W("function" == typeof t.overlays.getArray, 49), o = t.overlays) : o = new Y;
|
||
return {controls: i, interactions: r, keyboardEventTarget: e, overlays: o, values: n}
|
||
}(e);
|
||
this.maxTilesLoading_ = void 0 !== e.maxTilesLoading ? e.maxTilesLoading : 16, this.loadTilesWhileAnimating_ = void 0 !== e.loadTilesWhileAnimating && e.loadTilesWhileAnimating, this.loadTilesWhileInteracting_ = void 0 !== e.loadTilesWhileInteracting && e.loadTilesWhileInteracting, this.pixelRatio_ = void 0 !== e.pixelRatio ? e.pixelRatio : Sr, this.animationDelayKey_, this.animationDelay_ = function () {
|
||
this.animationDelayKey_ = void 0, this.renderFrame_.call(this, Date.now())
|
||
}.bind(this), this.coordinateToPixelTransform_ = [1, 0, 0, 1, 0, 0], this.pixelToCoordinateTransform_ = [1, 0, 0, 1, 0, 0], this.frameIndex_ = 0, this.frameState_ = null, this.previousExtent_ = null, this.viewPropertyListenerKey_ = null, this.viewChangeListenerKey_ = null, this.layerGroupPropertyListenerKeys_ = null, this.viewport_ = document.createElement("div"), this.viewport_.className = "ol-viewport" + (Rr ? " ol-touch" : ""), this.viewport_.style.position = "relative", this.viewport_.style.overflow = "hidden", this.viewport_.style.width = "100%", this.viewport_.style.height = "100%", this.viewport_.style.msTouchAction = "none", this.viewport_.style.touchAction = "none", this.overlayContainer_ = document.createElement("div"), this.overlayContainer_.className = "ol-overlaycontainer", this.viewport_.appendChild(this.overlayContainer_), this.overlayContainerStopEvent_ = document.createElement("div"), this.overlayContainerStopEvent_.className = "ol-overlaycontainer-stopevent";
|
||
for (var r = [F.CLICK, F.DBLCLICK, F.MOUSEDOWN, F.TOUCHSTART, F.MSPOINTERDOWN, Ho.POINTERDOWN, F.MOUSEWHEEL, F.WHEEL], o = 0, n = r.length; o < n; ++o) w(this.overlayContainerStopEvent_, r[o], M);
|
||
for (var s in this.viewport_.appendChild(this.overlayContainerStopEvent_), this.mapBrowserEventHandler_ = new Nn(this, e.moveTolerance), Ho) w(this.mapBrowserEventHandler_, Ho[s], this.handleMapBrowserEvent, this);
|
||
this.keyboardEventTarget_ = i.keyboardEventTarget, this.keyHandlerKeys_ = null, w(this.viewport_, F.CONTEXTMENU, this.handleBrowserEvent, this), w(this.viewport_, F.WHEEL, this.handleBrowserEvent, this), w(this.viewport_, F.MOUSEWHEEL, this.handleBrowserEvent, this), this.controls = i.controls || new Y, this.interactions = i.interactions || new Y, this.overlays_ = i.overlays, this.overlayIdIndex_ = {}, this.renderer_ = this.createRenderer(), this.handleResize_, this.focus_ = null, this.postRenderFunctions_ = [], this.tileQueue_ = new Un(this.getTilePriority.bind(this), this.handleTileChange_.bind(this)), this.skippedFeatureUids_ = {}, w(this, z(Gn.LAYERGROUP), this.handleLayerGroupChanged_, this), w(this, z(Gn.VIEW), this.handleViewChanged_, this), w(this, z(Gn.SIZE), this.handleSizeChanged_, this), w(this, z(Gn.TARGET), this.handleTargetChanged_, this), this.setProperties(i.values), this.controls.forEach(function (t) {
|
||
t.setMap(this)
|
||
}.bind(this)), w(this.controls, u.ADD, function (t) {
|
||
t.element.setMap(this)
|
||
}, this), w(this.controls, u.REMOVE, function (t) {
|
||
t.element.setMap(null)
|
||
}, this), this.interactions.forEach(function (t) {
|
||
t.setMap(this)
|
||
}.bind(this)), w(this.interactions, u.ADD, function (t) {
|
||
t.element.setMap(this)
|
||
}, this), w(this.interactions, u.REMOVE, function (t) {
|
||
t.element.setMap(null)
|
||
}, this), this.overlays_.forEach(this.addOverlayInternal_.bind(this)), w(this.overlays_, u.ADD, function (t) {
|
||
this.addOverlayInternal_(t.element)
|
||
}, this), w(this.overlays_, u.REMOVE, function (t) {
|
||
var e = t.element.getId();
|
||
void 0 !== e && delete this.overlayIdIndex_[e.toString()], t.element.setMap(null)
|
||
}, this)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.createRenderer = function () {
|
||
throw new Error("Use a map type that has a createRenderer method")
|
||
}, e.prototype.addControl = function (t) {
|
||
this.getControls().push(t)
|
||
}, e.prototype.addInteraction = function (t) {
|
||
this.getInteractions().push(t)
|
||
}, e.prototype.addLayer = function (t) {
|
||
this.getLayerGroup().getLayers().push(t)
|
||
}, e.prototype.addOverlay = function (t) {
|
||
this.getOverlays().push(t)
|
||
}, e.prototype.addOverlayInternal_ = function (t) {
|
||
var e = t.getId();
|
||
void 0 !== e && (this.overlayIdIndex_[e.toString()] = t), t.setMap(this)
|
||
}, e.prototype.disposeInternal = function () {
|
||
this.mapBrowserEventHandler_.dispose(), C(this.viewport_, F.CONTEXTMENU, this.handleBrowserEvent, this), C(this.viewport_, F.WHEEL, this.handleBrowserEvent, this), C(this.viewport_, F.MOUSEWHEEL, this.handleBrowserEvent, this), void 0 !== this.handleResize_ && (removeEventListener(F.RESIZE, this.handleResize_, !1), this.handleResize_ = void 0), this.animationDelayKey_ && (cancelAnimationFrame(this.animationDelayKey_), this.animationDelayKey_ = void 0), this.setTarget(null), t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.forEachFeatureAtPixel = function (t, e, i) {
|
||
if (this.frameState_) {
|
||
var r = this.getCoordinateFromPixel(t),
|
||
o = void 0 !== (i = void 0 !== i ? i : {}).hitTolerance ? i.hitTolerance * this.frameState_.pixelRatio : 0,
|
||
n = void 0 !== i.layerFilter ? i.layerFilter : P;
|
||
return this.renderer_.forEachFeatureAtCoordinate(r, this.frameState_, o, e, null, n, null)
|
||
}
|
||
}, e.prototype.getFeaturesAtPixel = function (t, e) {
|
||
var i = null;
|
||
return this.forEachFeatureAtPixel(t, function (t) {
|
||
i || (i = []), i.push(t)
|
||
}, e), i
|
||
}, e.prototype.forEachLayerAtPixel = function (t, e, i) {
|
||
if (this.frameState_) {
|
||
var r = i || {}, o = void 0 !== r.hitTolerance ? i.hitTolerance * this.frameState_.pixelRatio : 0,
|
||
n = r.layerFilter || P;
|
||
return this.renderer_.forEachLayerAtPixel(t, this.frameState_, o, e, null, n, null)
|
||
}
|
||
}, e.prototype.hasFeatureAtPixel = function (t, e) {
|
||
if (!this.frameState_) return !1;
|
||
var i = this.getCoordinateFromPixel(t),
|
||
r = void 0 !== (e = void 0 !== e ? e : {}).layerFilter ? e.layerFilter : P,
|
||
o = void 0 !== e.hitTolerance ? e.hitTolerance * this.frameState_.pixelRatio : 0;
|
||
return this.renderer_.hasFeatureAtCoordinate(i, this.frameState_, o, r, null)
|
||
}, e.prototype.getEventCoordinate = function (t) {
|
||
return this.getCoordinateFromPixel(this.getEventPixel(t))
|
||
}, e.prototype.getEventPixel = function (t) {
|
||
var e = this.viewport_.getBoundingClientRect(), i = "changedTouches" in t ? t.changedTouches[0] : t;
|
||
return [i.clientX - e.left, i.clientY - e.top]
|
||
}, e.prototype.getTarget = function () {
|
||
return this.get(Gn.TARGET)
|
||
}, e.prototype.getTargetElement = function () {
|
||
var t = this.getTarget();
|
||
return void 0 !== t ? "string" == typeof t ? document.getElementById(t) : t : null
|
||
}, e.prototype.getCoordinateFromPixel = function (t) {
|
||
var e = this.frameState_;
|
||
return e ? ci(e.pixelToCoordinateTransform, t.slice()) : null
|
||
}, e.prototype.getControls = function () {
|
||
return this.controls
|
||
}, e.prototype.getOverlays = function () {
|
||
return this.overlays_
|
||
}, e.prototype.getOverlayById = function (t) {
|
||
var e = this.overlayIdIndex_[t.toString()];
|
||
return void 0 !== e ? e : null
|
||
}, e.prototype.getInteractions = function () {
|
||
return this.interactions
|
||
}, e.prototype.getLayerGroup = function () {
|
||
return this.get(Gn.LAYERGROUP)
|
||
}, e.prototype.getLayers = function () {
|
||
return this.getLayerGroup().getLayers()
|
||
}, e.prototype.getPixelFromCoordinate = function (t) {
|
||
var e = this.frameState_;
|
||
return e ? ci(e.coordinateToPixelTransform, t.slice(0, 2)) : null
|
||
}, e.prototype.getRenderer = function () {
|
||
return this.renderer_
|
||
}, e.prototype.getSize = function () {
|
||
return this.get(Gn.SIZE)
|
||
}, e.prototype.getView = function () {
|
||
return this.get(Gn.VIEW)
|
||
}, e.prototype.getViewport = function () {
|
||
return this.viewport_
|
||
}, e.prototype.getOverlayContainer = function () {
|
||
return this.overlayContainer_
|
||
}, e.prototype.getOverlayContainerStopEvent = function () {
|
||
return this.overlayContainerStopEvent_
|
||
}, e.prototype.getTilePriority = function (t, e, i, r) {
|
||
var o = this.frameState_;
|
||
if (!(o && e in o.wantedTiles)) return 1 / 0;
|
||
if (!o.wantedTiles[e][t.getKey()]) return 1 / 0;
|
||
var n = i[0] - o.focus[0], s = i[1] - o.focus[1];
|
||
return 65536 * Math.log(r) + Math.sqrt(n * n + s * s) / r
|
||
}, e.prototype.handleBrowserEvent = function (t, e) {
|
||
var i = e || t.type, r = new Wo(i, this, t);
|
||
this.handleMapBrowserEvent(r)
|
||
}, e.prototype.handleMapBrowserEvent = function (t) {
|
||
if (this.frameState_) {
|
||
this.focus_ = t.coordinate, t.frameState = this.frameState_;
|
||
var e = this.getInteractions().getArray();
|
||
if (!1 !== this.dispatchEvent(t)) for (var i = e.length - 1; i >= 0; i--) {
|
||
var r = e[i];
|
||
if (r.getActive()) if (!r.handleEvent(t)) break
|
||
}
|
||
}
|
||
}, e.prototype.handlePostRender = function () {
|
||
var t = this.frameState_, e = this.tileQueue_;
|
||
if (!e.isEmpty()) {
|
||
var i = this.maxTilesLoading_, r = i;
|
||
if (t) {
|
||
var o = t.viewHints;
|
||
o[$n.ANIMATING] && (i = this.loadTilesWhileAnimating_ ? 8 : 0, r = 2), o[$n.INTERACTING] && (i = this.loadTilesWhileInteracting_ ? 8 : 0, r = 2)
|
||
}
|
||
e.getTilesLoading() < i && (e.reprioritize(), e.loadMoreTiles(i, r))
|
||
}
|
||
!t || !this.hasListener(eo.RENDERCOMPLETE) || t.animate || this.tileQueue_.getTilesLoading() || function t(e) {
|
||
for (var i = 0, r = e.length; i < r; ++i) {
|
||
var o = e[i];
|
||
if ("function" == typeof o.getLayers) return t(o.getLayers().getArray());
|
||
var n = o.getSource();
|
||
if (n && n.loading) return !0
|
||
}
|
||
return !1
|
||
}(this.getLayers().getArray()) || this.renderer_.dispatchRenderEvent(eo.RENDERCOMPLETE, t);
|
||
for (var n = this.postRenderFunctions_, s = 0, a = n.length; s < a; ++s) n[s](this, t);
|
||
n.length = 0
|
||
}, e.prototype.handleSizeChanged_ = function () {
|
||
this.render()
|
||
}, e.prototype.handleTargetChanged_ = function () {
|
||
var t;
|
||
if (this.getTarget() && (t = this.getTargetElement()), this.keyHandlerKeys_) {
|
||
for (var e = 0, i = this.keyHandlerKeys_.length; e < i; ++e) S(this.keyHandlerKeys_[e]);
|
||
this.keyHandlerKeys_ = null
|
||
}
|
||
if (t) {
|
||
t.appendChild(this.viewport_);
|
||
var r = this.keyboardEventTarget_ ? this.keyboardEventTarget_ : t;
|
||
this.keyHandlerKeys_ = [w(r, F.KEYDOWN, this.handleBrowserEvent, this), w(r, F.KEYPRESS, this.handleBrowserEvent, this)], this.handleResize_ || (this.handleResize_ = this.updateSize.bind(this), addEventListener(F.RESIZE, this.handleResize_, !1))
|
||
} else this.renderer_.removeLayerRenderers(), Do(this.viewport_), void 0 !== this.handleResize_ && (removeEventListener(F.RESIZE, this.handleResize_, !1), this.handleResize_ = void 0);
|
||
this.updateSize()
|
||
}, e.prototype.handleTileChange_ = function () {
|
||
this.render()
|
||
}, e.prototype.handleViewPropertyChanged_ = function () {
|
||
this.render()
|
||
}, e.prototype.handleViewChanged_ = function () {
|
||
this.viewPropertyListenerKey_ && (S(this.viewPropertyListenerKey_), this.viewPropertyListenerKey_ = null), this.viewChangeListenerKey_ && (S(this.viewChangeListenerKey_), this.viewChangeListenerKey_ = null);
|
||
var t = this.getView();
|
||
t && (this.viewport_.setAttribute("data-view", a(t)), this.viewPropertyListenerKey_ = w(t, c.PROPERTYCHANGE, this.handleViewPropertyChanged_, this), this.viewChangeListenerKey_ = w(t, F.CHANGE, this.handleViewPropertyChanged_, this)), this.render()
|
||
}, e.prototype.handleLayerGroupChanged_ = function () {
|
||
this.layerGroupPropertyListenerKeys_ && (this.layerGroupPropertyListenerKeys_.forEach(S), this.layerGroupPropertyListenerKeys_ = null);
|
||
var t = this.getLayerGroup();
|
||
t && (this.layerGroupPropertyListenerKeys_ = [w(t, c.PROPERTYCHANGE, this.render, this), w(t, F.CHANGE, this.render, this)]), this.render()
|
||
}, e.prototype.isRendered = function () {
|
||
return !!this.frameState_
|
||
}, e.prototype.renderSync = function () {
|
||
this.animationDelayKey_ && cancelAnimationFrame(this.animationDelayKey_), this.animationDelay_()
|
||
}, e.prototype.render = function () {
|
||
void 0 === this.animationDelayKey_ && (this.animationDelayKey_ = requestAnimationFrame(this.animationDelay_))
|
||
}, e.prototype.removeControl = function (t) {
|
||
return this.getControls().remove(t)
|
||
}, e.prototype.removeInteraction = function (t) {
|
||
return this.getInteractions().remove(t)
|
||
}, e.prototype.removeLayer = function (t) {
|
||
return this.getLayerGroup().getLayers().remove(t)
|
||
}, e.prototype.removeOverlay = function (t) {
|
||
return this.getOverlays().remove(t)
|
||
}, e.prototype.renderFrame_ = function (t) {
|
||
var e, i = this.getSize(), r = this.getView(), o = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = this.frameState_,
|
||
s = null;
|
||
if (void 0 !== i && ds(i) && r && r.isDef()) {
|
||
for (var l = r.getHints(this.frameState_ ? this.frameState_.viewHints : void 0), h = this.getLayerGroup().getLayerStatesArray(), u = {}, c = 0, p = h.length; c < p; ++c) u[a(h[c].layer)] = h[c];
|
||
e = r.getState(this.pixelRatio_), s = {
|
||
animate: !1,
|
||
coordinateToPixelTransform: this.coordinateToPixelTransform_,
|
||
extent: o,
|
||
focus: this.focus_ ? this.focus_ : e.center,
|
||
index: this.frameIndex_++,
|
||
layerStates: u,
|
||
layerStatesArray: h,
|
||
pixelRatio: this.pixelRatio_,
|
||
pixelToCoordinateTransform: this.pixelToCoordinateTransform_,
|
||
postRenderFunctions: [],
|
||
size: i,
|
||
skippedFeatureUids: this.skippedFeatureUids_,
|
||
tileQueue: this.tileQueue_,
|
||
time: t,
|
||
usedTiles: {},
|
||
viewState: e,
|
||
viewHints: l,
|
||
wantedTiles: {}
|
||
}
|
||
}
|
||
if (s && (s.extent = Ft(e.center, e.resolution, e.rotation, s.size, o)), this.frameState_ = s, this.renderer_.renderFrame(s), s) {
|
||
if (s.animate && this.render(), Array.prototype.push.apply(this.postRenderFunctions_, s.postRenderFunctions), n) (!this.previousExtent_ || !Vt(this.previousExtent_) && !bt(s.extent, this.previousExtent_)) && (this.dispatchEvent(new Yo(Dn.MOVESTART, this, n)), this.previousExtent_ = vt(this.previousExtent_));
|
||
this.previousExtent_ && !s.viewHints[$n.ANIMATING] && !s.viewHints[$n.INTERACTING] && !bt(s.extent, this.previousExtent_) && (this.dispatchEvent(new Yo(Dn.MOVEEND, this, s)), ut(s.extent, this.previousExtent_))
|
||
}
|
||
this.dispatchEvent(new Yo(Dn.POSTRENDER, this, s)), setTimeout(this.handlePostRender.bind(this), 0)
|
||
}, e.prototype.setLayerGroup = function (t) {
|
||
this.set(Gn.LAYERGROUP, t)
|
||
}, e.prototype.setSize = function (t) {
|
||
this.set(Gn.SIZE, t)
|
||
}, e.prototype.setTarget = function (t) {
|
||
this.set(Gn.TARGET, t)
|
||
}, e.prototype.setView = function (t) {
|
||
this.set(Gn.VIEW, t)
|
||
}, e.prototype.skipFeature = function (t) {
|
||
this.skippedFeatureUids_[a(t)] = !0, this.render()
|
||
}, e.prototype.updateSize = function () {
|
||
var t = this.getTargetElement();
|
||
if (t) {
|
||
var e = getComputedStyle(t);
|
||
this.setSize([t.offsetWidth - parseFloat(e.borderLeftWidth) - parseFloat(e.paddingLeft) - parseFloat(e.paddingRight) - parseFloat(e.borderRightWidth), t.offsetHeight - parseFloat(e.borderTopWidth) - parseFloat(e.paddingTop) - parseFloat(e.paddingBottom) - parseFloat(e.borderBottomWidth)])
|
||
} else this.setSize(void 0)
|
||
}, e.prototype.unskipFeature = function (t) {
|
||
delete this.skippedFeatureUids_[a(t)], this.render()
|
||
}, e
|
||
}(U);
|
||
var ys = function (t) {
|
||
function e(e) {
|
||
t.call(this), this.element = e.element ? e.element : null, this.target_ = null, this.map_ = null, this.listenerKeys = [], this.render = e.render ? e.render : I, e.target && this.setTarget(e.target)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.disposeInternal = function () {
|
||
Do(this.element), t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.getMap = function () {
|
||
return this.map_
|
||
}, e.prototype.setMap = function (t) {
|
||
this.map_ && Do(this.element);
|
||
for (var e = 0, i = this.listenerKeys.length; e < i; ++e) S(this.listenerKeys[e]);
|
||
(this.listenerKeys.length = 0, this.map_ = t, this.map_) && ((this.target_ ? this.target_ : t.getOverlayContainerStopEvent()).appendChild(this.element), this.render !== I && this.listenerKeys.push(w(t, Dn.POSTRENDER, this.render, this)), t.render())
|
||
}, e.prototype.setTarget = function (t) {
|
||
this.target_ = "string" == typeof t ? document.getElementById(t) : t
|
||
}, e
|
||
}(U), vs = "ol-hidden", _s = "ol-selectable", xs = "ol-unselectable", ws = "ol-unsupported", bs = "ol-control",
|
||
Cs = "ol-collapsed", Ss = function () {
|
||
var t, e = {};
|
||
return function (i) {
|
||
if (t || (t = document.createElement("div").style), !(i in e)) {
|
||
t.font = i;
|
||
var r = t.fontFamily;
|
||
if (t.font = "", !r) return null;
|
||
e[i] = r.split(/,\s?/)
|
||
}
|
||
return e[i]
|
||
}
|
||
}();
|
||
|
||
function Es(t, e) {
|
||
return t.visible && e >= t.minResolution && e < t.maxResolution
|
||
}
|
||
|
||
var Ts = function (t) {
|
||
function e(e) {
|
||
var i = p({}, e);
|
||
delete i.source, t.call(this, i), this.mapPrecomposeKey_ = null, this.mapRenderKey_ = null, this.sourceChangeKey_ = null, e.map && this.setMap(e.map), w(this, z(as.SOURCE), this.handleSourcePropertyChange_, this);
|
||
var r = e.source ? e.source : null;
|
||
this.setSource(r)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getLayersArray = function (t) {
|
||
var e = t || [];
|
||
return e.push(this), e
|
||
}, e.prototype.getLayerStatesArray = function (t) {
|
||
var e = t || [];
|
||
return e.push(this.getLayerState()), e
|
||
}, e.prototype.getSource = function () {
|
||
return this.get(as.SOURCE) || null
|
||
}, e.prototype.getSourceState = function () {
|
||
var t = this.getSource();
|
||
return t ? t.getState() : hs.UNDEFINED
|
||
}, e.prototype.handleSourceChange_ = function () {
|
||
this.changed()
|
||
}, e.prototype.handleSourcePropertyChange_ = function () {
|
||
this.sourceChangeKey_ && (S(this.sourceChangeKey_), this.sourceChangeKey_ = null);
|
||
var t = this.getSource();
|
||
t && (this.sourceChangeKey_ = w(t, F.CHANGE, this.handleSourceChange_, this)), this.changed()
|
||
}, e.prototype.setMap = function (t) {
|
||
this.mapPrecomposeKey_ && (S(this.mapPrecomposeKey_), this.mapPrecomposeKey_ = null), t || this.changed(), this.mapRenderKey_ && (S(this.mapRenderKey_), this.mapRenderKey_ = null), t && (this.mapPrecomposeKey_ = w(t, eo.PRECOMPOSE, function (t) {
|
||
var e = t, i = this.getLayerState();
|
||
i.managed = !1, void 0 === this.getZIndex() && (i.zIndex = 1 / 0), e.frameState.layerStatesArray.push(i), e.frameState.layerStates[a(this)] = i
|
||
}, this), this.mapRenderKey_ = w(this, F.CHANGE, t.render, t), this.changed())
|
||
}, e.prototype.setSource = function (t) {
|
||
this.set(as.SOURCE, t)
|
||
}, e
|
||
}(ls);
|
||
|
||
function Rs(t) {
|
||
this.updateElement_(t.frameState)
|
||
}
|
||
|
||
var Ps = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {
|
||
element: document.createElement("div"),
|
||
render: i.render || Rs,
|
||
target: i.target
|
||
}), this.ulElement_ = document.createElement("ul"), this.collapsed_ = void 0 === i.collapsed || i.collapsed, this.overrideCollapsible_ = void 0 !== i.collapsible, this.collapsible_ = void 0 === i.collapsible || i.collapsible, this.collapsible_ || (this.collapsed_ = !1);
|
||
var r = void 0 !== i.className ? i.className : "ol-attribution",
|
||
o = void 0 !== i.tipLabel ? i.tipLabel : "Attributions",
|
||
n = void 0 !== i.collapseLabel ? i.collapseLabel : "»";
|
||
"string" == typeof n ? (this.collapseLabel_ = document.createElement("span"), this.collapseLabel_.textContent = n) : this.collapseLabel_ = n;
|
||
var s = void 0 !== i.label ? i.label : "i";
|
||
"string" == typeof s ? (this.label_ = document.createElement("span"), this.label_.textContent = s) : this.label_ = s;
|
||
var a = this.collapsible_ && !this.collapsed_ ? this.collapseLabel_ : this.label_,
|
||
l = document.createElement("button");
|
||
l.setAttribute("type", "button"), l.title = o, l.appendChild(a), w(l, F.CLICK, this.handleClick_, this);
|
||
var h = r + " " + xs + " " + bs + (this.collapsed_ && this.collapsible_ ? " " + Cs : "") + (this.collapsible_ ? "" : " ol-uncollapsible"),
|
||
u = this.element;
|
||
u.className = h, u.appendChild(this.ulElement_), u.appendChild(l), this.renderedAttributions_ = [], this.renderedVisible_ = !0
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.collectSourceAttributions_ = function (t) {
|
||
for (var e = {}, i = [], r = t.layerStatesArray, o = t.viewState.resolution, n = 0, s = r.length; n < s; ++n) {
|
||
var a = r[n];
|
||
if (Es(a, o)) {
|
||
var l = a.layer.getSource();
|
||
if (l) {
|
||
var h = l.getAttributions();
|
||
if (h) {
|
||
var u = h(t);
|
||
if (u) if (this.overrideCollapsible_ || !1 !== l.getAttributionsCollapsible() || this.setCollapsible(!1), Array.isArray(u)) for (var c = 0, p = u.length; c < p; ++c) u[c] in e || (i.push(u[c]), e[u[c]] = !0); else u in e || (i.push(u), e[u] = !0)
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return i
|
||
}, e.prototype.updateElement_ = function (t) {
|
||
if (t) {
|
||
var e = this.collectSourceAttributions_(t), i = e.length > 0;
|
||
if (this.renderedVisible_ != i && (this.element.style.display = i ? "" : "none", this.renderedVisible_ = i), !it(e, this.renderedAttributions_)) {
|
||
Go(this.ulElement_);
|
||
for (var r = 0, o = e.length; r < o; ++r) {
|
||
var n = document.createElement("li");
|
||
n.innerHTML = e[r], this.ulElement_.appendChild(n)
|
||
}
|
||
this.renderedAttributions_ = e
|
||
}
|
||
} else this.renderedVisible_ && (this.element.style.display = "none", this.renderedVisible_ = !1)
|
||
}, e.prototype.handleClick_ = function (t) {
|
||
t.preventDefault(), this.handleToggle_()
|
||
}, e.prototype.handleToggle_ = function () {
|
||
this.element.classList.toggle(Cs), this.collapsed_ ? No(this.collapseLabel_, this.label_) : No(this.label_, this.collapseLabel_), this.collapsed_ = !this.collapsed_
|
||
}, e.prototype.getCollapsible = function () {
|
||
return this.collapsible_
|
||
}, e.prototype.setCollapsible = function (t) {
|
||
this.collapsible_ !== t && (this.collapsible_ = t, this.element.classList.toggle("ol-uncollapsible"), !t && this.collapsed_ && this.handleToggle_())
|
||
}, e.prototype.setCollapsed = function (t) {
|
||
this.collapsible_ && this.collapsed_ !== t && this.handleToggle_()
|
||
}, e.prototype.getCollapsed = function () {
|
||
return this.collapsed_
|
||
}, e
|
||
}(ys);
|
||
|
||
function Ls(t) {
|
||
var e = t.frameState;
|
||
if (e) {
|
||
var i = e.viewState.rotation;
|
||
if (i != this.rotation_) {
|
||
var r = "rotate(" + i + "rad)";
|
||
if (this.autoHide_) {
|
||
var o = this.element.classList.contains(vs);
|
||
o || 0 !== i ? o && 0 !== i && this.element.classList.remove(vs) : this.element.classList.add(vs)
|
||
}
|
||
this.label_.style.msTransform = r, this.label_.style.webkitTransform = r, this.label_.style.transform = r
|
||
}
|
||
this.rotation_ = i
|
||
}
|
||
}
|
||
|
||
var Is = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {element: document.createElement("div"), render: i.render || Ls, target: i.target});
|
||
var r = void 0 !== i.className ? i.className : "ol-rotate", o = void 0 !== i.label ? i.label : "⇧";
|
||
this.label_ = null, "string" == typeof o ? (this.label_ = document.createElement("span"), this.label_.className = "ol-compass", this.label_.textContent = o) : (this.label_ = o, this.label_.classList.add("ol-compass"));
|
||
var n = i.tipLabel ? i.tipLabel : "Reset rotation", s = document.createElement("button");
|
||
s.className = r + "-reset", s.setAttribute("type", "button"), s.title = n, s.appendChild(this.label_), w(s, F.CLICK, this.handleClick_, this);
|
||
var a = r + " " + xs + " " + bs, l = this.element;
|
||
l.className = a, l.appendChild(s), this.callResetNorth_ = i.resetNorth ? i.resetNorth : void 0, this.duration_ = void 0 !== i.duration ? i.duration : 250, this.autoHide_ = void 0 === i.autoHide || i.autoHide, this.rotation_ = void 0, this.autoHide_ && this.element.classList.add(vs)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleClick_ = function (t) {
|
||
t.preventDefault(), void 0 !== this.callResetNorth_ ? this.callResetNorth_() : this.resetNorth_()
|
||
}, e.prototype.resetNorth_ = function () {
|
||
var t = this.getMap().getView();
|
||
t && void 0 !== t.getRotation() && (this.duration_ > 0 ? t.animate({
|
||
rotation: 0,
|
||
duration: this.duration_,
|
||
easing: Lo
|
||
}) : t.setRotation(0))
|
||
}, e
|
||
}(ys), Os = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {element: document.createElement("div"), target: i.target});
|
||
var r = void 0 !== i.className ? i.className : "ol-zoom", o = void 0 !== i.delta ? i.delta : 1,
|
||
n = void 0 !== i.zoomInLabel ? i.zoomInLabel : "+",
|
||
s = void 0 !== i.zoomOutLabel ? i.zoomOutLabel : "−",
|
||
a = void 0 !== i.zoomInTipLabel ? i.zoomInTipLabel : "Zoom in",
|
||
l = void 0 !== i.zoomOutTipLabel ? i.zoomOutTipLabel : "Zoom out",
|
||
h = document.createElement("button");
|
||
h.className = r + "-in", h.setAttribute("type", "button"), h.title = a, h.appendChild("string" == typeof n ? document.createTextNode(n) : n), w(h, F.CLICK, this.handleClick_.bind(this, o));
|
||
var u = document.createElement("button");
|
||
u.className = r + "-out", u.setAttribute("type", "button"), u.title = l, u.appendChild("string" == typeof s ? document.createTextNode(s) : s), w(u, F.CLICK, this.handleClick_.bind(this, -o));
|
||
var c = r + " " + xs + " " + bs, p = this.element;
|
||
p.className = c, p.appendChild(h), p.appendChild(u), this.duration_ = void 0 !== i.duration ? i.duration : 250
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleClick_ = function (t, e) {
|
||
e.preventDefault(), this.zoomByDelta_(t)
|
||
}, e.prototype.zoomByDelta_ = function (t) {
|
||
var e = this.getMap().getView();
|
||
if (e) {
|
||
var i = e.getResolution();
|
||
if (i) {
|
||
var r = e.constrainResolution(i, t);
|
||
this.duration_ > 0 ? (e.getAnimating() && e.cancelAnimations(), e.animate({
|
||
resolution: r,
|
||
duration: this.duration_,
|
||
easing: Lo
|
||
})) : e.setResolution(r)
|
||
}
|
||
}
|
||
}, e
|
||
}(ys);
|
||
|
||
function Ms(t) {
|
||
var e = t || {}, i = new Y;
|
||
return (void 0 === e.zoom || e.zoom) && i.push(new Os(e.zoomOptions)), (void 0 === e.rotate || e.rotate) && i.push(new Is(e.rotateOptions)), (void 0 === e.attribution || e.attribution) && i.push(new Ps(e.attributionOptions)), i
|
||
}
|
||
|
||
var As = {ACTIVE: "active"};
|
||
|
||
function ks(t, e, i) {
|
||
var r = t.getCenter();
|
||
if (r) {
|
||
var o = t.constrainCenter([r[0] + e[0], r[1] + e[1]]);
|
||
i ? t.animate({duration: i, easing: Oo, center: o}) : t.setCenter(o)
|
||
}
|
||
}
|
||
|
||
function Fs(t, e, i, r) {
|
||
e = t.constrainRotation(e, 0), Ns(t, e, i, r)
|
||
}
|
||
|
||
function Ns(t, e, i, r) {
|
||
if (void 0 !== e) {
|
||
var o = t.getRotation(), n = t.getCenter();
|
||
void 0 !== o && n && r > 0 ? t.animate({
|
||
rotation: e,
|
||
anchor: i,
|
||
duration: r,
|
||
easing: Lo
|
||
}) : t.rotate(e, i)
|
||
}
|
||
}
|
||
|
||
function Ds(t, e, i, r, o) {
|
||
e = t.constrainResolution(e, 0, o), js(t, e, i, r)
|
||
}
|
||
|
||
function Gs(t, e, i, r) {
|
||
var o = t.getResolution(), n = t.constrainResolution(o, e, 0);
|
||
if (void 0 !== n) {
|
||
var s = t.getResolutions();
|
||
n = te(n, t.getMinResolution() || s[s.length - 1], t.getMaxResolution() || s[0])
|
||
}
|
||
if (i && void 0 !== n && n !== o) {
|
||
var a = t.getCenter(), l = t.calculateCenterZoom(n, i);
|
||
l = t.constrainCenter(l), i = [(n * a[0] - o * l[0]) / (n - o), (n * a[1] - o * l[1]) / (n - o)]
|
||
}
|
||
js(t, n, i, r)
|
||
}
|
||
|
||
function js(t, e, i, r) {
|
||
if (e) {
|
||
var o = t.getResolution(), n = t.getCenter();
|
||
if (void 0 !== o && n && e !== o && r) t.animate({
|
||
resolution: e,
|
||
anchor: i,
|
||
duration: r,
|
||
easing: Lo
|
||
}); else {
|
||
if (i) {
|
||
var s = t.calculateCenterZoom(e, i);
|
||
t.setCenter(s)
|
||
}
|
||
t.setResolution(e)
|
||
}
|
||
}
|
||
}
|
||
|
||
var zs = function (t) {
|
||
function e(e) {
|
||
t.call(this), e.handleEvent && (this.handleEvent = e.handleEvent), this.map_ = null, this.setActive(!0)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getActive = function () {
|
||
return this.get(As.ACTIVE)
|
||
}, e.prototype.getMap = function () {
|
||
return this.map_
|
||
}, e.prototype.handleEvent = function (t) {
|
||
return !0
|
||
}, e.prototype.setActive = function (t) {
|
||
this.set(As.ACTIVE, t)
|
||
}, e.prototype.setMap = function (t) {
|
||
this.map_ = t
|
||
}, e
|
||
}(U);
|
||
|
||
function Us(t) {
|
||
var e = !1;
|
||
if (t.type == Ho.DBLCLICK) {
|
||
var i = t.originalEvent, r = t.map, o = t.coordinate, n = i.shiftKey ? -this.delta_ : this.delta_;
|
||
Gs(r.getView(), n, o, this.duration_), t.preventDefault(), e = !0
|
||
}
|
||
return !e
|
||
}
|
||
|
||
var Bs = function (t) {
|
||
function e(e) {
|
||
t.call(this, {handleEvent: Us});
|
||
var i = e || {};
|
||
this.delta_ = i.delta ? i.delta : 1, this.duration_ = void 0 !== i.duration ? i.duration : 250
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(zs), Vs = function (t) {
|
||
var e = t.originalEvent;
|
||
return e.altKey && !(e.metaKey || e.ctrlKey) && !e.shiftKey
|
||
}, Ys = function (t) {
|
||
var e = t.originalEvent;
|
||
return e.altKey && !(e.metaKey || e.ctrlKey) && e.shiftKey
|
||
}, Ws = function (t) {
|
||
return t.target.getTargetElement() === document.activeElement
|
||
}, Hs = P, Xs = function (t) {
|
||
var e = t.originalEvent;
|
||
return 0 == e.button && !(br && Cr && e.ctrlKey)
|
||
}, qs = L, Zs = function (t) {
|
||
return "pointermove" == t.type
|
||
}, Ks = function (t) {
|
||
return t.type == Ho.SINGLECLICK
|
||
}, Js = function (t) {
|
||
var e = t.originalEvent;
|
||
return !e.altKey && !(e.metaKey || e.ctrlKey) && !e.shiftKey
|
||
}, $s = function (t) {
|
||
var e = t.originalEvent;
|
||
return !e.altKey && !(e.metaKey || e.ctrlKey) && e.shiftKey
|
||
}, Qs = function (t) {
|
||
var e = t.originalEvent.target.tagName;
|
||
return "INPUT" !== e && "SELECT" !== e && "TEXTAREA" !== e
|
||
}, ta = function (t) {
|
||
var e = t.pointerEvent;
|
||
return W(void 0 !== e, 56), "mouse" == e.pointerType
|
||
}, ea = function (t) {
|
||
var e = t.pointerEvent;
|
||
return W(void 0 !== e, 56), e.isPrimary && 0 === e.button
|
||
};
|
||
|
||
function ia(t) {
|
||
for (var e = t.length, i = 0, r = 0, o = 0; o < e; o++) i += t[o].clientX, r += t[o].clientY;
|
||
return [i / e, r / e]
|
||
}
|
||
|
||
var ra = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, i), i.handleDownEvent && (this.handleDownEvent = i.handleDownEvent), i.handleDragEvent && (this.handleDragEvent = i.handleDragEvent), i.handleMoveEvent && (this.handleMoveEvent = i.handleMoveEvent), i.handleUpEvent && (this.handleUpEvent = i.handleUpEvent), i.stopDown && (this.stopDown = i.stopDown), this.handlingDownUpSequence = !1, this.trackedPointers_ = {}, this.targetPointers = []
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleDownEvent = function (t) {
|
||
return !1
|
||
}, e.prototype.handleDragEvent = function (t) {
|
||
}, e.prototype.handleEvent = function (t) {
|
||
if (!t.pointerEvent) return !0;
|
||
var e = !1;
|
||
if (this.updateTrackedPointers_(t), this.handlingDownUpSequence) {
|
||
if (t.type == Ho.POINTERDRAG) this.handleDragEvent(t); else if (t.type == Ho.POINTERUP) {
|
||
var i = this.handleUpEvent(t);
|
||
this.handlingDownUpSequence = i && this.targetPointers.length > 0
|
||
}
|
||
} else if (t.type == Ho.POINTERDOWN) {
|
||
var r = this.handleDownEvent(t);
|
||
r && t.preventDefault(), this.handlingDownUpSequence = r, e = this.stopDown(r)
|
||
} else t.type == Ho.POINTERMOVE && this.handleMoveEvent(t);
|
||
return !e
|
||
}, e.prototype.handleMoveEvent = function (t) {
|
||
}, e.prototype.handleUpEvent = function (t) {
|
||
return !1
|
||
}, e.prototype.stopDown = function (t) {
|
||
return t
|
||
}, e.prototype.updateTrackedPointers_ = function (t) {
|
||
if (function (t) {
|
||
var e = t.type;
|
||
return e === Ho.POINTERDOWN || e === Ho.POINTERDRAG || e === Ho.POINTERUP
|
||
}(t)) {
|
||
var e = t.pointerEvent, i = e.pointerId.toString();
|
||
t.type == Ho.POINTERUP ? delete this.trackedPointers_[i] : t.type == Ho.POINTERDOWN ? this.trackedPointers_[i] = e : i in this.trackedPointers_ && (this.trackedPointers_[i] = e), this.targetPointers = f(this.trackedPointers_)
|
||
}
|
||
}, e
|
||
}(zs), oa = function (t) {
|
||
function e(e) {
|
||
t.call(this, {stopDown: L});
|
||
var i = e || {};
|
||
this.kinetic_ = i.kinetic, this.lastCentroid = null, this.lastPointersCount_, this.panning_ = !1, this.condition_ = i.condition ? i.condition : Js, this.noKinetic_ = !1
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleDragEvent = function (t) {
|
||
this.panning_ || (this.panning_ = !0, this.getMap().getView().setHint($n.INTERACTING, 1));
|
||
var e = this.targetPointers, i = ia(e);
|
||
if (e.length == this.lastPointersCount_) {
|
||
if (this.kinetic_ && this.kinetic_.update(i[0], i[1]), this.lastCentroid) {
|
||
var r = this.lastCentroid[0] - i[0], o = i[1] - this.lastCentroid[1], n = t.map.getView(),
|
||
s = [r, o];
|
||
Br(s, n.getResolution()), Ur(s, n.getRotation()), Fr(s, n.getCenter()), s = n.constrainCenter(s), n.setCenter(s)
|
||
}
|
||
} else this.kinetic_ && this.kinetic_.begin();
|
||
this.lastCentroid = i, this.lastPointersCount_ = e.length
|
||
}, e.prototype.handleUpEvent = function (t) {
|
||
var e = t.map, i = e.getView();
|
||
if (0 === this.targetPointers.length) {
|
||
if (!this.noKinetic_ && this.kinetic_ && this.kinetic_.end()) {
|
||
var r = this.kinetic_.getDistance(), o = this.kinetic_.getAngle(), n = i.getCenter(),
|
||
s = e.getPixelFromCoordinate(n),
|
||
a = e.getCoordinateFromPixel([s[0] - r * Math.cos(o), s[1] - r * Math.sin(o)]);
|
||
i.animate({center: i.constrainCenter(a), duration: 500, easing: Lo})
|
||
}
|
||
return this.panning_ && (this.panning_ = !1, i.setHint($n.INTERACTING, -1)), !1
|
||
}
|
||
return this.kinetic_ && this.kinetic_.begin(), this.lastCentroid = null, !0
|
||
}, e.prototype.handleDownEvent = function (t) {
|
||
if (this.targetPointers.length > 0 && this.condition_(t)) {
|
||
var e = t.map.getView();
|
||
return this.lastCentroid = null, e.getAnimating() && e.setCenter(t.frameState.viewState.center), this.kinetic_ && this.kinetic_.begin(), this.noKinetic_ = this.targetPointers.length > 1, !0
|
||
}
|
||
return !1
|
||
}, e
|
||
}(ra), na = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {stopDown: L}), this.condition_ = i.condition ? i.condition : Ys, this.lastAngle_ = void 0, this.duration_ = void 0 !== i.duration ? i.duration : 250
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleDragEvent = function (t) {
|
||
if (ta(t)) {
|
||
var e = t.map, i = e.getView();
|
||
if (i.getConstraints().rotation !== qn) {
|
||
var r = e.getSize(), o = t.pixel, n = Math.atan2(r[1] / 2 - o[1], o[0] - r[0] / 2);
|
||
if (void 0 !== this.lastAngle_) {
|
||
var s = n - this.lastAngle_, a = i.getRotation();
|
||
Ns(i, a - s)
|
||
}
|
||
this.lastAngle_ = n
|
||
}
|
||
}
|
||
}, e.prototype.handleUpEvent = function (t) {
|
||
if (!ta(t)) return !0;
|
||
var e = t.map.getView();
|
||
e.setHint($n.INTERACTING, -1);
|
||
var i = e.getRotation();
|
||
return Fs(e, i, void 0, this.duration_), !1
|
||
}, e.prototype.handleDownEvent = function (t) {
|
||
return !!ta(t) && (!(!Xs(t) || !this.condition_(t)) && (t.map.getView().setHint($n.INTERACTING, 1), this.lastAngle_ = void 0, !0))
|
||
}, e
|
||
}(ra), sa = function (t) {
|
||
function e(e) {
|
||
t.call(this), this.geometry_ = null, this.element_ = document.createElement("div"), this.element_.style.position = "absolute", this.element_.className = "ol-box " + e, this.map_ = null, this.startPixel_ = null, this.endPixel_ = null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.disposeInternal = function () {
|
||
this.setMap(null)
|
||
}, e.prototype.render_ = function () {
|
||
var t = this.startPixel_, e = this.endPixel_, i = this.element_.style;
|
||
i.left = Math.min(t[0], e[0]) + "px", i.top = Math.min(t[1], e[1]) + "px", i.width = Math.abs(e[0] - t[0]) + "px", i.height = Math.abs(e[1] - t[1]) + "px"
|
||
}, e.prototype.setMap = function (t) {
|
||
if (this.map_) {
|
||
this.map_.getOverlayContainer().removeChild(this.element_);
|
||
var e = this.element_.style;
|
||
e.left = e.top = e.width = e.height = "inherit"
|
||
}
|
||
this.map_ = t, this.map_ && this.map_.getOverlayContainer().appendChild(this.element_)
|
||
}, e.prototype.setPixels = function (t, e) {
|
||
this.startPixel_ = t, this.endPixel_ = e, this.createOrUpdateGeometry(), this.render_()
|
||
}, e.prototype.createOrUpdateGeometry = function () {
|
||
var t = this.startPixel_, e = this.endPixel_,
|
||
i = [t, [t[0], e[1]], e, [e[0], t[1]]].map(this.map_.getCoordinateFromPixel, this.map_);
|
||
i[4] = i[0].slice(), this.geometry_ ? this.geometry_.setCoordinates([i]) : this.geometry_ = new fr([i])
|
||
}, e.prototype.getGeometry = function () {
|
||
return this.geometry_
|
||
}, e
|
||
}(R), aa = "boxstart", la = "boxdrag", ha = "boxend", ua = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, e), this.coordinate = i, this.mapBrowserEvent = r
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A), ca = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = e || {};
|
||
this.box_ = new sa(i.className || "ol-dragbox"), this.minArea_ = void 0 !== i.minArea ? i.minArea : 64, this.onBoxEnd_ = i.onBoxEnd ? i.onBoxEnd : I, this.startPixel_ = null, this.condition_ = i.condition ? i.condition : Hs, this.boxEndCondition_ = i.boxEndCondition ? i.boxEndCondition : this.defaultBoxEndCondition
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.defaultBoxEndCondition = function (t, e, i) {
|
||
var r = i[0] - e[0], o = i[1] - e[1];
|
||
return r * r + o * o >= this.minArea_
|
||
}, e.prototype.getGeometry = function () {
|
||
return this.box_.getGeometry()
|
||
}, e.prototype.handleDragEvent = function (t) {
|
||
ta(t) && (this.box_.setPixels(this.startPixel_, t.pixel), this.dispatchEvent(new ua(la, t.coordinate, t)))
|
||
}, e.prototype.handleUpEvent = function (t) {
|
||
return !ta(t) || (this.box_.setMap(null), this.boxEndCondition_(t, this.startPixel_, t.pixel) && (this.onBoxEnd_(t), this.dispatchEvent(new ua(ha, t.coordinate, t))), !1)
|
||
}, e.prototype.handleDownEvent = function (t) {
|
||
return !!ta(t) && (!(!Xs(t) || !this.condition_(t)) && (this.startPixel_ = t.pixel, this.box_.setMap(t.map), this.box_.setPixels(this.startPixel_, this.startPixel_), this.dispatchEvent(new ua(aa, t.coordinate, t)), !0))
|
||
}, e
|
||
}(ra);
|
||
|
||
function pa() {
|
||
var t = this.getMap(), e = t.getView(), i = t.getSize(), r = this.getGeometry().getExtent();
|
||
if (this.out_) {
|
||
var o = e.calculateExtent(i),
|
||
n = xt([t.getPixelFromCoordinate(Ot(r)), t.getPixelFromCoordinate(zt(r))]);
|
||
Wt(o, 1 / e.getResolutionForExtent(n, i)), r = o
|
||
}
|
||
var s = e.constrainResolution(e.getResolutionForExtent(r, i)), a = At(r);
|
||
a = e.constrainCenter(a), e.animate({resolution: s, center: a, duration: this.duration_, easing: Lo})
|
||
}
|
||
|
||
var da = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = i.condition ? i.condition : $s;
|
||
t.call(this, {
|
||
condition: r,
|
||
className: i.className || "ol-dragzoom",
|
||
onBoxEnd: pa
|
||
}), this.duration_ = void 0 !== i.duration ? i.duration : 200, this.out_ = void 0 !== i.out && i.out
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(ca), fa = {LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40};
|
||
|
||
function ga(t) {
|
||
var e = !1;
|
||
if (t.type == F.KEYDOWN) {
|
||
var i = t.originalEvent.keyCode;
|
||
if (this.condition_(t) && (i == fa.DOWN || i == fa.LEFT || i == fa.RIGHT || i == fa.UP)) {
|
||
var r = t.map.getView(), o = r.getResolution() * this.pixelDelta_, n = 0, s = 0;
|
||
i == fa.DOWN ? s = -o : i == fa.LEFT ? n = -o : i == fa.RIGHT ? n = o : s = o;
|
||
var a = [n, s];
|
||
Ur(a, r.getRotation()), ks(r, a, this.duration_), t.preventDefault(), e = !0
|
||
}
|
||
}
|
||
return !e
|
||
}
|
||
|
||
var ma = function (t) {
|
||
function e(e) {
|
||
t.call(this, {handleEvent: ga});
|
||
var i = e || {};
|
||
this.defaultCondition_ = function (t) {
|
||
return Js(t) && Qs(t)
|
||
}, this.condition_ = void 0 !== i.condition ? i.condition : this.defaultCondition_, this.duration_ = void 0 !== i.duration ? i.duration : 100, this.pixelDelta_ = void 0 !== i.pixelDelta ? i.pixelDelta : 128
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(zs);
|
||
|
||
function ya(t) {
|
||
var e = !1;
|
||
if (t.type == F.KEYDOWN || t.type == F.KEYPRESS) {
|
||
var i = t.originalEvent.charCode;
|
||
if (this.condition_(t) && (i == "+".charCodeAt(0) || i == "-".charCodeAt(0))) {
|
||
var r = t.map, o = i == "+".charCodeAt(0) ? this.delta_ : -this.delta_;
|
||
Gs(r.getView(), o, void 0, this.duration_), t.preventDefault(), e = !0
|
||
}
|
||
}
|
||
return !e
|
||
}
|
||
|
||
var va = function (t) {
|
||
function e(e) {
|
||
t.call(this, {handleEvent: ya});
|
||
var i = e || {};
|
||
this.condition_ = i.condition ? i.condition : Qs, this.delta_ = i.delta ? i.delta : 1, this.duration_ = void 0 !== i.duration ? i.duration : 100
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(zs), _a = {TRACKPAD: "trackpad", WHEEL: "wheel"}, xa = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, i), this.delta_ = 0, this.duration_ = void 0 !== i.duration ? i.duration : 250, this.timeout_ = void 0 !== i.timeout ? i.timeout : 80, this.useAnchor_ = void 0 === i.useAnchor || i.useAnchor, this.constrainResolution_ = i.constrainResolution || !1, this.condition_ = i.condition ? i.condition : Hs, this.lastAnchor_ = null, this.startTime_ = void 0, this.timeoutId_, this.mode_ = void 0, this.trackpadEventGap_ = 400, this.trackpadTimeoutId_, this.trackpadDeltaPerZoom_ = 300, this.trackpadZoomBuffer_ = 1.5
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.decrementInteractingHint_ = function () {
|
||
this.trackpadTimeoutId_ = void 0, this.getMap().getView().setHint($n.INTERACTING, -1)
|
||
}, e.prototype.handleEvent = function (t) {
|
||
if (!this.condition_(t)) return !0;
|
||
var e = t.type;
|
||
if (e !== F.WHEEL && e !== F.MOUSEWHEEL) return !0;
|
||
t.preventDefault();
|
||
var i, r = t.map, o = t.originalEvent;
|
||
if (this.useAnchor_ && (this.lastAnchor_ = t.coordinate), t.type == F.WHEEL ? (i = o.deltaY, xr && o.deltaMode === WheelEvent.DOM_DELTA_PIXEL && (i /= Sr), o.deltaMode === WheelEvent.DOM_DELTA_LINE && (i *= 40)) : t.type == F.MOUSEWHEEL && (i = -o.wheelDeltaY, wr && (i /= 3)), 0 === i) return !1;
|
||
var n = Date.now();
|
||
if (void 0 === this.startTime_ && (this.startTime_ = n), (!this.mode_ || n - this.startTime_ > this.trackpadEventGap_) && (this.mode_ = Math.abs(i) < 4 ? _a.TRACKPAD : _a.WHEEL), this.mode_ === _a.TRACKPAD) {
|
||
var s = r.getView();
|
||
this.trackpadTimeoutId_ ? clearTimeout(this.trackpadTimeoutId_) : s.setHint($n.INTERACTING, 1), this.trackpadTimeoutId_ = setTimeout(this.decrementInteractingHint_.bind(this), this.trackpadEventGap_);
|
||
var a = s.getResolution() * Math.pow(2, i / this.trackpadDeltaPerZoom_), l = s.getMinResolution(),
|
||
h = s.getMaxResolution(), u = 0;
|
||
if (a < l ? (a = Math.max(a, l / this.trackpadZoomBuffer_), u = 1) : a > h && (a = Math.min(a, h * this.trackpadZoomBuffer_), u = -1), this.lastAnchor_) {
|
||
var c = s.calculateCenterZoom(a, this.lastAnchor_);
|
||
s.setCenter(s.constrainCenter(c))
|
||
}
|
||
return s.setResolution(a), 0 === u && this.constrainResolution_ && s.animate({
|
||
resolution: s.constrainResolution(a, i > 0 ? -1 : 1),
|
||
easing: Lo,
|
||
anchor: this.lastAnchor_,
|
||
duration: this.duration_
|
||
}), u > 0 ? s.animate({
|
||
resolution: l,
|
||
easing: Lo,
|
||
anchor: this.lastAnchor_,
|
||
duration: 500
|
||
}) : u < 0 && s.animate({
|
||
resolution: h,
|
||
easing: Lo,
|
||
anchor: this.lastAnchor_,
|
||
duration: 500
|
||
}), this.startTime_ = n, !1
|
||
}
|
||
this.delta_ += i;
|
||
var p = Math.max(this.timeout_ - (n - this.startTime_), 0);
|
||
return clearTimeout(this.timeoutId_), this.timeoutId_ = setTimeout(this.handleWheelZoom_.bind(this, r), p), !1
|
||
}, e.prototype.handleWheelZoom_ = function (t) {
|
||
var e = t.getView();
|
||
e.getAnimating() && e.cancelAnimations();
|
||
Gs(e, -te(this.delta_, -1, 1), this.lastAnchor_, this.duration_), this.mode_ = void 0, this.delta_ = 0, this.lastAnchor_ = null, this.startTime_ = void 0, this.timeoutId_ = void 0
|
||
}, e.prototype.setMouseAnchor = function (t) {
|
||
this.useAnchor_ = t, t || (this.lastAnchor_ = null)
|
||
}, e
|
||
}(zs), wa = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = i;
|
||
r.stopDown || (r.stopDown = L), t.call(this, r), this.anchor_ = null, this.lastAngle_ = void 0, this.rotating_ = !1, this.rotationDelta_ = 0, this.threshold_ = void 0 !== i.threshold ? i.threshold : .3, this.duration_ = void 0 !== i.duration ? i.duration : 250
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleDragEvent = function (t) {
|
||
var e = 0, i = this.targetPointers[0], r = this.targetPointers[1],
|
||
o = Math.atan2(r.clientY - i.clientY, r.clientX - i.clientX);
|
||
if (void 0 !== this.lastAngle_) {
|
||
var n = o - this.lastAngle_;
|
||
this.rotationDelta_ += n, !this.rotating_ && Math.abs(this.rotationDelta_) > this.threshold_ && (this.rotating_ = !0), e = n
|
||
}
|
||
this.lastAngle_ = o;
|
||
var s = t.map, a = s.getView();
|
||
if (a.getConstraints().rotation !== qn) {
|
||
var l = s.getViewport().getBoundingClientRect(), h = ia(this.targetPointers);
|
||
if (h[0] -= l.left, h[1] -= l.top, this.anchor_ = s.getCoordinateFromPixel(h), this.rotating_) {
|
||
var u = a.getRotation();
|
||
s.render(), Ns(a, u + e, this.anchor_)
|
||
}
|
||
}
|
||
}, e.prototype.handleUpEvent = function (t) {
|
||
if (this.targetPointers.length < 2) {
|
||
var e = t.map.getView();
|
||
if (e.setHint($n.INTERACTING, -1), this.rotating_) {
|
||
var i = e.getRotation();
|
||
Fs(e, i, this.anchor_, this.duration_)
|
||
}
|
||
return !1
|
||
}
|
||
return !0
|
||
}, e.prototype.handleDownEvent = function (t) {
|
||
if (this.targetPointers.length >= 2) {
|
||
var e = t.map;
|
||
return this.anchor_ = null, this.lastAngle_ = void 0, this.rotating_ = !1, this.rotationDelta_ = 0, this.handlingDownUpSequence || e.getView().setHint($n.INTERACTING, 1), !0
|
||
}
|
||
return !1
|
||
}, e
|
||
}(ra), ba = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = i;
|
||
r.stopDown || (r.stopDown = L), t.call(this, r), this.constrainResolution_ = i.constrainResolution || !1, this.anchor_ = null, this.duration_ = void 0 !== i.duration ? i.duration : 400, this.lastDistance_ = void 0, this.lastScaleDelta_ = 1
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleDragEvent = function (t) {
|
||
var e = 1, i = this.targetPointers[0], r = this.targetPointers[1], o = i.clientX - r.clientX,
|
||
n = i.clientY - r.clientY, s = Math.sqrt(o * o + n * n);
|
||
void 0 !== this.lastDistance_ && (e = this.lastDistance_ / s), this.lastDistance_ = s;
|
||
var a = t.map, l = a.getView(), h = l.getResolution(), u = l.getMaxResolution(),
|
||
c = l.getMinResolution(), p = h * e;
|
||
p > u ? (e = u / h, p = u) : p < c && (e = c / h, p = c), 1 != e && (this.lastScaleDelta_ = e);
|
||
var d = a.getViewport().getBoundingClientRect(), f = ia(this.targetPointers);
|
||
f[0] -= d.left, f[1] -= d.top, this.anchor_ = a.getCoordinateFromPixel(f), a.render(), js(l, p, this.anchor_)
|
||
}, e.prototype.handleUpEvent = function (t) {
|
||
if (this.targetPointers.length < 2) {
|
||
var e = t.map.getView();
|
||
e.setHint($n.INTERACTING, -1);
|
||
var i = e.getResolution();
|
||
if (this.constrainResolution_ || i < e.getMinResolution() || i > e.getMaxResolution()) {
|
||
var r = this.lastScaleDelta_ - 1;
|
||
Ds(e, i, this.anchor_, this.duration_, r)
|
||
}
|
||
return !1
|
||
}
|
||
return !0
|
||
}, e.prototype.handleDownEvent = function (t) {
|
||
if (this.targetPointers.length >= 2) {
|
||
var e = t.map;
|
||
return this.anchor_ = null, this.lastDistance_ = void 0, this.lastScaleDelta_ = 1, this.handlingDownUpSequence || e.getView().setHint($n.INTERACTING, 1), !0
|
||
}
|
||
return !1
|
||
}, e
|
||
}(ra);
|
||
|
||
function Ca(t) {
|
||
var e = t || {}, i = new Y, r = new Bo(-.005, .05, 100);
|
||
return (void 0 === e.altShiftDragRotate || e.altShiftDragRotate) && i.push(new na), (void 0 === e.doubleClickZoom || e.doubleClickZoom) && i.push(new Bs({
|
||
delta: e.zoomDelta,
|
||
duration: e.zoomDuration
|
||
})), (void 0 === e.dragPan || e.dragPan) && i.push(new oa({
|
||
condition: e.onFocusOnly ? Ws : void 0,
|
||
kinetic: r
|
||
})), (void 0 === e.pinchRotate || e.pinchRotate) && i.push(new wa), (void 0 === e.pinchZoom || e.pinchZoom) && i.push(new ba({
|
||
constrainResolution: e.constrainResolution,
|
||
duration: e.zoomDuration
|
||
})), (void 0 === e.keyboard || e.keyboard) && (i.push(new ma), i.push(new va({
|
||
delta: e.zoomDelta,
|
||
duration: e.zoomDuration
|
||
}))), (void 0 === e.mouseWheelZoom || e.mouseWheelZoom) && i.push(new xa({
|
||
condition: e.onFocusOnly ? Ws : void 0,
|
||
constrainResolution: e.constrainResolution,
|
||
duration: e.zoomDuration
|
||
})), (void 0 === e.shiftDragZoom || e.shiftDragZoom) && i.push(new da({duration: e.zoomDuration})), i
|
||
}
|
||
|
||
var Sa = .5, Ea = {IMAGE: "image", VECTOR: "vector"}, Ta = function (t) {
|
||
function e(e, i, r, o, n) {
|
||
t.call(this, e), this.vectorContext = i, this.frameState = r, this.context = o, this.glContext = n
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A), Ra = function (t) {
|
||
function e(e) {
|
||
t.call(this), this.highWaterMark = void 0 !== e ? e : 2048, this.count_ = 0, this.entries_ = {}, this.oldest_ = null, this.newest_ = null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.canExpireCache = function () {
|
||
return this.getCount() > this.highWaterMark
|
||
}, e.prototype.clear = function () {
|
||
this.count_ = 0, this.entries_ = {}, this.oldest_ = null, this.newest_ = null, this.dispatchEvent(F.CLEAR)
|
||
}, e.prototype.containsKey = function (t) {
|
||
return this.entries_.hasOwnProperty(t)
|
||
}, e.prototype.forEach = function (t, e) {
|
||
for (var i = this.oldest_; i;) t.call(e, i.value_, i.key_, this), i = i.newer
|
||
}, e.prototype.get = function (t) {
|
||
var e = this.entries_[t];
|
||
return W(void 0 !== e, 15), e === this.newest_ ? e.value_ : (e === this.oldest_ ? (this.oldest_ = this.oldest_.newer, this.oldest_.older = null) : (e.newer.older = e.older, e.older.newer = e.newer), e.newer = null, e.older = this.newest_, this.newest_.newer = e, this.newest_ = e, e.value_)
|
||
}, e.prototype.remove = function (t) {
|
||
var e = this.entries_[t];
|
||
return W(void 0 !== e, 15), e === this.newest_ ? (this.newest_ = e.older, this.newest_ && (this.newest_.newer = null)) : e === this.oldest_ ? (this.oldest_ = e.newer, this.oldest_ && (this.oldest_.older = null)) : (e.newer.older = e.older, e.older.newer = e.newer), delete this.entries_[t], --this.count_, e.value_
|
||
}, e.prototype.getCount = function () {
|
||
return this.count_
|
||
}, e.prototype.getKeys = function () {
|
||
var t, e = new Array(this.count_), i = 0;
|
||
for (t = this.newest_; t; t = t.older) e[i++] = t.key_;
|
||
return e
|
||
}, e.prototype.getValues = function () {
|
||
var t, e = new Array(this.count_), i = 0;
|
||
for (t = this.newest_; t; t = t.older) e[i++] = t.value_;
|
||
return e
|
||
}, e.prototype.peekLast = function () {
|
||
return this.oldest_.value_
|
||
}, e.prototype.peekLastKey = function () {
|
||
return this.oldest_.key_
|
||
}, e.prototype.peekFirstKey = function () {
|
||
return this.newest_.key_
|
||
}, e.prototype.pop = function () {
|
||
var t = this.oldest_;
|
||
return delete this.entries_[t.key_], t.newer && (t.newer.older = null), this.oldest_ = t.newer, this.oldest_ || (this.newest_ = null), --this.count_, t.value_
|
||
}, e.prototype.replace = function (t, e) {
|
||
this.get(t), this.entries_[t].value_ = e
|
||
}, e.prototype.set = function (t, e) {
|
||
W(!(t in this.entries_), 16);
|
||
var i = {key_: t, newer: null, older: this.newest_, value_: e};
|
||
this.newest_ ? this.newest_.newer = i : this.oldest_ = i, this.newest_ = i, this.entries_[t] = i, ++this.count_
|
||
}, e.prototype.setSize = function (t) {
|
||
this.highWaterMark = t
|
||
}, e.prototype.prune = function () {
|
||
for (; this.canExpireCache();) this.pop()
|
||
}, e
|
||
}(k), Pa = [0, 0, 0, 1], La = [], Ia = [0, 0, 0, 1], Oa = [0, 0, 0, 0], Ma = new Ra, Aa = {}, ka = null,
|
||
Fa = {}, Na = function () {
|
||
var t, e, i = 60, r = Aa, o = "32px ", n = ["monospace", "serif"], s = n.length,
|
||
a = "wmytzilWMYTZIL@#/&?$%10";
|
||
|
||
function l(t) {
|
||
for (var i = Da(), r = 100; r <= 700; r += 300) {
|
||
for (var l = r + " ", h = !0, u = 0; u < s; ++u) {
|
||
var c = n[u];
|
||
if (i.font = l + o + c, e = i.measureText(a).width, t != c) {
|
||
i.font = l + o + t + "," + c;
|
||
var p = i.measureText(a).width;
|
||
h = h && p != e
|
||
}
|
||
}
|
||
if (h) return !0
|
||
}
|
||
return !1
|
||
}
|
||
|
||
function h() {
|
||
var e = !0;
|
||
for (var o in r) r[o] < i && (l(o) ? (r[o] = i, d(Fa), ka = null, Ma.clear()) : (++r[o], e = !1));
|
||
e && (clearInterval(t), t = void 0)
|
||
}
|
||
|
||
return function (e) {
|
||
var o = Ss(e);
|
||
if (o) for (var n = 0, s = o.length; n < s; ++n) {
|
||
var a = o[n];
|
||
a in r || (r[a] = i, l(a) || (r[a] = 0, void 0 === t && (t = setInterval(h, 32))))
|
||
}
|
||
}
|
||
}();
|
||
|
||
function Da() {
|
||
return ka || (ka = Ao(1, 1)), ka
|
||
}
|
||
|
||
var Ga, ja, za = (ja = Fa, function (t) {
|
||
var e = ja[t];
|
||
return null == e && (Ga || ((Ga = document.createElement("span")).textContent = "M", Ga.style.margin = Ga.style.padding = "0 !important", Ga.style.position = "absolute !important", Ga.style.left = "-99999px !important"), Ga.style.font = t, document.body.appendChild(Ga), e = ja[t] = Ga.offsetHeight, document.body.removeChild(Ga)), e
|
||
});
|
||
|
||
function Ua(t, e) {
|
||
var i = Da();
|
||
return t != i.font && (i.font = t), i.measureText(e).width
|
||
}
|
||
|
||
function Ba(t, e, i, r) {
|
||
0 !== e && (t.translate(i, r), t.rotate(e), t.translate(-i, -r))
|
||
}
|
||
|
||
var Va = [1, 0, 0, 1, 0, 0];
|
||
|
||
function Ya(t, e, i, r, o, n, s, a, l, h, u) {
|
||
var c;
|
||
1 != i && (c = t.globalAlpha, t.globalAlpha = c * i), e && t.setTransform.apply(t, e), t.drawImage(r, o, n, s, a, l, h, s * u, a * u), c && (t.globalAlpha = c), e && t.setTransform.apply(t, Va)
|
||
}
|
||
|
||
function Wa(t) {
|
||
return Array.isArray(t) ? uo(t) : t
|
||
}
|
||
|
||
var Ha = function () {
|
||
};
|
||
Ha.prototype.drawCustom = function (t, e, i) {
|
||
}, Ha.prototype.drawGeometry = function (t) {
|
||
}, Ha.prototype.setStyle = function (t) {
|
||
}, Ha.prototype.drawCircle = function (t, e) {
|
||
}, Ha.prototype.drawFeature = function (t, e) {
|
||
}, Ha.prototype.drawGeometryCollection = function (t, e) {
|
||
}, Ha.prototype.drawLineString = function (t, e) {
|
||
}, Ha.prototype.drawMultiLineString = function (t, e) {
|
||
}, Ha.prototype.drawMultiPoint = function (t, e) {
|
||
}, Ha.prototype.drawMultiPolygon = function (t, e) {
|
||
}, Ha.prototype.drawPoint = function (t, e) {
|
||
}, Ha.prototype.drawPolygon = function (t, e) {
|
||
}, Ha.prototype.drawText = function (t, e) {
|
||
}, Ha.prototype.setFillStrokeStyle = function (t, e) {
|
||
}, Ha.prototype.setImageStyle = function (t, e) {
|
||
}, Ha.prototype.setTextStyle = function (t, e) {
|
||
};
|
||
var Xa = Ha, qa = function (t) {
|
||
function e(e, i, r, o, n) {
|
||
t.call(this), this.context_ = e, this.pixelRatio_ = i, this.extent_ = r, this.transform_ = o, this.viewRotation_ = n, this.contextFillState_ = null, this.contextStrokeState_ = null, this.contextTextState_ = null, this.fillState_ = null, this.strokeState_ = null, this.image_ = null, this.imageAnchorX_ = 0, this.imageAnchorY_ = 0, this.imageHeight_ = 0, this.imageOpacity_ = 0, this.imageOriginX_ = 0, this.imageOriginY_ = 0, this.imageRotateWithView_ = !1, this.imageRotation_ = 0, this.imageScale_ = 0, this.imageWidth_ = 0, this.text_ = "", this.textOffsetX_ = 0, this.textOffsetY_ = 0, this.textRotateWithView_ = !1, this.textRotation_ = 0, this.textScale_ = 0, this.textFillState_ = null, this.textStrokeState_ = null, this.textState_ = null, this.pixelCoordinates_ = [], this.tmpLocalTransform_ = [1, 0, 0, 1, 0, 0]
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.drawImages_ = function (t, e, i, r) {
|
||
if (this.image_) {
|
||
var o = Kt(t, e, i, 2, this.transform_, this.pixelCoordinates_), n = this.context_,
|
||
s = this.tmpLocalTransform_, a = n.globalAlpha;
|
||
1 != this.imageOpacity_ && (n.globalAlpha = a * this.imageOpacity_);
|
||
var l = this.imageRotation_;
|
||
this.imageRotateWithView_ && (l += this.viewRotation_);
|
||
for (var h = 0, u = o.length; h < u; h += 2) {
|
||
var c = o[h] - this.imageAnchorX_, p = o[h + 1] - this.imageAnchorY_;
|
||
if (0 !== l || 1 != this.imageScale_) {
|
||
var d = c + this.imageAnchorX_, f = p + this.imageAnchorY_;
|
||
gi(s, d, f, this.imageScale_, this.imageScale_, l, -d, -f), n.setTransform.apply(n, s)
|
||
}
|
||
n.drawImage(this.image_, this.imageOriginX_, this.imageOriginY_, this.imageWidth_, this.imageHeight_, c, p, this.imageWidth_, this.imageHeight_)
|
||
}
|
||
0 === l && 1 == this.imageScale_ || n.setTransform(1, 0, 0, 1, 0, 0), 1 != this.imageOpacity_ && (n.globalAlpha = a)
|
||
}
|
||
}, e.prototype.drawText_ = function (t, e, i, r) {
|
||
if (this.textState_ && "" !== this.text_) {
|
||
this.textFillState_ && this.setContextFillState_(this.textFillState_), this.textStrokeState_ && this.setContextStrokeState_(this.textStrokeState_), this.setContextTextState_(this.textState_);
|
||
var o = Kt(t, e, i, r, this.transform_, this.pixelCoordinates_), n = this.context_,
|
||
s = this.textRotation_;
|
||
for (this.textRotateWithView_ && (s += this.viewRotation_); e < i; e += r) {
|
||
var a = o[e] + this.textOffsetX_, l = o[e + 1] + this.textOffsetY_;
|
||
if (0 !== s || 1 != this.textScale_) {
|
||
var h = gi(this.tmpLocalTransform_, a, l, this.textScale_, this.textScale_, s, -a, -l);
|
||
n.setTransform.apply(n, h)
|
||
}
|
||
this.textStrokeState_ && n.strokeText(this.text_, a, l), this.textFillState_ && n.fillText(this.text_, a, l)
|
||
}
|
||
0 === s && 1 == this.textScale_ || n.setTransform(1, 0, 0, 1, 0, 0)
|
||
}
|
||
}, e.prototype.moveToLineTo_ = function (t, e, i, r, o) {
|
||
var n = this.context_, s = Kt(t, e, i, r, this.transform_, this.pixelCoordinates_);
|
||
n.moveTo(s[0], s[1]);
|
||
var a = s.length;
|
||
o && (a -= 2);
|
||
for (var l = 2; l < a; l += 2) n.lineTo(s[l], s[l + 1]);
|
||
return o && n.closePath(), i
|
||
}, e.prototype.drawRings_ = function (t, e, i, r) {
|
||
for (var o = 0, n = i.length; o < n; ++o) e = this.moveToLineTo_(t, e, i[o], r, !0);
|
||
return e
|
||
}, e.prototype.drawCircle = function (t) {
|
||
if (Bt(this.extent_, t.getExtent())) {
|
||
if (this.fillState_ || this.strokeState_) {
|
||
this.fillState_ && this.setContextFillState_(this.fillState_), this.strokeState_ && this.setContextStrokeState_(this.strokeState_);
|
||
var e = wi(t, this.transform_, this.pixelCoordinates_), i = e[2] - e[0], r = e[3] - e[1],
|
||
o = Math.sqrt(i * i + r * r), n = this.context_;
|
||
n.beginPath(), n.arc(e[0], e[1], o, 0, 2 * Math.PI), this.fillState_ && n.fill(), this.strokeState_ && n.stroke()
|
||
}
|
||
"" !== this.text_ && this.drawText_(t.getCenter(), 0, 2, 2)
|
||
}
|
||
}, e.prototype.setStyle = function (t) {
|
||
this.setFillStrokeStyle(t.getFill(), t.getStroke()), this.setImageStyle(t.getImage()), this.setTextStyle(t.getText())
|
||
}, e.prototype.drawGeometry = function (t) {
|
||
switch (t.getType()) {
|
||
case Zt.POINT:
|
||
this.drawPoint(t);
|
||
break;
|
||
case Zt.LINE_STRING:
|
||
this.drawLineString(t);
|
||
break;
|
||
case Zt.POLYGON:
|
||
this.drawPolygon(t);
|
||
break;
|
||
case Zt.MULTI_POINT:
|
||
this.drawMultiPoint(t);
|
||
break;
|
||
case Zt.MULTI_LINE_STRING:
|
||
this.drawMultiLineString(t);
|
||
break;
|
||
case Zt.MULTI_POLYGON:
|
||
this.drawMultiPolygon(t);
|
||
break;
|
||
case Zt.GEOMETRY_COLLECTION:
|
||
this.drawGeometryCollection(t);
|
||
break;
|
||
case Zt.CIRCLE:
|
||
this.drawCircle(t)
|
||
}
|
||
}, e.prototype.drawFeature = function (t, e) {
|
||
var i = e.getGeometryFunction()(t);
|
||
i && Bt(this.extent_, i.getExtent()) && (this.setStyle(e), this.drawGeometry(i))
|
||
}, e.prototype.drawGeometryCollection = function (t) {
|
||
for (var e = t.getGeometriesArray(), i = 0, r = e.length; i < r; ++i) this.drawGeometry(e[i])
|
||
}, e.prototype.drawPoint = function (t) {
|
||
var e = t.getFlatCoordinates(), i = t.getStride();
|
||
this.image_ && this.drawImages_(e, 0, e.length, i), "" !== this.text_ && this.drawText_(e, 0, e.length, i)
|
||
}, e.prototype.drawMultiPoint = function (t) {
|
||
var e = t.getFlatCoordinates(), i = t.getStride();
|
||
this.image_ && this.drawImages_(e, 0, e.length, i), "" !== this.text_ && this.drawText_(e, 0, e.length, i)
|
||
}, e.prototype.drawLineString = function (t) {
|
||
if (Bt(this.extent_, t.getExtent())) {
|
||
if (this.strokeState_) {
|
||
this.setContextStrokeState_(this.strokeState_);
|
||
var e = this.context_, i = t.getFlatCoordinates();
|
||
e.beginPath(), this.moveToLineTo_(i, 0, i.length, t.getStride(), !1), e.stroke()
|
||
}
|
||
if ("" !== this.text_) {
|
||
var r = t.getFlatMidpoint();
|
||
this.drawText_(r, 0, 2, 2)
|
||
}
|
||
}
|
||
}, e.prototype.drawMultiLineString = function (t) {
|
||
var e = t.getExtent();
|
||
if (Bt(this.extent_, e)) {
|
||
if (this.strokeState_) {
|
||
this.setContextStrokeState_(this.strokeState_);
|
||
var i = this.context_, r = t.getFlatCoordinates(), o = 0, n = t.getEnds(), s = t.getStride();
|
||
i.beginPath();
|
||
for (var a = 0, l = n.length; a < l; ++a) o = this.moveToLineTo_(r, o, n[a], s, !1);
|
||
i.stroke()
|
||
}
|
||
if ("" !== this.text_) {
|
||
var h = t.getFlatMidpoints();
|
||
this.drawText_(h, 0, h.length, 2)
|
||
}
|
||
}
|
||
}, e.prototype.drawPolygon = function (t) {
|
||
if (Bt(this.extent_, t.getExtent())) {
|
||
if (this.strokeState_ || this.fillState_) {
|
||
this.fillState_ && this.setContextFillState_(this.fillState_), this.strokeState_ && this.setContextStrokeState_(this.strokeState_);
|
||
var e = this.context_;
|
||
e.beginPath(), this.drawRings_(t.getOrientedFlatCoordinates(), 0, t.getEnds(), t.getStride()), this.fillState_ && e.fill(), this.strokeState_ && e.stroke()
|
||
}
|
||
if ("" !== this.text_) {
|
||
var i = t.getFlatInteriorPoint();
|
||
this.drawText_(i, 0, 2, 2)
|
||
}
|
||
}
|
||
}, e.prototype.drawMultiPolygon = function (t) {
|
||
if (Bt(this.extent_, t.getExtent())) {
|
||
if (this.strokeState_ || this.fillState_) {
|
||
this.fillState_ && this.setContextFillState_(this.fillState_), this.strokeState_ && this.setContextStrokeState_(this.strokeState_);
|
||
var e = this.context_, i = t.getOrientedFlatCoordinates(), r = 0, o = t.getEndss(),
|
||
n = t.getStride();
|
||
e.beginPath();
|
||
for (var s = 0, a = o.length; s < a; ++s) {
|
||
var l = o[s];
|
||
r = this.drawRings_(i, r, l, n)
|
||
}
|
||
this.fillState_ && e.fill(), this.strokeState_ && e.stroke()
|
||
}
|
||
if ("" !== this.text_) {
|
||
var h = t.getFlatInteriorPoints();
|
||
this.drawText_(h, 0, h.length, 2)
|
||
}
|
||
}
|
||
}, e.prototype.setContextFillState_ = function (t) {
|
||
var e = this.context_, i = this.contextFillState_;
|
||
i ? i.fillStyle != t.fillStyle && (i.fillStyle = e.fillStyle = t.fillStyle) : (e.fillStyle = t.fillStyle, this.contextFillState_ = {fillStyle: t.fillStyle})
|
||
}, e.prototype.setContextStrokeState_ = function (t) {
|
||
var e = this.context_, i = this.contextStrokeState_;
|
||
i ? (i.lineCap != t.lineCap && (i.lineCap = e.lineCap = t.lineCap), Er && (it(i.lineDash, t.lineDash) || e.setLineDash(i.lineDash = t.lineDash), i.lineDashOffset != t.lineDashOffset && (i.lineDashOffset = e.lineDashOffset = t.lineDashOffset)), i.lineJoin != t.lineJoin && (i.lineJoin = e.lineJoin = t.lineJoin), i.lineWidth != t.lineWidth && (i.lineWidth = e.lineWidth = t.lineWidth), i.miterLimit != t.miterLimit && (i.miterLimit = e.miterLimit = t.miterLimit), i.strokeStyle != t.strokeStyle && (i.strokeStyle = e.strokeStyle = t.strokeStyle)) : (e.lineCap = t.lineCap, Er && (e.setLineDash(t.lineDash), e.lineDashOffset = t.lineDashOffset), e.lineJoin = t.lineJoin, e.lineWidth = t.lineWidth, e.miterLimit = t.miterLimit, e.strokeStyle = t.strokeStyle, this.contextStrokeState_ = {
|
||
lineCap: t.lineCap,
|
||
lineDash: t.lineDash,
|
||
lineDashOffset: t.lineDashOffset,
|
||
lineJoin: t.lineJoin,
|
||
lineWidth: t.lineWidth,
|
||
miterLimit: t.miterLimit,
|
||
strokeStyle: t.strokeStyle
|
||
})
|
||
}, e.prototype.setContextTextState_ = function (t) {
|
||
var e = this.context_, i = this.contextTextState_, r = t.textAlign ? t.textAlign : "center";
|
||
i ? (i.font != t.font && (i.font = e.font = t.font), i.textAlign != r && (i.textAlign = e.textAlign = r), i.textBaseline != t.textBaseline && (i.textBaseline = e.textBaseline = t.textBaseline)) : (e.font = t.font, e.textAlign = r, e.textBaseline = t.textBaseline, this.contextTextState_ = {
|
||
font: t.font,
|
||
textAlign: r,
|
||
textBaseline: t.textBaseline
|
||
})
|
||
}, e.prototype.setFillStrokeStyle = function (t, e) {
|
||
if (t) {
|
||
var i = t.getColor();
|
||
this.fillState_ = {fillStyle: Wa(i || Pa)}
|
||
} else this.fillState_ = null;
|
||
if (e) {
|
||
var r = e.getColor(), o = e.getLineCap(), n = e.getLineDash(), s = e.getLineDashOffset(),
|
||
a = e.getLineJoin(), l = e.getWidth(), h = e.getMiterLimit();
|
||
this.strokeState_ = {
|
||
lineCap: void 0 !== o ? o : "round",
|
||
lineDash: n || La,
|
||
lineDashOffset: s || 0,
|
||
lineJoin: void 0 !== a ? a : "round",
|
||
lineWidth: this.pixelRatio_ * (void 0 !== l ? l : 1),
|
||
miterLimit: void 0 !== h ? h : 10,
|
||
strokeStyle: Wa(r || Ia)
|
||
}
|
||
} else this.strokeState_ = null
|
||
}, e.prototype.setImageStyle = function (t) {
|
||
if (t) {
|
||
var e = t.getAnchor(), i = t.getImage(1), r = t.getOrigin(), o = t.getSize();
|
||
this.imageAnchorX_ = e[0], this.imageAnchorY_ = e[1], this.imageHeight_ = o[1], this.image_ = i, this.imageOpacity_ = t.getOpacity(), this.imageOriginX_ = r[0], this.imageOriginY_ = r[1], this.imageRotateWithView_ = t.getRotateWithView(), this.imageRotation_ = t.getRotation(), this.imageScale_ = t.getScale() * this.pixelRatio_, this.imageWidth_ = o[0]
|
||
} else this.image_ = null
|
||
}, e.prototype.setTextStyle = function (t) {
|
||
if (t) {
|
||
var e = t.getFill();
|
||
if (e) {
|
||
var i = e.getColor();
|
||
this.textFillState_ = {fillStyle: Wa(i || Pa)}
|
||
} else this.textFillState_ = null;
|
||
var r = t.getStroke();
|
||
if (r) {
|
||
var o = r.getColor(), n = r.getLineCap(), s = r.getLineDash(), a = r.getLineDashOffset(),
|
||
l = r.getLineJoin(), h = r.getWidth(), u = r.getMiterLimit();
|
||
this.textStrokeState_ = {
|
||
lineCap: void 0 !== n ? n : "round",
|
||
lineDash: s || La,
|
||
lineDashOffset: a || 0,
|
||
lineJoin: void 0 !== l ? l : "round",
|
||
lineWidth: void 0 !== h ? h : 1,
|
||
miterLimit: void 0 !== u ? u : 10,
|
||
strokeStyle: Wa(o || Ia)
|
||
}
|
||
} else this.textStrokeState_ = null;
|
||
var c = t.getFont(), p = t.getOffsetX(), d = t.getOffsetY(), f = t.getRotateWithView(),
|
||
g = t.getRotation(), m = t.getScale(), y = t.getText(), v = t.getTextAlign(),
|
||
_ = t.getTextBaseline();
|
||
this.textState_ = {
|
||
font: void 0 !== c ? c : "10px sans-serif",
|
||
textAlign: void 0 !== v ? v : "center",
|
||
textBaseline: void 0 !== _ ? _ : "middle"
|
||
}, this.text_ = void 0 !== y ? y : "", this.textOffsetX_ = void 0 !== p ? this.pixelRatio_ * p : 0, this.textOffsetY_ = void 0 !== d ? this.pixelRatio_ * d : 0, this.textRotateWithView_ = void 0 !== f && f, this.textRotation_ = void 0 !== g ? g : 0, this.textScale_ = this.pixelRatio_ * (void 0 !== m ? m : 1)
|
||
} else this.text_ = ""
|
||
}, e
|
||
}(Xa), Za = function () {
|
||
this.cache_ = {}, this.cacheSize_ = 0, this.maxCacheSize_ = 32
|
||
};
|
||
|
||
function Ka(t, e, i) {
|
||
return e + ":" + t + ":" + (i ? oo(i) : "null")
|
||
}
|
||
|
||
Za.prototype.clear = function () {
|
||
this.cache_ = {}, this.cacheSize_ = 0
|
||
}, Za.prototype.expire = function () {
|
||
if (this.cacheSize_ > this.maxCacheSize_) {
|
||
var t = 0;
|
||
for (var e in this.cache_) {
|
||
var i = this.cache_[e];
|
||
0 != (3 & t++) || i.hasListener() || (delete this.cache_[e], --this.cacheSize_)
|
||
}
|
||
}
|
||
}, Za.prototype.get = function (t, e, i) {
|
||
var r = Ka(t, e, i);
|
||
return r in this.cache_ ? this.cache_[r] : null
|
||
}, Za.prototype.set = function (t, e, i, r) {
|
||
var o = Ka(t, e, i);
|
||
this.cache_[o] = r, ++this.cacheSize_
|
||
}, Za.prototype.setSize = function (t) {
|
||
this.maxCacheSize_ = t, this.expire()
|
||
};
|
||
var Ja = Za, $a = new Za;
|
||
|
||
function Qa(t, e) {
|
||
$a.expire()
|
||
}
|
||
|
||
function tl(t, e) {
|
||
return t.zIndex - e.zIndex
|
||
}
|
||
|
||
var el = function (t) {
|
||
function e(e) {
|
||
t.call(this), this.map_ = e, this.layerRenderers_ = {}, this.layerRendererListeners_ = {}, this.layerRendererConstructors_ = []
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.dispatchRenderEvent = function (t, e) {
|
||
n()
|
||
}, e.prototype.registerLayerRenderers = function (t) {
|
||
this.layerRendererConstructors_.push.apply(this.layerRendererConstructors_, t)
|
||
}, e.prototype.calculateMatrices2D = function (t) {
|
||
var e = t.viewState, i = t.coordinateToPixelTransform, r = t.pixelToCoordinateTransform;
|
||
gi(i, t.size[0] / 2, t.size[1] / 2, 1 / e.resolution, -1 / e.resolution, -e.rotation, -e.center[0], -e.center[1]), mi(ui(r, i))
|
||
}, e.prototype.removeLayerRenderers = function () {
|
||
for (var t in this.layerRenderers_) this.removeLayerRendererByKey_(t).dispose()
|
||
}, e.prototype.forEachFeatureAtCoordinate = function (t, e, i, r, o, n, s) {
|
||
var l, h = e.viewState, u = h.resolution;
|
||
|
||
function c(t, i) {
|
||
var n = e.layerStates[a(i)].managed;
|
||
if (!(a(t) in e.skippedFeatureUids) || n) return r.call(o, t, n ? i : null)
|
||
}
|
||
|
||
var p = h.projection, d = t;
|
||
if (p.canWrapX()) {
|
||
var f = p.getExtent(), g = Ut(f), m = t[0];
|
||
if (m < f[0] || m > f[2]) d = [m + g * Math.ceil((f[0] - m) / g), t[1]]
|
||
}
|
||
var y, v = e.layerStatesArray;
|
||
for (y = v.length - 1; y >= 0; --y) {
|
||
var _ = v[y], x = _.layer;
|
||
if (Es(_, u) && n.call(s, x)) {
|
||
var w = this.getLayerRenderer(x), b = x.getSource();
|
||
if (b && (l = w.forEachFeatureAtCoordinate(b.getWrapX() ? d : t, e, i, c)), l) return l
|
||
}
|
||
}
|
||
}, e.prototype.forEachLayerAtPixel = function (t, e, i, r, o, s, a) {
|
||
return n()
|
||
}, e.prototype.hasFeatureAtCoordinate = function (t, e, i, r, o) {
|
||
return void 0 !== this.forEachFeatureAtCoordinate(t, e, i, P, this, r, o)
|
||
}, e.prototype.getLayerRenderer = function (t) {
|
||
var e = a(t);
|
||
if (e in this.layerRenderers_) return this.layerRenderers_[e];
|
||
for (var i, r = 0, o = this.layerRendererConstructors_.length; r < o; ++r) {
|
||
var n = this.layerRendererConstructors_[r];
|
||
if (n.handles(t)) {
|
||
i = n.create(this, t);
|
||
break
|
||
}
|
||
}
|
||
if (!i) throw new Error("Unable to create renderer for layer: " + t.getType());
|
||
return this.layerRenderers_[e] = i, this.layerRendererListeners_[e] = w(i, F.CHANGE, this.handleLayerRendererChange_, this), i
|
||
}, e.prototype.getLayerRendererByKey = function (t) {
|
||
return this.layerRenderers_[t]
|
||
}, e.prototype.getLayerRenderers = function () {
|
||
return this.layerRenderers_
|
||
}, e.prototype.getMap = function () {
|
||
return this.map_
|
||
}, e.prototype.handleLayerRendererChange_ = function () {
|
||
this.map_.render()
|
||
}, e.prototype.removeLayerRendererByKey_ = function (t) {
|
||
var e = this.layerRenderers_[t];
|
||
return delete this.layerRenderers_[t], S(this.layerRendererListeners_[t]), delete this.layerRendererListeners_[t], e
|
||
}, e.prototype.removeUnusedLayerRenderers_ = function (t, e) {
|
||
for (var i in this.layerRenderers_) e && i in e.layerStates || this.removeLayerRendererByKey_(i).dispose()
|
||
}, e.prototype.renderFrame = function (t) {
|
||
n()
|
||
}, e.prototype.scheduleExpireIconCache = function (t) {
|
||
t.postRenderFunctions.push(Qa)
|
||
}, e.prototype.scheduleRemoveUnusedLayerRenderers = function (t) {
|
||
for (var e in this.layerRenderers_) if (!(e in t.layerStates)) return void t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this))
|
||
}, e
|
||
}(R), il = [], rl = function (t) {
|
||
function e(e) {
|
||
t.call(this, e);
|
||
var i = e.getViewport();
|
||
this.context_ = Ao(), this.canvas_ = this.context_.canvas, this.canvas_.style.width = "100%", this.canvas_.style.height = "100%", this.canvas_.style.display = "block", this.canvas_.className = xs, i.insertBefore(this.canvas_, i.childNodes[0] || null), this.renderedVisible_ = !0, this.transform_ = [1, 0, 0, 1, 0, 0]
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.dispatchRenderEvent = function (t, e) {
|
||
var i = this.getMap(), r = this.context_;
|
||
if (i.hasListener(t)) {
|
||
var o = e.extent, n = e.pixelRatio, s = e.viewState.rotation, a = this.getTransform(e),
|
||
l = new qa(r, n, o, a, s), h = new Ta(t, l, e, r, null);
|
||
i.dispatchEvent(h)
|
||
}
|
||
}, e.prototype.getTransform = function (t) {
|
||
var e = t.viewState, i = this.canvas_.width / 2, r = this.canvas_.height / 2,
|
||
o = t.pixelRatio / e.resolution, n = -o, s = -e.rotation, a = -e.center[0], l = -e.center[1];
|
||
return gi(this.transform_, i, r, o, n, s, a, l)
|
||
}, e.prototype.renderFrame = function (t) {
|
||
if (t) {
|
||
var e = this.context_, i = t.pixelRatio, r = Math.round(t.size[0] * i),
|
||
o = Math.round(t.size[1] * i);
|
||
this.canvas_.width != r || this.canvas_.height != o ? (this.canvas_.width = r, this.canvas_.height = o) : e.clearRect(0, 0, r, o);
|
||
var n = t.viewState.rotation;
|
||
this.calculateMatrices2D(t), this.dispatchRenderEvent(eo.PRECOMPOSE, t);
|
||
var s = t.layerStatesArray;
|
||
rt(s, tl), n && (e.save(), Ba(e, n, r / 2, o / 2));
|
||
var a, l, h = t.viewState.resolution;
|
||
for (a = 0, l = s.length; a < l; ++a) {
|
||
var u = s[a], c = u.layer, p = this.getLayerRenderer(c);
|
||
Es(u, h) && u.sourceState == hs.READY && (p.prepareFrame(t, u) && p.composeFrame(t, u, e))
|
||
}
|
||
n && e.restore(), this.dispatchRenderEvent(eo.POSTCOMPOSE, t), this.renderedVisible_ || (this.canvas_.style.display = "", this.renderedVisible_ = !0), this.scheduleRemoveUnusedLayerRenderers(t), this.scheduleExpireIconCache(t)
|
||
} else this.renderedVisible_ && (this.canvas_.style.display = "none", this.renderedVisible_ = !1)
|
||
}, e.prototype.forEachLayerAtPixel = function (t, e, i, r, o, n, s) {
|
||
var a, l, h = e.viewState.resolution, u = e.layerStatesArray, c = u.length,
|
||
p = ci(e.pixelToCoordinateTransform, t.slice());
|
||
for (l = c - 1; l >= 0; --l) {
|
||
var d = u[l], f = d.layer;
|
||
if (Es(d, h) && n.call(s, f)) if (a = this.getLayerRenderer(f).forEachLayerAtCoordinate(p, e, i, r, o)) return a
|
||
}
|
||
}, e.prototype.registerLayerRenderers = function (e) {
|
||
t.prototype.registerLayerRenderers.call(this, e);
|
||
for (var i = 0, r = e.length; i < r; ++i) {
|
||
var o = e[i];
|
||
K(il, o) || il.push(o)
|
||
}
|
||
}, e
|
||
}(el), nl = function (t) {
|
||
function e(e) {
|
||
t.call(this), this.layer_ = e
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.createLoadedTileFinder = function (t, e, i) {
|
||
return function (r, o) {
|
||
return t.forEachLoadedTile(e, r, o, function (t) {
|
||
i[r] || (i[r] = {}), i[r][t.tileCoord.toString()] = t
|
||
})
|
||
}
|
||
}, e.prototype.forEachFeatureAtCoordinate = function (t, e, i, r) {
|
||
}, e.prototype.getLayer = function () {
|
||
return this.layer_
|
||
}, e.prototype.handleImageChange_ = function (t) {
|
||
t.target.getState() === So.LOADED && this.renderIfReadyAndVisible()
|
||
}, e.prototype.hasFeatureAtCoordinate = function (t, e) {
|
||
return !1
|
||
}, e.prototype.loadImage = function (t) {
|
||
var e = t.getState();
|
||
return e != So.LOADED && e != So.ERROR && w(t, F.CHANGE, this.handleImageChange_, this), e == So.IDLE && (t.load(), e = t.getState()), e == So.LOADED
|
||
}, e.prototype.renderIfReadyAndVisible = function () {
|
||
var t = this.getLayer();
|
||
t.getVisible() && t.getSourceState() == hs.READY && this.changed()
|
||
}, e.prototype.scheduleExpireCache = function (t, e) {
|
||
if (e.canExpireCache()) {
|
||
var i = function (t, e, i) {
|
||
var r = a(t);
|
||
r in i.usedTiles && t.expireCache(i.viewState.projection, i.usedTiles[r])
|
||
}.bind(null, e);
|
||
t.postRenderFunctions.push(i)
|
||
}
|
||
}, e.prototype.updateUsedTiles = function (t, e, i, r) {
|
||
var o = a(e), n = i.toString();
|
||
o in t ? n in t[o] ? t[o][n].extend(r) : t[o][n] = r : (t[o] = {}, t[o][n] = r)
|
||
}, e.prototype.manageTilePyramid = function (t, e, i, r, o, n, s, l, h, u) {
|
||
var c = a(e);
|
||
c in t.wantedTiles || (t.wantedTiles[c] = {});
|
||
var p, d, f, g, m, y, v = t.wantedTiles[c], _ = t.tileQueue;
|
||
for (y = i.getMinZoom(); y <= s; ++y) for (d = i.getTileRangeForExtentAndZ(n, y, d), f = i.getResolution(y), g = d.minX; g <= d.maxX; ++g) for (m = d.minY; m <= d.maxY; ++m) s - y <= l ? ((p = e.getTile(y, g, m, r, o)).getState() == Ro.IDLE && (v[p.getKey()] = !0, _.isKeyQueued(p.getKey()) || _.enqueue([p, c, i.getTileCoordCenter(p.tileCoord), f])), void 0 !== h && h.call(u, p)) : e.useTile(y, g, m, o)
|
||
}, e
|
||
}(D), sl = function (t) {
|
||
function e(e) {
|
||
t.call(this, e), this.renderedResolution, this.transform_ = [1, 0, 0, 1, 0, 0]
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.clip = function (t, e, i) {
|
||
var r = e.pixelRatio, o = e.size[0] * r, n = e.size[1] * r, s = e.viewState.rotation, a = jt(i),
|
||
l = zt(i), h = Mt(i), u = Ot(i);
|
||
ci(e.coordinateToPixelTransform, a), ci(e.coordinateToPixelTransform, l), ci(e.coordinateToPixelTransform, h), ci(e.coordinateToPixelTransform, u), t.save(), Ba(t, -s, o / 2, n / 2), t.beginPath(), t.moveTo(a[0] * r, a[1] * r), t.lineTo(l[0] * r, l[1] * r), t.lineTo(h[0] * r, h[1] * r), t.lineTo(u[0] * r, u[1] * r), t.clip(), Ba(t, s, o / 2, n / 2)
|
||
}, e.prototype.dispatchComposeEvent_ = function (t, e, i, r) {
|
||
var o = this.getLayer();
|
||
if (o.hasListener(t)) {
|
||
var n = i.size[0] * i.pixelRatio, s = i.size[1] * i.pixelRatio, a = i.viewState.rotation;
|
||
Ba(e, -a, n / 2, s / 2);
|
||
var l = void 0 !== r ? r : this.getTransform(i, 0),
|
||
h = new qa(e, i.pixelRatio, i.extent, l, i.viewState.rotation), u = new Ta(t, h, i, e, null);
|
||
o.dispatchEvent(u), Ba(e, a, n / 2, s / 2)
|
||
}
|
||
}, e.prototype.forEachLayerAtCoordinate = function (t, e, i, r, o) {
|
||
return this.forEachFeatureAtCoordinate(t, e, i, P) ? r.call(o, this.getLayer(), null) : void 0
|
||
}, e.prototype.postCompose = function (t, e, i, r) {
|
||
this.dispatchComposeEvent_(eo.POSTCOMPOSE, t, e, r)
|
||
}, e.prototype.preCompose = function (t, e, i) {
|
||
this.dispatchComposeEvent_(eo.PRECOMPOSE, t, e, i)
|
||
}, e.prototype.dispatchRenderEvent = function (t, e, i) {
|
||
this.dispatchComposeEvent_(eo.RENDER, t, e, i)
|
||
}, e.prototype.getTransform = function (t, e) {
|
||
var i = t.viewState, r = t.pixelRatio, o = r * t.size[0] / 2, n = r * t.size[1] / 2,
|
||
s = r / i.resolution, a = -s, l = -i.rotation, h = -i.center[0] + e, u = -i.center[1];
|
||
return gi(this.transform_, o, n, s, a, l, h, u)
|
||
}, e.prototype.composeFrame = function (t, e, i) {
|
||
n()
|
||
}, e.prototype.prepareFrame = function (t, e) {
|
||
return n()
|
||
}, e
|
||
}(nl), al = function (t) {
|
||
function e(e) {
|
||
t.call(this, e), this.coordinateToCanvasPixelTransform = [1, 0, 0, 1, 0, 0], this.hitCanvasContext_ = null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.composeFrame = function (t, e, i) {
|
||
this.preCompose(i, t);
|
||
var r = this.getImage();
|
||
if (r) {
|
||
var o = e.extent, n = void 0 !== o && !dt(o, t.extent) && Bt(o, t.extent);
|
||
n && this.clip(i, t, o);
|
||
var s = this.getImageTransform(), a = i.globalAlpha;
|
||
i.globalAlpha = e.opacity;
|
||
var l = s[4], h = s[5], u = r.width * s[0], c = r.height * s[3];
|
||
u >= .5 && c >= .5 && i.drawImage(r, 0, 0, +r.width, +r.height, Math.round(l), Math.round(h), Math.round(u), Math.round(c)), i.globalAlpha = a, n && i.restore()
|
||
}
|
||
this.postCompose(i, t, e)
|
||
}, e.prototype.getImage = function () {
|
||
return n()
|
||
}, e.prototype.getImageTransform = function () {
|
||
return n()
|
||
}, e.prototype.forEachLayerAtCoordinate = function (t, e, i, r, o) {
|
||
if (this.getImage()) {
|
||
var n = ci(this.coordinateToCanvasPixelTransform, t.slice());
|
||
Br(n, e.viewState.resolution / this.renderedResolution), this.hitCanvasContext_ || (this.hitCanvasContext_ = Ao(1, 1)), this.hitCanvasContext_.clearRect(0, 0, 1, 1), this.hitCanvasContext_.drawImage(this.getImage(), n[0], n[1], 1, 1, 0, 0, 1, 1);
|
||
var s = this.hitCanvasContext_.getImageData(0, 0, 1, 1).data;
|
||
return s[3] > 0 ? r.call(o, this.getLayer(), s) : void 0
|
||
}
|
||
}, e
|
||
}(sl), ll = function (t) {
|
||
function e(i) {
|
||
if (t.call(this, i), this.image_ = null, this.imageTransform_ = [1, 0, 0, 1, 0, 0], this.skippedFeatures_ = [], this.vectorRenderer_ = null, i.getType() === Vo.VECTOR) for (var r = 0, o = il.length; r < o; ++r) {
|
||
var n = il[r];
|
||
if (n !== e && n.handles(i)) {
|
||
this.vectorRenderer_ = new n(i);
|
||
break
|
||
}
|
||
}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.disposeInternal = function () {
|
||
this.vectorRenderer_ && this.vectorRenderer_.dispose(), t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.getImage = function () {
|
||
return this.image_ ? this.image_.getImage() : null
|
||
}, e.prototype.getImageTransform = function () {
|
||
return this.imageTransform_
|
||
}, e.prototype.prepareFrame = function (t, e) {
|
||
var i, r = t.pixelRatio, o = t.size, n = t.viewState, s = n.center, a = n.resolution,
|
||
l = this.getLayer().getSource(), h = t.viewHints, u = this.vectorRenderer_, c = t.extent;
|
||
if (u || void 0 === e.extent || (c = Dt(c, e.extent)), !h[$n.ANIMATING] && !h[$n.INTERACTING] && !Vt(c)) {
|
||
var d = n.projection, f = this.skippedFeatures_;
|
||
if (u) {
|
||
var g = u.context,
|
||
m = p({}, t, {size: [Ut(c) / a, Nt(c) / a], viewState: p({}, t.viewState, {rotation: 0})}),
|
||
y = Object.keys(m.skippedFeatureUids).sort();
|
||
i = new To(c, a, r, g.canvas, function (t) {
|
||
!u.prepareFrame(m, e) || !u.replayGroupChanged && it(f, y) || (g.canvas.width = m.size[0] * r, g.canvas.height = m.size[1] * r, u.compose(g, m, e), f = y, t())
|
||
})
|
||
} else i = l.getImage(c, a, r, d);
|
||
i && this.loadImage(i) && (this.image_ = i, this.skippedFeatures_ = f)
|
||
}
|
||
if (this.image_) {
|
||
var v = (i = this.image_).getExtent(), _ = i.getResolution(), x = i.getPixelRatio(),
|
||
w = r * _ / (a * x),
|
||
b = gi(this.imageTransform_, r * o[0] / 2, r * o[1] / 2, w, w, 0, x * (v[0] - s[0]) / _, x * (s[1] - v[3]) / _);
|
||
gi(this.coordinateToCanvasPixelTransform, r * o[0] / 2 - b[4], r * o[1] / 2 - b[5], r / a, -r / a, 0, -s[0], -s[1]), this.renderedResolution = _ * r / x
|
||
}
|
||
return !!this.image_
|
||
}, e.prototype.forEachFeatureAtCoordinate = function (e, i, r, o) {
|
||
return this.vectorRenderer_ ? this.vectorRenderer_.forEachFeatureAtCoordinate(e, i, r, o) : t.prototype.forEachFeatureAtCoordinate.call(this, e, i, r, o)
|
||
}, e
|
||
}(al);
|
||
ll.handles = function (t) {
|
||
return t.getType() === Vo.IMAGE || t.getType() === Vo.VECTOR && t.getRenderMode() === Ea.IMAGE
|
||
}, ll.create = function (t, e) {
|
||
return new ll(e)
|
||
};
|
||
var hl = ll, ul = function (t, e, i, r) {
|
||
this.minX = t, this.maxX = e, this.minY = i, this.maxY = r
|
||
};
|
||
|
||
function cl(t, e, i, r, o) {
|
||
return void 0 !== o ? (o.minX = t, o.maxX = e, o.minY = i, o.maxY = r, o) : new ul(t, e, i, r)
|
||
}
|
||
|
||
ul.prototype.contains = function (t) {
|
||
return this.containsXY(t[1], t[2])
|
||
}, ul.prototype.containsTileRange = function (t) {
|
||
return this.minX <= t.minX && t.maxX <= this.maxX && this.minY <= t.minY && t.maxY <= this.maxY
|
||
}, ul.prototype.containsXY = function (t, e) {
|
||
return this.minX <= t && t <= this.maxX && this.minY <= e && e <= this.maxY
|
||
}, ul.prototype.equals = function (t) {
|
||
return this.minX == t.minX && this.minY == t.minY && this.maxX == t.maxX && this.maxY == t.maxY
|
||
}, ul.prototype.extend = function (t) {
|
||
t.minX < this.minX && (this.minX = t.minX), t.maxX > this.maxX && (this.maxX = t.maxX), t.minY < this.minY && (this.minY = t.minY), t.maxY > this.maxY && (this.maxY = t.maxY)
|
||
}, ul.prototype.getHeight = function () {
|
||
return this.maxY - this.minY + 1
|
||
}, ul.prototype.getSize = function () {
|
||
return [this.getWidth(), this.getHeight()]
|
||
}, ul.prototype.getWidth = function () {
|
||
return this.maxX - this.minX + 1
|
||
}, ul.prototype.intersects = function (t) {
|
||
return this.minX <= t.maxX && this.maxX >= t.minX && this.minY <= t.maxY && this.maxY >= t.minY
|
||
};
|
||
var pl = ul, dl = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e), this.context = i ? null : Ao(), this.oversampling_, this.renderedExtent_ = null, this.renderedRevision, this.renderedTiles = [], this.newTiles_ = !1, this.tmpExtent = [1 / 0, 1 / 0, -1 / 0, -1 / 0], this.tmpTileRange_ = new pl(0, 0, 0, 0), this.imageTransform_ = [1, 0, 0, 1, 0, 0], this.zDirection = 0
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.isDrawableTile_ = function (t) {
|
||
var e = this.getLayer(), i = t.getState(), r = e.getUseInterimTilesOnError();
|
||
return i == Ro.LOADED || i == Ro.EMPTY || i == Ro.ERROR && !r
|
||
}, e.prototype.getTile = function (t, e, i, r, o) {
|
||
var n = this.getLayer(), s = n.getSource().getTile(t, e, i, r, o);
|
||
return s.getState() == Ro.ERROR && (n.getUseInterimTilesOnError() ? n.getPreload() > 0 && (this.newTiles_ = !0) : s.setState(Ro.LOADED)), this.isDrawableTile_(s) || (s = s.getInterimTile()), s
|
||
}, e.prototype.prepareFrame = function (t, e) {
|
||
var i = t.pixelRatio, r = t.size, o = t.viewState, n = o.projection, s = o.resolution, l = o.center,
|
||
h = this.getLayer(), u = h.getSource(), c = u.getRevision(), p = u.getTileGridForProjection(n),
|
||
d = p.getZForResolution(s, this.zDirection), f = p.getResolution(d), g = Math.round(s / f) || 1,
|
||
m = t.extent;
|
||
if (void 0 !== e.extent && (m = Dt(m, e.extent)), Vt(m)) return !1;
|
||
var y = p.getTileRangeForExtentAndZ(m, d), v = p.getTileRangeExtent(d, y), _ = u.getTilePixelRatio(i),
|
||
x = {};
|
||
x[d] = {};
|
||
var w, b, C, S = this.createLoadedTileFinder(u, n, x), E = t.viewHints,
|
||
T = E[$n.ANIMATING] || E[$n.INTERACTING], R = this.tmpExtent, P = this.tmpTileRange_;
|
||
for (this.newTiles_ = !1, b = y.minX; b <= y.maxX; ++b) for (C = y.minY; C <= y.maxY; ++C) if (!(Date.now() - t.time > 16 && T)) {
|
||
if (w = this.getTile(d, b, C, i, n), this.isDrawableTile_(w)) {
|
||
var L = a(this);
|
||
if (w.getState() == Ro.LOADED) {
|
||
x[d][w.tileCoord.toString()] = w;
|
||
var I = w.inTransition(L);
|
||
this.newTiles_ || !I && -1 !== this.renderedTiles.indexOf(w) || (this.newTiles_ = !0)
|
||
}
|
||
if (1 === w.getAlpha(L, t.time)) continue
|
||
}
|
||
var O = p.getTileCoordChildTileRange(w.tileCoord, P, R), M = !1;
|
||
O && (M = S(d + 1, O)), M || p.forEachTileCoordParentTileRange(w.tileCoord, S, null, P, R)
|
||
}
|
||
var A = f * i / _ * g;
|
||
if (!(this.renderedResolution && Date.now() - t.time > 16 && T) && (this.newTiles_ || !this.renderedExtent_ || !dt(this.renderedExtent_, m) || this.renderedRevision != c || g != this.oversampling_ || !T && A != this.renderedResolution)) {
|
||
var k = this.context;
|
||
if (k) {
|
||
var F = u.getTilePixelSize(d, i, n), N = Math.round(y.getWidth() * F[0] / g),
|
||
D = Math.round(y.getHeight() * F[1] / g), G = k.canvas;
|
||
G.width != N || G.height != D ? (this.oversampling_ = g, G.width = N, G.height = D) : ((this.renderedExtent_ && !bt(v, this.renderedExtent_) || this.renderedRevision != c) && k.clearRect(0, 0, N, D), g = this.oversampling_)
|
||
}
|
||
this.renderedTiles.length = 0;
|
||
var j, z, U, B, V, Y, W, H, X, q, Z = Object.keys(x).map(Number);
|
||
for (Z.sort(function (t, e) {
|
||
return t === d ? 1 : e === d ? -1 : t > e ? 1 : t < e ? -1 : 0
|
||
}), B = 0, V = Z.length; B < V; ++B) for (var K in U = Z[B], z = u.getTilePixelSize(U, i, n), j = p.getResolution(U) / f, W = _ * u.getGutterForProjection(n), H = x[U]) w = H[K], b = ((Y = p.getTileCoordExtent(w.getTileCoord(), R))[0] - v[0]) / f * _ / g, C = (v[3] - Y[3]) / f * _ / g, X = z[0] * j / g, q = z[1] * j / g, this.drawTileImage(w, t, e, b, C, X, q, W, d === U), this.renderedTiles.push(w);
|
||
this.renderedRevision = c, this.renderedResolution = f * i / _ * g, this.renderedExtent_ = v
|
||
}
|
||
var J = this.renderedResolution / s,
|
||
$ = gi(this.imageTransform_, i * r[0] / 2, i * r[1] / 2, J, J, 0, (this.renderedExtent_[0] - l[0]) / this.renderedResolution * i, (l[1] - this.renderedExtent_[3]) / this.renderedResolution * i);
|
||
return gi(this.coordinateToCanvasPixelTransform, i * r[0] / 2 - $[4], i * r[1] / 2 - $[5], i / s, -i / s, 0, -l[0], -l[1]), this.updateUsedTiles(t.usedTiles, u, d, y), this.manageTilePyramid(t, u, p, i, n, m, d, h.getPreload()), this.scheduleExpireCache(t, u), this.renderedTiles.length > 0
|
||
}, e.prototype.drawTileImage = function (t, e, i, r, o, n, s, l, h) {
|
||
var u = this.getTileImage(t);
|
||
if (u) {
|
||
var c = a(this), p = h ? t.getAlpha(c, e.time) : 1, d = this.getLayer().getSource();
|
||
1 !== p || d.getOpaque(e.viewState.projection) || this.context.clearRect(r, o, n, s);
|
||
var f = p !== this.context.globalAlpha;
|
||
f && (this.context.save(), this.context.globalAlpha = p), this.context.drawImage(u, l, l, u.width - 2 * l, u.height - 2 * l, r, o, n, s), f && this.context.restore(), 1 !== p ? e.animate = !0 : h && t.endTransition(c)
|
||
}
|
||
}, e.prototype.getImage = function () {
|
||
var t = this.context;
|
||
return t ? t.canvas : null
|
||
}, e.prototype.getImageTransform = function () {
|
||
return this.imageTransform_
|
||
}, e.prototype.getTileImage = function (t) {
|
||
return t.getImage()
|
||
}, e
|
||
}(al);
|
||
dl.handles = function (t) {
|
||
return t.getType() === Vo.TILE
|
||
}, dl.create = function (t, e) {
|
||
return new dl(e)
|
||
}, dl.prototype.getLayer;
|
||
var fl = dl, gl = i(3), ml = i.n(gl), yl = function () {
|
||
};
|
||
yl.prototype.getReplay = function (t, e) {
|
||
return n()
|
||
}, yl.prototype.isEmpty = function () {
|
||
return n()
|
||
}, yl.prototype.addDeclutter = function (t) {
|
||
return n()
|
||
};
|
||
var vl = yl, _l = {
|
||
CIRCLE: "Circle",
|
||
DEFAULT: "Default",
|
||
IMAGE: "Image",
|
||
LINE_STRING: "LineString",
|
||
POLYGON: "Polygon",
|
||
TEXT: "Text"
|
||
};
|
||
|
||
function xl(t, e, i, r, o, n, s, a) {
|
||
for (var l, h, u, c = [], p = t[e] > t[i - r], d = o.length, f = t[e], g = t[e + 1], m = t[e += r], y = t[e + 1], v = 0, _ = Math.sqrt(Math.pow(m - f, 2) + Math.pow(y - g, 2)), x = "", w = 0, b = 0; b < d; ++b) {
|
||
h = p ? d - b - 1 : b;
|
||
var C = o.charAt(h), S = n(x = p ? C + x : x + C) - w;
|
||
w += S;
|
||
for (var E = s + S / 2; e < i - r && v + _ < E;) f = m, g = y, m = t[e += r], y = t[e + 1], v += _, _ = Math.sqrt(Math.pow(m - f, 2) + Math.pow(y - g, 2));
|
||
var T = E - v, R = Math.atan2(y - g, m - f);
|
||
if (p && (R += R > 0 ? -Math.PI : Math.PI), void 0 !== u) {
|
||
var P = R - u;
|
||
if (P += P > Math.PI ? -2 * Math.PI : P < -Math.PI ? 2 * Math.PI : 0, Math.abs(P) > a) return null
|
||
}
|
||
var L = T / _, I = he(f, m, L), O = he(g, y, L);
|
||
u == R ? (p && (l[0] = I, l[1] = O, l[2] = S / 2), l[4] = x) : (w = S, l = [I, O, S / 2, R, x = C], p ? c.unshift(l) : c.push(l), u = R), s += S
|
||
}
|
||
return c
|
||
}
|
||
|
||
var wl = {
|
||
BEGIN_GEOMETRY: 0,
|
||
BEGIN_PATH: 1,
|
||
CIRCLE: 2,
|
||
CLOSE_PATH: 3,
|
||
CUSTOM: 4,
|
||
DRAW_CHARS: 5,
|
||
DRAW_IMAGE: 6,
|
||
END_GEOMETRY: 7,
|
||
FILL: 8,
|
||
MOVE_TO_LINE_TO: 9,
|
||
SET_FILL_STYLE: 10,
|
||
SET_STROKE_STYLE: 11,
|
||
STROKE: 12
|
||
}, bl = [wl.FILL], Cl = [wl.STROKE], Sl = [wl.BEGIN_PATH], El = [wl.CLOSE_PATH], Tl = wl,
|
||
Rl = [_l.POLYGON, _l.CIRCLE, _l.LINE_STRING, _l.IMAGE, _l.TEXT, _l.DEFAULT], Pl = {
|
||
left: 0,
|
||
end: 0,
|
||
center: .5,
|
||
right: 1,
|
||
start: 1,
|
||
top: 0,
|
||
middle: .5,
|
||
hanging: .2,
|
||
alphabetic: .8,
|
||
ideographic: .8,
|
||
bottom: 1
|
||
}, Ll = [1 / 0, 1 / 0, -1 / 0, -1 / 0], Il = [1, 0, 0, 1, 0, 0], Ol = function (t) {
|
||
function e(e, i, r, o, n, s) {
|
||
t.call(this), this.declutterTree = s, this.tolerance = e, this.maxExtent = i, this.overlaps = n, this.pixelRatio = o, this.maxLineWidth = 0, this.resolution = r, this.alignFill_, this.beginGeometryInstruction1_ = null, this.beginGeometryInstruction2_ = null, this.bufferedMaxExtent_ = null, this.instructions = [], this.coordinates = [], this.coordinateCache_ = {}, this.renderedTransform_ = [1, 0, 0, 1, 0, 0], this.hitDetectionInstructions = [], this.pixelCoordinates_ = null, this.state = {}, this.viewRotation_ = 0
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.replayTextBackground_ = function (t, e, i, r, o, n, s) {
|
||
t.beginPath(), t.moveTo.apply(t, e), t.lineTo.apply(t, i), t.lineTo.apply(t, r), t.lineTo.apply(t, o), t.lineTo.apply(t, e), n && (this.alignFill_ = n[2], this.fill_(t)), s && (this.setStrokeStyle_(t, s), t.stroke())
|
||
}, e.prototype.replayImage_ = function (t, e, i, r, o, n, s, a, l, h, u, c, p, d, f, g, m, y) {
|
||
var v = m || y;
|
||
e -= o *= p, i -= n *= p;
|
||
var _, x, w, b, C = f + h > r.width ? r.width - h : f, S = a + u > r.height ? r.height - u : a,
|
||
E = g[3] + C * p + g[1], T = g[0] + S * p + g[2], R = e - g[3], P = i - g[0];
|
||
(v || 0 !== c) && (_ = [R, P], x = [R + E, P], w = [R + E, P + T], b = [R, P + T]);
|
||
var L = null;
|
||
if (0 !== c) {
|
||
var I = e + o, O = i + n;
|
||
L = gi(Il, I, O, 1, 1, c, -I, -O), vt(Ll), St(Ll, ci(Il, _)), St(Ll, ci(Il, x)), St(Ll, ci(Il, w)), St(Ll, ci(Il, b))
|
||
} else yt(R, P, R + E, P + T, Ll);
|
||
var M = t.canvas, A = y ? y[2] * p / 2 : 0,
|
||
k = Ll[0] - A <= M.width && Ll[2] + A >= 0 && Ll[1] - A <= M.height && Ll[3] + A >= 0;
|
||
if (d && (e = Math.round(e), i = Math.round(i)), s) {
|
||
if (!k && 1 == s[4]) return;
|
||
Ct(s, Ll);
|
||
var F = k ? [t, L ? L.slice(0) : null, l, r, h, u, C, S, e, i, p] : null;
|
||
F && v && F.push(m, y, _, x, w, b), s.push(F)
|
||
} else k && (v && this.replayTextBackground_(t, _, x, w, b, m, y), Ya(t, L, l, r, h, u, C, S, e, i, p))
|
||
}, e.prototype.applyPixelRatio = function (t) {
|
||
var e = this.pixelRatio;
|
||
return 1 == e ? t : t.map(function (t) {
|
||
return t * e
|
||
})
|
||
}, e.prototype.appendFlatCoordinates = function (t, e, i, r, o, n) {
|
||
var s = this.coordinates.length, a = this.getBufferedMaxExtent();
|
||
n && (e += r);
|
||
var l, h, u, c = [t[e], t[e + 1]], p = [NaN, NaN], d = !0;
|
||
for (l = e + r; l < i; l += r) p[0] = t[l], p[1] = t[l + 1], (u = gt(a, p)) !== h ? (d && (this.coordinates[s++] = c[0], this.coordinates[s++] = c[1]), this.coordinates[s++] = p[0], this.coordinates[s++] = p[1], d = !1) : u === at.INTERSECTING ? (this.coordinates[s++] = p[0], this.coordinates[s++] = p[1], d = !1) : d = !0, c[0] = p[0], c[1] = p[1], h = u;
|
||
return (o && d || l === e + r) && (this.coordinates[s++] = c[0], this.coordinates[s++] = c[1]), s
|
||
}, e.prototype.drawCustomCoordinates_ = function (t, e, i, r, o) {
|
||
for (var n = 0, s = i.length; n < s; ++n) {
|
||
var a = i[n], l = this.appendFlatCoordinates(t, e, a, r, !1, !1);
|
||
o.push(l), e = a
|
||
}
|
||
return e
|
||
}, e.prototype.drawCustom = function (t, e, i) {
|
||
this.beginGeometry(t, e);
|
||
var r, o, n, s, a, l = t.getType(), h = t.getStride(), u = this.coordinates.length;
|
||
if (l == Zt.MULTI_POLYGON) {
|
||
r = (t = t).getOrientedFlatCoordinates(), s = [];
|
||
var c = t.getEndss();
|
||
a = 0;
|
||
for (var p = 0, d = c.length; p < d; ++p) {
|
||
var f = [];
|
||
a = this.drawCustomCoordinates_(r, a, c[p], h, f), s.push(f)
|
||
}
|
||
this.instructions.push([Tl.CUSTOM, u, s, t, i, ji])
|
||
} else l == Zt.POLYGON || l == Zt.MULTI_LINE_STRING ? (n = [], r = l == Zt.POLYGON ? t.getOrientedFlatCoordinates() : t.getFlatCoordinates(), a = this.drawCustomCoordinates_(r, 0, t.getEnds(), h, n), this.instructions.push([Tl.CUSTOM, u, n, t, i, Gi])) : l == Zt.LINE_STRING || l == Zt.MULTI_POINT ? (r = t.getFlatCoordinates(), o = this.appendFlatCoordinates(r, 0, r.length, h, !1, !1), this.instructions.push([Tl.CUSTOM, u, o, t, i, Di])) : l == Zt.POINT && (r = t.getFlatCoordinates(), this.coordinates.push(r[0], r[1]), o = this.coordinates.length, this.instructions.push([Tl.CUSTOM, u, o, t, i]));
|
||
this.endGeometry(t, e)
|
||
}, e.prototype.beginGeometry = function (t, e) {
|
||
this.beginGeometryInstruction1_ = [Tl.BEGIN_GEOMETRY, e, 0], this.instructions.push(this.beginGeometryInstruction1_), this.beginGeometryInstruction2_ = [Tl.BEGIN_GEOMETRY, e, 0], this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)
|
||
}, e.prototype.finish = function () {
|
||
}, e.prototype.fill_ = function (t) {
|
||
if (this.alignFill_) {
|
||
var e = ci(this.renderedTransform_, [0, 0]), i = 512 * this.pixelRatio;
|
||
t.translate(e[0] % i, e[1] % i), t.rotate(this.viewRotation_)
|
||
}
|
||
t.fill(), this.alignFill_ && t.setTransform.apply(t, Va)
|
||
}, e.prototype.setStrokeStyle_ = function (t, e) {
|
||
t.strokeStyle = e[1], t.lineWidth = e[2], t.lineCap = e[3], t.lineJoin = e[4], t.miterLimit = e[5], Er && (t.lineDashOffset = e[7], t.setLineDash(e[6]))
|
||
}, e.prototype.renderDeclutter_ = function (t, e) {
|
||
if (t && t.length > 5) {
|
||
var i = t[4];
|
||
if (1 == i || i == t.length - 5) {
|
||
var r = {minX: t[0], minY: t[1], maxX: t[2], maxY: t[3], value: e};
|
||
if (!this.declutterTree.collides(r)) {
|
||
this.declutterTree.insert(r);
|
||
for (var o = 5, n = t.length; o < n; ++o) {
|
||
var s = t[o];
|
||
s && (s.length > 11 && this.replayTextBackground_(s[0], s[13], s[14], s[15], s[16], s[11], s[12]), Ya.apply(void 0, s))
|
||
}
|
||
}
|
||
t.length = 5, vt(t)
|
||
}
|
||
}
|
||
}, e.prototype.replay_ = function (t, e, i, r, o, n, s) {
|
||
var l;
|
||
this.pixelCoordinates_ && it(e, this.renderedTransform_) ? l = this.pixelCoordinates_ : (this.pixelCoordinates_ || (this.pixelCoordinates_ = []), l = Kt(this.coordinates, 0, this.coordinates.length, 2, e, this.pixelCoordinates_), ui(this.renderedTransform_, e));
|
||
for (var h, u, c, p, d, f, m, y, v, _, x, w, b = !g(i), C = 0, S = r.length, E = 0, T = 0, R = 0, P = null, L = null, I = this.coordinateCache_, O = this.viewRotation_, M = {
|
||
context: t,
|
||
pixelRatio: this.pixelRatio,
|
||
resolution: this.resolution,
|
||
rotation: O
|
||
}, A = this.instructions != r || this.overlaps ? 0 : 200; C < S;) {
|
||
var k = r[C];
|
||
switch (k[0]) {
|
||
case Tl.BEGIN_GEOMETRY:
|
||
_ = k[1], b && i[a(_)] || !_.getGeometry() ? C = k[2] : void 0 === s || Bt(s, _.getGeometry().getExtent()) ? ++C : C = k[2] + 1;
|
||
break;
|
||
case Tl.BEGIN_PATH:
|
||
T > A && (this.fill_(t), T = 0), R > A && (t.stroke(), R = 0), T || R || (t.beginPath(), p = d = NaN), ++C;
|
||
break;
|
||
case Tl.CIRCLE:
|
||
var F = l[E = k[1]], N = l[E + 1], D = l[E + 2] - F, G = l[E + 3] - N,
|
||
j = Math.sqrt(D * D + G * G);
|
||
t.moveTo(F + j, N), t.arc(F, N, j, 0, 2 * Math.PI, !0), ++C;
|
||
break;
|
||
case Tl.CLOSE_PATH:
|
||
t.closePath(), ++C;
|
||
break;
|
||
case Tl.CUSTOM:
|
||
E = k[1], h = k[2];
|
||
var z = k[3], U = k[4], B = 6 == k.length ? k[5] : void 0;
|
||
M.geometry = z, M.feature = _, C in I || (I[C] = []);
|
||
var V = I[C];
|
||
B ? B(l, E, h, 2, V) : (V[0] = l[E], V[1] = l[E + 1], V.length = 2), U(V, M), ++C;
|
||
break;
|
||
case Tl.DRAW_IMAGE:
|
||
E = k[1], h = k[2], v = k[3], u = k[4], c = k[5], y = n ? null : k[6];
|
||
var Y = k[7], W = k[8], H = k[9], X = k[10], q = k[11], Z = k[12], K = k[13], J = k[14],
|
||
$ = void 0, Q = void 0, tt = void 0;
|
||
for (k.length > 16 ? ($ = k[15], Q = k[16], tt = k[17]) : ($ = Oa, Q = tt = !1), q && (Z += O); E < h; E += 2) this.replayImage_(t, l[E], l[E + 1], v, u, c, y, Y, W, H, X, Z, K, o, J, $, Q ? P : null, tt ? L : null);
|
||
this.renderDeclutter_(y, _), ++C;
|
||
break;
|
||
case Tl.DRAW_CHARS:
|
||
var et = k[1], rt = k[2], ot = k[3];
|
||
y = n ? null : k[4];
|
||
var nt = k[5], st = k[6], at = k[7], lt = k[8], ht = k[9], ut = k[10], ct = k[11],
|
||
pt = k[12], dt = k[13], ft = k[14], gt = Kr(l, et, rt, 2), mt = lt(pt);
|
||
if (nt || mt <= gt) {
|
||
var yt = this.textStates[dt].textAlign,
|
||
vt = xl(l, et, rt, 2, pt, lt, (gt - mt) * Pl[yt], at);
|
||
if (vt) {
|
||
var _t = void 0, xt = void 0, wt = void 0, bt = void 0, Ct = void 0;
|
||
if (ut) for (_t = 0, xt = vt.length; _t < xt; ++_t) wt = (Ct = vt[_t])[4], bt = this.getImage(wt, dt, "", ut), u = Ct[2] + ct, c = ot * bt.height + 2 * (.5 - ot) * ct - ht, this.replayImage_(t, Ct[0], Ct[1], bt, u, c, y, bt.height, 1, 0, 0, Ct[3], ft, !1, bt.width, Oa, null, null);
|
||
if (st) for (_t = 0, xt = vt.length; _t < xt; ++_t) wt = (Ct = vt[_t])[4], bt = this.getImage(wt, dt, st, ""), u = Ct[2], c = ot * bt.height - ht, this.replayImage_(t, Ct[0], Ct[1], bt, u, c, y, bt.height, 1, 0, 0, Ct[3], ft, !1, bt.width, Oa, null, null)
|
||
}
|
||
}
|
||
this.renderDeclutter_(y, _), ++C;
|
||
break;
|
||
case Tl.END_GEOMETRY:
|
||
if (void 0 !== n) {
|
||
var St = n(_ = k[1]);
|
||
if (St) return St
|
||
}
|
||
++C;
|
||
break;
|
||
case Tl.FILL:
|
||
A ? T++ : this.fill_(t), ++C;
|
||
break;
|
||
case Tl.MOVE_TO_LINE_TO:
|
||
for (E = k[1], h = k[2], x = l[E], m = (w = l[E + 1]) + .5 | 0, (f = x + .5 | 0) === p && m === d || (t.moveTo(x, w), p = f, d = m), E += 2; E < h; E += 2) f = (x = l[E]) + .5 | 0, m = (w = l[E + 1]) + .5 | 0, E != h - 2 && f === p && m === d || (t.lineTo(x, w), p = f, d = m);
|
||
++C;
|
||
break;
|
||
case Tl.SET_FILL_STYLE:
|
||
P = k, this.alignFill_ = k[2], T && (this.fill_(t), T = 0, R && (t.stroke(), R = 0)), t.fillStyle = k[1], ++C;
|
||
break;
|
||
case Tl.SET_STROKE_STYLE:
|
||
L = k, R && (t.stroke(), R = 0), this.setStrokeStyle_(t, k), ++C;
|
||
break;
|
||
case Tl.STROKE:
|
||
A ? R++ : t.stroke(), ++C;
|
||
break;
|
||
default:
|
||
++C
|
||
}
|
||
}
|
||
T && this.fill_(t), R && t.stroke()
|
||
}, e.prototype.replay = function (t, e, i, r, o) {
|
||
this.viewRotation_ = i, this.replay_(t, e, r, this.instructions, o, void 0, void 0)
|
||
}, e.prototype.replayHitDetection = function (t, e, i, r, o, n) {
|
||
return this.viewRotation_ = i, this.replay_(t, e, r, this.hitDetectionInstructions, !0, o, n)
|
||
}, e.prototype.reverseHitDetectionInstructions = function () {
|
||
var t, e = this.hitDetectionInstructions;
|
||
e.reverse();
|
||
var i, r, o = e.length, n = -1;
|
||
for (t = 0; t < o; ++t) (r = (i = e[t])[0]) == Tl.END_GEOMETRY ? n = t : r == Tl.BEGIN_GEOMETRY && (i[2] = t, $(this.hitDetectionInstructions, n, t), n = -1)
|
||
}, e.prototype.setFillStrokeStyle = function (t, e) {
|
||
var i = this.state;
|
||
if (t) {
|
||
var r = t.getColor();
|
||
i.fillStyle = Wa(r || Pa)
|
||
} else i.fillStyle = void 0;
|
||
if (e) {
|
||
var o = e.getColor();
|
||
i.strokeStyle = Wa(o || Ia);
|
||
var n = e.getLineCap();
|
||
i.lineCap = void 0 !== n ? n : "round";
|
||
var s = e.getLineDash();
|
||
i.lineDash = s ? s.slice() : La;
|
||
var a = e.getLineDashOffset();
|
||
i.lineDashOffset = a || 0;
|
||
var l = e.getLineJoin();
|
||
i.lineJoin = void 0 !== l ? l : "round";
|
||
var h = e.getWidth();
|
||
i.lineWidth = void 0 !== h ? h : 1;
|
||
var u = e.getMiterLimit();
|
||
i.miterLimit = void 0 !== u ? u : 10, i.lineWidth > this.maxLineWidth && (this.maxLineWidth = i.lineWidth, this.bufferedMaxExtent_ = null)
|
||
} else i.strokeStyle = void 0, i.lineCap = void 0, i.lineDash = null, i.lineDashOffset = void 0, i.lineJoin = void 0, i.lineWidth = void 0, i.miterLimit = void 0
|
||
}, e.prototype.createFill = function (t, e) {
|
||
var i = t.fillStyle, r = [Tl.SET_FILL_STYLE, i];
|
||
return "string" != typeof i && r.push(!0), r
|
||
}, e.prototype.applyStroke = function (t) {
|
||
this.instructions.push(this.createStroke(t))
|
||
}, e.prototype.createStroke = function (t) {
|
||
return [Tl.SET_STROKE_STYLE, t.strokeStyle, t.lineWidth * this.pixelRatio, t.lineCap, t.lineJoin, t.miterLimit, this.applyPixelRatio(t.lineDash), t.lineDashOffset * this.pixelRatio]
|
||
}, e.prototype.updateFillStyle = function (t, e, i) {
|
||
var r = t.fillStyle;
|
||
"string" == typeof r && t.currentFillStyle == r || (void 0 !== r && this.instructions.push(e.call(this, t, i)), t.currentFillStyle = r)
|
||
}, e.prototype.updateStrokeStyle = function (t, e) {
|
||
var i = t.strokeStyle, r = t.lineCap, o = t.lineDash, n = t.lineDashOffset, s = t.lineJoin,
|
||
a = t.lineWidth, l = t.miterLimit;
|
||
(t.currentStrokeStyle != i || t.currentLineCap != r || o != t.currentLineDash && !it(t.currentLineDash, o) || t.currentLineDashOffset != n || t.currentLineJoin != s || t.currentLineWidth != a || t.currentMiterLimit != l) && (void 0 !== i && e.call(this, t), t.currentStrokeStyle = i, t.currentLineCap = r, t.currentLineDash = o, t.currentLineDashOffset = n, t.currentLineJoin = s, t.currentLineWidth = a, t.currentMiterLimit = l)
|
||
}, e.prototype.endGeometry = function (t, e) {
|
||
this.beginGeometryInstruction1_[2] = this.instructions.length, this.beginGeometryInstruction1_ = null, this.beginGeometryInstruction2_[2] = this.hitDetectionInstructions.length, this.beginGeometryInstruction2_ = null;
|
||
var i = [Tl.END_GEOMETRY, e];
|
||
this.instructions.push(i), this.hitDetectionInstructions.push(i)
|
||
}, e.prototype.getBufferedMaxExtent = function () {
|
||
if (!this.bufferedMaxExtent_ && (this.bufferedMaxExtent_ = ut(this.maxExtent), this.maxLineWidth > 0)) {
|
||
var t = this.resolution * (this.maxLineWidth + 1) / 2;
|
||
ht(this.bufferedMaxExtent_, t, this.bufferedMaxExtent_)
|
||
}
|
||
return this.bufferedMaxExtent_
|
||
}, e
|
||
}(Xa), Ml = function (t) {
|
||
function e(e, i, r, o, n, s) {
|
||
t.call(this, e, i, r, o, n, s), this.declutterGroup_ = null, this.hitDetectionImage_ = null, this.image_ = null, this.anchorX_ = void 0, this.anchorY_ = void 0, this.height_ = void 0, this.opacity_ = void 0, this.originX_ = void 0, this.originY_ = void 0, this.rotateWithView_ = void 0, this.rotation_ = void 0, this.scale_ = void 0, this.width_ = void 0
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.drawCoordinates_ = function (t, e, i, r) {
|
||
return this.appendFlatCoordinates(t, e, i, r, !1, !1)
|
||
}, e.prototype.drawPoint = function (t, e) {
|
||
if (this.image_) {
|
||
this.beginGeometry(t, e);
|
||
var i = t.getFlatCoordinates(), r = t.getStride(), o = this.coordinates.length,
|
||
n = this.drawCoordinates_(i, 0, i.length, r);
|
||
this.instructions.push([Tl.DRAW_IMAGE, o, n, this.image_, this.anchorX_, this.anchorY_, this.declutterGroup_, this.height_, this.opacity_, this.originX_, this.originY_, this.rotateWithView_, this.rotation_, this.scale_ * this.pixelRatio, this.width_]), this.hitDetectionInstructions.push([Tl.DRAW_IMAGE, o, n, this.hitDetectionImage_, this.anchorX_, this.anchorY_, this.declutterGroup_, this.height_, this.opacity_, this.originX_, this.originY_, this.rotateWithView_, this.rotation_, this.scale_, this.width_]), this.endGeometry(t, e)
|
||
}
|
||
}, e.prototype.drawMultiPoint = function (t, e) {
|
||
if (this.image_) {
|
||
this.beginGeometry(t, e);
|
||
var i = t.getFlatCoordinates(), r = t.getStride(), o = this.coordinates.length,
|
||
n = this.drawCoordinates_(i, 0, i.length, r);
|
||
this.instructions.push([Tl.DRAW_IMAGE, o, n, this.image_, this.anchorX_, this.anchorY_, this.declutterGroup_, this.height_, this.opacity_, this.originX_, this.originY_, this.rotateWithView_, this.rotation_, this.scale_ * this.pixelRatio, this.width_]), this.hitDetectionInstructions.push([Tl.DRAW_IMAGE, o, n, this.hitDetectionImage_, this.anchorX_, this.anchorY_, this.declutterGroup_, this.height_, this.opacity_, this.originX_, this.originY_, this.rotateWithView_, this.rotation_, this.scale_, this.width_]), this.endGeometry(t, e)
|
||
}
|
||
}, e.prototype.finish = function () {
|
||
this.reverseHitDetectionInstructions(), this.anchorX_ = void 0, this.anchorY_ = void 0, this.hitDetectionImage_ = null, this.image_ = null, this.height_ = void 0, this.scale_ = void 0, this.opacity_ = void 0, this.originX_ = void 0, this.originY_ = void 0, this.rotateWithView_ = void 0, this.rotation_ = void 0, this.width_ = void 0
|
||
}, e.prototype.setImageStyle = function (t, e) {
|
||
var i = t.getAnchor(), r = t.getSize(), o = t.getHitDetectionImage(1), n = t.getImage(1),
|
||
s = t.getOrigin();
|
||
this.anchorX_ = i[0], this.anchorY_ = i[1], this.declutterGroup_ = e, this.hitDetectionImage_ = o, this.image_ = n, this.height_ = r[1], this.opacity_ = t.getOpacity(), this.originX_ = s[0], this.originY_ = s[1], this.rotateWithView_ = t.getRotateWithView(), this.rotation_ = t.getRotation(), this.scale_ = t.getScale(), this.width_ = r[0]
|
||
}, e
|
||
}(Ol), Al = function (t) {
|
||
function e(e, i, r, o, n, s) {
|
||
t.call(this, e, i, r, o, n, s)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.drawFlatCoordinates_ = function (t, e, i, r) {
|
||
var o = this.coordinates.length, n = this.appendFlatCoordinates(t, e, i, r, !1, !1),
|
||
s = [Tl.MOVE_TO_LINE_TO, o, n];
|
||
return this.instructions.push(s), this.hitDetectionInstructions.push(s), i
|
||
}, e.prototype.drawLineString = function (t, e) {
|
||
var i = this.state, r = i.strokeStyle, o = i.lineWidth;
|
||
if (void 0 !== r && void 0 !== o) {
|
||
this.updateStrokeStyle(i, this.applyStroke), this.beginGeometry(t, e), this.hitDetectionInstructions.push([Tl.SET_STROKE_STYLE, i.strokeStyle, i.lineWidth, i.lineCap, i.lineJoin, i.miterLimit, i.lineDash, i.lineDashOffset], Sl);
|
||
var n = t.getFlatCoordinates(), s = t.getStride();
|
||
this.drawFlatCoordinates_(n, 0, n.length, s), this.hitDetectionInstructions.push(Cl), this.endGeometry(t, e)
|
||
}
|
||
}, e.prototype.drawMultiLineString = function (t, e) {
|
||
var i = this.state, r = i.strokeStyle, o = i.lineWidth;
|
||
if (void 0 !== r && void 0 !== o) {
|
||
this.updateStrokeStyle(i, this.applyStroke), this.beginGeometry(t, e), this.hitDetectionInstructions.push([Tl.SET_STROKE_STYLE, i.strokeStyle, i.lineWidth, i.lineCap, i.lineJoin, i.miterLimit, i.lineDash, i.lineDashOffset], Sl);
|
||
for (var n = t.getEnds(), s = t.getFlatCoordinates(), a = t.getStride(), l = 0, h = 0, u = n.length; h < u; ++h) l = this.drawFlatCoordinates_(s, l, n[h], a);
|
||
this.hitDetectionInstructions.push(Cl), this.endGeometry(t, e)
|
||
}
|
||
}, e.prototype.finish = function () {
|
||
var t = this.state;
|
||
null != t.lastStroke && t.lastStroke != this.coordinates.length && this.instructions.push(Cl), this.reverseHitDetectionInstructions(), this.state = null
|
||
}, e.prototype.applyStroke = function (e) {
|
||
null != e.lastStroke && e.lastStroke != this.coordinates.length && (this.instructions.push(Cl), e.lastStroke = this.coordinates.length), e.lastStroke = 0, t.prototype.applyStroke.call(this, e), this.instructions.push(Sl)
|
||
}, e
|
||
}(Ol), kl = function (t) {
|
||
function e(e, i, r, o, n, s) {
|
||
t.call(this, e, i, r, o, n, s)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.drawFlatCoordinatess_ = function (t, e, i, r) {
|
||
var o = this.state, n = void 0 !== o.fillStyle, s = null != o.strokeStyle, a = i.length;
|
||
this.instructions.push(Sl), this.hitDetectionInstructions.push(Sl);
|
||
for (var l = 0; l < a; ++l) {
|
||
var h = i[l], u = this.coordinates.length, c = this.appendFlatCoordinates(t, e, h, r, !0, !s),
|
||
p = [Tl.MOVE_TO_LINE_TO, u, c];
|
||
this.instructions.push(p), this.hitDetectionInstructions.push(p), s && (this.instructions.push(El), this.hitDetectionInstructions.push(El)), e = h
|
||
}
|
||
return n && (this.instructions.push(bl), this.hitDetectionInstructions.push(bl)), s && (this.instructions.push(Cl), this.hitDetectionInstructions.push(Cl)), e
|
||
}, e.prototype.drawCircle = function (t, e) {
|
||
var i = this.state, r = i.fillStyle, o = i.strokeStyle;
|
||
if (void 0 !== r || void 0 !== o) {
|
||
this.setFillStrokeStyles_(t), this.beginGeometry(t, e), void 0 !== i.fillStyle && this.hitDetectionInstructions.push([Tl.SET_FILL_STYLE, oo(Pa)]), void 0 !== i.strokeStyle && this.hitDetectionInstructions.push([Tl.SET_STROKE_STYLE, i.strokeStyle, i.lineWidth, i.lineCap, i.lineJoin, i.miterLimit, i.lineDash, i.lineDashOffset]);
|
||
var n = t.getFlatCoordinates(), s = t.getStride(), a = this.coordinates.length;
|
||
this.appendFlatCoordinates(n, 0, n.length, s, !1, !1);
|
||
var l = [Tl.CIRCLE, a];
|
||
this.instructions.push(Sl, l), this.hitDetectionInstructions.push(Sl, l), this.hitDetectionInstructions.push(bl), void 0 !== i.fillStyle && this.instructions.push(bl), void 0 !== i.strokeStyle && (this.instructions.push(Cl), this.hitDetectionInstructions.push(Cl)), this.endGeometry(t, e)
|
||
}
|
||
}, e.prototype.drawPolygon = function (t, e) {
|
||
var i = this.state, r = i.fillStyle, o = i.strokeStyle;
|
||
if (void 0 !== r || void 0 !== o) {
|
||
this.setFillStrokeStyles_(t), this.beginGeometry(t, e), void 0 !== i.fillStyle && this.hitDetectionInstructions.push([Tl.SET_FILL_STYLE, oo(Pa)]), void 0 !== i.strokeStyle && this.hitDetectionInstructions.push([Tl.SET_STROKE_STYLE, i.strokeStyle, i.lineWidth, i.lineCap, i.lineJoin, i.miterLimit, i.lineDash, i.lineDashOffset]);
|
||
var n = t.getEnds(), s = t.getOrientedFlatCoordinates(), a = t.getStride();
|
||
this.drawFlatCoordinatess_(s, 0, n, a), this.endGeometry(t, e)
|
||
}
|
||
}, e.prototype.drawMultiPolygon = function (t, e) {
|
||
var i = this.state, r = i.fillStyle, o = i.strokeStyle;
|
||
if (void 0 !== r || void 0 !== o) {
|
||
this.setFillStrokeStyles_(t), this.beginGeometry(t, e), void 0 !== i.fillStyle && this.hitDetectionInstructions.push([Tl.SET_FILL_STYLE, oo(Pa)]), void 0 !== i.strokeStyle && this.hitDetectionInstructions.push([Tl.SET_STROKE_STYLE, i.strokeStyle, i.lineWidth, i.lineCap, i.lineJoin, i.miterLimit, i.lineDash, i.lineDashOffset]);
|
||
for (var n = t.getEndss(), s = t.getOrientedFlatCoordinates(), a = t.getStride(), l = 0, h = 0, u = n.length; h < u; ++h) l = this.drawFlatCoordinatess_(s, l, n[h], a);
|
||
this.endGeometry(t, e)
|
||
}
|
||
}, e.prototype.finish = function () {
|
||
this.reverseHitDetectionInstructions(), this.state = null;
|
||
var t = this.tolerance;
|
||
if (0 !== t) for (var e = this.coordinates, i = 0, r = e.length; i < r; ++i) e[i] = Vi(e[i], t)
|
||
}, e.prototype.setFillStrokeStyles_ = function (t) {
|
||
var e = this.state;
|
||
void 0 !== e.fillStyle && this.updateFillStyle(e, this.createFill, t), void 0 !== e.strokeStyle && this.updateStrokeStyle(e, this.applyStroke)
|
||
}, e
|
||
}(Ol);
|
||
|
||
function Fl(t, e, i, r, o) {
|
||
var n, s, a, l, h, u, c, p, d, f = i, g = i, m = 0, y = 0, v = i;
|
||
for (n = i; n < r; n += o) {
|
||
var _ = e[n], x = e[n + 1];
|
||
void 0 !== l && (p = _ - l, d = x - h, a = Math.sqrt(p * p + d * d), void 0 !== u && (y += s, Math.acos((u * p + c * d) / (s * a)) > t && (y > m && (m = y, f = v, g = n), y = 0, v = n - o)), s = a, u = p, c = d), l = _, h = x
|
||
}
|
||
return (y += a) > m ? [v, n] : [f, g]
|
||
}
|
||
|
||
function Nl(t, e, i) {
|
||
for (var r = e.length, o = 0, n = 0; n < r; ++n) {
|
||
var s = Ua(t, e[n]);
|
||
o = Math.max(o, s), i.push(s)
|
||
}
|
||
return o
|
||
}
|
||
|
||
var Dl = function (t) {
|
||
function e(e, i, r, o, n, s) {
|
||
t.call(this, e, i, r, o, n, s), this.declutterGroup_, this.labels_ = null, this.text_ = "", this.textOffsetX_ = 0, this.textOffsetY_ = 0, this.textRotateWithView_ = void 0, this.textRotation_ = 0, this.textFillState_ = null, this.fillStates = {}, this.textStrokeState_ = null, this.strokeStates = {}, this.textState_ = {}, this.textStates = {}, this.textKey_ = "", this.fillKey_ = "", this.strokeKey_ = "", this.widths_ = {}, Ma.prune()
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.drawText = function (t, e) {
|
||
var i = this.textFillState_, r = this.textStrokeState_, o = this.textState_;
|
||
if ("" !== this.text_ && o && (i || r)) {
|
||
var n, s, a = this.coordinates.length, l = t.getType(), h = null, u = 2, c = 2;
|
||
if (o.placement === mo.LINE) {
|
||
if (!Bt(this.getBufferedMaxExtent(), t.getExtent())) return;
|
||
var p;
|
||
if (h = t.getFlatCoordinates(), c = t.getStride(), l == Zt.LINE_STRING) p = [h.length]; else if (l == Zt.MULTI_LINE_STRING) p = t.getEnds(); else if (l == Zt.POLYGON) p = t.getEnds().slice(0, 1); else if (l == Zt.MULTI_POLYGON) {
|
||
var d = t.getEndss();
|
||
for (p = [], n = 0, s = d.length; n < s; ++n) p.push(d[n][0])
|
||
}
|
||
this.beginGeometry(t, e);
|
||
for (var f, g = o.textAlign, m = 0, y = 0, v = p.length; y < v; ++y) {
|
||
if (null == g) {
|
||
var _ = Fl(o.maxAngle, h, m, p[y], c);
|
||
m = _[0], f = _[1]
|
||
} else f = p[y];
|
||
for (n = m; n < f; n += c) this.coordinates.push(h[n], h[n + 1]);
|
||
u = this.coordinates.length, m = p[y], this.drawChars_(a, u, this.declutterGroup_), a = u
|
||
}
|
||
this.endGeometry(t, e)
|
||
} else {
|
||
var x = this.getImage(this.text_, this.textKey_, this.fillKey_, this.strokeKey_),
|
||
w = x.width / this.pixelRatio;
|
||
switch (l) {
|
||
case Zt.POINT:
|
||
case Zt.MULTI_POINT:
|
||
u = (h = t.getFlatCoordinates()).length;
|
||
break;
|
||
case Zt.LINE_STRING:
|
||
h = t.getFlatMidpoint();
|
||
break;
|
||
case Zt.CIRCLE:
|
||
h = t.getCenter();
|
||
break;
|
||
case Zt.MULTI_LINE_STRING:
|
||
u = (h = t.getFlatMidpoints()).length;
|
||
break;
|
||
case Zt.POLYGON:
|
||
if (h = t.getFlatInteriorPoint(), !o.overflow && h[2] / this.resolution < w) return;
|
||
c = 3;
|
||
break;
|
||
case Zt.MULTI_POLYGON:
|
||
var b = t.getFlatInteriorPoints();
|
||
for (h = [], n = 0, s = b.length; n < s; n += 3) (o.overflow || b[n + 2] / this.resolution >= w) && h.push(b[n], b[n + 1]);
|
||
if (0 == (u = h.length)) return
|
||
}
|
||
u = this.appendFlatCoordinates(h, 0, u, c, !1, !1), (o.backgroundFill || o.backgroundStroke) && (this.setFillStrokeStyle(o.backgroundFill, o.backgroundStroke), o.backgroundFill && (this.updateFillStyle(this.state, this.createFill, t), this.hitDetectionInstructions.push(this.createFill(this.state, t))), o.backgroundStroke && (this.updateStrokeStyle(this.state, this.applyStroke), this.hitDetectionInstructions.push(this.createStroke(this.state)))), this.beginGeometry(t, e), this.drawTextImage_(x, a, u), this.endGeometry(t, e)
|
||
}
|
||
}
|
||
}, e.prototype.getImage = function (t, e, i, r) {
|
||
var o, n = r + e + t + i + this.pixelRatio;
|
||
if (!Ma.containsKey(n)) {
|
||
var s = r ? this.strokeStates[r] || this.textStrokeState_ : null,
|
||
a = i ? this.fillStates[i] || this.textFillState_ : null,
|
||
l = this.textStates[e] || this.textState_, h = this.pixelRatio, u = l.scale * h,
|
||
c = Pl[l.textAlign || "center"], p = r && s.lineWidth ? s.lineWidth : 0, d = t.split("\n"),
|
||
f = d.length, g = [], m = Nl(l.font, d, g), y = za(l.font), v = y * f, _ = m + p,
|
||
x = Ao(Math.ceil(_ * u), Math.ceil((v + p) * u));
|
||
o = x.canvas, Ma.set(n, o), 1 != u && x.scale(u, u), x.font = l.font, r && (x.strokeStyle = s.strokeStyle, x.lineWidth = p, x.lineCap = s.lineCap, x.lineJoin = s.lineJoin, x.miterLimit = s.miterLimit, Er && s.lineDash.length && (x.setLineDash(s.lineDash), x.lineDashOffset = s.lineDashOffset)), i && (x.fillStyle = a.fillStyle), x.textBaseline = "middle", x.textAlign = "center";
|
||
var w, b = .5 - c, C = c * o.width / u + b * p;
|
||
if (r) for (w = 0; w < f; ++w) x.strokeText(d[w], C + b * g[w], .5 * (p + y) + w * y);
|
||
if (i) for (w = 0; w < f; ++w) x.fillText(d[w], C + b * g[w], .5 * (p + y) + w * y)
|
||
}
|
||
return Ma.get(n)
|
||
}, e.prototype.drawTextImage_ = function (t, e, i) {
|
||
var r = this.textState_, o = this.textStrokeState_, n = this.pixelRatio,
|
||
s = Pl[r.textAlign || "center"], a = Pl[r.textBaseline], l = o && o.lineWidth ? o.lineWidth : 0,
|
||
h = s * t.width / n + 2 * (.5 - s) * l, u = a * t.height / n + 2 * (.5 - a) * l;
|
||
this.instructions.push([Tl.DRAW_IMAGE, e, i, t, (h - this.textOffsetX_) * n, (u - this.textOffsetY_) * n, this.declutterGroup_, t.height, 1, 0, 0, this.textRotateWithView_, this.textRotation_, 1, t.width, r.padding == Oa ? Oa : r.padding.map(function (t) {
|
||
return t * n
|
||
}), !!r.backgroundFill, !!r.backgroundStroke]), this.hitDetectionInstructions.push([Tl.DRAW_IMAGE, e, i, t, (h - this.textOffsetX_) * n, (u - this.textOffsetY_) * n, this.declutterGroup_, t.height, 1, 0, 0, this.textRotateWithView_, this.textRotation_, 1 / n, t.width, r.padding, !!r.backgroundFill, !!r.backgroundStroke])
|
||
}, e.prototype.drawChars_ = function (t, e, i) {
|
||
var r = this.textStrokeState_, o = this.textState_, n = this.textFillState_, s = this.strokeKey_;
|
||
r && (s in this.strokeStates || (this.strokeStates[s] = {
|
||
strokeStyle: r.strokeStyle,
|
||
lineCap: r.lineCap,
|
||
lineDashOffset: r.lineDashOffset,
|
||
lineWidth: r.lineWidth,
|
||
lineJoin: r.lineJoin,
|
||
miterLimit: r.miterLimit,
|
||
lineDash: r.lineDash
|
||
}));
|
||
var a = this.textKey_;
|
||
this.textKey_ in this.textStates || (this.textStates[this.textKey_] = {
|
||
font: o.font,
|
||
textAlign: o.textAlign || "center",
|
||
scale: o.scale
|
||
});
|
||
var l = this.fillKey_;
|
||
n && (l in this.fillStates || (this.fillStates[l] = {fillStyle: n.fillStyle}));
|
||
var h = this.pixelRatio, u = Pl[o.textBaseline], c = this.textOffsetY_ * h, p = this.text_, d = o.font,
|
||
f = o.scale, g = r ? r.lineWidth * f / 2 : 0, m = this.widths_[d];
|
||
m || (this.widths_[d] = m = {}), this.instructions.push([Tl.DRAW_CHARS, t, e, u, i, o.overflow, l, o.maxAngle, function (t) {
|
||
var e = m[t];
|
||
return e || (e = m[t] = Ua(d, t)), e * f * h
|
||
}, c, s, g * h, p, a, 1]), this.hitDetectionInstructions.push([Tl.DRAW_CHARS, t, e, u, i, o.overflow, l, o.maxAngle, function (t) {
|
||
var e = m[t];
|
||
return e || (e = m[t] = Ua(d, t)), e * f
|
||
}, c, s, g, p, a, 1 / h])
|
||
}, e.prototype.setTextStyle = function (t, e) {
|
||
var i, r, o;
|
||
if (t) {
|
||
this.declutterGroup_ = e;
|
||
var n = t.getFill();
|
||
n ? ((r = this.textFillState_) || (r = this.textFillState_ = {}), r.fillStyle = Wa(n.getColor() || Pa)) : r = this.textFillState_ = null;
|
||
var s = t.getStroke();
|
||
if (s) {
|
||
(o = this.textStrokeState_) || (o = this.textStrokeState_ = {});
|
||
var l = s.getLineDash(), h = s.getLineDashOffset(), u = s.getWidth(), c = s.getMiterLimit();
|
||
o.lineCap = s.getLineCap() || "round", o.lineDash = l ? l.slice() : La, o.lineDashOffset = void 0 === h ? 0 : h, o.lineJoin = s.getLineJoin() || "round", o.lineWidth = void 0 === u ? 1 : u, o.miterLimit = void 0 === c ? 10 : c, o.strokeStyle = Wa(s.getColor() || Ia)
|
||
} else o = this.textStrokeState_ = null;
|
||
i = this.textState_;
|
||
var p = t.getFont() || "10px sans-serif";
|
||
Na(p);
|
||
var d = t.getScale();
|
||
i.overflow = t.getOverflow(), i.font = p, i.maxAngle = t.getMaxAngle(), i.placement = t.getPlacement(), i.textAlign = t.getTextAlign(), i.textBaseline = t.getTextBaseline() || "middle", i.backgroundFill = t.getBackgroundFill(), i.backgroundStroke = t.getBackgroundStroke(), i.padding = t.getPadding() || Oa, i.scale = void 0 === d ? 1 : d;
|
||
var f = t.getOffsetX(), g = t.getOffsetY(), m = t.getRotateWithView(), y = t.getRotation();
|
||
this.text_ = t.getText() || "", this.textOffsetX_ = void 0 === f ? 0 : f, this.textOffsetY_ = void 0 === g ? 0 : g, this.textRotateWithView_ = void 0 !== m && m, this.textRotation_ = void 0 === y ? 0 : y, this.strokeKey_ = o ? ("string" == typeof o.strokeStyle ? o.strokeStyle : a(o.strokeStyle)) + o.lineCap + o.lineDashOffset + "|" + o.lineWidth + o.lineJoin + o.miterLimit + "[" + o.lineDash.join() + "]" : "", this.textKey_ = i.font + i.scale + (i.textAlign || "?"), this.fillKey_ = r ? "string" == typeof r.fillStyle ? r.fillStyle : "|" + a(r.fillStyle) : ""
|
||
} else this.text_ = ""
|
||
}, e
|
||
}(Ol), Gl = {Circle: kl, Default: Ol, Image: Ml, LineString: Al, Polygon: kl, Text: Dl}, jl = {0: [[!0]]};
|
||
|
||
function zl(t, e, i) {
|
||
var r, o = Math.floor(t.length / 2);
|
||
if (e >= o) for (r = o; r < e; r++) t[r][i] = !0; else if (e < o) for (r = e + 1; r < o; r++) t[r][i] = !0
|
||
}
|
||
|
||
function Ul(t) {
|
||
if (void 0 !== jl[t]) return jl[t];
|
||
for (var e = 2 * t + 1, i = new Array(e), r = 0; r < e; r++) i[r] = new Array(e);
|
||
for (var o = t, n = 0, s = 0; o >= n;) zl(i, t + o, t + n), zl(i, t + n, t + o), zl(i, t - n, t + o), zl(i, t - o, t + n), zl(i, t - o, t - n), zl(i, t - n, t - o), zl(i, t + n, t - o), zl(i, t + o, t - n), 2 * ((s += 1 + 2 * ++n) - o) + 1 > 0 && (s += 1 - 2 * (o -= 1));
|
||
return jl[t] = i, i
|
||
}
|
||
|
||
function Bl(t, e, i, r) {
|
||
for (var o = Object.keys(t).map(Number).sort(Z), n = {}, s = 0, a = o.length; s < a; ++s) for (var l = t[o[s].toString()], h = 0, u = l.length; h < u;) {
|
||
var c = l[h++], p = l[h++];
|
||
c.replay(e, p, i, n, r)
|
||
}
|
||
}
|
||
|
||
var Vl = function (t) {
|
||
function e(e, i, r, o, n, s, a) {
|
||
t.call(this), this.declutterTree_ = s, this.declutterGroup_ = null, this.tolerance_ = e, this.maxExtent_ = i, this.overlaps_ = n, this.pixelRatio_ = o, this.resolution_ = r, this.renderBuffer_ = a, this.replaysByZIndex_ = {}, this.hitDetectionContext_ = Ao(1, 1), this.hitDetectionTransform_ = [1, 0, 0, 1, 0, 0]
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.addDeclutter = function (t) {
|
||
var e = null;
|
||
return this.declutterTree_ && (t ? (e = this.declutterGroup_)[4]++ : (e = this.declutterGroup_ = [1 / 0, 1 / 0, -1 / 0, -1 / 0]).push(1)), e
|
||
}, e.prototype.clip = function (t, e) {
|
||
var i = this.getClipCoords(e);
|
||
t.beginPath(), t.moveTo(i[0], i[1]), t.lineTo(i[2], i[3]), t.lineTo(i[4], i[5]), t.lineTo(i[6], i[7]), t.clip()
|
||
}, e.prototype.hasReplays = function (t) {
|
||
for (var e in this.replaysByZIndex_) for (var i = this.replaysByZIndex_[e], r = 0, o = t.length; r < o; ++r) if (t[r] in i) return !0;
|
||
return !1
|
||
}, e.prototype.finish = function () {
|
||
for (var t in this.replaysByZIndex_) {
|
||
var e = this.replaysByZIndex_[t];
|
||
for (var i in e) e[i].finish()
|
||
}
|
||
}, e.prototype.forEachFeatureAtCoordinate = function (t, e, i, r, o, n, s) {
|
||
var a, l = 2 * (r = Math.round(r)) + 1,
|
||
h = gi(this.hitDetectionTransform_, r + .5, r + .5, 1 / e, -1 / e, -i, -t[0], -t[1]),
|
||
u = this.hitDetectionContext_;
|
||
u.canvas.width !== l || u.canvas.height !== l ? (u.canvas.width = l, u.canvas.height = l) : u.clearRect(0, 0, l, l), void 0 !== this.renderBuffer_ && (St(a = [1 / 0, 1 / 0, -1 / 0, -1 / 0], t), ht(a, e * (this.renderBuffer_ + r), a));
|
||
var c, p, d = Ul(r);
|
||
|
||
function f(t) {
|
||
for (var e = u.getImageData(0, 0, l, l).data, i = 0; i < l; i++) for (var r = 0; r < l; r++) if (d[i][r] && e[4 * (r * l + i) + 3] > 0) {
|
||
var o = void 0;
|
||
return (!c || p != _l.IMAGE && p != _l.TEXT || -1 !== c.indexOf(t)) && (o = n(t)), o || void u.clearRect(0, 0, l, l)
|
||
}
|
||
}
|
||
|
||
this.declutterTree_ && (c = this.declutterTree_.all().map(function (t) {
|
||
return t.value
|
||
}));
|
||
var g, m, y, v, _, x = Object.keys(this.replaysByZIndex_).map(Number);
|
||
for (x.sort(Z), g = x.length - 1; g >= 0; --g) {
|
||
var w = x[g].toString();
|
||
for (y = this.replaysByZIndex_[w], m = Rl.length - 1; m >= 0; --m) if (void 0 !== (v = y[p = Rl[m]])) if (!s || p != _l.IMAGE && p != _l.TEXT) {
|
||
if (_ = v.replayHitDetection(u, h, i, o, f, a)) return _
|
||
} else {
|
||
var b = s[w];
|
||
b ? b.push(v, h.slice(0)) : s[w] = [v, h.slice(0)]
|
||
}
|
||
}
|
||
}, e.prototype.getClipCoords = function (t) {
|
||
var e = this.maxExtent_, i = e[0], r = e[1], o = e[2], n = e[3], s = [i, r, i, n, o, n, o, r];
|
||
return Kt(s, 0, 8, 2, t, s), s
|
||
}, e.prototype.getReplay = function (t, e) {
|
||
var i = void 0 !== t ? t.toString() : "0", r = this.replaysByZIndex_[i];
|
||
void 0 === r && (r = {}, this.replaysByZIndex_[i] = r);
|
||
var o = r[e];
|
||
void 0 === o && (o = new (0, Gl[e])(this.tolerance_, this.maxExtent_, this.resolution_, this.pixelRatio_, this.overlaps_, this.declutterTree_), r[e] = o);
|
||
return o
|
||
}, e.prototype.getReplays = function () {
|
||
return this.replaysByZIndex_
|
||
}, e.prototype.isEmpty = function () {
|
||
return g(this.replaysByZIndex_)
|
||
}, e.prototype.replay = function (t, e, i, r, o, n, s) {
|
||
var a = Object.keys(this.replaysByZIndex_).map(Number);
|
||
a.sort(Z), t.save(), this.clip(t, e);
|
||
var l, h, u, c, p, d, f = n || Rl;
|
||
for (l = 0, h = a.length; l < h; ++l) {
|
||
var g = a[l].toString();
|
||
for (p = this.replaysByZIndex_[g], u = 0, c = f.length; u < c; ++u) {
|
||
var m = f[u];
|
||
if (d = p[m], void 0 !== d) if (!s || m != _l.IMAGE && m != _l.TEXT) d.replay(t, e, i, r, o); else {
|
||
var y = s[g];
|
||
y ? y.push(d, e.slice(0)) : s[g] = [d, e.slice(0)]
|
||
}
|
||
}
|
||
}
|
||
t.restore()
|
||
}, e
|
||
}(vl), Yl = .5, Wl = {
|
||
Point: function (t, e, i, r) {
|
||
var o = i.getImage();
|
||
if (o) {
|
||
if (o.getImageState() != So.LOADED) return;
|
||
var n = t.getReplay(i.getZIndex(), _l.IMAGE);
|
||
n.setImageStyle(o, t.addDeclutter(!1)), n.drawPoint(e, r)
|
||
}
|
||
var s = i.getText();
|
||
if (s) {
|
||
var a = t.getReplay(i.getZIndex(), _l.TEXT);
|
||
a.setTextStyle(s, t.addDeclutter(!!o)), a.drawText(e, r)
|
||
}
|
||
}, LineString: function (t, e, i, r) {
|
||
var o = i.getStroke();
|
||
if (o) {
|
||
var n = t.getReplay(i.getZIndex(), _l.LINE_STRING);
|
||
n.setFillStrokeStyle(null, o), n.drawLineString(e, r)
|
||
}
|
||
var s = i.getText();
|
||
if (s) {
|
||
var a = t.getReplay(i.getZIndex(), _l.TEXT);
|
||
a.setTextStyle(s, t.addDeclutter(!1)), a.drawText(e, r)
|
||
}
|
||
}, Polygon: function (t, e, i, r) {
|
||
var o = i.getFill(), n = i.getStroke();
|
||
if (o || n) {
|
||
var s = t.getReplay(i.getZIndex(), _l.POLYGON);
|
||
s.setFillStrokeStyle(o, n), s.drawPolygon(e, r)
|
||
}
|
||
var a = i.getText();
|
||
if (a) {
|
||
var l = t.getReplay(i.getZIndex(), _l.TEXT);
|
||
l.setTextStyle(a, t.addDeclutter(!1)), l.drawText(e, r)
|
||
}
|
||
}, MultiPoint: function (t, e, i, r) {
|
||
var o = i.getImage();
|
||
if (o) {
|
||
if (o.getImageState() != So.LOADED) return;
|
||
var n = t.getReplay(i.getZIndex(), _l.IMAGE);
|
||
n.setImageStyle(o, t.addDeclutter(!1)), n.drawMultiPoint(e, r)
|
||
}
|
||
var s = i.getText();
|
||
if (s) {
|
||
var a = t.getReplay(i.getZIndex(), _l.TEXT);
|
||
a.setTextStyle(s, t.addDeclutter(!!o)), a.drawText(e, r)
|
||
}
|
||
}, MultiLineString: function (t, e, i, r) {
|
||
var o = i.getStroke();
|
||
if (o) {
|
||
var n = t.getReplay(i.getZIndex(), _l.LINE_STRING);
|
||
n.setFillStrokeStyle(null, o), n.drawMultiLineString(e, r)
|
||
}
|
||
var s = i.getText();
|
||
if (s) {
|
||
var a = t.getReplay(i.getZIndex(), _l.TEXT);
|
||
a.setTextStyle(s, t.addDeclutter(!1)), a.drawText(e, r)
|
||
}
|
||
}, MultiPolygon: function (t, e, i, r) {
|
||
var o = i.getFill(), n = i.getStroke();
|
||
if (n || o) {
|
||
var s = t.getReplay(i.getZIndex(), _l.POLYGON);
|
||
s.setFillStrokeStyle(o, n), s.drawMultiPolygon(e, r)
|
||
}
|
||
var a = i.getText();
|
||
if (a) {
|
||
var l = t.getReplay(i.getZIndex(), _l.TEXT);
|
||
l.setTextStyle(a, t.addDeclutter(!1)), l.drawText(e, r)
|
||
}
|
||
}, GeometryCollection: function (t, e, i, r) {
|
||
var o, n, s = e.getGeometriesArray();
|
||
for (o = 0, n = s.length; o < n; ++o) {
|
||
var a = Wl[s[o].getType()];
|
||
a(t, s[o], i, r)
|
||
}
|
||
}, Circle: function (t, e, i, r) {
|
||
var o = i.getFill(), n = i.getStroke();
|
||
if (o || n) {
|
||
var s = t.getReplay(i.getZIndex(), _l.CIRCLE);
|
||
s.setFillStrokeStyle(o, n), s.drawCircle(e, r)
|
||
}
|
||
var a = i.getText();
|
||
if (a) {
|
||
var l = t.getReplay(i.getZIndex(), _l.TEXT);
|
||
l.setTextStyle(a, t.addDeclutter(!1)), l.drawText(e, r)
|
||
}
|
||
}
|
||
};
|
||
|
||
function Hl(t, e) {
|
||
return parseInt(a(t), 10) - parseInt(a(e), 10)
|
||
}
|
||
|
||
function Xl(t, e) {
|
||
var i = ql(t, e);
|
||
return i * i
|
||
}
|
||
|
||
function ql(t, e) {
|
||
return Yl * t / e
|
||
}
|
||
|
||
function Zl(t, e, i, r, o, n) {
|
||
var s = !1, a = i.getImage();
|
||
if (a) {
|
||
var l = a.getImageState();
|
||
l == So.LOADED || l == So.ERROR ? a.unlistenImageChange(o, n) : (l == So.IDLE && a.load(), l = a.getImageState(), a.listenImageChange(o, n), s = !0)
|
||
}
|
||
return function (t, e, i, r) {
|
||
var o = i.getGeometryFunction()(e);
|
||
if (!o) return;
|
||
var n = o.getSimplifiedGeometry(r);
|
||
if (i.getRenderer()) !function t(e, i, r, o) {
|
||
if (i.getType() == Zt.GEOMETRY_COLLECTION) {
|
||
for (var n = i.getGeometries(), s = 0, a = n.length; s < a; ++s) t(e, n[s], r, o);
|
||
return
|
||
}
|
||
var l = e.getReplay(r.getZIndex(), _l.DEFAULT);
|
||
l.drawCustom(i, o, r.getRenderer())
|
||
}(t, n, i, e); else {
|
||
var s = Wl[n.getType()];
|
||
s(t, n, i, e)
|
||
}
|
||
}(t, e, i, r), s
|
||
}
|
||
|
||
var Kl = function (t) {
|
||
function e(e) {
|
||
t.call(this, e), this.declutterTree_ = e.getDeclutter() ? ml()(9, void 0) : null, this.dirty_ = !1, this.renderedRevision_ = -1, this.renderedResolution_ = NaN, this.renderedExtent_ = [1 / 0, 1 / 0, -1 / 0, -1 / 0], this.renderedRenderOrder_ = null, this.replayGroup_ = null, this.replayGroupChanged = !0, this.context = Ao(), w(Ma, F.CLEAR, this.handleFontsChanged_, this)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.disposeInternal = function () {
|
||
C(Ma, F.CLEAR, this.handleFontsChanged_, this), t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.compose = function (t, e, i) {
|
||
var r = e.extent, o = e.pixelRatio, n = i.managed ? e.skippedFeatureUids : {}, s = e.viewState,
|
||
a = s.projection, l = s.rotation, h = a.getExtent(), u = this.getLayer().getSource(),
|
||
c = this.getTransform(e, 0), p = i.extent, d = void 0 !== p;
|
||
d && this.clip(t, e, p);
|
||
var f = this.replayGroup_;
|
||
if (f && !f.isEmpty()) {
|
||
this.declutterTree_ && this.declutterTree_.clear();
|
||
var g, m = this.getLayer(), y = 0, v = 0, _ = 1 !== i.opacity, x = m.hasListener(eo.RENDER);
|
||
if (_ || x) {
|
||
var w = t.canvas.width, b = t.canvas.height;
|
||
if (l) {
|
||
var C = Math.round(Math.sqrt(w * w + b * b));
|
||
y = (C - w) / 2, v = (C - b) / 2, w = b = C
|
||
}
|
||
this.context.canvas.width = w, this.context.canvas.height = b, g = this.context
|
||
} else g = t;
|
||
var S = g.globalAlpha;
|
||
_ || (g.globalAlpha = i.opacity), g != t && g.translate(y, v);
|
||
var E = e.viewHints, T = !(E[$n.ANIMATING] || E[$n.INTERACTING]), R = e.size[0] * o,
|
||
P = e.size[1] * o;
|
||
if (Ba(g, -l, R / 2, P / 2), f.replay(g, c, l, n, T), u.getWrapX() && a.canWrapX() && !dt(h, r)) {
|
||
for (var L, I = r[0], O = Ut(h), M = 0; I < h[0];) L = O * --M, c = this.getTransform(e, L), f.replay(g, c, l, n, T), I += O;
|
||
for (M = 0, I = r[2]; I > h[2];) L = O * ++M, c = this.getTransform(e, L), f.replay(g, c, l, n, T), I -= O
|
||
}
|
||
if (Ba(g, l, R / 2, P / 2), x && this.dispatchRenderEvent(g, e, c), g != t) {
|
||
if (_) {
|
||
var A = t.globalAlpha;
|
||
t.globalAlpha = i.opacity, t.drawImage(g.canvas, -y, -v), t.globalAlpha = A
|
||
} else t.drawImage(g.canvas, -y, -v);
|
||
g.translate(-y, -v)
|
||
}
|
||
_ || (g.globalAlpha = S)
|
||
}
|
||
d && t.restore()
|
||
}, e.prototype.composeFrame = function (t, e, i) {
|
||
var r = this.getTransform(t, 0);
|
||
this.preCompose(i, t, r), this.compose(i, t, e), this.postCompose(i, t, e, r)
|
||
}, e.prototype.forEachFeatureAtCoordinate = function (t, e, i, r, o) {
|
||
if (this.replayGroup_) {
|
||
var n = e.viewState.resolution, s = e.viewState.rotation, l = this.getLayer(), h = {};
|
||
return this.replayGroup_.forEachFeatureAtCoordinate(t, n, s, i, {}, function (t) {
|
||
var e = a(t);
|
||
if (!(e in h)) return h[e] = !0, r.call(o, t, l)
|
||
}, null)
|
||
}
|
||
}, e.prototype.handleFontsChanged_ = function (t) {
|
||
var e = this.getLayer();
|
||
e.getVisible() && this.replayGroup_ && e.changed()
|
||
}, e.prototype.handleStyleImageChange_ = function (t) {
|
||
this.renderIfReadyAndVisible()
|
||
}, e.prototype.prepareFrame = function (t, e) {
|
||
var i = this.getLayer(), r = i.getSource(), o = t.viewHints[$n.ANIMATING],
|
||
n = t.viewHints[$n.INTERACTING], s = i.getUpdateWhileAnimating(), a = i.getUpdateWhileInteracting();
|
||
if (!this.dirty_ && !s && o || !a && n) return !0;
|
||
var l = t.extent, h = t.viewState, u = h.projection, c = h.resolution, p = t.pixelRatio,
|
||
d = i.getRevision(), f = i.getRenderBuffer(), g = i.getRenderOrder();
|
||
void 0 === g && (g = Hl);
|
||
var m = ht(l, f * c), y = h.projection.getExtent();
|
||
if (r.getWrapX() && h.projection.canWrapX() && !dt(y, t.extent)) {
|
||
var v = Ut(y), _ = Math.max(Ut(m) / 2, v);
|
||
m[0] = y[0] - _, m[2] = y[2] + _
|
||
}
|
||
if (!this.dirty_ && this.renderedResolution_ == c && this.renderedRevision_ == d && this.renderedRenderOrder_ == g && dt(this.renderedExtent_, m)) return this.replayGroupChanged = !1, !0;
|
||
this.replayGroup_ = null, this.dirty_ = !1;
|
||
var x = new Vl(ql(c, p), m, c, p, r.getOverlaps(), this.declutterTree_, i.getRenderBuffer());
|
||
r.loadFeatures(m, c, u);
|
||
var w = function (t) {
|
||
var e, r = t.getStyleFunction() || i.getStyleFunction();
|
||
if (r && (e = r(t, c)), e) {
|
||
var o = this.renderFeature(t, c, p, e, x);
|
||
this.dirty_ = this.dirty_ || o
|
||
}
|
||
}.bind(this);
|
||
if (g) {
|
||
var b = [];
|
||
r.forEachFeatureInExtent(m, function (t) {
|
||
b.push(t)
|
||
}), b.sort(g);
|
||
for (var C = 0, S = b.length; C < S; ++C) w(b[C])
|
||
} else r.forEachFeatureInExtent(m, w);
|
||
return x.finish(), this.renderedResolution_ = c, this.renderedRevision_ = d, this.renderedRenderOrder_ = g, this.renderedExtent_ = m, this.replayGroup_ = x, this.replayGroupChanged = !0, !0
|
||
}, e.prototype.renderFeature = function (t, e, i, r, o) {
|
||
if (!r) return !1;
|
||
var n = !1;
|
||
if (Array.isArray(r)) for (var s = 0, a = r.length; s < a; ++s) n = Zl(o, t, r[s], Xl(e, i), this.handleStyleImageChange_, this) || n; else n = Zl(o, t, r, Xl(e, i), this.handleStyleImageChange_, this);
|
||
return n
|
||
}, e
|
||
}(sl);
|
||
Kl.handles = function (t) {
|
||
return t.getType() === Vo.VECTOR
|
||
}, Kl.create = function (t, e) {
|
||
return new Kl(e)
|
||
};
|
||
var Jl = Kl, $l = {IMAGE: "image", HYBRID: "hybrid", VECTOR: "vector"}, Ql = {
|
||
image: [_l.POLYGON, _l.CIRCLE, _l.LINE_STRING, _l.IMAGE, _l.TEXT],
|
||
hybrid: [_l.POLYGON, _l.LINE_STRING]
|
||
}, th = {image: [_l.DEFAULT], hybrid: [_l.IMAGE, _l.TEXT, _l.DEFAULT], vector: Rl}, eh = function (t) {
|
||
function e(e) {
|
||
t.call(this, e, !0), this.declutterTree_ = e.getDeclutter() ? ml()(9, void 0) : null, this.dirty_ = !1, this.renderedLayerRevision_, this.tmpTransform_ = [1, 0, 0, 1, 0, 0];
|
||
var i = e.getRenderMode();
|
||
this.zDirection = i === $l.VECTOR ? 1 : 0, i !== $l.VECTOR && (this.context = Ao()), w(Ma, F.CLEAR, this.handleFontsChanged_, this)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.disposeInternal = function () {
|
||
C(Ma, F.CLEAR, this.handleFontsChanged_, this), t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.getTile = function (e, i, r, o, n) {
|
||
var s = t.prototype.getTile.call(this, e, i, r, o, n);
|
||
return s.getState() === Ro.LOADED && (this.createReplayGroup_(s, o, n), this.context && this.renderTileImage_(s, o, n)), s
|
||
}, e.prototype.getTileImage = function (t) {
|
||
var e = this.getLayer();
|
||
return t.getImage(e)
|
||
}, e.prototype.prepareFrame = function (e, i) {
|
||
var r = this.getLayer().getRevision();
|
||
return this.renderedLayerRevision_ != r && (this.renderedTiles.length = 0), this.renderedLayerRevision_ = r, t.prototype.prepareFrame.call(this, e, i)
|
||
}, e.prototype.createReplayGroup_ = function (t, e, i) {
|
||
var r = this, o = this.getLayer(), n = o.getRevision(), s = o.getRenderOrder() || null,
|
||
a = t.getReplayState(o);
|
||
if (a.dirty || a.renderedRevision != n || a.renderedRenderOrder != s) {
|
||
for (var l = o.getSource(), h = l.getTileGrid(), u = l.getTileGridForProjection(i).getResolution(t.tileCoord[0]), c = t.extent, p = function (n, p) {
|
||
var d = t.getTile(t.tileKeys[n]);
|
||
if (d.getState() == Ro.LOADED) {
|
||
var f = d.tileCoord, g = h.getTileCoordExtent(f), m = Dt(c, g),
|
||
y = bt(g, m) ? null : ht(m, o.getRenderBuffer() * u, r.tmpExtent),
|
||
v = d.getProjection(), _ = !1;
|
||
Qe(i, v) || (_ = !0, d.setProjection(i)), a.dirty = !1;
|
||
var x = new Vl(0, m, u, e, l.getOverlaps(), r.declutterTree_, o.getRenderBuffer()),
|
||
w = Xl(u, e), b = function (t) {
|
||
var e, i = t.getStyleFunction() || o.getStyleFunction();
|
||
if (i && (e = i(t, u)), e) {
|
||
var r = this.renderFeature(t, w, e, x);
|
||
this.dirty_ = this.dirty_ || r, a.dirty = a.dirty || r
|
||
}
|
||
}, C = d.getFeatures();
|
||
s && s !== a.renderedRenderOrder && C.sort(s);
|
||
for (var S = 0, E = C.length; S < E; ++S) {
|
||
var T = C[S];
|
||
_ && (v.getUnits() == ve.TILE_PIXELS && (v.setWorldExtent(g), v.setExtent(d.getExtent())), T.getGeometry().transform(v, i)), y && !Bt(y, T.getGeometry().getExtent()) || b.call(r, T)
|
||
}
|
||
x.finish(), d.setReplayGroup(o, t.tileCoord.toString(), x)
|
||
}
|
||
}, d = 0, f = t.tileKeys.length; d < f; ++d) p(d);
|
||
a.renderedRevision = n, a.renderedRenderOrder = s
|
||
}
|
||
}, e.prototype.forEachFeatureAtCoordinate = function (t, e, i, r, o) {
|
||
var n = e.viewState.resolution, s = e.viewState.rotation;
|
||
i = null == i ? 0 : i;
|
||
var l, h, u, c, p = this.getLayer(), d = {}, f = this.renderedTiles;
|
||
for (u = 0, c = f.length; u < c; ++u) {
|
||
var g = f[u];
|
||
if (pt(l = ht(g.extent, i * n, l), t)) for (var m = 0, y = g.tileKeys.length; m < y; ++m) {
|
||
var v = g.getTile(g.tileKeys[m]);
|
||
if (v.getState() == Ro.LOADED) {
|
||
var _ = v.getReplayGroup(p, g.tileCoord.toString());
|
||
h = h || _.forEachFeatureAtCoordinate(t, n, s, i, {}, function (t) {
|
||
var e = a(t);
|
||
if (!(e in d)) return d[e] = !0, r.call(o, t, p)
|
||
}, null)
|
||
}
|
||
}
|
||
}
|
||
return h
|
||
}, e.prototype.getReplayTransform_ = function (t, e) {
|
||
var i = this.getLayer().getSource().getTileGrid(), r = t.tileCoord, o = i.getResolution(r[0]),
|
||
n = e.viewState, s = e.pixelRatio, a = n.resolution / s,
|
||
l = i.getTileCoordExtent(r, this.tmpExtent), h = n.center, u = jt(l), c = e.size,
|
||
p = Math.round(s * c[0] / 2), d = Math.round(s * c[1] / 2);
|
||
return gi(this.tmpTransform_, p, d, o / a, o / a, n.rotation, (u[0] - h[0]) / o, (h[1] - u[1]) / o)
|
||
}, e.prototype.handleFontsChanged_ = function (t) {
|
||
var e = this.getLayer();
|
||
e.getVisible() && void 0 !== this.renderedLayerRevision_ && e.changed()
|
||
}, e.prototype.handleStyleImageChange_ = function (t) {
|
||
this.renderIfReadyAndVisible()
|
||
}, e.prototype.postCompose = function (e, i, r) {
|
||
var o = this.getLayer(), n = o.getRenderMode();
|
||
if (n != $l.IMAGE) {
|
||
var s, a, l = o.getDeclutter() ? {} : null, h = o.getSource(), u = th[n], c = i.pixelRatio,
|
||
p = i.viewState.rotation, d = i.size;
|
||
p && Ba(e, -p, s = Math.round(c * d[0] / 2), a = Math.round(c * d[1] / 2)), l && this.declutterTree_.clear();
|
||
for (var f = i.viewHints, g = !(f[$n.ANIMATING] || f[$n.INTERACTING]), m = this.renderedTiles, y = h.getTileGridForProjection(i.viewState.projection), v = [], _ = [], x = m.length - 1; x >= 0; --x) {
|
||
var w = m[x];
|
||
if (w.getState() != Ro.ABORT) for (var b = w.tileCoord, C = y.getTileCoordExtent(b, this.tmpExtent)[0] - w.extent[0], S = void 0, E = 0, T = w.tileKeys.length; E < T; ++E) {
|
||
var R = w.getTile(w.tileKeys[E]);
|
||
if (R.getState() == Ro.LOADED) {
|
||
var P = R.getReplayGroup(o, b.toString());
|
||
if (P && P.hasReplays(u)) {
|
||
S || (S = this.getTransform(i, C));
|
||
var L = R.tileCoord[0], I = P.getClipCoords(S);
|
||
e.save(), e.globalAlpha = r.opacity;
|
||
for (var O = 0, M = v.length; O < M; ++O) {
|
||
var A = v[O];
|
||
L < _[O] && (e.beginPath(), e.moveTo(I[0], I[1]), e.lineTo(I[2], I[3]), e.lineTo(I[4], I[5]), e.lineTo(I[6], I[7]), e.moveTo(A[6], A[7]), e.lineTo(A[4], A[5]), e.lineTo(A[2], A[3]), e.lineTo(A[0], A[1]), e.clip())
|
||
}
|
||
P.replay(e, S, p, {}, g, u, l), e.restore(), v.push(I), _.push(L)
|
||
}
|
||
}
|
||
}
|
||
}
|
||
l && Bl(l, e, p, g), p && Ba(e, p, s, a)
|
||
}
|
||
t.prototype.postCompose.call(this, e, i, r)
|
||
}, e.prototype.renderFeature = function (t, e, i, r) {
|
||
if (!i) return !1;
|
||
var o = !1;
|
||
if (Array.isArray(i)) for (var n = 0, s = i.length; n < s; ++n) o = Zl(r, t, i[n], e, this.handleStyleImageChange_, this) || o; else o = Zl(r, t, i, e, this.handleStyleImageChange_, this);
|
||
return o
|
||
}, e.prototype.renderTileImage_ = function (t, e, i) {
|
||
var r = this.getLayer(), o = t.getReplayState(r), n = r.getRevision(), s = Ql[r.getRenderMode()];
|
||
if (s && o.renderedTileRevision !== n) {
|
||
o.renderedTileRevision = n;
|
||
var a = t.wrappedTileCoord, l = a[0], h = r.getSource(), u = h.getTileGridForProjection(i),
|
||
c = u.getResolution(l), p = t.getContext(r), d = h.getTilePixelSize(l, e, i);
|
||
p.canvas.width = d[0], p.canvas.height = d[1];
|
||
for (var f = u.getTileCoordExtent(a, this.tmpExtent), g = 0, m = t.tileKeys.length; g < m; ++g) {
|
||
var y = t.getTile(t.tileKeys[g]);
|
||
if (y.getState() == Ro.LOADED) {
|
||
var v = e / c, _ = ai(this.tmpTransform_);
|
||
di(_, v, -v), fi(_, -f[0], -f[3]), y.getReplayGroup(r, t.tileCoord.toString()).replay(p, _, 0, {}, !0, s)
|
||
}
|
||
}
|
||
}
|
||
}, e
|
||
}(fl);
|
||
eh.handles = function (t) {
|
||
return t.getType() === Vo.VECTOR_TILE
|
||
}, eh.create = function (t, e) {
|
||
return new eh(e)
|
||
};
|
||
var ih = eh, rh = function (t) {
|
||
function e(e) {
|
||
(e = p({}, e)).controls || (e.controls = Ms()), e.interactions || (e.interactions = Ca()), t.call(this, e)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.createRenderer = function () {
|
||
var t = new rl(this);
|
||
return t.registerLayerRenderers([hl, fl, Jl, ih]), t
|
||
}, e
|
||
}(ms), oh = {
|
||
BOTTOM_LEFT: "bottom-left",
|
||
BOTTOM_CENTER: "bottom-center",
|
||
BOTTOM_RIGHT: "bottom-right",
|
||
CENTER_LEFT: "center-left",
|
||
CENTER_CENTER: "center-center",
|
||
CENTER_RIGHT: "center-right",
|
||
TOP_LEFT: "top-left",
|
||
TOP_CENTER: "top-center",
|
||
TOP_RIGHT: "top-right"
|
||
}, nh = {ELEMENT: "element", MAP: "map", OFFSET: "offset", POSITION: "position", POSITIONING: "positioning"},
|
||
sh = function (t) {
|
||
function e(e) {
|
||
t.call(this), this.options = e, this.id = e.id, this.insertFirst = void 0 === e.insertFirst || e.insertFirst, this.stopEvent = void 0 === e.stopEvent || e.stopEvent, this.element = document.createElement("div"), this.element.className = void 0 !== e.className ? e.className : "ol-overlay-container " + _s, this.element.style.position = "absolute", this.autoPan = void 0 !== e.autoPan && e.autoPan, this.autoPanAnimation = e.autoPanAnimation || {}, this.autoPanMargin = void 0 !== e.autoPanMargin ? e.autoPanMargin : 20, this.rendered = {
|
||
bottom_: "",
|
||
left_: "",
|
||
right_: "",
|
||
top_: "",
|
||
visible: !0
|
||
}, this.mapPostrenderListenerKey = null, w(this, z(nh.ELEMENT), this.handleElementChanged, this), w(this, z(nh.MAP), this.handleMapChanged, this), w(this, z(nh.OFFSET), this.handleOffsetChanged, this), w(this, z(nh.POSITION), this.handlePositionChanged, this), w(this, z(nh.POSITIONING), this.handlePositioningChanged, this), void 0 !== e.element && this.setElement(e.element), this.setOffset(void 0 !== e.offset ? e.offset : [0, 0]), this.setPositioning(void 0 !== e.positioning ? e.positioning : oh.TOP_LEFT), void 0 !== e.position && this.setPosition(e.position)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getElement = function () {
|
||
return this.get(nh.ELEMENT)
|
||
}, e.prototype.getId = function () {
|
||
return this.id
|
||
}, e.prototype.getMap = function () {
|
||
return this.get(nh.MAP)
|
||
}, e.prototype.getOffset = function () {
|
||
return this.get(nh.OFFSET)
|
||
}, e.prototype.getPosition = function () {
|
||
return this.get(nh.POSITION)
|
||
}, e.prototype.getPositioning = function () {
|
||
return this.get(nh.POSITIONING)
|
||
}, e.prototype.handleElementChanged = function () {
|
||
Go(this.element);
|
||
var t = this.getElement();
|
||
t && this.element.appendChild(t)
|
||
}, e.prototype.handleMapChanged = function () {
|
||
this.mapPostrenderListenerKey && (Do(this.element), S(this.mapPostrenderListenerKey), this.mapPostrenderListenerKey = null);
|
||
var t = this.getMap();
|
||
if (t) {
|
||
this.mapPostrenderListenerKey = w(t, Dn.POSTRENDER, this.render, this), this.updatePixelPosition();
|
||
var e = this.stopEvent ? t.getOverlayContainerStopEvent() : t.getOverlayContainer();
|
||
this.insertFirst ? e.insertBefore(this.element, e.childNodes[0] || null) : e.appendChild(this.element)
|
||
}
|
||
}, e.prototype.render = function () {
|
||
this.updatePixelPosition()
|
||
}, e.prototype.handleOffsetChanged = function () {
|
||
this.updatePixelPosition()
|
||
}, e.prototype.handlePositionChanged = function () {
|
||
this.updatePixelPosition(), this.get(nh.POSITION) && this.autoPan && this.panIntoView()
|
||
}, e.prototype.handlePositioningChanged = function () {
|
||
this.updatePixelPosition()
|
||
}, e.prototype.setElement = function (t) {
|
||
this.set(nh.ELEMENT, t)
|
||
}, e.prototype.setMap = function (t) {
|
||
this.set(nh.MAP, t)
|
||
}, e.prototype.setOffset = function (t) {
|
||
this.set(nh.OFFSET, t)
|
||
}, e.prototype.setPosition = function (t) {
|
||
this.set(nh.POSITION, t)
|
||
}, e.prototype.panIntoView = function () {
|
||
var t = this.getMap();
|
||
if (t && t.getTargetElement()) {
|
||
var e = this.getRect(t.getTargetElement(), t.getSize()), i = this.getElement(),
|
||
r = this.getRect(i, [ko(i), Fo(i)]), o = this.autoPanMargin;
|
||
if (!dt(e, r)) {
|
||
var n = r[0] - e[0], s = e[2] - r[2], a = r[1] - e[1], l = e[3] - r[3], h = [0, 0];
|
||
if (n < 0 ? h[0] = n - o : s < 0 && (h[0] = Math.abs(s) + o), a < 0 ? h[1] = a - o : l < 0 && (h[1] = Math.abs(l) + o), 0 !== h[0] || 0 !== h[1]) {
|
||
var u = t.getView().getCenter(), c = t.getPixelFromCoordinate(u),
|
||
p = [c[0] + h[0], c[1] + h[1]];
|
||
t.getView().animate({
|
||
center: t.getCoordinateFromPixel(p),
|
||
duration: this.autoPanAnimation.duration,
|
||
easing: this.autoPanAnimation.easing
|
||
})
|
||
}
|
||
}
|
||
}
|
||
}, e.prototype.getRect = function (t, e) {
|
||
var i = t.getBoundingClientRect(), r = i.left + window.pageXOffset, o = i.top + window.pageYOffset;
|
||
return [r, o, r + e[0], o + e[1]]
|
||
}, e.prototype.setPositioning = function (t) {
|
||
this.set(nh.POSITIONING, t)
|
||
}, e.prototype.setVisible = function (t) {
|
||
this.rendered.visible !== t && (this.element.style.display = t ? "" : "none", this.rendered.visible = t)
|
||
}, e.prototype.updatePixelPosition = function () {
|
||
var t = this.getMap(), e = this.getPosition();
|
||
if (t && t.isRendered() && e) {
|
||
var i = t.getPixelFromCoordinate(e), r = t.getSize();
|
||
this.updateRenderedPosition(i, r)
|
||
} else this.setVisible(!1)
|
||
}, e.prototype.updateRenderedPosition = function (t, e) {
|
||
var i = this.element.style, r = this.getOffset(), o = this.getPositioning();
|
||
this.setVisible(!0);
|
||
var n = r[0], s = r[1];
|
||
if (o == oh.BOTTOM_RIGHT || o == oh.CENTER_RIGHT || o == oh.TOP_RIGHT) {
|
||
"" !== this.rendered.left_ && (this.rendered.left_ = i.left = "");
|
||
var a = Math.round(e[0] - t[0] - n) + "px";
|
||
this.rendered.right_ != a && (this.rendered.right_ = i.right = a)
|
||
} else {
|
||
"" !== this.rendered.right_ && (this.rendered.right_ = i.right = ""), o != oh.BOTTOM_CENTER && o != oh.CENTER_CENTER && o != oh.TOP_CENTER || (n -= this.element.offsetWidth / 2);
|
||
var l = Math.round(t[0] + n) + "px";
|
||
this.rendered.left_ != l && (this.rendered.left_ = i.left = l)
|
||
}
|
||
if (o == oh.BOTTOM_LEFT || o == oh.BOTTOM_CENTER || o == oh.BOTTOM_RIGHT) {
|
||
"" !== this.rendered.top_ && (this.rendered.top_ = i.top = "");
|
||
var h = Math.round(e[1] - t[1] - s) + "px";
|
||
this.rendered.bottom_ != h && (this.rendered.bottom_ = i.bottom = h)
|
||
} else {
|
||
"" !== this.rendered.bottom_ && (this.rendered.bottom_ = i.bottom = ""), o != oh.CENTER_LEFT && o != oh.CENTER_CENTER && o != oh.CENTER_RIGHT || (s -= this.element.offsetHeight / 2);
|
||
var u = Math.round(t[1] + s) + "px";
|
||
this.rendered.top_ != u && (this.rendered.top_ = i.top = u)
|
||
}
|
||
}, e.prototype.getOptions = function () {
|
||
return this.options
|
||
}, e
|
||
}(U);
|
||
|
||
function ah(t, e, i, r) {
|
||
return void 0 !== r ? (r[0] = t, r[1] = e, r[2] = i, r) : [t, e, i]
|
||
}
|
||
|
||
function lh(t, e, i) {
|
||
return t + "/" + e + "/" + i
|
||
}
|
||
|
||
function hh(t) {
|
||
return lh(t[0], t[1], t[2])
|
||
}
|
||
|
||
function uh(t) {
|
||
return t.split("/").map(Number)
|
||
}
|
||
|
||
function ch(t) {
|
||
return (t[1] << t[0]) + t[2]
|
||
}
|
||
|
||
function ph(t) {
|
||
var e, i, r = t[0], o = new Array(r), n = 1 << r - 1;
|
||
for (e = 0; e < r; ++e) i = 48, t[1] & n && (i += 1), t[2] & n && (i += 2), o[e] = String.fromCharCode(i), n >>= 1;
|
||
return o.join("")
|
||
}
|
||
|
||
function dh(t, e) {
|
||
var i = t[0], r = t[1], o = t[2];
|
||
if (e.getMinZoom() > i || i > e.getMaxZoom()) return !1;
|
||
var n, s = e.getExtent();
|
||
return !(n = s ? e.getTileRangeForExtentAndZ(s, i) : e.getFullTileRange(i)) || n.containsXY(r, o)
|
||
}
|
||
|
||
var fh = function (t) {
|
||
function e(e) {
|
||
t.call(this, e)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.expireCache = function (t) {
|
||
for (; this.canExpireCache();) {
|
||
var e = this.peekLast(), i = e.tileCoord[0].toString();
|
||
if (i in t && t[i].contains(e.tileCoord)) break;
|
||
this.pop().dispose()
|
||
}
|
||
}, e.prototype.pruneExceptNewestZ = function () {
|
||
if (0 !== this.getCount()) {
|
||
var t = uh(this.peekFirstKey())[0];
|
||
this.forEach(function (e) {
|
||
e.tileCoord[0] !== t && (this.remove(hh(e.tileCoord)), e.dispose())
|
||
}, this)
|
||
}
|
||
}, e
|
||
}(Ra), gh = {ARRAY_BUFFER: "arraybuffer", JSON: "json", TEXT: "text", XML: "xml"};
|
||
|
||
function mh(t, e, i, r) {
|
||
return function (o, n, s) {
|
||
var a = new XMLHttpRequest;
|
||
a.open("GET", "function" == typeof t ? t(o, n, s) : t, !0), e.getType() == gh.ARRAY_BUFFER && (a.responseType = "arraybuffer"), a.onload = function (t) {
|
||
if (!a.status || a.status >= 200 && a.status < 300) {
|
||
var o, n = e.getType();
|
||
n == gh.JSON || n == gh.TEXT ? o = a.responseText : n == gh.XML ? (o = a.responseXML) || (o = (new DOMParser).parseFromString(a.responseText, "application/xml")) : n == gh.ARRAY_BUFFER && (o = a.response), o ? i.call(this, e.readFeatures(o, {featureProjection: s}), e.readProjection(o), e.getLastExtent()) : r.call(this)
|
||
} else r.call(this)
|
||
}.bind(this), a.onerror = function () {
|
||
r.call(this)
|
||
}.bind(this), a.send()
|
||
}
|
||
}
|
||
|
||
function yh(t, e) {
|
||
return mh(t, e, function (t, e) {
|
||
"function" == typeof this.addFeatures && this.addFeatures(t)
|
||
}, I)
|
||
}
|
||
|
||
var vh = function (t) {
|
||
function e(i, r, o, n, s, a, l, h, u, c, p, d, f, g, m) {
|
||
if (t.call(this, i, r, {transition: 0}), this.context_ = {}, this.loader_, this.replayState_ = {}, this.sourceTiles_ = c, this.tileKeys = [], this.extent = null, this.sourceRevision_ = o, this.wrappedTileCoord = a, this.loadListenerKeys_ = [], this.sourceTileListenerKeys_ = [], a) {
|
||
var y = this.extent = u.getTileCoordExtent(a), v = u.getResolution(m), _ = h.getZForResolution(v),
|
||
x = m != i[0], b = 0;
|
||
if (h.forEachTileCoord(y, _, function (t) {
|
||
var e = Dt(y, h.getTileCoordExtent(t)), i = h.getExtent();
|
||
if (i && (e = Dt(e, i, e)), Ut(e) / v >= .5 && Nt(e) / v >= .5) {
|
||
++b;
|
||
var r = t.toString(), o = c[r];
|
||
if (!o && !x) {
|
||
var a = l(t, p, d);
|
||
o = c[r] = new f(t, null == a ? Ro.EMPTY : Ro.IDLE, null == a ? "" : a, n, s), this.sourceTileListenerKeys_.push(w(o, F.CHANGE, g))
|
||
}
|
||
!o || x && o.getState() != Ro.LOADED || (o.consumers++, this.tileKeys.push(r))
|
||
}
|
||
}.bind(this)), x && b == this.tileKeys.length && this.finishLoading_(), m <= i[0] && this.state != Ro.LOADED) for (; m > u.getMinZoom();) {
|
||
var C = new e(i, r, o, n, s, a, l, h, u, c, p, d, f, I, --m);
|
||
if (C.state == Ro.LOADED) {
|
||
this.interimTile = C;
|
||
break
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.disposeInternal = function () {
|
||
this.state = Ro.ABORT, this.changed(), this.interimTile && this.interimTile.dispose();
|
||
for (var e = 0, i = this.tileKeys.length; e < i; ++e) {
|
||
var r = this.tileKeys[e], o = this.getTile(r);
|
||
o.consumers--, 0 == o.consumers && (delete this.sourceTiles_[r], o.dispose())
|
||
}
|
||
this.tileKeys.length = 0, this.sourceTiles_ = null, this.loadListenerKeys_.forEach(S), this.loadListenerKeys_.length = 0, this.sourceTileListenerKeys_.forEach(S), this.sourceTileListenerKeys_.length = 0, t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.getContext = function (t) {
|
||
var e = a(t);
|
||
return e in this.context_ || (this.context_[e] = Ao()), this.context_[e]
|
||
}, e.prototype.getImage = function (t) {
|
||
return -1 == this.getReplayState(t).renderedTileRevision ? null : this.getContext(t).canvas
|
||
}, e.prototype.getReplayState = function (t) {
|
||
var e = a(t);
|
||
return e in this.replayState_ || (this.replayState_[e] = {
|
||
dirty: !1,
|
||
renderedRenderOrder: null,
|
||
renderedRevision: -1,
|
||
renderedTileRevision: -1
|
||
}), this.replayState_[e]
|
||
}, e.prototype.getKey = function () {
|
||
return this.tileKeys.join("/") + "-" + this.sourceRevision_
|
||
}, e.prototype.getTile = function (t) {
|
||
return this.sourceTiles_[t]
|
||
}, e.prototype.load = function () {
|
||
var t = 0, e = {};
|
||
this.state == Ro.IDLE && this.setState(Ro.LOADING), this.state == Ro.LOADING && this.tileKeys.forEach(function (i) {
|
||
var r = this.getTile(i);
|
||
if (r.state == Ro.IDLE && (r.setLoader(this.loader_), r.load()), r.state == Ro.LOADING) {
|
||
var o = w(r, F.CHANGE, function (i) {
|
||
var o = r.getState();
|
||
if (o == Ro.LOADED || o == Ro.ERROR) {
|
||
var n = a(r);
|
||
o == Ro.ERROR ? e[n] = !0 : (--t, delete e[n]), t - Object.keys(e).length == 0 && this.finishLoading_()
|
||
}
|
||
}.bind(this));
|
||
this.loadListenerKeys_.push(o), ++t
|
||
}
|
||
}.bind(this)), t - Object.keys(e).length == 0 && setTimeout(this.finishLoading_.bind(this), 0)
|
||
}, e.prototype.finishLoading_ = function () {
|
||
for (var t = this.tileKeys.length, e = 0, i = t - 1; i >= 0; --i) {
|
||
var r = this.getTile(this.tileKeys[i]).getState();
|
||
r != Ro.LOADED && --t, r == Ro.EMPTY && ++e
|
||
}
|
||
t == this.tileKeys.length ? (this.loadListenerKeys_.forEach(S), this.loadListenerKeys_.length = 0, this.setState(Ro.LOADED)) : this.setState(e == this.tileKeys.length ? Ro.EMPTY : Ro.ERROR)
|
||
}, e
|
||
}(Mo);
|
||
|
||
function _h(t, e) {
|
||
var i = mh(e, t.getFormat(), t.onLoad.bind(t), t.onError.bind(t));
|
||
t.setLoader(i)
|
||
}
|
||
|
||
var xh = [0, 0, 4096, 4096], wh = function (t) {
|
||
function e(e, i, r, o, n, s) {
|
||
t.call(this, e, i, s), this.consumers = 0, this.extent_ = null, this.format_ = o, this.features_ = null, this.loader_, this.projection_ = null, this.replayGroups_ = {}, this.tileLoadFunction_ = n, this.url_ = r
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.disposeInternal = function () {
|
||
this.features_ = null, this.replayGroups_ = {}, this.state = Ro.ABORT, this.changed(), t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.getExtent = function () {
|
||
return this.extent_ || xh
|
||
}, e.prototype.getFormat = function () {
|
||
return this.format_
|
||
}, e.prototype.getFeatures = function () {
|
||
return this.features_
|
||
}, e.prototype.getKey = function () {
|
||
return this.url_
|
||
}, e.prototype.getProjection = function () {
|
||
return this.projection_
|
||
}, e.prototype.getReplayGroup = function (t, e) {
|
||
return this.replayGroups_[a(t) + "," + e]
|
||
}, e.prototype.load = function () {
|
||
this.state == Ro.IDLE && (this.setState(Ro.LOADING), this.tileLoadFunction_(this, this.url_), this.loader_(null, NaN, null))
|
||
}, e.prototype.onLoad = function (t, e, i) {
|
||
this.setProjection(e), this.setFeatures(t), this.setExtent(i)
|
||
}, e.prototype.onError = function () {
|
||
this.setState(Ro.ERROR)
|
||
}, e.prototype.setExtent = function (t) {
|
||
this.extent_ = t
|
||
}, e.prototype.setFeatures = function (t) {
|
||
this.features_ = t, this.setState(Ro.LOADED)
|
||
}, e.prototype.setProjection = function (t) {
|
||
this.projection_ = t
|
||
}, e.prototype.setReplayGroup = function (t, e, i) {
|
||
this.replayGroups_[a(t) + "," + e] = i
|
||
}, e.prototype.setLoader = function (t) {
|
||
this.loader_ = t
|
||
}, e
|
||
}(Mo), bh = 9729, Ch = 10242, Sh = 10243, Eh = 3553,
|
||
Th = ["experimental-webgl", "webgl", "webkit-3d", "moz-webgl"];
|
||
|
||
function Rh(t, e) {
|
||
for (var i = Th.length, r = 0; r < i; ++r) try {
|
||
var o = t.getContext(Th[r], e);
|
||
if (o) return o
|
||
} catch (t) {
|
||
}
|
||
return null
|
||
}
|
||
|
||
var Ph, Lh;
|
||
if ("undefined" != typeof window && "WebGLRenderingContext" in window) try {
|
||
var Ih = Rh(document.createElement("canvas"), {failIfMajorPerformanceCaveat: !0});
|
||
Ih && (!0, Ph = Ih.getParameter(Ih.MAX_TEXTURE_SIZE), Lh = Ih.getSupportedExtensions())
|
||
} catch (t) {
|
||
}
|
||
var Oh = function (t) {
|
||
this.source_ = t
|
||
};
|
||
Oh.prototype.isAnimated = function () {
|
||
return !1
|
||
}, Oh.prototype.getType = function () {
|
||
return n()
|
||
}, Oh.prototype.getSource = function () {
|
||
return this.source_
|
||
};
|
||
var Mh = Oh, Ah = function (t) {
|
||
function e(e) {
|
||
t.call(this, e)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getType = function () {
|
||
return 35632
|
||
}, e
|
||
}(Mh), kh = function (t) {
|
||
function e(e) {
|
||
t.call(this, e)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getType = function () {
|
||
return 35633
|
||
}, e
|
||
}(Mh),
|
||
Fh = new Ah("precision mediump float;\nvarying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_fillColor;\nuniform vec4 u_strokeColor;\nuniform vec2 u_size;\n\nvoid main(void) {\n vec2 windowCenter = vec2((v_center.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_center.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n vec2 windowOffset = vec2((v_offset.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_offset.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n float radius = length(windowCenter - windowOffset);\n float dist = length(windowCenter - gl_FragCoord.xy);\n if (dist > radius + v_halfWidth) {\n if (u_strokeColor.a == 0.0) {\n gl_FragColor = u_fillColor;\n } else {\n gl_FragColor = u_strokeColor;\n }\n gl_FragColor.a = gl_FragColor.a - (dist - (radius + v_halfWidth));\n } else if (u_fillColor.a == 0.0) {\n // Hooray, no fill, just stroke. We can use real antialiasing.\n gl_FragColor = u_strokeColor;\n if (dist < radius - v_halfWidth) {\n gl_FragColor.a = gl_FragColor.a - (radius - v_halfWidth - dist);\n }\n } else {\n gl_FragColor = u_fillColor;\n float strokeDist = radius - v_halfWidth;\n float antialias = 2.0 * v_pixelRatio;\n if (dist > strokeDist) {\n gl_FragColor = u_strokeColor;\n } else if (dist >= strokeDist - antialias) {\n float step = smoothstep(strokeDist - antialias, strokeDist, dist);\n gl_FragColor = mix(u_fillColor, u_strokeColor, step);\n }\n }\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n if (gl_FragColor.a <= 0.0) {\n discard;\n }\n}\n"),
|
||
Nh = new kh("varying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\nattribute vec2 a_position;\nattribute float a_instruction;\nattribute float a_radius;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n v_center = vec4(u_projectionMatrix * vec4(a_position, 0.0, 1.0)).xy;\n v_pixelRatio = u_pixelRatio;\n float lineWidth = u_lineWidth * u_pixelRatio;\n v_halfWidth = lineWidth / 2.0;\n if (lineWidth == 0.0) {\n lineWidth = 2.0 * u_pixelRatio;\n }\n vec2 offset;\n // Radius with anitaliasing (roughly).\n float radius = a_radius + 3.0 * u_pixelRatio;\n // Until we get gl_VertexID in WebGL, we store an instruction.\n if (a_instruction == 0.0) {\n // Offsetting the edges of the triangle by lineWidth / 2 is necessary, however\n // we should also leave some space for the antialiasing, thus we offset by lineWidth.\n offset = vec2(-1.0, 1.0);\n } else if (a_instruction == 1.0) {\n offset = vec2(-1.0, -1.0);\n } else if (a_instruction == 2.0) {\n offset = vec2(1.0, -1.0);\n } else {\n offset = vec2(1.0, 1.0);\n }\n\n gl_Position = u_projectionMatrix * vec4(a_position + offset * radius, 0.0, 1.0) +\n offsetMatrix * vec4(offset * lineWidth, 0.0, 0.0);\n v_offset = vec4(u_projectionMatrix * vec4(a_position.x + a_radius, a_position.y,\n 0.0, 1.0)).xy;\n\n if (distance(v_center, v_offset) > 20000.0) {\n gl_Position = vec4(v_center, 0.0, 1.0);\n }\n}\n\n\n"),
|
||
Dh = function (t, e) {
|
||
this.u_projectionMatrix = t.getUniformLocation(e, "u_projectionMatrix"), this.u_offsetScaleMatrix = t.getUniformLocation(e, "u_offsetScaleMatrix"), this.u_offsetRotateMatrix = t.getUniformLocation(e, "u_offsetRotateMatrix"), this.u_lineWidth = t.getUniformLocation(e, "u_lineWidth"), this.u_pixelRatio = t.getUniformLocation(e, "u_pixelRatio"), this.u_opacity = t.getUniformLocation(e, "u_opacity"), this.u_fillColor = t.getUniformLocation(e, "u_fillColor"), this.u_strokeColor = t.getUniformLocation(e, "u_strokeColor"), this.u_size = t.getUniformLocation(e, "u_size"), this.a_position = t.getAttribLocation(e, "a_position"), this.a_instruction = t.getAttribLocation(e, "a_instruction"), this.a_radius = t.getAttribLocation(e, "a_radius")
|
||
};
|
||
|
||
function Gh() {
|
||
return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
|
||
}
|
||
|
||
function jh(t, e) {
|
||
return t[0] = e[0], t[1] = e[1], t[4] = e[2], t[5] = e[3], t[12] = e[4], t[13] = e[5], t
|
||
}
|
||
|
||
var zh = function (t) {
|
||
function e(e, i) {
|
||
t.call(this), this.tolerance = e, this.maxExtent = i, this.origin = At(i), this.projectionMatrix_ = [1, 0, 0, 1, 0, 0], this.offsetRotateMatrix_ = [1, 0, 0, 1, 0, 0], this.offsetScaleMatrix_ = [1, 0, 0, 1, 0, 0], this.tmpMat4_ = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], this.indices = [], this.indicesBuffer = null, this.startIndices = [], this.startIndicesFeature = [], this.vertices = [], this.verticesBuffer = null, this.lineStringReplay = void 0
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getDeleteResourcesFunction = function (t) {
|
||
return n()
|
||
}, e.prototype.finish = function (t) {
|
||
n()
|
||
}, e.prototype.setUpProgram = function (t, e, i, r) {
|
||
return n()
|
||
}, e.prototype.shutDownProgram = function (t, e) {
|
||
n()
|
||
}, e.prototype.drawReplay = function (t, e, i, r) {
|
||
n()
|
||
}, e.prototype.drawHitDetectionReplayOneByOne = function (t, e, i, r, o) {
|
||
return n()
|
||
}, e.prototype.drawHitDetectionReplay = function (t, e, i, r, o, n) {
|
||
return o ? this.drawHitDetectionReplayOneByOne(t, e, i, r, n) : this.drawHitDetectionReplayAll(t, e, i, r)
|
||
}, e.prototype.drawHitDetectionReplayAll = function (t, e, i, r) {
|
||
t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), this.drawReplay(t, e, i, !0);
|
||
var o = r(null);
|
||
return o || void 0
|
||
}, e.prototype.replay = function (t, e, i, r, o, n, s, a, l, h, u) {
|
||
var c, p, d, f, g, m, y, v, _ = t.getGL();
|
||
this.lineStringReplay && (c = _.isEnabled(_.STENCIL_TEST), p = _.getParameter(_.STENCIL_FUNC), d = _.getParameter(_.STENCIL_VALUE_MASK), f = _.getParameter(_.STENCIL_REF), g = _.getParameter(_.STENCIL_WRITEMASK), m = _.getParameter(_.STENCIL_FAIL), y = _.getParameter(_.STENCIL_PASS_DEPTH_PASS), v = _.getParameter(_.STENCIL_PASS_DEPTH_FAIL), _.enable(_.STENCIL_TEST), _.clear(_.STENCIL_BUFFER_BIT), _.stencilMask(255), _.stencilFunc(_.ALWAYS, 1, 255), _.stencilOp(_.KEEP, _.KEEP, _.REPLACE), this.lineStringReplay.replay(t, e, i, r, o, n, s, a, l, h, u), _.stencilMask(0), _.stencilFunc(_.NOTEQUAL, 1, 255)), t.bindBuffer(34962, this.verticesBuffer), t.bindBuffer(34963, this.indicesBuffer);
|
||
var x = this.setUpProgram(_, t, o, n), w = ai(this.projectionMatrix_);
|
||
di(w, 2 / (i * o[0]), 2 / (i * o[1])), pi(w, -r), fi(w, -(e[0] - this.origin[0]), -(e[1] - this.origin[1]));
|
||
var b = ai(this.offsetScaleMatrix_);
|
||
di(b, 2 / o[0], 2 / o[1]);
|
||
var C, S = ai(this.offsetRotateMatrix_);
|
||
return 0 !== r && pi(S, -r), _.uniformMatrix4fv(x.u_projectionMatrix, !1, jh(this.tmpMat4_, w)), _.uniformMatrix4fv(x.u_offsetScaleMatrix, !1, jh(this.tmpMat4_, b)), _.uniformMatrix4fv(x.u_offsetRotateMatrix, !1, jh(this.tmpMat4_, S)), _.uniform1f(x.u_opacity, s), void 0 === l ? this.drawReplay(_, t, a, !1) : C = this.drawHitDetectionReplay(_, t, a, l, h, u), this.shutDownProgram(_, x), this.lineStringReplay && (c || _.disable(_.STENCIL_TEST), _.clear(_.STENCIL_BUFFER_BIT), _.stencilFunc(p, f, d), _.stencilMask(g), _.stencilOp(m, v, y)), C
|
||
}, e.prototype.drawElements = function (t, e, i, r) {
|
||
var o = e.hasOESElementIndexUint ? 5125 : 5123, n = r - i, s = i * (e.hasOESElementIndexUint ? 4 : 2);
|
||
t.drawElements(4, n, o, s)
|
||
}, e
|
||
}(Xa), Uh = [0, 0, 0, 1], Bh = [], Vh = [0, 0, 0, 1], Yh = Number.EPSILON || 2.220446049250313e-16,
|
||
Wh = function (t, e, i, r, o, n) {
|
||
var s = (i - t) * (n - e) - (o - t) * (r - e);
|
||
return s <= Yh && s >= -Yh ? void 0 : s > 0
|
||
}, Hh = 35044, Xh = function (t, e) {
|
||
this.arr_ = void 0 !== t ? t : [], this.usage_ = void 0 !== e ? e : Hh
|
||
};
|
||
Xh.prototype.getArray = function () {
|
||
return this.arr_
|
||
}, Xh.prototype.getUsage = function () {
|
||
return this.usage_
|
||
};
|
||
var qh = Xh, Zh = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e, i), this.defaultLocations_ = null, this.styles_ = [], this.styleIndices_ = [], this.radius_ = 0, this.state_ = {
|
||
fillColor: null,
|
||
strokeColor: null,
|
||
lineDash: null,
|
||
lineDashOffset: void 0,
|
||
lineWidth: void 0,
|
||
changed: !1
|
||
}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.drawCoordinates_ = function (t, e, i, r) {
|
||
var o, n, s = this.vertices.length, a = this.indices.length, l = s / 4;
|
||
for (o = e, n = i; o < n; o += r) this.vertices[s++] = t[o], this.vertices[s++] = t[o + 1], this.vertices[s++] = 0, this.vertices[s++] = this.radius_, this.vertices[s++] = t[o], this.vertices[s++] = t[o + 1], this.vertices[s++] = 1, this.vertices[s++] = this.radius_, this.vertices[s++] = t[o], this.vertices[s++] = t[o + 1], this.vertices[s++] = 2, this.vertices[s++] = this.radius_, this.vertices[s++] = t[o], this.vertices[s++] = t[o + 1], this.vertices[s++] = 3, this.vertices[s++] = this.radius_, this.indices[a++] = l, this.indices[a++] = l + 1, this.indices[a++] = l + 2, this.indices[a++] = l + 2, this.indices[a++] = l + 3, this.indices[a++] = l, l += 4
|
||
}, e.prototype.drawCircle = function (t, e) {
|
||
var i = t.getRadius(), r = t.getStride();
|
||
if (i) {
|
||
this.startIndices.push(this.indices.length), this.startIndicesFeature.push(e), this.state_.changed && (this.styleIndices_.push(this.indices.length), this.state_.changed = !1), this.radius_ = i;
|
||
var o = t.getFlatCoordinates();
|
||
o = Qt(o, 0, 2, r, -this.origin[0], -this.origin[1]), this.drawCoordinates_(o, 0, 2, r)
|
||
} else if (this.state_.changed && (this.styles_.pop(), this.styles_.length)) {
|
||
var n = this.styles_[this.styles_.length - 1];
|
||
this.state_.fillColor = n[0], this.state_.strokeColor = n[1], this.state_.lineWidth = n[2], this.state_.changed = !1
|
||
}
|
||
}, e.prototype.finish = function (t) {
|
||
this.verticesBuffer = new qh(this.vertices), this.indicesBuffer = new qh(this.indices), this.startIndices.push(this.indices.length), 0 === this.styleIndices_.length && this.styles_.length > 0 && (this.styles_ = []), this.vertices = null, this.indices = null
|
||
}, e.prototype.getDeleteResourcesFunction = function (t) {
|
||
var e = this.verticesBuffer, i = this.indicesBuffer;
|
||
return function () {
|
||
t.deleteBuffer(e), t.deleteBuffer(i)
|
||
}
|
||
}, e.prototype.setUpProgram = function (t, e, i, r) {
|
||
var o, n = e.getProgram(Fh, Nh);
|
||
return this.defaultLocations_ ? o = this.defaultLocations_ : (o = new Dh(t, n), this.defaultLocations_ = o), e.useProgram(n), t.enableVertexAttribArray(o.a_position), t.vertexAttribPointer(o.a_position, 2, 5126, !1, 16, 0), t.enableVertexAttribArray(o.a_instruction), t.vertexAttribPointer(o.a_instruction, 1, 5126, !1, 16, 8), t.enableVertexAttribArray(o.a_radius), t.vertexAttribPointer(o.a_radius, 1, 5126, !1, 16, 12), t.uniform2fv(o.u_size, i), t.uniform1f(o.u_pixelRatio, r), o
|
||
}, e.prototype.shutDownProgram = function (t, e) {
|
||
t.disableVertexAttribArray(e.a_position), t.disableVertexAttribArray(e.a_instruction), t.disableVertexAttribArray(e.a_radius)
|
||
}, e.prototype.drawReplay = function (t, e, i, r) {
|
||
var o, n, s, a;
|
||
if (g(i)) for (s = this.startIndices[this.startIndices.length - 1], o = this.styleIndices_.length - 1; o >= 0; --o) n = this.styleIndices_[o], a = this.styles_[o], this.setFillStyle_(t, a[0]), this.setStrokeStyle_(t, a[1], a[2]), this.drawElements(t, e, n, s), s = n; else this.drawReplaySkipping_(t, e, i)
|
||
}, e.prototype.drawHitDetectionReplayOneByOne = function (t, e, i, r, o) {
|
||
var n, s, l, h, u, c, p;
|
||
for (p = this.startIndices.length - 2, l = this.startIndices[p + 1], n = this.styleIndices_.length - 1; n >= 0; --n) for (h = this.styles_[n], this.setFillStyle_(t, h[0]), this.setStrokeStyle_(t, h[1], h[2]), u = this.styleIndices_[n]; p >= 0 && this.startIndices[p] >= u;) {
|
||
if (s = this.startIndices[p], void 0 === i[a(c = this.startIndicesFeature[p])] && c.getGeometry() && (void 0 === o || Bt(o, c.getGeometry().getExtent()))) {
|
||
t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), this.drawElements(t, e, s, l);
|
||
var d = r(c);
|
||
if (d) return d
|
||
}
|
||
p--, l = s
|
||
}
|
||
}, e.prototype.drawReplaySkipping_ = function (t, e, i) {
|
||
var r, o, n, s, l, h, u;
|
||
for (h = this.startIndices.length - 2, n = o = this.startIndices[h + 1], r = this.styleIndices_.length - 1; r >= 0; --r) {
|
||
for (s = this.styles_[r], this.setFillStyle_(t, s[0]), this.setStrokeStyle_(t, s[1], s[2]), l = this.styleIndices_[r]; h >= 0 && this.startIndices[h] >= l;) u = this.startIndices[h], i[a(this.startIndicesFeature[h])] && (o !== n && this.drawElements(t, e, o, n), n = u), h--, o = u;
|
||
o !== n && this.drawElements(t, e, o, n), o = n = l
|
||
}
|
||
}, e.prototype.setFillStyle_ = function (t, e) {
|
||
t.uniform4fv(this.defaultLocations_.u_fillColor, e)
|
||
}, e.prototype.setStrokeStyle_ = function (t, e, i) {
|
||
t.uniform4fv(this.defaultLocations_.u_strokeColor, e), t.uniform1f(this.defaultLocations_.u_lineWidth, i)
|
||
}, e.prototype.setFillStrokeStyle = function (t, e) {
|
||
var i, r;
|
||
if (e) {
|
||
var o = e.getLineDash();
|
||
this.state_.lineDash = o || Bh;
|
||
var n = e.getLineDashOffset();
|
||
this.state_.lineDashOffset = n || 0, i = (i = e.getColor()) instanceof CanvasGradient || i instanceof CanvasPattern ? Vh : lo(i).map(function (t, e) {
|
||
return 3 != e ? t / 255 : t
|
||
}) || Vh, r = void 0 !== (r = e.getWidth()) ? r : 1
|
||
} else i = [0, 0, 0, 0], r = 0;
|
||
var s = t ? t.getColor() : [0, 0, 0, 0];
|
||
s = s instanceof CanvasGradient || s instanceof CanvasPattern ? Uh : lo(s).map(function (t, e) {
|
||
return 3 != e ? t / 255 : t
|
||
}) || Uh, this.state_.strokeColor && it(this.state_.strokeColor, i) && this.state_.fillColor && it(this.state_.fillColor, s) && this.state_.lineWidth === r || (this.state_.changed = !0, this.state_.fillColor = s, this.state_.strokeColor = i, this.state_.lineWidth = r, this.styles_.push([s, i, r]))
|
||
}, e
|
||
}(zh),
|
||
Kh = new Ah("precision mediump float;\nvarying vec2 v_texCoord;\nvarying float v_opacity;\n\nuniform float u_opacity;\nuniform sampler2D u_image;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n float alpha = texColor.a * v_opacity * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n"),
|
||
Jh = new kh("varying vec2 v_texCoord;\nvarying float v_opacity;\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec2 a_offsets;\nattribute float a_opacity;\nattribute float a_rotateWithView;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n if (a_rotateWithView == 1.0) {\n offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n }\n vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n v_texCoord = a_texCoord;\n v_opacity = a_opacity;\n}\n\n\n"),
|
||
$h = function (t, e) {
|
||
this.u_projectionMatrix = t.getUniformLocation(e, "u_projectionMatrix"), this.u_offsetScaleMatrix = t.getUniformLocation(e, "u_offsetScaleMatrix"), this.u_offsetRotateMatrix = t.getUniformLocation(e, "u_offsetRotateMatrix"), this.u_opacity = t.getUniformLocation(e, "u_opacity"), this.u_image = t.getUniformLocation(e, "u_image"), this.a_position = t.getAttribLocation(e, "a_position"), this.a_texCoord = t.getAttribLocation(e, "a_texCoord"), this.a_offsets = t.getAttribLocation(e, "a_offsets"), this.a_opacity = t.getAttribLocation(e, "a_opacity"), this.a_rotateWithView = t.getAttribLocation(e, "a_rotateWithView")
|
||
}, Qh = {LOST: "webglcontextlost", RESTORED: "webglcontextrestored"};
|
||
|
||
function tu(t, e, i) {
|
||
var r = t.createTexture();
|
||
return t.bindTexture(t.TEXTURE_2D, r), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, t.LINEAR), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.LINEAR), void 0 !== e && t.texParameteri(Eh, Ch, e), void 0 !== i && t.texParameteri(Eh, Sh, i), r
|
||
}
|
||
|
||
function eu(t, e, i, r, o) {
|
||
var n = tu(t, r, o);
|
||
return t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, e, i, 0, t.RGBA, t.UNSIGNED_BYTE, null), n
|
||
}
|
||
|
||
function iu(t, e, i, r) {
|
||
var o = tu(t, i, r);
|
||
return t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, t.RGBA, t.UNSIGNED_BYTE, e), o
|
||
}
|
||
|
||
var ru = function (t) {
|
||
function e(e, i) {
|
||
t.call(this), this.canvas_ = e, this.gl_ = i, this.bufferCache_ = {}, this.shaderCache_ = {}, this.programCache_ = {}, this.currentProgram_ = null, this.hitDetectionFramebuffer_ = null, this.hitDetectionTexture_ = null, this.hitDetectionRenderbuffer_ = null, this.hasOESElementIndexUint = K(Lh, "OES_element_index_uint"), this.hasOESElementIndexUint && i.getExtension("OES_element_index_uint"), w(this.canvas_, Qh.LOST, this.handleWebGLContextLost, this), w(this.canvas_, Qh.RESTORED, this.handleWebGLContextRestored, this)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.bindBuffer = function (t, e) {
|
||
var i = this.getGL(), r = e.getArray(), o = a(e);
|
||
if (o in this.bufferCache_) {
|
||
var n = this.bufferCache_[o];
|
||
i.bindBuffer(t, n.buffer)
|
||
} else {
|
||
var s, l = i.createBuffer();
|
||
i.bindBuffer(t, l), 34962 == t ? s = new Float32Array(r) : 34963 == t && (s = this.hasOESElementIndexUint ? new Uint32Array(r) : new Uint16Array(r)), i.bufferData(t, s, e.getUsage()), this.bufferCache_[o] = {
|
||
buf: e,
|
||
buffer: l
|
||
}
|
||
}
|
||
}, e.prototype.deleteBuffer = function (t) {
|
||
var e = this.getGL(), i = a(t), r = this.bufferCache_[i];
|
||
e.isContextLost() || e.deleteBuffer(r.buffer), delete this.bufferCache_[i]
|
||
}, e.prototype.disposeInternal = function () {
|
||
E(this.canvas_);
|
||
var t = this.getGL();
|
||
if (!t.isContextLost()) {
|
||
for (var e in this.bufferCache_) t.deleteBuffer(this.bufferCache_[e].buffer);
|
||
for (var i in this.programCache_) t.deleteProgram(this.programCache_[i]);
|
||
for (var r in this.shaderCache_) t.deleteShader(this.shaderCache_[r]);
|
||
t.deleteFramebuffer(this.hitDetectionFramebuffer_), t.deleteRenderbuffer(this.hitDetectionRenderbuffer_), t.deleteTexture(this.hitDetectionTexture_)
|
||
}
|
||
}, e.prototype.getCanvas = function () {
|
||
return this.canvas_
|
||
}, e.prototype.getGL = function () {
|
||
return this.gl_
|
||
}, e.prototype.getHitDetectionFramebuffer = function () {
|
||
return this.hitDetectionFramebuffer_ || this.initHitDetectionFramebuffer_(), this.hitDetectionFramebuffer_
|
||
}, e.prototype.getShader = function (t) {
|
||
var e = a(t);
|
||
if (e in this.shaderCache_) return this.shaderCache_[e];
|
||
var i = this.getGL(), r = i.createShader(t.getType());
|
||
return i.shaderSource(r, t.getSource()), i.compileShader(r), this.shaderCache_[e] = r, r
|
||
}, e.prototype.getProgram = function (t, e) {
|
||
var i = a(t) + "/" + a(e);
|
||
if (i in this.programCache_) return this.programCache_[i];
|
||
var r = this.getGL(), o = r.createProgram();
|
||
return r.attachShader(o, this.getShader(t)), r.attachShader(o, this.getShader(e)), r.linkProgram(o), this.programCache_[i] = o, o
|
||
}, e.prototype.handleWebGLContextLost = function () {
|
||
d(this.bufferCache_), d(this.shaderCache_), d(this.programCache_), this.currentProgram_ = null, this.hitDetectionFramebuffer_ = null, this.hitDetectionTexture_ = null, this.hitDetectionRenderbuffer_ = null
|
||
}, e.prototype.handleWebGLContextRestored = function () {
|
||
}, e.prototype.initHitDetectionFramebuffer_ = function () {
|
||
var t = this.gl_, e = t.createFramebuffer();
|
||
t.bindFramebuffer(t.FRAMEBUFFER, e);
|
||
var i = eu(t, 1, 1), r = t.createRenderbuffer();
|
||
t.bindRenderbuffer(t.RENDERBUFFER, r), t.renderbufferStorage(t.RENDERBUFFER, t.DEPTH_COMPONENT16, 1, 1), t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, i, 0), t.framebufferRenderbuffer(t.FRAMEBUFFER, t.DEPTH_ATTACHMENT, t.RENDERBUFFER, r), t.bindTexture(t.TEXTURE_2D, null), t.bindRenderbuffer(t.RENDERBUFFER, null), t.bindFramebuffer(t.FRAMEBUFFER, null), this.hitDetectionFramebuffer_ = e, this.hitDetectionTexture_ = i, this.hitDetectionRenderbuffer_ = r
|
||
}, e.prototype.useProgram = function (t) {
|
||
return t != this.currentProgram_ && (this.getGL().useProgram(t), this.currentProgram_ = t, !0)
|
||
}, e
|
||
}(R), ou = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e, i), this.anchorX = void 0, this.anchorY = void 0, this.groupIndices = [], this.hitDetectionGroupIndices = [], this.height = void 0, this.imageHeight = void 0, this.imageWidth = void 0, this.defaultLocations = null, this.opacity = void 0, this.originX = void 0, this.originY = void 0, this.rotateWithView = void 0, this.rotation = void 0, this.scale = void 0, this.width = void 0
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getDeleteResourcesFunction = function (t) {
|
||
var e = this.verticesBuffer, i = this.indicesBuffer, r = this.getTextures(!0), o = t.getGL();
|
||
return function () {
|
||
var n, s;
|
||
if (!o.isContextLost()) for (n = 0, s = r.length; n < s; ++n) o.deleteTexture(r[n]);
|
||
t.deleteBuffer(e), t.deleteBuffer(i)
|
||
}
|
||
}, e.prototype.drawCoordinates = function (t, e, i, r) {
|
||
var o, n, s, a, l, h, u = this.anchorX, c = this.anchorY, p = this.height, d = this.imageHeight,
|
||
f = this.imageWidth, g = this.opacity, m = this.originX, y = this.originY,
|
||
v = this.rotateWithView ? 1 : 0, _ = -this.rotation, x = this.scale, w = this.width,
|
||
b = Math.cos(_), C = Math.sin(_), S = this.indices.length, E = this.vertices.length;
|
||
for (o = e; o < i; o += r) l = t[o] - this.origin[0], h = t[o + 1] - this.origin[1], n = E / 8, s = -x * u, a = -x * (p - c), this.vertices[E++] = l, this.vertices[E++] = h, this.vertices[E++] = s * b - a * C, this.vertices[E++] = s * C + a * b, this.vertices[E++] = m / f, this.vertices[E++] = (y + p) / d, this.vertices[E++] = g, this.vertices[E++] = v, s = x * (w - u), a = -x * (p - c), this.vertices[E++] = l, this.vertices[E++] = h, this.vertices[E++] = s * b - a * C, this.vertices[E++] = s * C + a * b, this.vertices[E++] = (m + w) / f, this.vertices[E++] = (y + p) / d, this.vertices[E++] = g, this.vertices[E++] = v, s = x * (w - u), a = x * c, this.vertices[E++] = l, this.vertices[E++] = h, this.vertices[E++] = s * b - a * C, this.vertices[E++] = s * C + a * b, this.vertices[E++] = (m + w) / f, this.vertices[E++] = y / d, this.vertices[E++] = g, this.vertices[E++] = v, s = -x * u, a = x * c, this.vertices[E++] = l, this.vertices[E++] = h, this.vertices[E++] = s * b - a * C, this.vertices[E++] = s * C + a * b, this.vertices[E++] = m / f, this.vertices[E++] = y / d, this.vertices[E++] = g, this.vertices[E++] = v, this.indices[S++] = n, this.indices[S++] = n + 1, this.indices[S++] = n + 2, this.indices[S++] = n, this.indices[S++] = n + 2, this.indices[S++] = n + 3;
|
||
return E
|
||
}, e.prototype.createTextures = function (t, e, i, r) {
|
||
var o, n, s, l, h = e.length;
|
||
for (l = 0; l < h; ++l) (s = a(n = e[l])) in i ? o = i[s] : (o = iu(r, n, 33071, 33071), i[s] = o), t[l] = o
|
||
}, e.prototype.setUpProgram = function (t, e, i, r) {
|
||
var o, n = e.getProgram(Kh, Jh);
|
||
return this.defaultLocations ? o = this.defaultLocations : (o = new $h(t, n), this.defaultLocations = o), e.useProgram(n), t.enableVertexAttribArray(o.a_position), t.vertexAttribPointer(o.a_position, 2, 5126, !1, 32, 0), t.enableVertexAttribArray(o.a_offsets), t.vertexAttribPointer(o.a_offsets, 2, 5126, !1, 32, 8), t.enableVertexAttribArray(o.a_texCoord), t.vertexAttribPointer(o.a_texCoord, 2, 5126, !1, 32, 16), t.enableVertexAttribArray(o.a_opacity), t.vertexAttribPointer(o.a_opacity, 1, 5126, !1, 32, 24), t.enableVertexAttribArray(o.a_rotateWithView), t.vertexAttribPointer(o.a_rotateWithView, 1, 5126, !1, 32, 28), o
|
||
}, e.prototype.shutDownProgram = function (t, e) {
|
||
t.disableVertexAttribArray(e.a_position), t.disableVertexAttribArray(e.a_offsets), t.disableVertexAttribArray(e.a_texCoord), t.disableVertexAttribArray(e.a_opacity), t.disableVertexAttribArray(e.a_rotateWithView)
|
||
}, e.prototype.drawReplay = function (t, e, i, r) {
|
||
var o, n, s, a = r ? this.getHitDetectionTextures() : this.getTextures(),
|
||
l = r ? this.hitDetectionGroupIndices : this.groupIndices;
|
||
if (g(i)) for (o = 0, n = a.length, s = 0; o < n; ++o) {
|
||
t.bindTexture(Eh, a[o]);
|
||
var h = l[o];
|
||
this.drawElements(t, e, s, h), s = h
|
||
} else this.drawReplaySkipping(t, e, i, a, l)
|
||
}, e.prototype.drawReplaySkipping = function (t, e, i, r, o) {
|
||
var n, s, l = 0;
|
||
for (n = 0, s = r.length; n < s; ++n) {
|
||
t.bindTexture(Eh, r[n]);
|
||
for (var h = n > 0 ? o[n - 1] : 0, u = o[n], c = h, p = h; l < this.startIndices.length && this.startIndices[l] <= u;) {
|
||
void 0 !== i[a(this.startIndicesFeature[l])] ? (c !== p && this.drawElements(t, e, c, p), p = c = l === this.startIndices.length - 1 ? u : this.startIndices[l + 1]) : p = l === this.startIndices.length - 1 ? u : this.startIndices[l + 1], l++
|
||
}
|
||
c !== p && this.drawElements(t, e, c, p)
|
||
}
|
||
}, e.prototype.drawHitDetectionReplayOneByOne = function (t, e, i, r, o) {
|
||
var n, s, l, h, u, c = this.startIndices.length - 1, p = this.getHitDetectionTextures();
|
||
for (n = p.length - 1; n >= 0; --n) for (t.bindTexture(Eh, p[n]), s = n > 0 ? this.hitDetectionGroupIndices[n - 1] : 0, h = this.hitDetectionGroupIndices[n]; c >= 0 && this.startIndices[c] >= s;) {
|
||
if (l = this.startIndices[c], void 0 === i[a(u = this.startIndicesFeature[c])] && u.getGeometry() && (void 0 === o || Bt(o, u.getGeometry().getExtent()))) {
|
||
t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), this.drawElements(t, e, l, h);
|
||
var d = r(u);
|
||
if (d) return d
|
||
}
|
||
h = l, c--
|
||
}
|
||
}, e.prototype.finish = function (t) {
|
||
this.anchorX = void 0, this.anchorY = void 0, this.height = void 0, this.imageHeight = void 0, this.imageWidth = void 0, this.indices = null, this.opacity = void 0, this.originX = void 0, this.originY = void 0, this.rotateWithView = void 0, this.rotation = void 0, this.scale = void 0, this.vertices = null, this.width = void 0
|
||
}, e.prototype.getTextures = function (t) {
|
||
return n()
|
||
}, e.prototype.getHitDetectionTextures = function () {
|
||
return n()
|
||
}, e
|
||
}(zh), nu = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e, i), this.images_ = [], this.hitDetectionImages_ = [], this.textures_ = [], this.hitDetectionTextures_ = []
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.drawMultiPoint = function (t, e) {
|
||
this.startIndices.push(this.indices.length), this.startIndicesFeature.push(e);
|
||
var i = t.getFlatCoordinates(), r = t.getStride();
|
||
this.drawCoordinates(i, 0, i.length, r)
|
||
}, e.prototype.drawPoint = function (t, e) {
|
||
this.startIndices.push(this.indices.length), this.startIndicesFeature.push(e);
|
||
var i = t.getFlatCoordinates(), r = t.getStride();
|
||
this.drawCoordinates(i, 0, i.length, r)
|
||
}, e.prototype.finish = function (e) {
|
||
var i = e.getGL();
|
||
this.groupIndices.push(this.indices.length), this.hitDetectionGroupIndices.push(this.indices.length), this.verticesBuffer = new qh(this.vertices);
|
||
var r = this.indices;
|
||
this.indicesBuffer = new qh(r);
|
||
var o = {};
|
||
this.createTextures(this.textures_, this.images_, o, i), this.createTextures(this.hitDetectionTextures_, this.hitDetectionImages_, o, i), this.images_ = null, this.hitDetectionImages_ = null, t.prototype.finish.call(this, e)
|
||
}, e.prototype.setImageStyle = function (t) {
|
||
var e = t.getAnchor(), i = t.getImage(1), r = t.getImageSize(), o = t.getHitDetectionImage(1),
|
||
n = t.getOpacity(), s = t.getOrigin(), l = t.getRotateWithView(), h = t.getRotation(),
|
||
u = t.getSize(), c = t.getScale();
|
||
0 === this.images_.length ? this.images_.push(i) : a(this.images_[this.images_.length - 1]) != a(i) && (this.groupIndices.push(this.indices.length), this.images_.push(i)), 0 === this.hitDetectionImages_.length ? this.hitDetectionImages_.push(o) : a(this.hitDetectionImages_[this.hitDetectionImages_.length - 1]) != a(o) && (this.hitDetectionGroupIndices.push(this.indices.length), this.hitDetectionImages_.push(o)), this.anchorX = e[0], this.anchorY = e[1], this.height = u[1], this.imageHeight = r[1], this.imageWidth = r[0], this.opacity = n, this.originX = s[0], this.originY = s[1], this.rotation = h, this.rotateWithView = l, this.scale = c, this.width = u[0]
|
||
}, e.prototype.getTextures = function (t) {
|
||
return t ? this.textures_.concat(this.hitDetectionTextures_) : this.textures_
|
||
}, e.prototype.getHitDetectionTextures = function () {
|
||
return this.hitDetectionTextures_
|
||
}, e
|
||
}(ou);
|
||
|
||
function su(t, e, i, r) {
|
||
var o = i - r;
|
||
return t[e] === t[o] && t[e + 1] === t[o + 1] && (i - e) / r > 3 && !!Ci(t, e, i, r)
|
||
}
|
||
|
||
var au = new Ah("precision mediump float;\nvarying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_color;\nuniform vec2 u_size;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n if (v_round > 0.0) {\n vec2 windowCoords = vec2((v_roundVertex.x + 1.0) / 2.0 * u_size.x * u_pixelRatio,\n (v_roundVertex.y + 1.0) / 2.0 * u_size.y * u_pixelRatio);\n if (length(windowCoords - gl_FragCoord.xy) > v_halfWidth * u_pixelRatio) {\n discard;\n }\n }\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n"),
|
||
lu = new kh("varying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\nattribute vec2 a_lastPos;\nattribute vec2 a_position;\nattribute vec2 a_nextPos;\nattribute float a_direction;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_miterLimit;\n\nbool nearlyEquals(in float value, in float ref) {\n float epsilon = 0.000000000001;\n return value >= ref - epsilon && value <= ref + epsilon;\n}\n\nvoid alongNormal(out vec2 offset, in vec2 nextP, in float turnDir, in float direction) {\n vec2 dirVect = nextP - a_position;\n vec2 normal = normalize(vec2(-turnDir * dirVect.y, turnDir * dirVect.x));\n offset = u_lineWidth / 2.0 * normal * direction;\n}\n\nvoid miterUp(out vec2 offset, out float round, in bool isRound, in float direction) {\n float halfWidth = u_lineWidth / 2.0;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_nextPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n round = 0.0;\n if (isRound) {\n round = 1.0;\n } else if (miterLength > u_miterLimit + u_lineWidth) {\n offset = halfWidth * tmpNormal * direction;\n }\n}\n\nbool miterDown(out vec2 offset, in vec4 projPos, in mat4 offsetMatrix, in float direction) {\n bool degenerate = false;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_lastPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n vec2 longOffset, shortOffset, longVertex;\n vec4 shortProjVertex;\n float halfWidth = u_lineWidth / 2.0;\n if (length(a_nextPos - a_position) > length(a_lastPos - a_position)) {\n longOffset = tmpNormal * direction * halfWidth;\n shortOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_nextPos;\n shortProjVertex = u_projectionMatrix * vec4(a_lastPos, 0.0, 1.0);\n } else {\n shortOffset = tmpNormal * direction * halfWidth;\n longOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_lastPos;\n shortProjVertex = u_projectionMatrix * vec4(a_nextPos, 0.0, 1.0);\n }\n //Intersection algorithm based on theory by Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).\n vec4 p1 = u_projectionMatrix * vec4(longVertex, 0.0, 1.0) + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p2 = projPos + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p3 = shortProjVertex + offsetMatrix * vec4(-shortOffset, 0.0, 0.0);\n vec4 p4 = shortProjVertex + offsetMatrix * vec4(shortOffset, 0.0, 0.0);\n float denom = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);\n float firstU = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n float secondU = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n float epsilon = 0.000000000001;\n if (firstU > epsilon && firstU < 1.0 - epsilon && secondU > epsilon && secondU < 1.0 - epsilon) {\n shortProjVertex.x = p1.x + firstU * (p2.x - p1.x);\n shortProjVertex.y = p1.y + firstU * (p2.y - p1.y);\n offset = shortProjVertex.xy;\n degenerate = true;\n } else {\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n }\n return degenerate;\n}\n\nvoid squareCap(out vec2 offset, out float round, in bool isRound, in vec2 nextP,\n in float turnDir, in float direction) {\n round = 0.0;\n vec2 dirVect = a_position - nextP;\n vec2 firstNormal = normalize(dirVect);\n vec2 secondNormal = vec2(turnDir * firstNormal.y * direction, -turnDir * firstNormal.x * direction);\n vec2 hypotenuse = normalize(firstNormal - secondNormal);\n vec2 normal = vec2(turnDir * hypotenuse.y * direction, -turnDir * hypotenuse.x * direction);\n float length = sqrt(v_halfWidth * v_halfWidth * 2.0);\n offset = normal * length;\n if (isRound) {\n round = 1.0;\n }\n}\n\nvoid main(void) {\n bool degenerate = false;\n float direction = float(sign(a_direction));\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n vec2 offset;\n vec4 projPos = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n bool round = nearlyEquals(mod(a_direction, 2.0), 0.0);\n\n v_round = 0.0;\n v_halfWidth = u_lineWidth / 2.0;\n v_roundVertex = projPos.xy;\n\n if (nearlyEquals(mod(a_direction, 3.0), 0.0) || nearlyEquals(mod(a_direction, 17.0), 0.0)) {\n alongNormal(offset, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 5.0), 0.0) || nearlyEquals(mod(a_direction, 13.0), 0.0)) {\n alongNormal(offset, a_lastPos, -1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 23.0), 0.0)) {\n miterUp(offset, v_round, round, direction);\n } else if (nearlyEquals(mod(a_direction, 19.0), 0.0)) {\n degenerate = miterDown(offset, projPos, offsetMatrix, direction);\n } else if (nearlyEquals(mod(a_direction, 7.0), 0.0)) {\n squareCap(offset, v_round, round, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 11.0), 0.0)) {\n squareCap(offset, v_round, round, a_lastPos, -1.0, direction);\n }\n if (!degenerate) {\n vec4 offsets = offsetMatrix * vec4(offset, 0.0, 0.0);\n gl_Position = projPos + offsets;\n } else {\n gl_Position = vec4(offset, 0.0, 1.0);\n }\n}\n\n\n"),
|
||
hu = function (t, e) {
|
||
this.u_projectionMatrix = t.getUniformLocation(e, "u_projectionMatrix"), this.u_offsetScaleMatrix = t.getUniformLocation(e, "u_offsetScaleMatrix"), this.u_offsetRotateMatrix = t.getUniformLocation(e, "u_offsetRotateMatrix"), this.u_lineWidth = t.getUniformLocation(e, "u_lineWidth"), this.u_miterLimit = t.getUniformLocation(e, "u_miterLimit"), this.u_opacity = t.getUniformLocation(e, "u_opacity"), this.u_color = t.getUniformLocation(e, "u_color"), this.u_size = t.getUniformLocation(e, "u_size"), this.u_pixelRatio = t.getUniformLocation(e, "u_pixelRatio"), this.a_lastPos = t.getAttribLocation(e, "a_lastPos"), this.a_position = t.getAttribLocation(e, "a_position"), this.a_nextPos = t.getAttribLocation(e, "a_nextPos"), this.a_direction = t.getAttribLocation(e, "a_direction")
|
||
}, uu = 3, cu = 5, pu = 7, du = 11, fu = 13, gu = 17, mu = 19, yu = 23, vu = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e, i), this.defaultLocations_ = null, this.styles_ = [], this.styleIndices_ = [], this.state_ = {
|
||
strokeColor: null,
|
||
lineCap: void 0,
|
||
lineDash: null,
|
||
lineDashOffset: void 0,
|
||
lineJoin: void 0,
|
||
lineWidth: void 0,
|
||
miterLimit: void 0,
|
||
changed: !1
|
||
}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.drawCoordinates_ = function (t, e, i, r) {
|
||
var o, n, s, a, l, h, u, c, p = this.vertices.length, d = this.indices.length,
|
||
f = "bevel" === this.state_.lineJoin ? 0 : "miter" === this.state_.lineJoin ? 1 : 2,
|
||
g = "butt" === this.state_.lineCap ? 0 : "square" === this.state_.lineCap ? 1 : 2,
|
||
m = su(t, e, i, r), y = d, v = 1;
|
||
for (o = e, n = i; o < n; o += r) {
|
||
if (l = p / 7, h = u, u = c || [t[o], t[o + 1]], o === e) {
|
||
if (c = [t[o + r], t[o + r + 1]], i - e == 2 * r && it(u, c)) break;
|
||
if (!m) {
|
||
g && (p = this.addVertices_([0, 0], u, c, v * pu * g, p), p = this.addVertices_([0, 0], u, c, -v * pu * g, p), this.indices[d++] = l + 2, this.indices[d++] = l, this.indices[d++] = l + 1, this.indices[d++] = l + 1, this.indices[d++] = l + 3, this.indices[d++] = l + 2), p = this.addVertices_([0, 0], u, c, v * uu * (g || 1), p), y = (p = this.addVertices_([0, 0], u, c, -v * uu * (g || 1), p)) / 7 - 1;
|
||
continue
|
||
}
|
||
h = [t[i - 2 * r], t[i - 2 * r + 1]], s = c
|
||
} else {
|
||
if (o === i - r) {
|
||
if (m) {
|
||
c = s;
|
||
break
|
||
}
|
||
h = h || [0, 0], p = this.addVertices_(h, u, [0, 0], v * cu * (g || 1), p), p = this.addVertices_(h, u, [0, 0], -v * cu * (g || 1), p), this.indices[d++] = l, this.indices[d++] = y - 1, this.indices[d++] = y, this.indices[d++] = y, this.indices[d++] = l + 1, this.indices[d++] = l, g && (p = this.addVertices_(h, u, [0, 0], v * du * g, p), p = this.addVertices_(h, u, [0, 0], -v * du * g, p), this.indices[d++] = l + 2, this.indices[d++] = l, this.indices[d++] = l + 1, this.indices[d++] = l + 1, this.indices[d++] = l + 3, this.indices[d++] = l + 2);
|
||
break
|
||
}
|
||
c = [t[o + r], t[o + r + 1]]
|
||
}
|
||
a = Wh(h[0], h[1], u[0], u[1], c[0], c[1]) ? -1 : 1, p = this.addVertices_(h, u, c, a * fu * (f || 1), p), p = this.addVertices_(h, u, c, a * gu * (f || 1), p), p = this.addVertices_(h, u, c, -a * mu * (f || 1), p), o > e && (this.indices[d++] = l, this.indices[d++] = y - 1, this.indices[d++] = y, this.indices[d++] = l + 2, this.indices[d++] = l, this.indices[d++] = v * a > 0 ? y : y - 1), this.indices[d++] = l, this.indices[d++] = l + 2, this.indices[d++] = l + 1, y = l + 2, v = a, f && (p = this.addVertices_(h, u, c, a * yu * f, p), this.indices[d++] = l + 1, this.indices[d++] = l + 3, this.indices[d++] = l)
|
||
}
|
||
m && (l = l || p / 7, a = lr([h[0], h[1], u[0], u[1], c[0], c[1]], 0, 6, 2) ? 1 : -1, p = this.addVertices_(h, u, c, a * fu * (f || 1), p), p = this.addVertices_(h, u, c, -a * mu * (f || 1), p), this.indices[d++] = l, this.indices[d++] = y - 1, this.indices[d++] = y, this.indices[d++] = l + 1, this.indices[d++] = l, this.indices[d++] = v * a > 0 ? y : y - 1)
|
||
}, e.prototype.addVertices_ = function (t, e, i, r, o) {
|
||
return this.vertices[o++] = t[0], this.vertices[o++] = t[1], this.vertices[o++] = e[0], this.vertices[o++] = e[1], this.vertices[o++] = i[0], this.vertices[o++] = i[1], this.vertices[o++] = r, o
|
||
}, e.prototype.isValid_ = function (t, e, i, r) {
|
||
var o = i - e;
|
||
return !(o < 2 * r) && (o !== 2 * r || !it([t[e], t[e + 1]], [t[e + r], t[e + r + 1]]))
|
||
}, e.prototype.drawLineString = function (t, e) {
|
||
var i = t.getFlatCoordinates(), r = t.getStride();
|
||
this.isValid_(i, 0, i.length, r) && (i = Qt(i, 0, i.length, r, -this.origin[0], -this.origin[1]), this.state_.changed && (this.styleIndices_.push(this.indices.length), this.state_.changed = !1), this.startIndices.push(this.indices.length), this.startIndicesFeature.push(e), this.drawCoordinates_(i, 0, i.length, r))
|
||
}, e.prototype.drawMultiLineString = function (t, e) {
|
||
var i = this.indices.length, r = t.getEnds();
|
||
r.unshift(0);
|
||
var o, n, s = t.getFlatCoordinates(), a = t.getStride();
|
||
if (r.length > 1) for (o = 1, n = r.length; o < n; ++o) if (this.isValid_(s, r[o - 1], r[o], a)) {
|
||
var l = Qt(s, r[o - 1], r[o], a, -this.origin[0], -this.origin[1]);
|
||
this.drawCoordinates_(l, 0, l.length, a)
|
||
}
|
||
this.indices.length > i && (this.startIndices.push(i), this.startIndicesFeature.push(e), this.state_.changed && (this.styleIndices_.push(i), this.state_.changed = !1))
|
||
}, e.prototype.drawPolygonCoordinates = function (t, e, i) {
|
||
var r, o;
|
||
if (su(t, 0, t.length, i) || (t.push(t[0]), t.push(t[1])), this.drawCoordinates_(t, 0, t.length, i), e.length) for (r = 0, o = e.length; r < o; ++r) su(e[r], 0, e[r].length, i) || (e[r].push(e[r][0]), e[r].push(e[r][1])), this.drawCoordinates_(e[r], 0, e[r].length, i)
|
||
}, e.prototype.setPolygonStyle = function (t, e) {
|
||
var i = void 0 === e ? this.indices.length : e;
|
||
this.startIndices.push(i), this.startIndicesFeature.push(t), this.state_.changed && (this.styleIndices_.push(i), this.state_.changed = !1)
|
||
}, e.prototype.getCurrentIndex = function () {
|
||
return this.indices.length
|
||
}, e.prototype.finish = function (t) {
|
||
this.verticesBuffer = new qh(this.vertices), this.indicesBuffer = new qh(this.indices), this.startIndices.push(this.indices.length), 0 === this.styleIndices_.length && this.styles_.length > 0 && (this.styles_ = []), this.vertices = null, this.indices = null
|
||
}, e.prototype.getDeleteResourcesFunction = function (t) {
|
||
var e = this.verticesBuffer, i = this.indicesBuffer;
|
||
return function () {
|
||
t.deleteBuffer(e), t.deleteBuffer(i)
|
||
}
|
||
}, e.prototype.setUpProgram = function (t, e, i, r) {
|
||
var o, n = e.getProgram(au, lu);
|
||
return this.defaultLocations_ ? o = this.defaultLocations_ : (o = new hu(t, n), this.defaultLocations_ = o), e.useProgram(n), t.enableVertexAttribArray(o.a_lastPos), t.vertexAttribPointer(o.a_lastPos, 2, 5126, !1, 28, 0), t.enableVertexAttribArray(o.a_position), t.vertexAttribPointer(o.a_position, 2, 5126, !1, 28, 8), t.enableVertexAttribArray(o.a_nextPos), t.vertexAttribPointer(o.a_nextPos, 2, 5126, !1, 28, 16), t.enableVertexAttribArray(o.a_direction), t.vertexAttribPointer(o.a_direction, 1, 5126, !1, 28, 24), t.uniform2fv(o.u_size, i), t.uniform1f(o.u_pixelRatio, r), o
|
||
}, e.prototype.shutDownProgram = function (t, e) {
|
||
t.disableVertexAttribArray(e.a_lastPos), t.disableVertexAttribArray(e.a_position), t.disableVertexAttribArray(e.a_nextPos), t.disableVertexAttribArray(e.a_direction)
|
||
}, e.prototype.drawReplay = function (t, e, i, r) {
|
||
var o, n, s, a, l = t.getParameter(t.DEPTH_FUNC), h = t.getParameter(t.DEPTH_WRITEMASK);
|
||
if (r || (t.enable(t.DEPTH_TEST), t.depthMask(!0), t.depthFunc(t.NOTEQUAL)), g(i)) for (s = this.startIndices[this.startIndices.length - 1], o = this.styleIndices_.length - 1; o >= 0; --o) n = this.styleIndices_[o], a = this.styles_[o], this.setStrokeStyle_(t, a[0], a[1], a[2]), this.drawElements(t, e, n, s), t.clear(t.DEPTH_BUFFER_BIT), s = n; else this.drawReplaySkipping_(t, e, i);
|
||
r || (t.disable(t.DEPTH_TEST), t.clear(t.DEPTH_BUFFER_BIT), t.depthMask(h), t.depthFunc(l))
|
||
}, e.prototype.drawReplaySkipping_ = function (t, e, i) {
|
||
var r, o, n, s, l, h, u;
|
||
for (h = this.startIndices.length - 2, n = o = this.startIndices[h + 1], r = this.styleIndices_.length - 1; r >= 0; --r) {
|
||
for (s = this.styles_[r], this.setStrokeStyle_(t, s[0], s[1], s[2]), l = this.styleIndices_[r]; h >= 0 && this.startIndices[h] >= l;) u = this.startIndices[h], i[a(this.startIndicesFeature[h])] && (o !== n && (this.drawElements(t, e, o, n), t.clear(t.DEPTH_BUFFER_BIT)), n = u), h--, o = u;
|
||
o !== n && (this.drawElements(t, e, o, n), t.clear(t.DEPTH_BUFFER_BIT)), o = n = l
|
||
}
|
||
}, e.prototype.drawHitDetectionReplayOneByOne = function (t, e, i, r, o) {
|
||
var n, s, l, h, u, c, p;
|
||
for (p = this.startIndices.length - 2, l = this.startIndices[p + 1], n = this.styleIndices_.length - 1; n >= 0; --n) for (h = this.styles_[n], this.setStrokeStyle_(t, h[0], h[1], h[2]), u = this.styleIndices_[n]; p >= 0 && this.startIndices[p] >= u;) {
|
||
if (s = this.startIndices[p], void 0 === i[a(c = this.startIndicesFeature[p])] && c.getGeometry() && (void 0 === o || Bt(o, c.getGeometry().getExtent()))) {
|
||
t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), this.drawElements(t, e, s, l);
|
||
var d = r(c);
|
||
if (d) return d
|
||
}
|
||
p--, l = s
|
||
}
|
||
}, e.prototype.setStrokeStyle_ = function (t, e, i, r) {
|
||
t.uniform4fv(this.defaultLocations_.u_color, e), t.uniform1f(this.defaultLocations_.u_lineWidth, i), t.uniform1f(this.defaultLocations_.u_miterLimit, r)
|
||
}, e.prototype.setFillStrokeStyle = function (t, e) {
|
||
var i = e.getLineCap();
|
||
this.state_.lineCap = void 0 !== i ? i : "round";
|
||
var r = e.getLineDash();
|
||
this.state_.lineDash = r || Bh;
|
||
var o = e.getLineDashOffset();
|
||
this.state_.lineDashOffset = o || 0;
|
||
var n = e.getLineJoin();
|
||
this.state_.lineJoin = void 0 !== n ? n : "round";
|
||
var s = e.getColor();
|
||
s = s instanceof CanvasGradient || s instanceof CanvasPattern ? Vh : lo(s).map(function (t, e) {
|
||
return 3 != e ? t / 255 : t
|
||
}) || Vh;
|
||
var a = e.getWidth();
|
||
a = void 0 !== a ? a : 1;
|
||
var l = e.getMiterLimit();
|
||
l = void 0 !== l ? l : 10, this.state_.strokeColor && it(this.state_.strokeColor, s) && this.state_.lineWidth === a && this.state_.miterLimit === l || (this.state_.changed = !0, this.state_.strokeColor = s, this.state_.lineWidth = a, this.state_.miterLimit = l, this.styles_.push([s, a, l]))
|
||
}, e
|
||
}(zh),
|
||
_u = new Ah("precision mediump float;\n\n\n\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main(void) {\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n"),
|
||
xu = new kh("\n\nattribute vec2 a_position;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n}\n\n\n"),
|
||
wu = function (t, e) {
|
||
this.u_projectionMatrix = t.getUniformLocation(e, "u_projectionMatrix"), this.u_offsetScaleMatrix = t.getUniformLocation(e, "u_offsetScaleMatrix"), this.u_offsetRotateMatrix = t.getUniformLocation(e, "u_offsetRotateMatrix"), this.u_color = t.getUniformLocation(e, "u_color"), this.u_opacity = t.getUniformLocation(e, "u_opacity"), this.a_position = t.getAttribLocation(e, "a_position")
|
||
}, bu = function (t) {
|
||
this.first_, this.last_, this.head_, this.circular_ = void 0 === t || t, this.length_ = 0
|
||
};
|
||
bu.prototype.insertItem = function (t) {
|
||
var e = {prev: void 0, next: void 0, data: t}, i = this.head_;
|
||
if (i) {
|
||
var r = i.next;
|
||
e.prev = i, e.next = r, i.next = e, r && (r.prev = e), i === this.last_ && (this.last_ = e)
|
||
} else this.first_ = e, this.last_ = e, this.circular_ && (e.next = e, e.prev = e);
|
||
this.head_ = e, this.length_++
|
||
}, bu.prototype.removeItem = function () {
|
||
var t = this.head_;
|
||
if (t) {
|
||
var e = t.next, i = t.prev;
|
||
e && (e.prev = i), i && (i.next = e), this.head_ = e || i, this.first_ === this.last_ ? (this.head_ = void 0, this.first_ = void 0, this.last_ = void 0) : this.first_ === t ? this.first_ = this.head_ : this.last_ === t && (this.last_ = i ? this.head_.prev : this.head_), this.length_--
|
||
}
|
||
}, bu.prototype.firstItem = function () {
|
||
if (this.head_ = this.first_, this.head_) return this.head_.data
|
||
}, bu.prototype.lastItem = function () {
|
||
if (this.head_ = this.last_, this.head_) return this.head_.data
|
||
}, bu.prototype.nextItem = function () {
|
||
if (this.head_ && this.head_.next) return this.head_ = this.head_.next, this.head_.data
|
||
}, bu.prototype.getNextItem = function () {
|
||
if (this.head_ && this.head_.next) return this.head_.next.data
|
||
}, bu.prototype.prevItem = function () {
|
||
if (this.head_ && this.head_.prev) return this.head_ = this.head_.prev, this.head_.data
|
||
}, bu.prototype.getPrevItem = function () {
|
||
if (this.head_ && this.head_.prev) return this.head_.prev.data
|
||
}, bu.prototype.getCurrItem = function () {
|
||
if (this.head_) return this.head_.data
|
||
}, bu.prototype.setFirstItem = function () {
|
||
this.circular_ && this.head_ && (this.first_ = this.head_, this.last_ = this.head_.prev)
|
||
}, bu.prototype.concat = function (t) {
|
||
if (t.head_) {
|
||
if (this.head_) {
|
||
var e = this.head_.next;
|
||
this.head_.next = t.first_, t.first_.prev = this.head_, e.prev = t.last_, t.last_.next = e, this.length_ += t.length_
|
||
} else this.head_ = t.head_, this.first_ = t.first_, this.last_ = t.last_, this.length_ = t.length_;
|
||
t.head_ = void 0, t.first_ = void 0, t.last_ = void 0, t.length_ = 0
|
||
}
|
||
}, bu.prototype.getLength = function () {
|
||
return this.length_
|
||
};
|
||
var Cu = bu, Su = function (t) {
|
||
this.rbush_ = ml()(t, void 0), this.items_ = {}
|
||
};
|
||
Su.prototype.insert = function (t, e) {
|
||
var i = {minX: t[0], minY: t[1], maxX: t[2], maxY: t[3], value: e};
|
||
this.rbush_.insert(i), this.items_[a(e)] = i
|
||
}, Su.prototype.load = function (t, e) {
|
||
for (var i = new Array(e.length), r = 0, o = e.length; r < o; r++) {
|
||
var n = t[r], s = e[r], l = {minX: n[0], minY: n[1], maxX: n[2], maxY: n[3], value: s};
|
||
i[r] = l, this.items_[a(s)] = l
|
||
}
|
||
this.rbush_.load(i)
|
||
}, Su.prototype.remove = function (t) {
|
||
var e = a(t), i = this.items_[e];
|
||
return delete this.items_[e], null !== this.rbush_.remove(i)
|
||
}, Su.prototype.update = function (t, e) {
|
||
var i = this.items_[a(e)];
|
||
bt([i.minX, i.minY, i.maxX, i.maxY], t) || (this.remove(e), this.insert(t, e))
|
||
}, Su.prototype.getAll = function () {
|
||
return this.rbush_.all().map(function (t) {
|
||
return t.value
|
||
})
|
||
}, Su.prototype.getInExtent = function (t) {
|
||
var e = {minX: t[0], minY: t[1], maxX: t[2], maxY: t[3]};
|
||
return this.rbush_.search(e).map(function (t) {
|
||
return t.value
|
||
})
|
||
}, Su.prototype.forEach = function (t, e) {
|
||
return this.forEach_(this.getAll(), t, e)
|
||
}, Su.prototype.forEachInExtent = function (t, e, i) {
|
||
return this.forEach_(this.getInExtent(t), e, i)
|
||
}, Su.prototype.forEach_ = function (t, e, i) {
|
||
for (var r, o = 0, n = t.length; o < n; o++) if (r = e.call(i, t[o])) return r;
|
||
return r
|
||
}, Su.prototype.isEmpty = function () {
|
||
return g(this.items_)
|
||
}, Su.prototype.clear = function () {
|
||
this.rbush_.clear(), this.items_ = {}
|
||
}, Su.prototype.getExtent = function (t) {
|
||
var e = this.rbush_.toJSON();
|
||
return yt(e.minX, e.minY, e.maxX, e.maxY, t)
|
||
}, Su.prototype.concat = function (t) {
|
||
for (var e in this.rbush_.load(t.rbush_.all()), t.items_) this.items_[e] = t.items_[e]
|
||
};
|
||
var Eu = Su, Tu = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e, i), this.lineStringReplay = new vu(e, i), this.defaultLocations_ = null, this.styles_ = [], this.styleIndices_ = [], this.state_ = {
|
||
fillColor: null,
|
||
changed: !1
|
||
}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.drawCoordinates_ = function (t, e, i) {
|
||
var r = new Cu, o = new Eu;
|
||
this.processFlatCoordinates_(t, i, r, o, !0);
|
||
var n = this.getMaxCoords_(r);
|
||
if (e.length) {
|
||
var s, a, l = [];
|
||
for (s = 0, a = e.length; s < a; ++s) {
|
||
var h = {list: new Cu, maxCoords: void 0, rtree: new Eu};
|
||
l.push(h), this.processFlatCoordinates_(e[s], i, h.list, h.rtree, !1), this.classifyPoints_(h.list, h.rtree, !0), h.maxCoords = this.getMaxCoords_(h.list)
|
||
}
|
||
for (l.sort(function (t, e) {
|
||
return e.maxCoords[0] === t.maxCoords[0] ? t.maxCoords[1] - e.maxCoords[1] : e.maxCoords[0] - t.maxCoords[0]
|
||
}), s = 0; s < l.length; ++s) {
|
||
var u = l[s].list, c = u.firstItem(), p = c, d = void 0;
|
||
do {
|
||
if (this.getIntersections_(p, o).length) {
|
||
d = !0;
|
||
break
|
||
}
|
||
p = u.nextItem()
|
||
} while (c !== p);
|
||
d || this.bridgeHole_(u, l[s].maxCoords[0], r, n[0], o) && (o.concat(l[s].rtree), this.classifyPoints_(r, o, !1))
|
||
}
|
||
} else this.classifyPoints_(r, o, !1);
|
||
this.triangulate_(r, o)
|
||
}, e.prototype.processFlatCoordinates_ = function (t, e, i, r, o) {
|
||
var n, s, a, l, h, u = lr(t, 0, t.length, e), c = this.vertices.length / 2, p = [], d = [];
|
||
if (o === u) {
|
||
for (l = a = this.createPoint_(t[0], t[1], c++), n = e, s = t.length; n < s; n += e) h = this.createPoint_(t[n], t[n + 1], c++), d.push(this.insertItem_(l, h, i)), p.push([Math.min(l.x, h.x), Math.min(l.y, h.y), Math.max(l.x, h.x), Math.max(l.y, h.y)]), l = h;
|
||
d.push(this.insertItem_(h, a, i)), p.push([Math.min(l.x, h.x), Math.min(l.y, h.y), Math.max(l.x, h.x), Math.max(l.y, h.y)])
|
||
} else {
|
||
var f = t.length - e;
|
||
for (l = a = this.createPoint_(t[f], t[f + 1], c++), n = f - e, s = 0; n >= s; n -= e) h = this.createPoint_(t[n], t[n + 1], c++), d.push(this.insertItem_(l, h, i)), p.push([Math.min(l.x, h.x), Math.min(l.y, h.y), Math.max(l.x, h.x), Math.max(l.y, h.y)]), l = h;
|
||
d.push(this.insertItem_(h, a, i)), p.push([Math.min(l.x, h.x), Math.min(l.y, h.y), Math.max(l.x, h.x), Math.max(l.y, h.y)])
|
||
}
|
||
r.load(p, d)
|
||
}, e.prototype.getMaxCoords_ = function (t) {
|
||
var e = t.firstItem(), i = e, r = [i.p0.x, i.p0.y];
|
||
do {
|
||
(i = t.nextItem()).p0.x > r[0] && (r = [i.p0.x, i.p0.y])
|
||
} while (i !== e);
|
||
return r
|
||
}, e.prototype.classifyPoints_ = function (t, e, i) {
|
||
var r = t.firstItem(), o = r, n = t.nextItem(), s = !1;
|
||
do {
|
||
var a = i ? Wh(n.p1.x, n.p1.y, o.p1.x, o.p1.y, o.p0.x, o.p0.y) : Wh(o.p0.x, o.p0.y, o.p1.x, o.p1.y, n.p1.x, n.p1.y);
|
||
void 0 === a ? (this.removeItem_(o, n, t, e), s = !0, n === r && (r = t.getNextItem()), n = o, t.prevItem()) : o.p1.reflex !== a && (o.p1.reflex = a, s = !0), o = n, n = t.nextItem()
|
||
} while (o !== r);
|
||
return s
|
||
}, e.prototype.bridgeHole_ = function (t, e, i, r, o) {
|
||
for (var n = t.firstItem(); n.p1.x !== e;) n = t.nextItem();
|
||
var s, a, l, h, u = n.p1, c = {x: r, y: u.y, i: -1}, p = 1 / 0,
|
||
d = this.getIntersections_({p0: u, p1: c}, o, !0);
|
||
for (s = 0, a = d.length; s < a; ++s) {
|
||
var f = d[s], g = this.calculateIntersection_(u, c, f.p0, f.p1, !0), m = Math.abs(u.x - g[0]);
|
||
m < p && void 0 !== Wh(u.x, u.y, f.p0.x, f.p0.y, f.p1.x, f.p1.y) && (p = m, h = {
|
||
x: g[0],
|
||
y: g[1],
|
||
i: -1
|
||
}, n = f)
|
||
}
|
||
if (p === 1 / 0) return !1;
|
||
if (l = n.p1, p > 0) {
|
||
var y = this.getPointsInTriangle_(u, h, n.p1, o);
|
||
if (y.length) {
|
||
var v = 1 / 0;
|
||
for (s = 0, a = y.length; s < a; ++s) {
|
||
var _ = y[s], x = Math.atan2(u.y - _.y, c.x - _.x);
|
||
(x < v || x === v && _.x < l.x) && (v = x, l = _)
|
||
}
|
||
}
|
||
}
|
||
for (n = i.firstItem(); n.p1.x !== l.x || n.p1.y !== l.y;) n = i.nextItem();
|
||
var w = {x: u.x, y: u.y, i: u.i, reflex: void 0}, b = {x: n.p1.x, y: n.p1.y, i: n.p1.i, reflex: void 0};
|
||
return t.getNextItem().p0 = w, this.insertItem_(u, n.p1, t, o), this.insertItem_(b, w, t, o), n.p1 = b, t.setFirstItem(), i.concat(t), !0
|
||
}, e.prototype.triangulate_ = function (t, e) {
|
||
for (var i = !1, r = this.isSimple_(t, e); t.getLength() > 3;) if (r) {
|
||
if (!this.clipEars_(t, e, r, i) && !this.classifyPoints_(t, e, i) && !this.resolveSelfIntersections_(t, e, !0)) break
|
||
} else if (!this.clipEars_(t, e, r, i) && !this.classifyPoints_(t, e, i) && !this.resolveSelfIntersections_(t, e)) {
|
||
if (!(r = this.isSimple_(t, e))) {
|
||
this.splitPolygon_(t, e);
|
||
break
|
||
}
|
||
i = !this.isClockwise_(t), this.classifyPoints_(t, e, i)
|
||
}
|
||
if (3 === t.getLength()) {
|
||
var o = this.indices.length;
|
||
this.indices[o++] = t.getPrevItem().p0.i, this.indices[o++] = t.getCurrItem().p0.i, this.indices[o++] = t.getNextItem().p0.i
|
||
}
|
||
}, e.prototype.clipEars_ = function (t, e, i, r) {
|
||
var o, n, s, a = this.indices.length, l = t.firstItem(), h = t.getPrevItem(), u = l, c = t.nextItem(),
|
||
p = t.getNextItem(), d = !1;
|
||
do {
|
||
if (o = u.p0, n = u.p1, s = c.p1, !1 === n.reflex) {
|
||
var f = void 0;
|
||
f = i ? 0 === this.getPointsInTriangle_(o, n, s, e, !0).length : r ? this.diagonalIsInside_(p.p1, s, n, o, h.p0) : this.diagonalIsInside_(h.p0, o, n, s, p.p1), (i || 0 === this.getIntersections_({
|
||
p0: o,
|
||
p1: s
|
||
}, e).length) && f && (i || !1 === o.reflex || !1 === s.reflex || lr([h.p0.x, h.p0.y, o.x, o.y, n.x, n.y, s.x, s.y, p.p1.x, p.p1.y], 0, 10, 2) === !r) && (this.indices[a++] = o.i, this.indices[a++] = n.i, this.indices[a++] = s.i, this.removeItem_(u, c, t, e), c === l && (l = p), d = !0)
|
||
}
|
||
h = t.getPrevItem(), u = t.getCurrItem(), c = t.nextItem(), p = t.getNextItem()
|
||
} while (u !== l && t.getLength() > 3);
|
||
return d
|
||
}, e.prototype.resolveSelfIntersections_ = function (t, e, i) {
|
||
var r = t.firstItem();
|
||
t.nextItem();
|
||
var o = r, n = t.nextItem(), s = !1;
|
||
do {
|
||
var a = this.calculateIntersection_(o.p0, o.p1, n.p0, n.p1, i);
|
||
if (a) {
|
||
var l = !1, h = this.vertices.length, u = this.indices.length, c = h / 2, p = t.prevItem();
|
||
t.removeItem(), e.remove(p), l = p === r;
|
||
var d = void 0;
|
||
if (i ? (a[0] === o.p0.x && a[1] === o.p0.y ? (t.prevItem(), d = o.p0, n.p0 = d, e.remove(o), l = l || o === r) : (d = n.p1, o.p1 = d, e.remove(n), l = l || n === r), t.removeItem()) : (d = this.createPoint_(a[0], a[1], c), o.p1 = d, n.p0 = d, e.update([Math.min(o.p0.x, o.p1.x), Math.min(o.p0.y, o.p1.y), Math.max(o.p0.x, o.p1.x), Math.max(o.p0.y, o.p1.y)], o), e.update([Math.min(n.p0.x, n.p1.x), Math.min(n.p0.y, n.p1.y), Math.max(n.p0.x, n.p1.x), Math.max(n.p0.y, n.p1.y)], n)), this.indices[u++] = p.p0.i, this.indices[u++] = p.p1.i, this.indices[u++] = d.i, s = !0, l) break
|
||
}
|
||
o = t.getPrevItem(), n = t.nextItem()
|
||
} while (o !== r);
|
||
return s
|
||
}, e.prototype.isSimple_ = function (t, e) {
|
||
var i = t.firstItem(), r = i;
|
||
do {
|
||
if (this.getIntersections_(r, e).length) return !1;
|
||
r = t.nextItem()
|
||
} while (r !== i);
|
||
return !0
|
||
}, e.prototype.isClockwise_ = function (t) {
|
||
var e = 2 * t.getLength(), i = new Array(e), r = t.firstItem(), o = r, n = 0;
|
||
do {
|
||
i[n++] = o.p0.x, i[n++] = o.p0.y, o = t.nextItem()
|
||
} while (o !== r);
|
||
return lr(i, 0, e, 2)
|
||
}, e.prototype.splitPolygon_ = function (t, e) {
|
||
var i = t.firstItem(), r = i;
|
||
do {
|
||
var o = this.getIntersections_(r, e);
|
||
if (o.length) {
|
||
var n = o[0], s = this.vertices.length / 2,
|
||
a = this.calculateIntersection_(r.p0, r.p1, n.p0, n.p1),
|
||
l = this.createPoint_(a[0], a[1], s), h = new Cu, u = new Eu;
|
||
this.insertItem_(l, r.p1, h, u), r.p1 = l, e.update([Math.min(r.p0.x, l.x), Math.min(r.p0.y, l.y), Math.max(r.p0.x, l.x), Math.max(r.p0.y, l.y)], r);
|
||
for (var c = t.nextItem(); c !== n;) this.insertItem_(c.p0, c.p1, h, u), e.remove(c), t.removeItem(), c = t.getCurrItem();
|
||
this.insertItem_(n.p0, l, h, u), n.p0 = l, e.update([Math.min(n.p1.x, l.x), Math.min(n.p1.y, l.y), Math.max(n.p1.x, l.x), Math.max(n.p1.y, l.y)], n), this.classifyPoints_(t, e, !1), this.triangulate_(t, e), this.classifyPoints_(h, u, !1), this.triangulate_(h, u);
|
||
break
|
||
}
|
||
r = t.nextItem()
|
||
} while (r !== i)
|
||
}, e.prototype.createPoint_ = function (t, e, i) {
|
||
var r = this.vertices.length;
|
||
return this.vertices[r++] = t, this.vertices[r++] = e, {x: t, y: e, i: i, reflex: void 0}
|
||
}, e.prototype.insertItem_ = function (t, e, i, r) {
|
||
var o = {p0: t, p1: e};
|
||
return i.insertItem(o), r && r.insert([Math.min(t.x, e.x), Math.min(t.y, e.y), Math.max(t.x, e.x), Math.max(t.y, e.y)], o), o
|
||
}, e.prototype.removeItem_ = function (t, e, i, r) {
|
||
i.getCurrItem() === e && (i.removeItem(), t.p1 = e.p1, r.remove(e), r.update([Math.min(t.p0.x, t.p1.x), Math.min(t.p0.y, t.p1.y), Math.max(t.p0.x, t.p1.x), Math.max(t.p0.y, t.p1.y)], t))
|
||
}, e.prototype.getPointsInTriangle_ = function (t, e, i, r, o) {
|
||
for (var n = [], s = r.getInExtent([Math.min(t.x, e.x, i.x), Math.min(t.y, e.y, i.y), Math.max(t.x, e.x, i.x), Math.max(t.y, e.y, i.y)]), a = 0, l = s.length; a < l; ++a) for (var h in s[a]) {
|
||
var u = s[a][h];
|
||
"object" != typeof u || o && !u.reflex || u.x === t.x && u.y === t.y || u.x === e.x && u.y === e.y || u.x === i.x && u.y === i.y || -1 !== n.indexOf(u) || !Ki([t.x, t.y, e.x, e.y, i.x, i.y], 0, 6, 2, u.x, u.y) || n.push(u)
|
||
}
|
||
return n
|
||
}, e.prototype.getIntersections_ = function (t, e, i) {
|
||
for (var r = t.p0, o = t.p1, n = e.getInExtent([Math.min(r.x, o.x), Math.min(r.y, o.y), Math.max(r.x, o.x), Math.max(r.y, o.y)]), s = [], a = 0, l = n.length; a < l; ++a) {
|
||
var h = n[a];
|
||
t !== h && (i || h.p0 !== o || h.p1 !== r) && this.calculateIntersection_(r, o, h.p0, h.p1, i) && s.push(h)
|
||
}
|
||
return s
|
||
}, e.prototype.calculateIntersection_ = function (t, e, i, r, o) {
|
||
var n = (r.y - i.y) * (e.x - t.x) - (r.x - i.x) * (e.y - t.y);
|
||
if (0 !== n) {
|
||
var s = ((r.x - i.x) * (t.y - i.y) - (r.y - i.y) * (t.x - i.x)) / n,
|
||
a = ((e.x - t.x) * (t.y - i.y) - (e.y - t.y) * (t.x - i.x)) / n;
|
||
if (!o && s > Yh && s < 1 - Yh && a > Yh && a < 1 - Yh || o && s >= 0 && s <= 1 && a >= 0 && a <= 1) return [t.x + s * (e.x - t.x), t.y + s * (e.y - t.y)]
|
||
}
|
||
}, e.prototype.diagonalIsInside_ = function (t, e, i, r, o) {
|
||
if (void 0 === e.reflex || void 0 === r.reflex) return !1;
|
||
var n = (i.x - r.x) * (e.y - r.y) > (i.y - r.y) * (e.x - r.x),
|
||
s = (o.x - r.x) * (e.y - r.y) < (o.y - r.y) * (e.x - r.x),
|
||
a = (t.x - e.x) * (r.y - e.y) > (t.y - e.y) * (r.x - e.x),
|
||
l = (i.x - e.x) * (r.y - e.y) < (i.y - e.y) * (r.x - e.x), h = r.reflex ? s || n : s && n,
|
||
u = e.reflex ? l || a : l && a;
|
||
return h && u
|
||
}, e.prototype.drawMultiPolygon = function (t, e) {
|
||
var i, r, o, n, s = t.getEndss(), a = t.getStride(), l = this.indices.length,
|
||
h = this.lineStringReplay.getCurrentIndex(), u = t.getFlatCoordinates(), c = 0;
|
||
for (i = 0, r = s.length; i < r; ++i) {
|
||
var p = s[i];
|
||
if (p.length > 0) {
|
||
var d = Qt(u, c, p[0], a, -this.origin[0], -this.origin[1]);
|
||
if (d.length) {
|
||
var f = [], g = void 0;
|
||
for (o = 1, n = p.length; o < n; ++o) p[o] !== p[o - 1] && (g = Qt(u, p[o - 1], p[o], a, -this.origin[0], -this.origin[1]), f.push(g));
|
||
this.lineStringReplay.drawPolygonCoordinates(d, f, a), this.drawCoordinates_(d, f, a)
|
||
}
|
||
}
|
||
c = p[p.length - 1]
|
||
}
|
||
this.indices.length > l && (this.startIndices.push(l), this.startIndicesFeature.push(e), this.state_.changed && (this.styleIndices_.push(l), this.state_.changed = !1)), this.lineStringReplay.getCurrentIndex() > h && this.lineStringReplay.setPolygonStyle(e, h)
|
||
}, e.prototype.drawPolygon = function (t, e) {
|
||
var i = t.getEnds(), r = t.getStride();
|
||
if (i.length > 0) {
|
||
var o = t.getFlatCoordinates().map(Number), n = Qt(o, 0, i[0], r, -this.origin[0], -this.origin[1]);
|
||
if (n.length) {
|
||
var s, a, l, h = [];
|
||
for (s = 1, a = i.length; s < a; ++s) i[s] !== i[s - 1] && (l = Qt(o, i[s - 1], i[s], r, -this.origin[0], -this.origin[1]), h.push(l));
|
||
this.startIndices.push(this.indices.length), this.startIndicesFeature.push(e), this.state_.changed && (this.styleIndices_.push(this.indices.length), this.state_.changed = !1), this.lineStringReplay.setPolygonStyle(e), this.lineStringReplay.drawPolygonCoordinates(n, h, r), this.drawCoordinates_(n, h, r)
|
||
}
|
||
}
|
||
}, e.prototype.finish = function (t) {
|
||
this.verticesBuffer = new qh(this.vertices), this.indicesBuffer = new qh(this.indices), this.startIndices.push(this.indices.length), this.lineStringReplay.finish(t), 0 === this.styleIndices_.length && this.styles_.length > 0 && (this.styles_ = []), this.vertices = null, this.indices = null
|
||
}, e.prototype.getDeleteResourcesFunction = function (t) {
|
||
var e = this.verticesBuffer, i = this.indicesBuffer,
|
||
r = this.lineStringReplay.getDeleteResourcesFunction(t);
|
||
return function () {
|
||
t.deleteBuffer(e), t.deleteBuffer(i), r()
|
||
}
|
||
}, e.prototype.setUpProgram = function (t, e, i, r) {
|
||
var o, n = e.getProgram(_u, xu);
|
||
return this.defaultLocations_ ? o = this.defaultLocations_ : (o = new wu(t, n), this.defaultLocations_ = o), e.useProgram(n), t.enableVertexAttribArray(o.a_position), t.vertexAttribPointer(o.a_position, 2, 5126, !1, 8, 0), o
|
||
}, e.prototype.shutDownProgram = function (t, e) {
|
||
t.disableVertexAttribArray(e.a_position)
|
||
}, e.prototype.drawReplay = function (t, e, i, r) {
|
||
var o, n, s, a, l = t.getParameter(t.DEPTH_FUNC), h = t.getParameter(t.DEPTH_WRITEMASK);
|
||
if (r || (t.enable(t.DEPTH_TEST), t.depthMask(!0), t.depthFunc(t.NOTEQUAL)), g(i)) for (s = this.startIndices[this.startIndices.length - 1], o = this.styleIndices_.length - 1; o >= 0; --o) n = this.styleIndices_[o], a = this.styles_[o], this.setFillStyle_(t, a), this.drawElements(t, e, n, s), s = n; else this.drawReplaySkipping_(t, e, i);
|
||
r || (t.disable(t.DEPTH_TEST), t.clear(t.DEPTH_BUFFER_BIT), t.depthMask(h), t.depthFunc(l))
|
||
}, e.prototype.drawHitDetectionReplayOneByOne = function (t, e, i, r, o) {
|
||
var n, s, l, h, u, c, p;
|
||
for (p = this.startIndices.length - 2, l = this.startIndices[p + 1], n = this.styleIndices_.length - 1; n >= 0; --n) for (h = this.styles_[n], this.setFillStyle_(t, h), u = this.styleIndices_[n]; p >= 0 && this.startIndices[p] >= u;) {
|
||
if (s = this.startIndices[p], void 0 === i[a(c = this.startIndicesFeature[p])] && c.getGeometry() && (void 0 === o || Bt(o, c.getGeometry().getExtent()))) {
|
||
t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), this.drawElements(t, e, s, l);
|
||
var d = r(c);
|
||
if (d) return d
|
||
}
|
||
p--, l = s
|
||
}
|
||
}, e.prototype.drawReplaySkipping_ = function (t, e, i) {
|
||
var r, o, n, s, l, h, u;
|
||
for (h = this.startIndices.length - 2, n = o = this.startIndices[h + 1], r = this.styleIndices_.length - 1; r >= 0; --r) {
|
||
for (s = this.styles_[r], this.setFillStyle_(t, s), l = this.styleIndices_[r]; h >= 0 && this.startIndices[h] >= l;) u = this.startIndices[h], i[a(this.startIndicesFeature[h])] && (o !== n && (this.drawElements(t, e, o, n), t.clear(t.DEPTH_BUFFER_BIT)), n = u), h--, o = u;
|
||
o !== n && (this.drawElements(t, e, o, n), t.clear(t.DEPTH_BUFFER_BIT)), o = n = l
|
||
}
|
||
}, e.prototype.setFillStyle_ = function (t, e) {
|
||
t.uniform4fv(this.defaultLocations_.u_color, e)
|
||
}, e.prototype.setFillStrokeStyle = function (t, e) {
|
||
var i = t ? t.getColor() : [0, 0, 0, 0];
|
||
if (i = i instanceof CanvasGradient || i instanceof CanvasPattern ? Uh : lo(i).map(function (t, e) {
|
||
return 3 != e ? t / 255 : t
|
||
}) || Uh, this.state_.fillColor && it(i, this.state_.fillColor) || (this.state_.fillColor = i, this.state_.changed = !0, this.styles_.push(i)), e) this.lineStringReplay.setFillStrokeStyle(null, e); else {
|
||
var r = new go({color: [0, 0, 0, 0], width: 0});
|
||
this.lineStringReplay.setFillStrokeStyle(null, r)
|
||
}
|
||
}, e
|
||
}(zh), Ru = function (t, e) {
|
||
this.space_ = e, this.emptyBlocks_ = [{
|
||
x: 0,
|
||
y: 0,
|
||
width: t,
|
||
height: t
|
||
}], this.entries_ = {}, this.context_ = Ao(t, t), this.canvas_ = this.context_.canvas
|
||
};
|
||
Ru.prototype.get = function (t) {
|
||
return this.entries_[t] || null
|
||
}, Ru.prototype.add = function (t, e, i, r, o) {
|
||
for (var n = 0, s = this.emptyBlocks_.length; n < s; ++n) {
|
||
var a = this.emptyBlocks_[n];
|
||
if (a.width >= e + this.space_ && a.height >= i + this.space_) {
|
||
var l = {offsetX: a.x + this.space_, offsetY: a.y + this.space_, image: this.canvas_};
|
||
return this.entries_[t] = l, r.call(o, this.context_, a.x + this.space_, a.y + this.space_), this.split_(n, a, e + this.space_, i + this.space_), l
|
||
}
|
||
}
|
||
return null
|
||
}, Ru.prototype.split_ = function (t, e, i, r) {
|
||
var o, n;
|
||
e.width - i > e.height - r ? (o = {x: e.x + i, y: e.y, width: e.width - i, height: e.height}, n = {
|
||
x: e.x,
|
||
y: e.y + r,
|
||
width: i,
|
||
height: e.height - r
|
||
}, this.updateBlocks_(t, o, n)) : (o = {x: e.x + i, y: e.y, width: e.width - i, height: r}, n = {
|
||
x: e.x,
|
||
y: e.y + r,
|
||
width: e.width,
|
||
height: e.height - r
|
||
}, this.updateBlocks_(t, o, n))
|
||
}, Ru.prototype.updateBlocks_ = function (t, e, i) {
|
||
var r = [t, 1];
|
||
e.width > 0 && e.height > 0 && r.push(e), i.width > 0 && i.height > 0 && r.push(i), this.emptyBlocks_.splice.apply(this.emptyBlocks_, r)
|
||
};
|
||
var Pu = Ru, Lu = function (t) {
|
||
var e = t || {};
|
||
this.currentSize_ = void 0 !== e.initialSize ? e.initialSize : 256, this.maxSize_ = void 0 !== e.maxSize ? e.maxSize : void 0 !== Ph ? Ph : 2048, this.space_ = void 0 !== e.space ? e.space : 1, this.atlases_ = [new Pu(this.currentSize_, this.space_)], this.currentHitSize_ = this.currentSize_, this.hitAtlases_ = [new Pu(this.currentHitSize_, this.space_)]
|
||
};
|
||
Lu.prototype.getInfo = function (t) {
|
||
var e = this.getInfo_(this.atlases_, t);
|
||
if (!e) return null;
|
||
var i = this.getInfo_(this.hitAtlases_, t);
|
||
return this.mergeInfos_(e, i)
|
||
}, Lu.prototype.getInfo_ = function (t, e) {
|
||
for (var i = 0, r = t.length; i < r; ++i) {
|
||
var o = t[i].get(e);
|
||
if (o) return o
|
||
}
|
||
return null
|
||
}, Lu.prototype.mergeInfos_ = function (t, e) {
|
||
return {offsetX: t.offsetX, offsetY: t.offsetY, image: t.image, hitImage: e.image}
|
||
}, Lu.prototype.add = function (t, e, i, r, o, n) {
|
||
if (e + this.space_ > this.maxSize_ || i + this.space_ > this.maxSize_) return null;
|
||
var s = this.add_(!1, t, e, i, r, n);
|
||
if (!s) return null;
|
||
var a = void 0 !== o ? o : I, l = this.add_(!0, t, e, i, a, n);
|
||
return this.mergeInfos_(s, l)
|
||
}, Lu.prototype.add_ = function (t, e, i, r, o, n) {
|
||
var s, a, l, h, u = t ? this.hitAtlases_ : this.atlases_;
|
||
for (l = 0, h = u.length; l < h; ++l) {
|
||
if (a = (s = u[l]).add(e, i, r, o, n)) return a;
|
||
if (!a && l === h - 1) {
|
||
var c = void 0;
|
||
t ? (c = Math.min(2 * this.currentHitSize_, this.maxSize_), this.currentHitSize_ = c) : (c = Math.min(2 * this.currentSize_, this.maxSize_), this.currentSize_ = c), s = new Pu(c, this.space_), u.push(s), ++h
|
||
}
|
||
}
|
||
return null
|
||
};
|
||
var Iu = Lu, Ou = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e, i), this.images_ = [], this.textures_ = [], this.measureCanvas_ = Ao(0, 0).canvas, this.state_ = {
|
||
strokeColor: null,
|
||
lineCap: void 0,
|
||
lineDash: null,
|
||
lineDashOffset: void 0,
|
||
lineJoin: void 0,
|
||
lineWidth: 0,
|
||
miterLimit: void 0,
|
||
fillColor: null,
|
||
font: void 0,
|
||
scale: void 0
|
||
}, this.text_ = "", this.textAlign_ = void 0, this.textBaseline_ = void 0, this.offsetX_ = void 0, this.offsetY_ = void 0, this.atlases_ = {}, this.currAtlas_ = void 0, this.scale = 1, this.opacity = 1
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.drawText = function (t, e) {
|
||
if (this.text_) {
|
||
var i = null, r = 2, o = 2;
|
||
switch (t.getType()) {
|
||
case Zt.POINT:
|
||
case Zt.MULTI_POINT:
|
||
r = (i = t.getFlatCoordinates()).length, o = t.getStride();
|
||
break;
|
||
case Zt.CIRCLE:
|
||
i = t.getCenter();
|
||
break;
|
||
case Zt.LINE_STRING:
|
||
i = t.getFlatMidpoint();
|
||
break;
|
||
case Zt.MULTI_LINE_STRING:
|
||
r = (i = t.getFlatMidpoints()).length;
|
||
break;
|
||
case Zt.POLYGON:
|
||
i = t.getFlatInteriorPoint();
|
||
break;
|
||
case Zt.MULTI_POLYGON:
|
||
r = (i = t.getFlatInteriorPoints()).length
|
||
}
|
||
this.startIndices.push(this.indices.length), this.startIndicesFeature.push(e);
|
||
var n, s, l, h, u, c, p, d, f = this.currAtlas_, g = this.text_.split("\n"),
|
||
m = this.getTextSize_(g), y = Math.round(m[0] * this.textAlign_ - this.offsetX_),
|
||
v = Math.round(m[1] * this.textBaseline_ - this.offsetY_),
|
||
_ = this.state_.lineWidth / 2 * this.state_.scale;
|
||
for (n = 0, s = g.length; n < s; ++n) for (u = 0, c = f.height * n, l = 0, h = (p = g[n].split("")).length; l < h; ++l) {
|
||
if (d = f.atlas.getInfo(p[l])) {
|
||
var x = d.image;
|
||
if (this.anchorX = y - u, this.anchorY = v - c, this.originX = 0 === l ? d.offsetX - _ : d.offsetX, this.originY = d.offsetY, this.height = f.height, this.width = 0 === l || l === p.length - 1 ? f.width[p[l]] + _ : f.width[p[l]], this.imageHeight = x.height, this.imageWidth = x.width, 0 === this.images_.length) this.images_.push(x); else a(this.images_[this.images_.length - 1]) != a(x) && (this.groupIndices.push(this.indices.length), this.images_.push(x));
|
||
this.drawText_(i, 0, r, o)
|
||
}
|
||
u += this.width
|
||
}
|
||
}
|
||
}, e.prototype.getTextSize_ = function (t) {
|
||
var e = this, i = this.currAtlas_, r = t.length * i.height;
|
||
return [t.map(function (t) {
|
||
for (var r = 0, o = 0, n = t.length; o < n; ++o) {
|
||
var s = t[o];
|
||
i.width[s] || e.addCharToAtlas_(s), r += i.width[s] ? i.width[s] : 0
|
||
}
|
||
return r
|
||
}).reduce(function (t, e) {
|
||
return Math.max(t, e)
|
||
}), r]
|
||
}, e.prototype.drawText_ = function (t, e, i, r) {
|
||
for (var o = e, n = i; o < n; o += r) this.drawCoordinates(t, e, i, r)
|
||
}, e.prototype.addCharToAtlas_ = function (t) {
|
||
if (1 === t.length) {
|
||
var e = this.currAtlas_, i = this.state_, r = this.measureCanvas_.getContext("2d");
|
||
r.font = i.font;
|
||
var o = Math.ceil(r.measureText(t).width * i.scale);
|
||
e.atlas.add(t, o, e.height, function (e, r, o) {
|
||
e.font = i.font, e.fillStyle = i.fillColor, e.strokeStyle = i.strokeColor, e.lineWidth = i.lineWidth, e.lineCap = i.lineCap, e.lineJoin = i.lineJoin, e.miterLimit = i.miterLimit, e.textAlign = "left", e.textBaseline = "top", Er && i.lineDash && (e.setLineDash(i.lineDash), e.lineDashOffset = i.lineDashOffset), 1 !== i.scale && e.setTransform(i.scale, 0, 0, i.scale, 0, 0), i.strokeColor && e.strokeText(t, r, o), i.fillColor && e.fillText(t, r, o)
|
||
}) && (e.width[t] = o)
|
||
}
|
||
}, e.prototype.finish = function (e) {
|
||
var i = e.getGL();
|
||
this.groupIndices.push(this.indices.length), this.hitDetectionGroupIndices = this.groupIndices, this.verticesBuffer = new qh(this.vertices), this.indicesBuffer = new qh(this.indices);
|
||
this.createTextures(this.textures_, this.images_, {}, i), this.state_ = {
|
||
strokeColor: null,
|
||
lineCap: void 0,
|
||
lineDash: null,
|
||
lineDashOffset: void 0,
|
||
lineJoin: void 0,
|
||
lineWidth: 0,
|
||
miterLimit: void 0,
|
||
fillColor: null,
|
||
font: void 0,
|
||
scale: void 0
|
||
}, this.text_ = "", this.textAlign_ = void 0, this.textBaseline_ = void 0, this.offsetX_ = void 0, this.offsetY_ = void 0, this.images_ = null, this.atlases_ = {}, this.currAtlas_ = void 0, t.prototype.finish.call(this, e)
|
||
}, e.prototype.setTextStyle = function (t) {
|
||
var e = this.state_, i = t.getFill(), r = t.getStroke();
|
||
if (t && t.getText() && (i || r)) {
|
||
if (i) {
|
||
var o = i.getColor();
|
||
e.fillColor = Wa(o || Uh)
|
||
} else e.fillColor = null;
|
||
if (r) {
|
||
var n = r.getColor();
|
||
e.strokeColor = Wa(n || Vh), e.lineWidth = r.getWidth() || 1, e.lineCap = r.getLineCap() || "round", e.lineDashOffset = r.getLineDashOffset() || 0, e.lineJoin = r.getLineJoin() || "round", e.miterLimit = r.getMiterLimit() || 10;
|
||
var s = r.getLineDash();
|
||
e.lineDash = s ? s.slice() : Bh
|
||
} else e.strokeColor = null, e.lineWidth = 0;
|
||
e.font = t.getFont() || "10px sans-serif", e.scale = t.getScale() || 1, this.text_ = t.getText();
|
||
var a = Pl[t.getTextAlign()], l = Pl[t.getTextBaseline()];
|
||
this.textAlign_ = void 0 === a ? .5 : a, this.textBaseline_ = void 0 === l ? .5 : l, this.offsetX_ = t.getOffsetX() || 0, this.offsetY_ = t.getOffsetY() || 0, this.rotateWithView = !!t.getRotateWithView(), this.rotation = t.getRotation() || 0, this.currAtlas_ = this.getAtlas_(e)
|
||
} else this.text_ = ""
|
||
}, e.prototype.getAtlas_ = function (t) {
|
||
var e = [];
|
||
for (var i in t) (t[i] || 0 === t[i]) && (Array.isArray(t[i]) ? e = e.concat(t[i]) : e.push(t[i]));
|
||
var r = this.calculateHash_(e);
|
||
if (!this.atlases_[r]) {
|
||
var o = this.measureCanvas_.getContext("2d");
|
||
o.font = t.font;
|
||
var n = Math.ceil((1.5 * o.measureText("M").width + t.lineWidth / 2) * t.scale);
|
||
this.atlases_[r] = {atlas: new Iu({space: t.lineWidth + 1}), width: {}, height: n}
|
||
}
|
||
return this.atlases_[r]
|
||
}, e.prototype.calculateHash_ = function (t) {
|
||
for (var e = "", i = 0, r = t.length; i < r; ++i) e += t[i];
|
||
return e
|
||
}, e.prototype.getTextures = function (t) {
|
||
return this.textures_
|
||
}, e.prototype.getHitDetectionTextures = function () {
|
||
return this.textures_
|
||
}, e
|
||
}(ou), Mu = [1, 1], Au = {Circle: Zh, Image: nu, LineString: vu, Polygon: Tu, Text: Ou}, ku = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this), this.maxExtent_ = i, this.tolerance_ = e, this.renderBuffer_ = r, this.replaysByZIndex_ = {}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.addDeclutter = function (t) {
|
||
return []
|
||
}, e.prototype.getDeleteResourcesFunction = function (t) {
|
||
var e, i = [];
|
||
for (e in this.replaysByZIndex_) {
|
||
var r = this.replaysByZIndex_[e];
|
||
for (var o in r) i.push(r[o].getDeleteResourcesFunction(t))
|
||
}
|
||
return function () {
|
||
for (var t, e = arguments, r = i.length, o = 0; o < r; o++) t = i[o].apply(this, e);
|
||
return t
|
||
}
|
||
}, e.prototype.finish = function (t) {
|
||
var e;
|
||
for (e in this.replaysByZIndex_) {
|
||
var i = this.replaysByZIndex_[e];
|
||
for (var r in i) i[r].finish(t)
|
||
}
|
||
}, e.prototype.getReplay = function (t, e) {
|
||
var i = void 0 !== t ? t.toString() : "0", r = this.replaysByZIndex_[i];
|
||
void 0 === r && (r = {}, this.replaysByZIndex_[i] = r);
|
||
var o = r[e];
|
||
void 0 === o && (o = new (0, Au[e])(this.tolerance_, this.maxExtent_), r[e] = o);
|
||
return o
|
||
}, e.prototype.isEmpty = function () {
|
||
return g(this.replaysByZIndex_)
|
||
}, e.prototype.replay = function (t, e, i, r, o, n, s, a) {
|
||
var l, h, u, c, p, d, f = Object.keys(this.replaysByZIndex_).map(Number);
|
||
for (f.sort(Z), l = 0, h = f.length; l < h; ++l) for (p = this.replaysByZIndex_[f[l].toString()], u = 0, c = Rl.length; u < c; ++u) d = p[Rl[u]], void 0 !== d && d.replay(t, e, i, r, o, n, s, a, void 0, !1)
|
||
}, e.prototype.replayHitDetection_ = function (t, e, i, r, o, n, s, a, l, h, u) {
|
||
var c, p, d, f, g, m, y = Object.keys(this.replaysByZIndex_).map(Number);
|
||
for (y.sort(function (t, e) {
|
||
return e - t
|
||
}), c = 0, p = y.length; c < p; ++c) for (f = this.replaysByZIndex_[y[c].toString()], d = Rl.length - 1; d >= 0; --d) if (void 0 !== (g = f[Rl[d]]) && (m = g.replay(t, e, i, r, o, n, s, a, l, h, u))) return m
|
||
}, e.prototype.forEachFeatureAtCoordinate = function (t, e, i, r, o, n, s, a, l, h) {
|
||
var u, c = e.getGL();
|
||
return c.bindFramebuffer(c.FRAMEBUFFER, e.getHitDetectionFramebuffer()), void 0 !== this.renderBuffer_ && (u = ht(_t(t), r * this.renderBuffer_)), this.replayHitDetection_(e, t, r, o, Mu, s, a, l, function (t) {
|
||
var e = new Uint8Array(4);
|
||
if (c.readPixels(0, 0, 1, 1, c.RGBA, c.UNSIGNED_BYTE, e), e[3] > 0) {
|
||
var i = h(t);
|
||
if (i) return i
|
||
}
|
||
}, !0, u)
|
||
}, e.prototype.hasFeatureAtCoordinate = function (t, e, i, r, o, n, s, a, l) {
|
||
var h = e.getGL();
|
||
return h.bindFramebuffer(h.FRAMEBUFFER, e.getHitDetectionFramebuffer()), void 0 !== this.replayHitDetection_(e, t, r, o, Mu, s, a, l, function (t) {
|
||
var e = new Uint8Array(4);
|
||
return h.readPixels(0, 0, 1, 1, h.RGBA, h.UNSIGNED_BYTE, e), e[3] > 0
|
||
}, !1)
|
||
}, e
|
||
}(vl), Fu = function (t) {
|
||
function e(e, i, r, o, n, s, a) {
|
||
t.call(this), this.context_ = e, this.center_ = i, this.extent_ = s, this.pixelRatio_ = a, this.size_ = n, this.rotation_ = o, this.resolution_ = r, this.imageStyle_ = null, this.fillStyle_ = null, this.strokeStyle_ = null, this.textStyle_ = null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.drawText_ = function (t, e) {
|
||
var i = this.context_, r = t.getReplay(0, _l.TEXT);
|
||
r.setTextStyle(this.textStyle_), r.drawText(e, null), r.finish(i);
|
||
r.replay(this.context_, this.center_, this.resolution_, this.rotation_, this.size_, this.pixelRatio_, 1, {}, void 0, !1), r.getDeleteResourcesFunction(i)()
|
||
}, e.prototype.setStyle = function (t) {
|
||
this.setFillStrokeStyle(t.getFill(), t.getStroke()), this.setImageStyle(t.getImage()), this.setTextStyle(t.getText())
|
||
}, e.prototype.drawGeometry = function (t) {
|
||
switch (t.getType()) {
|
||
case Zt.POINT:
|
||
this.drawPoint(t, null);
|
||
break;
|
||
case Zt.LINE_STRING:
|
||
this.drawLineString(t, null);
|
||
break;
|
||
case Zt.POLYGON:
|
||
this.drawPolygon(t, null);
|
||
break;
|
||
case Zt.MULTI_POINT:
|
||
this.drawMultiPoint(t, null);
|
||
break;
|
||
case Zt.MULTI_LINE_STRING:
|
||
this.drawMultiLineString(t, null);
|
||
break;
|
||
case Zt.MULTI_POLYGON:
|
||
this.drawMultiPolygon(t, null);
|
||
break;
|
||
case Zt.GEOMETRY_COLLECTION:
|
||
this.drawGeometryCollection(t, null);
|
||
break;
|
||
case Zt.CIRCLE:
|
||
this.drawCircle(t, null)
|
||
}
|
||
}, e.prototype.drawFeature = function (t, e) {
|
||
var i = e.getGeometryFunction()(t);
|
||
i && Bt(this.extent_, i.getExtent()) && (this.setStyle(e), this.drawGeometry(i))
|
||
}, e.prototype.drawGeometryCollection = function (t, e) {
|
||
var i, r, o = t.getGeometriesArray();
|
||
for (i = 0, r = o.length; i < r; ++i) this.drawGeometry(o[i])
|
||
}, e.prototype.drawPoint = function (t, e) {
|
||
var i = this.context_, r = new ku(1, this.extent_), o = r.getReplay(0, _l.IMAGE);
|
||
o.setImageStyle(this.imageStyle_), o.drawPoint(t, e), o.finish(i);
|
||
o.replay(this.context_, this.center_, this.resolution_, this.rotation_, this.size_, this.pixelRatio_, 1, {}, void 0, !1), o.getDeleteResourcesFunction(i)(), this.textStyle_ && this.drawText_(r, t)
|
||
}, e.prototype.drawMultiPoint = function (t, e) {
|
||
var i = this.context_, r = new ku(1, this.extent_), o = r.getReplay(0, _l.IMAGE);
|
||
o.setImageStyle(this.imageStyle_), o.drawMultiPoint(t, e), o.finish(i);
|
||
o.replay(this.context_, this.center_, this.resolution_, this.rotation_, this.size_, this.pixelRatio_, 1, {}, void 0, !1), o.getDeleteResourcesFunction(i)(), this.textStyle_ && this.drawText_(r, t)
|
||
}, e.prototype.drawLineString = function (t, e) {
|
||
var i = this.context_, r = new ku(1, this.extent_), o = r.getReplay(0, _l.LINE_STRING);
|
||
o.setFillStrokeStyle(null, this.strokeStyle_), o.drawLineString(t, e), o.finish(i);
|
||
o.replay(this.context_, this.center_, this.resolution_, this.rotation_, this.size_, this.pixelRatio_, 1, {}, void 0, !1), o.getDeleteResourcesFunction(i)(), this.textStyle_ && this.drawText_(r, t)
|
||
}, e.prototype.drawMultiLineString = function (t, e) {
|
||
var i = this.context_, r = new ku(1, this.extent_), o = r.getReplay(0, _l.LINE_STRING);
|
||
o.setFillStrokeStyle(null, this.strokeStyle_), o.drawMultiLineString(t, e), o.finish(i);
|
||
o.replay(this.context_, this.center_, this.resolution_, this.rotation_, this.size_, this.pixelRatio_, 1, {}, void 0, !1), o.getDeleteResourcesFunction(i)(), this.textStyle_ && this.drawText_(r, t)
|
||
}, e.prototype.drawPolygon = function (t, e) {
|
||
var i = this.context_, r = new ku(1, this.extent_), o = r.getReplay(0, _l.POLYGON);
|
||
o.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_), o.drawPolygon(t, e), o.finish(i);
|
||
o.replay(this.context_, this.center_, this.resolution_, this.rotation_, this.size_, this.pixelRatio_, 1, {}, void 0, !1), o.getDeleteResourcesFunction(i)(), this.textStyle_ && this.drawText_(r, t)
|
||
}, e.prototype.drawMultiPolygon = function (t, e) {
|
||
var i = this.context_, r = new ku(1, this.extent_), o = r.getReplay(0, _l.POLYGON);
|
||
o.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_), o.drawMultiPolygon(t, e), o.finish(i);
|
||
o.replay(this.context_, this.center_, this.resolution_, this.rotation_, this.size_, this.pixelRatio_, 1, {}, void 0, !1), o.getDeleteResourcesFunction(i)(), this.textStyle_ && this.drawText_(r, t)
|
||
}, e.prototype.drawCircle = function (t, e) {
|
||
var i = this.context_, r = new ku(1, this.extent_), o = r.getReplay(0, _l.CIRCLE);
|
||
o.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_), o.drawCircle(t, e), o.finish(i);
|
||
o.replay(this.context_, this.center_, this.resolution_, this.rotation_, this.size_, this.pixelRatio_, 1, {}, void 0, !1), o.getDeleteResourcesFunction(i)(), this.textStyle_ && this.drawText_(r, t)
|
||
}, e.prototype.setImageStyle = function (t) {
|
||
this.imageStyle_ = t
|
||
}, e.prototype.setFillStrokeStyle = function (t, e) {
|
||
this.fillStyle_ = t, this.strokeStyle_ = e
|
||
}, e.prototype.setTextStyle = function (t) {
|
||
this.textStyle_ = t
|
||
}, e
|
||
}(Xa),
|
||
Nu = new Ah("precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n gl_FragColor.a = texColor.a * u_opacity;\n}\n"),
|
||
Du = new kh("varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n"),
|
||
Gu = function (t, e) {
|
||
this.u_texCoordMatrix = t.getUniformLocation(e, "u_texCoordMatrix"), this.u_projectionMatrix = t.getUniformLocation(e, "u_projectionMatrix"), this.u_opacity = t.getUniformLocation(e, "u_opacity"), this.u_texture = t.getUniformLocation(e, "u_texture"), this.a_position = t.getAttribLocation(e, "a_position"), this.a_texCoord = t.getAttribLocation(e, "a_texCoord")
|
||
}, ju = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, i), this.mapRenderer = e, this.arrayBuffer_ = new qh([-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1]), this.texture = null, this.framebuffer = null, this.framebufferDimension = void 0, this.texCoordMatrix = [1, 0, 0, 1, 0, 0], this.projectionMatrix = [1, 0, 0, 1, 0, 0], this.tmpMat4_ = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], this.defaultLocations_ = null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.bindFramebuffer = function (t, e) {
|
||
var i = this.mapRenderer.getGL();
|
||
if (void 0 === this.framebufferDimension || this.framebufferDimension != e) {
|
||
var r = function (t, e, i) {
|
||
t.isContextLost() || (t.deleteFramebuffer(e), t.deleteTexture(i))
|
||
}.bind(null, i, this.framebuffer, this.texture);
|
||
t.postRenderFunctions.push(r);
|
||
var o = eu(i, e, e), n = i.createFramebuffer();
|
||
i.bindFramebuffer(36160, n), i.framebufferTexture2D(36160, 36064, Eh, o, 0), this.texture = o, this.framebuffer = n, this.framebufferDimension = e
|
||
} else i.bindFramebuffer(36160, this.framebuffer)
|
||
}, e.prototype.composeFrame = function (t, e, i) {
|
||
this.dispatchComposeEvent_(eo.PRECOMPOSE, i, t), i.bindBuffer(34962, this.arrayBuffer_);
|
||
var r, o = i.getGL(), n = i.getProgram(Nu, Du);
|
||
this.defaultLocations_ ? r = this.defaultLocations_ : (r = new Gu(o, n), this.defaultLocations_ = r), i.useProgram(n) && (o.enableVertexAttribArray(r.a_position), o.vertexAttribPointer(r.a_position, 2, 5126, !1, 16, 0), o.enableVertexAttribArray(r.a_texCoord), o.vertexAttribPointer(r.a_texCoord, 2, 5126, !1, 16, 8), o.uniform1i(r.u_texture, 0)), o.uniformMatrix4fv(r.u_texCoordMatrix, !1, jh(this.tmpMat4_, this.getTexCoordMatrix())), o.uniformMatrix4fv(r.u_projectionMatrix, !1, jh(this.tmpMat4_, this.getProjectionMatrix())), o.uniform1f(r.u_opacity, e.opacity), o.bindTexture(Eh, this.getTexture()), o.drawArrays(5, 0, 4), this.dispatchComposeEvent_(eo.POSTCOMPOSE, i, t)
|
||
}, e.prototype.dispatchComposeEvent_ = function (t, e, i) {
|
||
var r = this.getLayer();
|
||
if (r.hasListener(t)) {
|
||
var o = i.viewState, n = o.resolution, s = i.pixelRatio, a = i.extent, l = o.center, h = o.rotation,
|
||
u = i.size, c = new Fu(e, l, n, h, u, a, s), p = new Ta(t, c, i, null, e);
|
||
r.dispatchEvent(p)
|
||
}
|
||
}, e.prototype.getTexCoordMatrix = function () {
|
||
return this.texCoordMatrix
|
||
}, e.prototype.getTexture = function () {
|
||
return this.texture
|
||
}, e.prototype.getProjectionMatrix = function () {
|
||
return this.projectionMatrix
|
||
}, e.prototype.handleWebGLContextLost = function () {
|
||
this.texture = null, this.framebuffer = null, this.framebufferDimension = void 0
|
||
}, e.prototype.prepareFrame = function (t, e, i) {
|
||
return n()
|
||
}, e.prototype.forEachLayerAtPixel = function (t, e, i, r) {
|
||
return n()
|
||
}, e
|
||
}(nl), zu = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e, i), this.image_ = null, this.hitCanvasContext_ = null, this.hitTransformationMatrix_ = null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.createTexture_ = function (t) {
|
||
var e = t.getImage();
|
||
return iu(this.mapRenderer.getGL(), e, 33071, 33071)
|
||
}, e.prototype.prepareFrame = function (t, e, i) {
|
||
var r = this.mapRenderer.getGL(), o = t.pixelRatio, n = t.viewState, s = n.center, a = n.resolution,
|
||
l = n.rotation, h = this.image_, u = this.texture, c = this.getLayer().getSource(), p = t.viewHints,
|
||
d = t.extent;
|
||
if (void 0 !== e.extent && (d = Dt(d, e.extent)), !p[$n.ANIMATING] && !p[$n.INTERACTING] && !Vt(d)) {
|
||
var f = n.projection, g = c.getImage(d, a, o, f);
|
||
if (g) if (this.loadImage(g) && (h = g, u = this.createTexture_(g), this.texture)) {
|
||
var m = function (t, e) {
|
||
t.isContextLost() || t.deleteTexture(e)
|
||
}.bind(null, r, this.texture);
|
||
t.postRenderFunctions.push(m)
|
||
}
|
||
}
|
||
if (h) {
|
||
var y = this.mapRenderer.getContext().getCanvas();
|
||
this.updateProjectionMatrix_(y.width, y.height, o, s, a, l, h.getExtent()), this.hitTransformationMatrix_ = null;
|
||
var v = this.texCoordMatrix;
|
||
ai(v), di(v, 1, -1), fi(v, 0, -1), this.image_ = h, this.texture = u
|
||
}
|
||
return !!h
|
||
}, e.prototype.updateProjectionMatrix_ = function (t, e, i, r, o, n, s) {
|
||
var a = t * o, l = e * o, h = this.projectionMatrix;
|
||
ai(h), di(h, 2 * i / a, 2 * i / l), pi(h, -n), fi(h, s[0] - r[0], s[1] - r[1]), di(h, (s[2] - s[0]) / 2, (s[3] - s[1]) / 2), fi(h, 1, 1)
|
||
}, e.prototype.forEachLayerAtPixel = function (t, e, i, r) {
|
||
if (this.image_ && this.image_.getImage()) {
|
||
var o = [this.image_.getImage().width, this.image_.getImage().height];
|
||
this.hitTransformationMatrix_ || (this.hitTransformationMatrix_ = this.getHitTransformationMatrix_(e.size, o));
|
||
var n = ci(this.hitTransformationMatrix_, t.slice());
|
||
if (!(n[0] < 0 || n[0] > o[0] || n[1] < 0 || n[1] > o[1])) {
|
||
this.hitCanvasContext_ || (this.hitCanvasContext_ = Ao(1, 1)), this.hitCanvasContext_.clearRect(0, 0, 1, 1), this.hitCanvasContext_.drawImage(this.image_.getImage(), n[0], n[1], 1, 1, 0, 0, 1, 1);
|
||
var s = this.hitCanvasContext_.getImageData(0, 0, 1, 1).data;
|
||
return s[3] > 0 ? i.call(r, this.getLayer(), s) : void 0
|
||
}
|
||
}
|
||
}, e.prototype.getHitTransformationMatrix_ = function (t, e) {
|
||
var i = [1, 0, 0, 1, 0, 0];
|
||
fi(i, -1, -1), di(i, 2 / t[0], 2 / t[1]), fi(i, 0, t[1]), di(i, 1, -1);
|
||
var r = mi(this.projectionMatrix.slice()), o = [1, 0, 0, 1, 0, 0];
|
||
return fi(o, 0, e[1]), di(o, 1, -1), di(o, e[0] / 2, e[1] / 2), fi(o, 1, 1), li(o, r), li(o, i), o
|
||
}, e
|
||
}(ju);
|
||
zu.handles = function (t) {
|
||
return t.getType() === Vo.IMAGE
|
||
}, zu.create = function (t, e) {
|
||
return new zu(t, e)
|
||
};
|
||
var Uu = zu, Bu = function (t) {
|
||
function e(e) {
|
||
t.call(this, e);
|
||
var i = e.getViewport();
|
||
this.canvas_ = document.createElement("canvas"), this.canvas_.style.width = "100%", this.canvas_.style.height = "100%", this.canvas_.style.display = "block", this.canvas_.className = xs, i.insertBefore(this.canvas_, i.childNodes[0] || null), this.clipTileCanvasWidth_ = 0, this.clipTileCanvasHeight_ = 0, this.clipTileContext_ = Ao(), this.renderedVisible_ = !0, this.gl_ = Rh(this.canvas_, {
|
||
antialias: !0,
|
||
depth: !0,
|
||
failIfMajorPerformanceCaveat: !0,
|
||
preserveDrawingBuffer: !1,
|
||
stencil: !0
|
||
}), this.context_ = new ru(this.canvas_, this.gl_), w(this.canvas_, Qh.LOST, this.handleWebGLContextLost, this), w(this.canvas_, Qh.RESTORED, this.handleWebGLContextRestored, this), this.textureCache_ = new Ra, this.focus_ = null, this.tileTextureQueue_ = new zn(function (t) {
|
||
var e = t[1], i = t[2], r = e[0] - this.focus_[0], o = e[1] - this.focus_[1];
|
||
return 65536 * Math.log(i) + Math.sqrt(r * r + o * o) / i
|
||
}.bind(this), function (t) {
|
||
return t[0].getKey()
|
||
}), this.loadNextTileTexture_ = function (t, e) {
|
||
if (!this.tileTextureQueue_.isEmpty()) {
|
||
this.tileTextureQueue_.reprioritize();
|
||
var i = this.tileTextureQueue_.dequeue(), r = i[0], o = i[3], n = i[4];
|
||
this.bindTileTexture(r, o, n, bh, bh)
|
||
}
|
||
return !1
|
||
}.bind(this), this.textureCacheFrameMarkerCount_ = 0, this.initializeGL_()
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.bindTileTexture = function (t, e, i, r, o) {
|
||
var n = this.getGL(), s = t.getKey();
|
||
if (this.textureCache_.containsKey(s)) {
|
||
var a = this.textureCache_.get(s);
|
||
n.bindTexture(Eh, a.texture), a.magFilter != r && (n.texParameteri(Eh, 10240, r), a.magFilter = r), a.minFilter != o && (n.texParameteri(Eh, 10241, o), a.minFilter = o)
|
||
} else {
|
||
var l = n.createTexture(), h = t;
|
||
if (n.bindTexture(Eh, l), i > 0) {
|
||
var u = this.clipTileContext_.canvas, c = this.clipTileContext_;
|
||
this.clipTileCanvasWidth_ !== e[0] || this.clipTileCanvasHeight_ !== e[1] ? (u.width = e[0], u.height = e[1], this.clipTileCanvasWidth_ = e[0], this.clipTileCanvasHeight_ = e[1]) : c.clearRect(0, 0, e[0], e[1]), c.drawImage(h.getImage(), i, i, e[0], e[1], 0, 0, e[0], e[1]), n.texImage2D(Eh, 0, 6408, 6408, 5121, u)
|
||
} else n.texImage2D(Eh, 0, 6408, 6408, 5121, h.getImage());
|
||
n.texParameteri(Eh, 10240, r), n.texParameteri(Eh, 10241, o), n.texParameteri(Eh, Ch, 33071), n.texParameteri(Eh, Sh, 33071), this.textureCache_.set(s, {
|
||
texture: l,
|
||
magFilter: r,
|
||
minFilter: o
|
||
})
|
||
}
|
||
}, e.prototype.dispatchRenderEvent = function (t, e) {
|
||
var i = this.getMap();
|
||
if (i.hasListener(t)) {
|
||
var r = this.context_, o = e.extent, n = e.size, s = e.viewState, a = e.pixelRatio,
|
||
l = s.resolution, h = s.center, u = s.rotation, c = new Fu(r, h, l, u, n, o, a),
|
||
p = new Ta(t, c, e, null, r);
|
||
i.dispatchEvent(p)
|
||
}
|
||
}, e.prototype.disposeInternal = function () {
|
||
var e = this.getGL();
|
||
e.isContextLost() || this.textureCache_.forEach(function (t) {
|
||
t && e.deleteTexture(t.texture)
|
||
}), this.context_.dispose(), t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.expireCache_ = function (t, e) {
|
||
for (var i, r = this.getGL(); this.textureCache_.getCount() - this.textureCacheFrameMarkerCount_ > 1024;) {
|
||
if (i = this.textureCache_.peekLast()) r.deleteTexture(i.texture); else {
|
||
if (+this.textureCache_.peekLastKey() == e.index) break;
|
||
--this.textureCacheFrameMarkerCount_
|
||
}
|
||
this.textureCache_.pop()
|
||
}
|
||
}, e.prototype.getContext = function () {
|
||
return this.context_
|
||
}, e.prototype.getGL = function () {
|
||
return this.gl_
|
||
}, e.prototype.getTileTextureQueue = function () {
|
||
return this.tileTextureQueue_
|
||
}, e.prototype.handleWebGLContextLost = function (t) {
|
||
t.preventDefault(), this.textureCache_.clear(), this.textureCacheFrameMarkerCount_ = 0;
|
||
var e = this.getLayerRenderers();
|
||
for (var i in e) {
|
||
e[i].handleWebGLContextLost()
|
||
}
|
||
}, e.prototype.handleWebGLContextRestored = function () {
|
||
this.initializeGL_(), this.getMap().render()
|
||
}, e.prototype.initializeGL_ = function () {
|
||
var t = this.gl_;
|
||
t.activeTexture(33984), t.blendFuncSeparate(770, 771, 1, 771), t.disable(2884), t.disable(2929), t.disable(3089), t.disable(2960)
|
||
}, e.prototype.isTileTextureLoaded = function (t) {
|
||
return this.textureCache_.containsKey(t.getKey())
|
||
}, e.prototype.renderFrame = function (t) {
|
||
var e = this.getContext(), i = this.getGL();
|
||
if (i.isContextLost()) return !1;
|
||
if (!t) return this.renderedVisible_ && (this.canvas_.style.display = "none", this.renderedVisible_ = !1), !1;
|
||
this.focus_ = t.focus, this.textureCache_.set((-t.index).toString(), null), ++this.textureCacheFrameMarkerCount_, this.dispatchRenderEvent(eo.PRECOMPOSE, t);
|
||
var r = [], o = t.layerStatesArray;
|
||
rt(o, tl);
|
||
var n, s, a = t.viewState.resolution;
|
||
for (n = 0, s = o.length; n < s; ++n) {
|
||
var l = o[n];
|
||
if (Es(l, a) && l.sourceState == hs.READY) this.getLayerRenderer(l.layer).prepareFrame(t, l, e) && r.push(l)
|
||
}
|
||
var h = t.size[0] * t.pixelRatio, u = t.size[1] * t.pixelRatio;
|
||
for (this.canvas_.width == h && this.canvas_.height == u || (this.canvas_.width = h, this.canvas_.height = u), i.bindFramebuffer(36160, null), i.clearColor(0, 0, 0, 0), i.clear(16384), i.enable(3042), i.viewport(0, 0, this.canvas_.width, this.canvas_.height), n = 0, s = r.length; n < s; ++n) {
|
||
var c = r[n];
|
||
this.getLayerRenderer(c.layer).composeFrame(t, c, e)
|
||
}
|
||
this.renderedVisible_ || (this.canvas_.style.display = "", this.renderedVisible_ = !0), this.calculateMatrices2D(t), this.textureCache_.getCount() - this.textureCacheFrameMarkerCount_ > 1024 && t.postRenderFunctions.push(this.expireCache_.bind(this)), this.tileTextureQueue_.isEmpty() || (t.postRenderFunctions.push(this.loadNextTileTexture_), t.animate = !0), this.dispatchRenderEvent(eo.POSTCOMPOSE, t), this.scheduleRemoveUnusedLayerRenderers(t), this.scheduleExpireIconCache(t)
|
||
}, e.prototype.forEachFeatureAtCoordinate = function (t, e, i, r, o, n, s) {
|
||
var a;
|
||
if (this.getGL().isContextLost()) return !1;
|
||
var l, h = e.viewState, u = e.layerStatesArray;
|
||
for (l = u.length - 1; l >= 0; --l) {
|
||
var c = u[l], p = c.layer;
|
||
if (Es(c, h.resolution) && n.call(s, p)) if (a = this.getLayerRenderer(p).forEachFeatureAtCoordinate(t, e, i, r)) return a
|
||
}
|
||
}, e.prototype.hasFeatureAtCoordinate = function (t, e, i, r, o) {
|
||
var n = !1;
|
||
if (this.getGL().isContextLost()) return !1;
|
||
var s, a = e.viewState, l = e.layerStatesArray;
|
||
for (s = l.length - 1; s >= 0; --s) {
|
||
var h = l[s], u = h.layer;
|
||
if (Es(h, a.resolution) && r.call(o, u)) if (n = this.getLayerRenderer(u).hasFeatureAtCoordinate(t, e)) return !0
|
||
}
|
||
return n
|
||
}, e.prototype.forEachLayerAtPixel = function (t, e, i, r, o, n, s) {
|
||
if (this.getGL().isContextLost()) return !1;
|
||
var a, l, h = e.viewState, u = e.layerStatesArray;
|
||
for (l = u.length - 1; l >= 0; --l) {
|
||
var c = u[l], p = c.layer;
|
||
if (Es(c, h.resolution) && n.call(o, p)) if (a = this.getLayerRenderer(p).forEachLayerAtPixel(t, e, r, o)) return a
|
||
}
|
||
}, e
|
||
}(el);
|
||
|
||
function Vu(t) {
|
||
return t ? Array.isArray(t) ? function (e) {
|
||
return t
|
||
} : "function" == typeof t ? t : function (e) {
|
||
return [t]
|
||
} : null
|
||
}
|
||
|
||
var Yu = function (t) {
|
||
function e(e) {
|
||
t.call(this), this.projection_ = We(e.projection), this.attributions_ = Vu(e.attributions), this.attributionsCollapsible_ = void 0 === e.attributionsCollapsible || e.attributionsCollapsible, this.loading = !1, this.state_ = void 0 !== e.state ? e.state : hs.READY, this.wrapX_ = void 0 !== e.wrapX && e.wrapX
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getAttributions = function () {
|
||
return this.attributions_
|
||
}, e.prototype.getAttributionsCollapsible = function () {
|
||
return this.attributionsCollapsible_
|
||
}, e.prototype.getProjection = function () {
|
||
return this.projection_
|
||
}, e.prototype.getResolutions = function () {
|
||
return n()
|
||
}, e.prototype.getState = function () {
|
||
return this.state_
|
||
}, e.prototype.getWrapX = function () {
|
||
return this.wrapX_
|
||
}, e.prototype.refresh = function () {
|
||
this.changed()
|
||
}, e.prototype.setAttributions = function (t) {
|
||
this.attributions_ = Vu(t), this.changed()
|
||
}, e.prototype.setState = function (t) {
|
||
this.state_ = t, this.changed()
|
||
}, e
|
||
}(U), Wu = [0, 0, 0], Hu = function (t) {
|
||
var e;
|
||
if (this.minZoom = void 0 !== t.minZoom ? t.minZoom : 0, this.resolutions_ = t.resolutions, W(nt(this.resolutions_, function (t, e) {
|
||
return e - t
|
||
}, !0), 17), !t.origins) for (var i = 0, r = this.resolutions_.length - 1; i < r; ++i) if (e) {
|
||
if (this.resolutions_[i] / this.resolutions_[i + 1] !== e) {
|
||
e = void 0;
|
||
break
|
||
}
|
||
} else e = this.resolutions_[i] / this.resolutions_[i + 1];
|
||
this.zoomFactor_ = e, this.maxZoom = this.resolutions_.length - 1, this.origin_ = void 0 !== t.origin ? t.origin : null, this.origins_ = null, void 0 !== t.origins && (this.origins_ = t.origins, W(this.origins_.length == this.resolutions_.length, 20));
|
||
var o = t.extent;
|
||
void 0 === o || this.origin_ || this.origins_ || (this.origin_ = jt(o)), W(!this.origin_ && this.origins_ || this.origin_ && !this.origins_, 18), this.tileSizes_ = null, void 0 !== t.tileSizes && (this.tileSizes_ = t.tileSizes, W(this.tileSizes_.length == this.resolutions_.length, 19)), this.tileSize_ = void 0 !== t.tileSize ? t.tileSize : this.tileSizes_ ? null : Vn, W(!this.tileSize_ && this.tileSizes_ || this.tileSize_ && !this.tileSizes_, 22), this.extent_ = void 0 !== o ? o : null, this.fullTileRanges_ = null, this.tmpSize_ = [0, 0], void 0 !== t.sizes ? this.fullTileRanges_ = t.sizes.map(function (t, e) {
|
||
return new pl(Math.min(0, t[0]), Math.max(t[0] - 1, -1), Math.min(0, t[1]), Math.max(t[1] - 1, -1))
|
||
}, this) : o && this.calculateTileRanges_(o)
|
||
};
|
||
Hu.prototype.forEachTileCoord = function (t, e, i) {
|
||
for (var r = this.getTileRangeForExtentAndZ(t, e), o = r.minX, n = r.maxX; o <= n; ++o) for (var s = r.minY, a = r.maxY; s <= a; ++s) i([e, o, s])
|
||
}, Hu.prototype.forEachTileCoordParentTileRange = function (t, e, i, r, o) {
|
||
var n, s, a, l = null, h = t[0] - 1;
|
||
for (2 === this.zoomFactor_ ? (s = t[1], a = t[2]) : l = this.getTileCoordExtent(t, o); h >= this.minZoom;) {
|
||
if (n = 2 === this.zoomFactor_ ? cl(s = Math.floor(s / 2), s, a = Math.floor(a / 2), a, r) : this.getTileRangeForExtentAndZ(l, h, r), e.call(i, h, n)) return !0;
|
||
--h
|
||
}
|
||
return !1
|
||
}, Hu.prototype.getExtent = function () {
|
||
return this.extent_
|
||
}, Hu.prototype.getMaxZoom = function () {
|
||
return this.maxZoom
|
||
}, Hu.prototype.getMinZoom = function () {
|
||
return this.minZoom
|
||
}, Hu.prototype.getOrigin = function (t) {
|
||
return this.origin_ ? this.origin_ : this.origins_[t]
|
||
}, Hu.prototype.getResolution = function (t) {
|
||
return this.resolutions_[t]
|
||
}, Hu.prototype.getResolutions = function () {
|
||
return this.resolutions_
|
||
}, Hu.prototype.getTileCoordChildTileRange = function (t, e, i) {
|
||
if (t[0] < this.maxZoom) {
|
||
if (2 === this.zoomFactor_) {
|
||
var r = 2 * t[1], o = 2 * t[2];
|
||
return cl(r, r + 1, o, o + 1, e)
|
||
}
|
||
var n = this.getTileCoordExtent(t, i);
|
||
return this.getTileRangeForExtentAndZ(n, t[0] + 1, e)
|
||
}
|
||
return null
|
||
}, Hu.prototype.getTileRangeExtent = function (t, e, i) {
|
||
var r = this.getOrigin(t), o = this.getResolution(t), n = gs(this.getTileSize(t), this.tmpSize_),
|
||
s = r[0] + e.minX * n[0] * o, a = r[0] + (e.maxX + 1) * n[0] * o;
|
||
return yt(s, r[1] + e.minY * n[1] * o, a, r[1] + (e.maxY + 1) * n[1] * o, i)
|
||
}, Hu.prototype.getTileRangeForExtentAndZ = function (t, e, i) {
|
||
var r = Wu;
|
||
this.getTileCoordForXYAndZ_(t[0], t[1], e, !1, r);
|
||
var o = r[1], n = r[2];
|
||
return this.getTileCoordForXYAndZ_(t[2], t[3], e, !0, r), cl(o, r[1], n, r[2], i)
|
||
}, Hu.prototype.getTileCoordCenter = function (t) {
|
||
var e = this.getOrigin(t[0]), i = this.getResolution(t[0]), r = gs(this.getTileSize(t[0]), this.tmpSize_);
|
||
return [e[0] + (t[1] + .5) * r[0] * i, e[1] + (t[2] + .5) * r[1] * i]
|
||
}, Hu.prototype.getTileCoordExtent = function (t, e) {
|
||
var i = this.getOrigin(t[0]), r = this.getResolution(t[0]), o = gs(this.getTileSize(t[0]), this.tmpSize_),
|
||
n = i[0] + t[1] * o[0] * r, s = i[1] + t[2] * o[1] * r;
|
||
return yt(n, s, n + o[0] * r, s + o[1] * r, e)
|
||
}, Hu.prototype.getTileCoordForCoordAndResolution = function (t, e, i) {
|
||
return this.getTileCoordForXYAndResolution_(t[0], t[1], e, !1, i)
|
||
}, Hu.prototype.getTileCoordForXYAndResolution_ = function (t, e, i, r, o) {
|
||
var n = this.getZForResolution(i), s = i / this.getResolution(n), a = this.getOrigin(n),
|
||
l = gs(this.getTileSize(n), this.tmpSize_), h = r ? .5 : 0, u = r ? 0 : .5,
|
||
c = Math.floor((t - a[0]) / i + h), p = Math.floor((e - a[1]) / i + u), d = s * c / l[0],
|
||
f = s * p / l[1];
|
||
return r ? (d = Math.ceil(d) - 1, f = Math.ceil(f) - 1) : (d = Math.floor(d), f = Math.floor(f)), ah(n, d, f, o)
|
||
}, Hu.prototype.getTileCoordForXYAndZ_ = function (t, e, i, r, o) {
|
||
var n = this.getOrigin(i), s = this.getResolution(i), a = gs(this.getTileSize(i), this.tmpSize_),
|
||
l = r ? .5 : 0, h = r ? 0 : .5, u = Math.floor((t - n[0]) / s + l), c = Math.floor((e - n[1]) / s + h),
|
||
p = u / a[0], d = c / a[1];
|
||
return r ? (p = Math.ceil(p) - 1, d = Math.ceil(d) - 1) : (p = Math.floor(p), d = Math.floor(d)), ah(i, p, d, o)
|
||
}, Hu.prototype.getTileCoordForCoordAndZ = function (t, e, i) {
|
||
return this.getTileCoordForXYAndZ_(t[0], t[1], e, !1, i)
|
||
}, Hu.prototype.getTileCoordResolution = function (t) {
|
||
return this.resolutions_[t[0]]
|
||
}, Hu.prototype.getTileSize = function (t) {
|
||
return this.tileSize_ ? this.tileSize_ : this.tileSizes_[t]
|
||
}, Hu.prototype.getFullTileRange = function (t) {
|
||
return this.fullTileRanges_ ? this.fullTileRanges_[t] : null
|
||
}, Hu.prototype.getZForResolution = function (t, e) {
|
||
return te(J(this.resolutions_, t, e || 0), this.minZoom, this.maxZoom)
|
||
}, Hu.prototype.calculateTileRanges_ = function (t) {
|
||
for (var e = this.resolutions_.length, i = new Array(e), r = this.minZoom; r < e; ++r) i[r] = this.getTileRangeForExtentAndZ(t, r);
|
||
this.fullTileRanges_ = i
|
||
};
|
||
var Xu = Hu;
|
||
|
||
function qu(t) {
|
||
var e = t.getDefaultTileGrid();
|
||
return e || (e = Qu(t), t.setDefaultTileGrid(e)), e
|
||
}
|
||
|
||
function Zu(t, e, i) {
|
||
var r = e[0], o = t.getTileCoordCenter(e), n = tc(i);
|
||
if (pt(n, o)) return e;
|
||
var s = Ut(n), a = Math.ceil((n[0] - o[0]) / s);
|
||
return o[0] += s * a, t.getTileCoordForCoordAndZ(o, r)
|
||
}
|
||
|
||
function Ku(t, e, i, r) {
|
||
var o = void 0 !== r ? r : st.TOP_LEFT, n = $u(t, e, i);
|
||
return new Xu({extent: t, origin: kt(t, o), resolutions: n, tileSize: i})
|
||
}
|
||
|
||
function Ju(t) {
|
||
var e = t || {}, i = e.extent || We("EPSG:3857").getExtent(),
|
||
r = {extent: i, minZoom: e.minZoom, tileSize: e.tileSize, resolutions: $u(i, e.maxZoom, e.tileSize)};
|
||
return new Xu(r)
|
||
}
|
||
|
||
function $u(t, e, i) {
|
||
for (var r = void 0 !== e ? e : Bn, o = Nt(t), n = Ut(t), s = gs(void 0 !== i ? i : Vn), a = Math.max(n / s[0], o / s[1]), l = r + 1, h = new Array(l), u = 0; u < l; ++u) h[u] = a / Math.pow(2, u);
|
||
return h
|
||
}
|
||
|
||
function Qu(t, e, i, r) {
|
||
return Ku(tc(t), e, i, r)
|
||
}
|
||
|
||
function tc(t) {
|
||
var e = (t = We(t)).getExtent();
|
||
if (!e) {
|
||
var i = 180 * ye[ve.DEGREES] / t.getMetersPerUnit();
|
||
e = yt(-i, -i, i, i)
|
||
}
|
||
return e
|
||
}
|
||
|
||
var ec = function (t) {
|
||
function e(e) {
|
||
t.call(this, {
|
||
attributions: e.attributions,
|
||
attributionsCollapsible: e.attributionsCollapsible,
|
||
projection: e.projection,
|
||
state: e.state,
|
||
wrapX: e.wrapX
|
||
}), this.opaque_ = void 0 !== e.opaque && e.opaque, this.tilePixelRatio_ = void 0 !== e.tilePixelRatio ? e.tilePixelRatio : 1, this.tileGrid = void 0 !== e.tileGrid ? e.tileGrid : null, this.tileCache = new fh(e.cacheSize), this.tmpSize = [0, 0], this.key_ = e.key || "", this.tileOptions = {transition: e.transition}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.canExpireCache = function () {
|
||
return this.tileCache.canExpireCache()
|
||
}, e.prototype.expireCache = function (t, e) {
|
||
var i = this.getTileCacheForProjection(t);
|
||
i && i.expireCache(e)
|
||
}, e.prototype.forEachLoadedTile = function (t, e, i, r) {
|
||
var o = this.getTileCacheForProjection(t);
|
||
if (!o) return !1;
|
||
for (var n, s, a, l = !0, h = i.minX; h <= i.maxX; ++h) for (var u = i.minY; u <= i.maxY; ++u) s = lh(e, h, u), a = !1, o.containsKey(s) && (a = (n = o.get(s)).getState() === Ro.LOADED) && (a = !1 !== r(n)), a || (l = !1);
|
||
return l
|
||
}, e.prototype.getGutterForProjection = function (t) {
|
||
return 0
|
||
}, e.prototype.getKey = function () {
|
||
return this.key_
|
||
}, e.prototype.setKey = function (t) {
|
||
this.key_ !== t && (this.key_ = t, this.changed())
|
||
}, e.prototype.getOpaque = function (t) {
|
||
return this.opaque_
|
||
}, e.prototype.getResolutions = function () {
|
||
return this.tileGrid.getResolutions()
|
||
}, e.prototype.getTile = function (t, e, i, r, o) {
|
||
return n()
|
||
}, e.prototype.getTileGrid = function () {
|
||
return this.tileGrid
|
||
}, e.prototype.getTileGridForProjection = function (t) {
|
||
return this.tileGrid ? this.tileGrid : qu(t)
|
||
}, e.prototype.getTileCacheForProjection = function (t) {
|
||
var e = this.getProjection();
|
||
return e && !Qe(e, t) ? null : this.tileCache
|
||
}, e.prototype.getTilePixelRatio = function (t) {
|
||
return this.tilePixelRatio_
|
||
}, e.prototype.getTilePixelSize = function (t, e, i) {
|
||
var r = this.getTileGridForProjection(i), o = this.getTilePixelRatio(e),
|
||
n = gs(r.getTileSize(t), this.tmpSize);
|
||
return 1 == o ? n : fs(n, o, this.tmpSize)
|
||
}, e.prototype.getTileCoordForTileUrlFunction = function (t, e) {
|
||
var i = void 0 !== e ? e : this.getProjection(), r = this.getTileGridForProjection(i);
|
||
return this.getWrapX() && i.isGlobal() && (t = Zu(r, t, i)), dh(t, r) ? t : null
|
||
}, e.prototype.refresh = function () {
|
||
this.tileCache.clear(), this.changed()
|
||
}, e.prototype.useTile = function (t, e, i, r) {
|
||
}, e
|
||
}(Yu), ic = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e), this.tile = i
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A), rc = ec,
|
||
oc = new Ah("precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor = texture2D(u_texture, v_texCoord);\n}\n"),
|
||
nc = new kh("varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position = vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord = a_texCoord;\n}\n\n\n"),
|
||
sc = function (t, e) {
|
||
this.u_tileOffset = t.getUniformLocation(e, "u_tileOffset"), this.u_texture = t.getUniformLocation(e, "u_texture"), this.a_position = t.getAttribLocation(e, "a_position"), this.a_texCoord = t.getAttribLocation(e, "a_texCoord")
|
||
}, ac = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e, i), this.fragmentShader_ = oc, this.vertexShader_ = nc, this.locations_ = null, this.renderArrayBuffer_ = new qh([0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0]), this.renderedTileRange_ = null, this.renderedFramebufferExtent_ = null, this.renderedRevision_ = -1, this.tmpSize_ = [0, 0]
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.disposeInternal = function () {
|
||
this.mapRenderer.getContext().deleteBuffer(this.renderArrayBuffer_), t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.createLoadedTileFinder = function (t, e, i) {
|
||
var r = this.mapRenderer;
|
||
return function (o, n) {
|
||
return t.forEachLoadedTile(e, o, n, function (t) {
|
||
var e = r.isTileTextureLoaded(t);
|
||
return e && (i[o] || (i[o] = {}), i[o][t.tileCoord.toString()] = t), e
|
||
})
|
||
}
|
||
}, e.prototype.handleWebGLContextLost = function () {
|
||
t.prototype.handleWebGLContextLost.call(this), this.locations_ = null
|
||
}, e.prototype.prepareFrame = function (t, e, i) {
|
||
var r = this.mapRenderer, o = i.getGL(), n = t.viewState, s = n.projection, a = this.getLayer(),
|
||
l = a.getSource();
|
||
if (!(l instanceof rc)) return !0;
|
||
var h, u = l.getTileGridForProjection(s), c = u.getZForResolution(n.resolution), p = u.getResolution(c),
|
||
d = l.getTilePixelSize(c, t.pixelRatio, s), f = d[0] / gs(u.getTileSize(c), this.tmpSize_)[0],
|
||
g = p / f, m = l.getTilePixelRatio(f) * l.getGutterForProjection(s), y = n.center, v = t.extent,
|
||
_ = u.getTileRangeForExtentAndZ(v, c);
|
||
if (this.renderedTileRange_ && this.renderedTileRange_.equals(_) && this.renderedRevision_ == l.getRevision()) h = this.renderedFramebufferExtent_; else {
|
||
var x = _.getSize(), w = ie(Math.max(x[0] * d[0], x[1] * d[1])), b = g * w, C = u.getOrigin(c),
|
||
S = C[0] + _.minX * d[0] * g, E = C[1] + _.minY * d[1] * g;
|
||
h = [S, E, S + b, E + b], this.bindFramebuffer(t, w), o.viewport(0, 0, w, w), o.clearColor(0, 0, 0, 0), o.clear(16384), o.disable(3042);
|
||
var T = i.getProgram(this.fragmentShader_, this.vertexShader_);
|
||
i.useProgram(T), this.locations_ || (this.locations_ = new sc(o, T)), i.bindBuffer(34962, this.renderArrayBuffer_), o.enableVertexAttribArray(this.locations_.a_position), o.vertexAttribPointer(this.locations_.a_position, 2, 5126, !1, 16, 0), o.enableVertexAttribArray(this.locations_.a_texCoord), o.vertexAttribPointer(this.locations_.a_texCoord, 2, 5126, !1, 16, 8), o.uniform1i(this.locations_.u_texture, 0);
|
||
var R = {};
|
||
R[c] = {};
|
||
var P, L, I, O, M, A, k = this.createLoadedTileFinder(l, s, R), F = a.getUseInterimTilesOnError(),
|
||
N = !0, D = [1 / 0, 1 / 0, -1 / 0, -1 / 0], G = new pl(0, 0, 0, 0);
|
||
for (O = _.minX; O <= _.maxX; ++O) for (M = _.minY; M <= _.maxY; ++M) if (L = l.getTile(c, O, M, f, s), void 0 === e.extent || Bt(A = u.getTileCoordExtent(L.tileCoord, D), e.extent)) {
|
||
if ((I = L.getState()) == Ro.LOADED || I == Ro.EMPTY || I == Ro.ERROR && !F || (L = L.getInterimTile()), (I = L.getState()) == Ro.LOADED) {
|
||
if (r.isTileTextureLoaded(L)) {
|
||
R[c][L.tileCoord.toString()] = L;
|
||
continue
|
||
}
|
||
} else if (I == Ro.EMPTY || I == Ro.ERROR && !F) continue;
|
||
N = !1, u.forEachTileCoordParentTileRange(L.tileCoord, k, null, G, D) || (P = u.getTileCoordChildTileRange(L.tileCoord, G, D)) && k(c + 1, P)
|
||
}
|
||
var j = Object.keys(R).map(Number);
|
||
j.sort(Z);
|
||
for (var z = new Float32Array(4), U = 0, B = j.length; U < B; ++U) {
|
||
var V = R[j[U]];
|
||
for (var Y in V) (L = V[Y]) instanceof zo && (A = u.getTileCoordExtent(L.tileCoord, D), z[0] = 2 * (A[2] - A[0]) / b, z[1] = 2 * (A[3] - A[1]) / b, z[2] = 2 * (A[0] - h[0]) / b - 1, z[3] = 2 * (A[1] - h[1]) / b - 1, o.uniform4fv(this.locations_.u_tileOffset, z), r.bindTileTexture(L, d, m * f, bh, bh), o.drawArrays(5, 0, 4))
|
||
}
|
||
N ? (this.renderedTileRange_ = _, this.renderedFramebufferExtent_ = h, this.renderedRevision_ = l.getRevision()) : (this.renderedTileRange_ = null, this.renderedFramebufferExtent_ = null, this.renderedRevision_ = -1, t.animate = !0)
|
||
}
|
||
this.updateUsedTiles(t.usedTiles, l, c, _);
|
||
var W = r.getTileTextureQueue();
|
||
this.manageTilePyramid(t, l, u, f, s, v, c, a.getPreload(), function (t) {
|
||
t.getState() != Ro.LOADED || r.isTileTextureLoaded(t) || W.isKeyQueued(t.getKey()) || W.enqueue([t, u.getTileCoordCenter(t.tileCoord), u.getResolution(t.tileCoord[0]), d, m * f])
|
||
}, this), this.scheduleExpireCache(t, l);
|
||
var H = this.texCoordMatrix;
|
||
return ai(H), fi(H, (Math.round(y[0] / p) * p - h[0]) / (h[2] - h[0]), (Math.round(y[1] / p) * p - h[1]) / (h[3] - h[1])), 0 !== n.rotation && pi(H, n.rotation), di(H, t.size[0] * n.resolution / (h[2] - h[0]), t.size[1] * n.resolution / (h[3] - h[1])), fi(H, -.5, -.5), !0
|
||
}, e.prototype.forEachLayerAtPixel = function (t, e, i, r) {
|
||
if (this.framebuffer) {
|
||
var o = [t[0] / e.size[0], (e.size[1] - t[1]) / e.size[1]], n = ci(this.texCoordMatrix, o.slice()),
|
||
s = [n[0] * this.framebufferDimension, n[1] * this.framebufferDimension],
|
||
a = this.mapRenderer.getContext().getGL();
|
||
a.bindFramebuffer(a.FRAMEBUFFER, this.framebuffer);
|
||
var l = new Uint8Array(4);
|
||
return a.readPixels(s[0], s[1], 1, 1, a.RGBA, a.UNSIGNED_BYTE, l), l[3] > 0 ? i.call(r, this.getLayer(), l) : void 0
|
||
}
|
||
}, e
|
||
}(ju);
|
||
ac.handles = function (t) {
|
||
return t.getType() === Vo.TILE
|
||
}, ac.create = function (t, e) {
|
||
return new ac(t, e)
|
||
};
|
||
var lc = ac, hc = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e, i), this.dirty_ = !1, this.renderedRevision_ = -1, this.renderedResolution_ = NaN, this.renderedExtent_ = [1 / 0, 1 / 0, -1 / 0, -1 / 0], this.renderedRenderOrder_ = null, this.replayGroup_ = null, this.layerState_ = null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.composeFrame = function (t, e, i) {
|
||
this.layerState_ = e;
|
||
var r = t.viewState, o = this.replayGroup_, n = t.size, s = t.pixelRatio, a = this.mapRenderer.getGL();
|
||
o && !o.isEmpty() && (a.enable(a.SCISSOR_TEST), a.scissor(0, 0, n[0] * s, n[1] * s), o.replay(i, r.center, r.resolution, r.rotation, n, s, e.opacity, e.managed ? t.skippedFeatureUids : {}), a.disable(a.SCISSOR_TEST))
|
||
}, e.prototype.disposeInternal = function () {
|
||
var e = this.replayGroup_;
|
||
if (e) {
|
||
var i = this.mapRenderer.getContext();
|
||
e.getDeleteResourcesFunction(i)(), this.replayGroup_ = null
|
||
}
|
||
t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.forEachFeatureAtCoordinate = function (t, e, i, r, o) {
|
||
if (this.replayGroup_ && this.layerState_) {
|
||
var n = this.mapRenderer.getContext(), s = e.viewState, l = this.getLayer(), h = this.layerState_,
|
||
u = {};
|
||
return this.replayGroup_.forEachFeatureAtCoordinate(t, n, s.center, s.resolution, s.rotation, e.size, e.pixelRatio, h.opacity, {}, function (t) {
|
||
var e = a(t);
|
||
if (!(e in u)) return u[e] = !0, r.call(o, t, l)
|
||
})
|
||
}
|
||
}, e.prototype.hasFeatureAtCoordinate = function (t, e) {
|
||
if (this.replayGroup_ && this.layerState_) {
|
||
var i = this.mapRenderer.getContext(), r = e.viewState, o = this.layerState_;
|
||
return this.replayGroup_.hasFeatureAtCoordinate(t, i, r.center, r.resolution, r.rotation, e.size, e.pixelRatio, o.opacity, e.skippedFeatureUids)
|
||
}
|
||
return !1
|
||
}, e.prototype.forEachLayerAtPixel = function (t, e, i, r) {
|
||
var o = ci(e.pixelToCoordinateTransform, t.slice());
|
||
return this.hasFeatureAtCoordinate(o, e) ? i.call(r, this.getLayer(), null) : void 0
|
||
}, e.prototype.handleStyleImageChange_ = function (t) {
|
||
this.renderIfReadyAndVisible()
|
||
}, e.prototype.prepareFrame = function (t, e, i) {
|
||
var r = this.getLayer(), o = r.getSource(), n = t.viewHints[$n.ANIMATING],
|
||
s = t.viewHints[$n.INTERACTING], a = r.getUpdateWhileAnimating(), l = r.getUpdateWhileInteracting();
|
||
if (!this.dirty_ && !a && n || !l && s) return !0;
|
||
var h = t.extent, u = t.viewState, c = u.projection, p = u.resolution, d = t.pixelRatio,
|
||
f = r.getRevision(), g = r.getRenderBuffer(), m = r.getRenderOrder();
|
||
void 0 === m && (m = Hl);
|
||
var y = ht(h, g * p);
|
||
if (!this.dirty_ && this.renderedResolution_ == p && this.renderedRevision_ == f && this.renderedRenderOrder_ == m && dt(this.renderedExtent_, y)) return !0;
|
||
this.replayGroup_ && t.postRenderFunctions.push(this.replayGroup_.getDeleteResourcesFunction(i)), this.dirty_ = !1;
|
||
var v = new ku(ql(p, d), y, r.getRenderBuffer());
|
||
o.loadFeatures(y, p, c);
|
||
var _ = function (t) {
|
||
var e, i = t.getStyleFunction() || r.getStyleFunction();
|
||
if (i && (e = i(t, p)), e) {
|
||
var o = this.renderFeature(t, p, d, e, v);
|
||
this.dirty_ = this.dirty_ || o
|
||
}
|
||
}.bind(this);
|
||
if (m) {
|
||
var x = [];
|
||
o.forEachFeatureInExtent(y, function (t) {
|
||
x.push(t)
|
||
}), x.sort(m), x.forEach(_.bind(this))
|
||
} else o.forEachFeatureInExtent(y, _);
|
||
return v.finish(i), this.renderedResolution_ = p, this.renderedRevision_ = f, this.renderedRenderOrder_ = m, this.renderedExtent_ = y, this.replayGroup_ = v, !0
|
||
}, e.prototype.renderFeature = function (t, e, i, r, o) {
|
||
if (!r) return !1;
|
||
var n = !1;
|
||
if (Array.isArray(r)) for (var s = r.length - 1; s >= 0; --s) n = Zl(o, t, r[s], Xl(e, i), this.handleStyleImageChange_, this) || n; else n = Zl(o, t, r, Xl(e, i), this.handleStyleImageChange_, this) || n;
|
||
return n
|
||
}, e
|
||
}(ju);
|
||
hc.handles = function (t) {
|
||
return t.getType() === Vo.VECTOR
|
||
}, hc.create = function (t, e) {
|
||
return new hc(t, e)
|
||
};
|
||
var uc, cc = hc, pc = function (t) {
|
||
function e(e) {
|
||
(e = p({}, e)).controls || (e.controls = Ms()), e.interactions || (e.interactions = Ca()), t.call(this, e)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.createRenderer = function () {
|
||
var t = new Bu(this);
|
||
return t.registerLayerRenderers([Uu, lc, cc]), t
|
||
}, e
|
||
}(ms), dc = function () {
|
||
if (!uc) {
|
||
var t = document.body;
|
||
t.webkitRequestFullscreen ? uc = "webkitfullscreenchange" : t.mozRequestFullScreen ? uc = "mozfullscreenchange" : t.msRequestFullscreen ? uc = "MSFullscreenChange" : t.requestFullscreen && (uc = "fullscreenchange")
|
||
}
|
||
return uc
|
||
};
|
||
|
||
function fc() {
|
||
var t = document.body;
|
||
return !!(t.webkitRequestFullscreen || t.mozRequestFullScreen && document.mozFullScreenEnabled || t.msRequestFullscreen && document.msFullscreenEnabled || t.requestFullscreen && document.fullscreenEnabled)
|
||
}
|
||
|
||
function gc() {
|
||
return !!(document.webkitIsFullScreen || document.mozFullScreen || document.msFullscreenElement || document.fullscreenElement)
|
||
}
|
||
|
||
function mc(t) {
|
||
t.requestFullscreen ? t.requestFullscreen() : t.msRequestFullscreen ? t.msRequestFullscreen() : t.mozRequestFullScreen ? t.mozRequestFullScreen() : t.webkitRequestFullscreen && t.webkitRequestFullscreen()
|
||
}
|
||
|
||
var yc = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {
|
||
element: document.createElement("div"),
|
||
target: i.target
|
||
}), this.cssClassName_ = void 0 !== i.className ? i.className : "ol-full-screen";
|
||
var r = void 0 !== i.label ? i.label : "⤢";
|
||
this.labelNode_ = "string" == typeof r ? document.createTextNode(r) : r;
|
||
var o = void 0 !== i.labelActive ? i.labelActive : "×";
|
||
this.labelActiveNode_ = "string" == typeof o ? document.createTextNode(o) : o, this.button_ = document.createElement("button");
|
||
var n = i.tipLabel ? i.tipLabel : "Toggle full-screen";
|
||
this.setClassName_(this.button_, gc()), this.button_.setAttribute("type", "button"), this.button_.title = n, this.button_.appendChild(this.labelNode_), w(this.button_, F.CLICK, this.handleClick_, this);
|
||
var s = this.cssClassName_ + " " + xs + " " + bs + " " + (fc() ? "" : ws), a = this.element;
|
||
a.className = s, a.appendChild(this.button_), this.keys_ = void 0 !== i.keys && i.keys, this.source_ = i.source
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleClick_ = function (t) {
|
||
t.preventDefault(), this.handleFullScreen_()
|
||
}, e.prototype.handleFullScreen_ = function () {
|
||
if (fc()) {
|
||
var t, e = this.getMap();
|
||
if (e) if (gc()) document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen(); else t = this.source_ ? "string" == typeof this.source_ ? document.getElementById(this.source_) : this.source_ : e.getTargetElement(), this.keys_ ? function (t) {
|
||
t.mozRequestFullScreenWithKeys ? t.mozRequestFullScreenWithKeys() : t.webkitRequestFullscreen ? t.webkitRequestFullscreen() : mc(t)
|
||
}(t) : mc(t)
|
||
}
|
||
}, e.prototype.handleFullScreenChange_ = function () {
|
||
var t = this.getMap();
|
||
gc() ? (this.setClassName_(this.button_, !0), No(this.labelActiveNode_, this.labelNode_)) : (this.setClassName_(this.button_, !1), No(this.labelNode_, this.labelActiveNode_)), t && t.updateSize()
|
||
}, e.prototype.setClassName_ = function (t, e) {
|
||
var i = this.cssClassName_ + "-true", r = this.cssClassName_ + "-false", o = e ? i : r;
|
||
t.classList.remove(i), t.classList.remove(r), t.classList.add(o)
|
||
}, e.prototype.setMap = function (e) {
|
||
t.prototype.setMap.call(this, e), e && this.listenerKeys.push(w(document, dc(), this.handleFullScreenChange_, this))
|
||
}, e
|
||
}(ys), vc = "projection";
|
||
|
||
function _c(t) {
|
||
var e = t.frameState;
|
||
e ? this.mapProjection_ != e.viewState.projection && (this.mapProjection_ = e.viewState.projection, this.transform_ = null) : this.mapProjection_ = null
|
||
}
|
||
|
||
var xc = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = document.createElement("div");
|
||
r.className = void 0 !== i.className ? i.className : "ol-mouse-position", t.call(this, {
|
||
element: r,
|
||
render: i.render || _c,
|
||
target: i.target
|
||
}), w(this, z(vc), this.handleProjectionChanged_, this), i.coordinateFormat && this.setCoordinateFormat(i.coordinateFormat), i.projection && this.setProjection(i.projection), this.undefinedHTML_ = void 0 !== i.undefinedHTML ? i.undefinedHTML : " ", this.renderOnMouseOut_ = !!this.undefinedHTML_, this.renderedHTML_ = r.innerHTML, this.mapProjection_ = null, this.transform_ = null, this.lastMouseMovePixel_ = null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleProjectionChanged_ = function () {
|
||
this.transform_ = null
|
||
}, e.prototype.getCoordinateFormat = function () {
|
||
return this.get("coordinateFormat")
|
||
}, e.prototype.getProjection = function () {
|
||
return this.get(vc)
|
||
}, e.prototype.handleMouseMove = function (t) {
|
||
var e = this.getMap();
|
||
this.lastMouseMovePixel_ = e.getEventPixel(t), this.updateHTML_(this.lastMouseMovePixel_)
|
||
}, e.prototype.handleMouseOut = function (t) {
|
||
this.updateHTML_(null), this.lastMouseMovePixel_ = null
|
||
}, e.prototype.setMap = function (e) {
|
||
if (t.prototype.setMap.call(this, e), e) {
|
||
var i = e.getViewport();
|
||
this.listenerKeys.push(w(i, F.MOUSEMOVE, this.handleMouseMove, this), w(i, F.TOUCHSTART, this.handleMouseMove, this)), this.renderOnMouseOut_ && this.listenerKeys.push(w(i, F.MOUSEOUT, this.handleMouseOut, this), w(i, F.TOUCHEND, this.handleMouseOut, this))
|
||
}
|
||
}, e.prototype.setCoordinateFormat = function (t) {
|
||
this.set("coordinateFormat", t)
|
||
}, e.prototype.setProjection = function (t) {
|
||
this.set(vc, We(t))
|
||
}, e.prototype.updateHTML_ = function (t) {
|
||
var e = this.undefinedHTML_;
|
||
if (t && this.mapProjection_) {
|
||
if (!this.transform_) {
|
||
var i = this.getProjection();
|
||
this.transform_ = i ? ti(this.mapProjection_, i) : Be
|
||
}
|
||
var r = this.getMap().getCoordinateFromPixel(t);
|
||
if (r) {
|
||
this.transform_(r, r);
|
||
var o = this.getCoordinateFormat();
|
||
e = o ? o(r) : r.toString()
|
||
}
|
||
}
|
||
this.renderedHTML_ && e === this.renderedHTML_ || (this.element.innerHTML = e, this.renderedHTML_ = e)
|
||
}, e
|
||
}(ys);
|
||
|
||
function wc(t) {
|
||
this.validateExtent_(), this.updateBox_()
|
||
}
|
||
|
||
var bc = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {
|
||
element: document.createElement("div"),
|
||
render: i.render || wc,
|
||
target: i.target
|
||
}), this.collapsed_ = void 0 === i.collapsed || i.collapsed, this.collapsible_ = void 0 === i.collapsible || i.collapsible, this.collapsible_ || (this.collapsed_ = !1);
|
||
var r = void 0 !== i.className ? i.className : "ol-overviewmap",
|
||
o = void 0 !== i.tipLabel ? i.tipLabel : "Overview map",
|
||
n = void 0 !== i.collapseLabel ? i.collapseLabel : "«";
|
||
"string" == typeof n ? (this.collapseLabel_ = document.createElement("span"), this.collapseLabel_.textContent = n) : this.collapseLabel_ = n;
|
||
var s = void 0 !== i.label ? i.label : "»";
|
||
"string" == typeof s ? (this.label_ = document.createElement("span"), this.label_.textContent = s) : this.label_ = s;
|
||
var a = this.collapsible_ && !this.collapsed_ ? this.collapseLabel_ : this.label_,
|
||
l = document.createElement("button");
|
||
l.setAttribute("type", "button"), l.title = o, l.appendChild(a), w(l, F.CLICK, this.handleClick_, this), this.ovmapDiv_ = document.createElement("div"), this.ovmapDiv_.className = "ol-overviewmap-map", this.ovmap_ = new rh({
|
||
controls: new Y,
|
||
interactions: new Y,
|
||
view: i.view
|
||
});
|
||
var h = this.ovmap_;
|
||
i.layers && i.layers.forEach(function (t) {
|
||
h.addLayer(t)
|
||
}.bind(this));
|
||
var u = document.createElement("div");
|
||
u.className = "ol-overviewmap-box", u.style.boxSizing = "border-box", this.boxOverlay_ = new sh({
|
||
position: [0, 0],
|
||
positioning: oh.BOTTOM_LEFT,
|
||
element: u
|
||
}), this.ovmap_.addOverlay(this.boxOverlay_);
|
||
var c = r + " " + xs + " " + bs + (this.collapsed_ && this.collapsible_ ? " " + Cs : "") + (this.collapsible_ ? "" : " ol-uncollapsible"),
|
||
p = this.element;
|
||
p.className = c, p.appendChild(this.ovmapDiv_), p.appendChild(l);
|
||
var d = this, f = this.boxOverlay_, g = this.boxOverlay_.getElement(), m = function (t) {
|
||
var e, i = {clientX: (e = t).clientX - g.offsetWidth / 2, clientY: e.clientY + g.offsetHeight / 2},
|
||
r = h.getEventCoordinate(i);
|
||
f.setPosition(r)
|
||
}, y = function (t) {
|
||
var e = h.getEventCoordinate(t);
|
||
d.getMap().getView().setCenter(e), window.removeEventListener("mousemove", m), window.removeEventListener("mouseup", y)
|
||
};
|
||
g.addEventListener("mousedown", function () {
|
||
window.addEventListener("mousemove", m), window.addEventListener("mouseup", y)
|
||
})
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.setMap = function (e) {
|
||
var i = this.getMap();
|
||
if (e !== i) {
|
||
if (i) {
|
||
var r = i.getView();
|
||
r && this.unbindView_(r), this.ovmap_.setTarget(null)
|
||
}
|
||
if (t.prototype.setMap.call(this, e), e) {
|
||
this.ovmap_.setTarget(this.ovmapDiv_), this.listenerKeys.push(w(e, c.PROPERTYCHANGE, this.handleMapPropertyChange_, this)), 0 === this.ovmap_.getLayers().getLength() && this.ovmap_.setLayerGroup(e.getLayerGroup());
|
||
var o = e.getView();
|
||
o && (this.bindView_(o), o.isDef() && (this.ovmap_.updateSize(), this.resetExtent_()))
|
||
}
|
||
}
|
||
}, e.prototype.handleMapPropertyChange_ = function (t) {
|
||
if (t.key === Gn.VIEW) {
|
||
var e = t.oldValue;
|
||
e && this.unbindView_(e);
|
||
var i = this.getMap().getView();
|
||
this.bindView_(i)
|
||
}
|
||
}, e.prototype.bindView_ = function (t) {
|
||
w(t, z(Qn.ROTATION), this.handleRotationChanged_, this)
|
||
}, e.prototype.unbindView_ = function (t) {
|
||
C(t, z(Qn.ROTATION), this.handleRotationChanged_, this)
|
||
}, e.prototype.handleRotationChanged_ = function () {
|
||
this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())
|
||
}, e.prototype.validateExtent_ = function () {
|
||
var t = this.getMap(), e = this.ovmap_;
|
||
if (t.isRendered() && e.isRendered()) {
|
||
var i = t.getSize(), r = t.getView().calculateExtent(i), o = e.getSize(),
|
||
n = e.getView().calculateExtent(o), s = e.getPixelFromCoordinate(jt(r)),
|
||
a = e.getPixelFromCoordinate(Mt(r)), l = Math.abs(s[0] - a[0]), h = Math.abs(s[1] - a[1]),
|
||
u = o[0], c = o[1];
|
||
l < .1 * u || h < .1 * c || l > .75 * u || h > .75 * c ? this.resetExtent_() : dt(n, r) || this.recenter_()
|
||
}
|
||
}, e.prototype.resetExtent_ = function () {
|
||
var t = this.getMap(), e = this.ovmap_, i = t.getSize(), r = t.getView().calculateExtent(i),
|
||
o = e.getView(), n = Math.log(7.5) / Math.LN2;
|
||
Wt(r, 1 / (.1 * Math.pow(2, n / 2))), o.fit(r)
|
||
}, e.prototype.recenter_ = function () {
|
||
var t = this.getMap(), e = this.ovmap_, i = t.getView();
|
||
e.getView().setCenter(i.getCenter())
|
||
}, e.prototype.updateBox_ = function () {
|
||
var t = this.getMap(), e = this.ovmap_;
|
||
if (t.isRendered() && e.isRendered()) {
|
||
var i = t.getSize(), r = t.getView(), o = e.getView(), n = r.getRotation(), s = this.boxOverlay_,
|
||
a = this.boxOverlay_.getElement(), l = r.calculateExtent(i), h = o.getResolution(), u = Ot(l),
|
||
c = zt(l), p = this.calculateCoordinateRotate_(n, u);
|
||
s.setPosition(p), a && (a.style.width = Math.abs((u[0] - c[0]) / h) + "px", a.style.height = Math.abs((c[1] - u[1]) / h) + "px")
|
||
}
|
||
}, e.prototype.calculateCoordinateRotate_ = function (t, e) {
|
||
var i, r = this.getMap().getView().getCenter();
|
||
return r && (Ur(i = [e[0] - r[0], e[1] - r[1]], t), Fr(i, r)), i
|
||
}, e.prototype.handleClick_ = function (t) {
|
||
t.preventDefault(), this.handleToggle_()
|
||
}, e.prototype.handleToggle_ = function () {
|
||
this.element.classList.toggle(Cs), this.collapsed_ ? No(this.collapseLabel_, this.label_) : No(this.label_, this.collapseLabel_), this.collapsed_ = !this.collapsed_;
|
||
var t = this.ovmap_;
|
||
this.collapsed_ || t.isRendered() || (t.updateSize(), this.resetExtent_(), b(t, Dn.POSTRENDER, function (t) {
|
||
this.updateBox_()
|
||
}, this))
|
||
}, e.prototype.getCollapsible = function () {
|
||
return this.collapsible_
|
||
}, e.prototype.setCollapsible = function (t) {
|
||
this.collapsible_ !== t && (this.collapsible_ = t, this.element.classList.toggle("ol-uncollapsible"), !t && this.collapsed_ && this.handleToggle_())
|
||
}, e.prototype.setCollapsed = function (t) {
|
||
this.collapsible_ && this.collapsed_ !== t && this.handleToggle_()
|
||
}, e.prototype.getCollapsed = function () {
|
||
return this.collapsed_
|
||
}, e.prototype.getOverviewMap = function () {
|
||
return this.ovmap_
|
||
}, e
|
||
}(ys), Cc = "units",
|
||
Sc = {DEGREES: "degrees", IMPERIAL: "imperial", NAUTICAL: "nautical", METRIC: "metric", US: "us"},
|
||
Ec = [1, 2, 5];
|
||
|
||
function Tc(t) {
|
||
var e = t.frameState;
|
||
this.viewState_ = e ? e.viewState : null, this.updateElement_()
|
||
}
|
||
|
||
var Rc = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = void 0 !== i.className ? i.className : "ol-scale-line";
|
||
t.call(this, {
|
||
element: document.createElement("div"),
|
||
render: i.render || Tc,
|
||
target: i.target
|
||
}), this.innerElement_ = document.createElement("div"), this.innerElement_.className = r + "-inner", this.element.className = r + " " + xs, this.element.appendChild(this.innerElement_), this.viewState_ = null, this.minWidth_ = void 0 !== i.minWidth ? i.minWidth : 64, this.renderedVisible_ = !1, this.renderedWidth_ = void 0, this.renderedHTML_ = "", w(this, z(Cc), this.handleUnitsChanged_, this), this.setUnits(i.units || Sc.METRIC)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getUnits = function () {
|
||
return this.get(Cc)
|
||
}, e.prototype.handleUnitsChanged_ = function () {
|
||
this.updateElement_()
|
||
}, e.prototype.setUnits = function (t) {
|
||
this.set(Cc, t)
|
||
}, e.prototype.updateElement_ = function () {
|
||
var t = this.viewState_;
|
||
if (t) {
|
||
var e = t.center, i = t.projection, r = this.getUnits(),
|
||
o = r == Sc.DEGREES ? ve.DEGREES : ve.METERS, n = He(i, t.resolution, e, o);
|
||
i.getUnits() != ve.DEGREES && i.getMetersPerUnit() && o == ve.METERS && (n *= i.getMetersPerUnit());
|
||
var s = this.minWidth_ * n, a = "";
|
||
if (r == Sc.DEGREES) {
|
||
var l = ye[ve.DEGREES];
|
||
i.getUnits() == ve.DEGREES ? s *= l : n /= l, s < l / 60 ? (a = "″", n *= 3600) : s < l ? (a = "′", n *= 60) : a = "°"
|
||
} else r == Sc.IMPERIAL ? s < .9144 ? (a = "in", n /= .0254) : s < 1609.344 ? (a = "ft", n /= .3048) : (a = "mi", n /= 1609.344) : r == Sc.NAUTICAL ? (n /= 1852, a = "nm") : r == Sc.METRIC ? s < .001 ? (a = "μm", n *= 1e6) : s < 1 ? (a = "mm", n *= 1e3) : s < 1e3 ? a = "m" : (a = "km", n /= 1e3) : r == Sc.US ? s < .9144 ? (a = "in", n *= 39.37) : s < 1609.344 ? (a = "ft", n /= .30480061) : (a = "mi", n /= 1609.3472) : W(!1, 33);
|
||
for (var h, u, c = 3 * Math.floor(Math.log(this.minWidth_ * n) / Math.log(10)); ;) {
|
||
if (h = Ec[(c % 3 + 3) % 3] * Math.pow(10, Math.floor(c / 3)), u = Math.round(h / n), isNaN(u)) return this.element.style.display = "none", void (this.renderedVisible_ = !1);
|
||
if (u >= this.minWidth_) break;
|
||
++c
|
||
}
|
||
var p = h + " " + a;
|
||
this.renderedHTML_ != p && (this.innerElement_.innerHTML = p, this.renderedHTML_ = p), this.renderedWidth_ != u && (this.innerElement_.style.width = u + "px", this.renderedWidth_ = u), this.renderedVisible_ || (this.element.style.display = "", this.renderedVisible_ = !0)
|
||
} else this.renderedVisible_ && (this.element.style.display = "none", this.renderedVisible_ = !1)
|
||
}, e
|
||
}(ys), Pc = {VERTICAL: 0, HORIZONTAL: 1};
|
||
|
||
function Lc(t) {
|
||
if (t.frameState) {
|
||
this.sliderInitialized_ || this.initSlider_();
|
||
var e = t.frameState.viewState.resolution;
|
||
e !== this.currentResolution_ && (this.currentResolution_ = e, this.setThumbPosition_(e))
|
||
}
|
||
}
|
||
|
||
var Ic = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {
|
||
element: document.createElement("div"),
|
||
render: i.render || Lc
|
||
}), this.dragListenerKeys_ = [], this.currentResolution_ = void 0, this.direction_ = Pc.VERTICAL, this.dragging_, this.heightLimit_ = 0, this.widthLimit_ = 0, this.previousX_, this.previousY_, this.thumbSize_ = null, this.sliderInitialized_ = !1, this.duration_ = void 0 !== i.duration ? i.duration : 200;
|
||
var r = void 0 !== i.className ? i.className : "ol-zoomslider", o = document.createElement("button");
|
||
o.setAttribute("type", "button"), o.className = r + "-thumb " + xs;
|
||
var n = this.element;
|
||
n.className = r + " " + xs + " " + bs, n.appendChild(o), this.dragger_ = new Fn(n), w(this.dragger_, qo.POINTERDOWN, this.handleDraggerStart_, this), w(this.dragger_, qo.POINTERMOVE, this.handleDraggerDrag_, this), w(this.dragger_, qo.POINTERUP, this.handleDraggerEnd_, this), w(n, F.CLICK, this.handleContainerClick_, this), w(o, F.CLICK, M)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.disposeInternal = function () {
|
||
this.dragger_.dispose(), t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.setMap = function (e) {
|
||
t.prototype.setMap.call(this, e), e && e.render()
|
||
}, e.prototype.initSlider_ = function () {
|
||
var t = this.element, e = t.offsetWidth, i = t.offsetHeight, r = t.firstElementChild,
|
||
o = getComputedStyle(r), n = r.offsetWidth + parseFloat(o.marginRight) + parseFloat(o.marginLeft),
|
||
s = r.offsetHeight + parseFloat(o.marginTop) + parseFloat(o.marginBottom);
|
||
this.thumbSize_ = [n, s], e > i ? (this.direction_ = Pc.HORIZONTAL, this.widthLimit_ = e - n) : (this.direction_ = Pc.VERTICAL, this.heightLimit_ = i - s), this.sliderInitialized_ = !0
|
||
}, e.prototype.handleContainerClick_ = function (t) {
|
||
var e = this.getMap().getView(),
|
||
i = this.getRelativePosition_(t.offsetX - this.thumbSize_[0] / 2, t.offsetY - this.thumbSize_[1] / 2),
|
||
r = this.getResolutionForPosition_(i);
|
||
e.animate({resolution: e.constrainResolution(r), duration: this.duration_, easing: Lo})
|
||
}, e.prototype.handleDraggerStart_ = function (t) {
|
||
if (!this.dragging_ && t.originalEvent.target === this.element.firstElementChild && (this.getMap().getView().setHint($n.INTERACTING, 1), this.previousX_ = t.clientX, this.previousY_ = t.clientY, this.dragging_ = !0, 0 === this.dragListenerKeys_.length)) {
|
||
var e = this.handleDraggerDrag_, i = this.handleDraggerEnd_;
|
||
this.dragListenerKeys_.push(w(document, F.MOUSEMOVE, e, this), w(document, qo.POINTERMOVE, e, this), w(document, F.MOUSEUP, i, this), w(document, qo.POINTERUP, i, this))
|
||
}
|
||
}, e.prototype.handleDraggerDrag_ = function (t) {
|
||
if (this.dragging_) {
|
||
var e = this.element.firstElementChild, i = t.clientX - this.previousX_ + parseFloat(e.style.left),
|
||
r = t.clientY - this.previousY_ + parseFloat(e.style.top), o = this.getRelativePosition_(i, r);
|
||
this.currentResolution_ = this.getResolutionForPosition_(o), this.getMap().getView().setResolution(this.currentResolution_), this.setThumbPosition_(this.currentResolution_), this.previousX_ = t.clientX, this.previousY_ = t.clientY
|
||
}
|
||
}, e.prototype.handleDraggerEnd_ = function (t) {
|
||
if (this.dragging_) {
|
||
var e = this.getMap().getView();
|
||
e.setHint($n.INTERACTING, -1), e.animate({
|
||
resolution: e.constrainResolution(this.currentResolution_),
|
||
duration: this.duration_,
|
||
easing: Lo
|
||
}), this.dragging_ = !1, this.previousX_ = void 0, this.previousY_ = void 0, this.dragListenerKeys_.forEach(S), this.dragListenerKeys_.length = 0
|
||
}
|
||
}, e.prototype.setThumbPosition_ = function (t) {
|
||
var e = this.getPositionForResolution_(t), i = this.element.firstElementChild;
|
||
this.direction_ == Pc.HORIZONTAL ? i.style.left = this.widthLimit_ * e + "px" : i.style.top = this.heightLimit_ * e + "px"
|
||
}, e.prototype.getRelativePosition_ = function (t, e) {
|
||
return te(this.direction_ === Pc.HORIZONTAL ? t / this.widthLimit_ : e / this.heightLimit_, 0, 1)
|
||
}, e.prototype.getResolutionForPosition_ = function (t) {
|
||
return this.getMap().getView().getResolutionForValueFunction()(1 - t)
|
||
}, e.prototype.getPositionForResolution_ = function (t) {
|
||
return 1 - this.getMap().getView().getValueForResolutionFunction()(t)
|
||
}, e
|
||
}(ys), Oc = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {
|
||
element: document.createElement("div"),
|
||
target: i.target
|
||
}), this.extent = i.extent ? i.extent : null;
|
||
var r = void 0 !== i.className ? i.className : "ol-zoom-extent", o = void 0 !== i.label ? i.label : "E",
|
||
n = void 0 !== i.tipLabel ? i.tipLabel : "Fit to extent", s = document.createElement("button");
|
||
s.setAttribute("type", "button"), s.title = n, s.appendChild("string" == typeof o ? document.createTextNode(o) : o), w(s, F.CLICK, this.handleClick_, this);
|
||
var a = r + " " + xs + " " + bs, l = this.element;
|
||
l.className = a, l.appendChild(s)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleClick_ = function (t) {
|
||
t.preventDefault(), this.handleZoomToExtent()
|
||
}, e.prototype.handleZoomToExtent = function () {
|
||
var t = this.getMap().getView(), e = this.extent ? this.extent : t.getProjection().getExtent();
|
||
t.fit(e)
|
||
}, e
|
||
}(ys), Mc = function () {
|
||
this.dataProjection = null, this.defaultFeatureProjection = null
|
||
};
|
||
Mc.prototype.getReadOptions = function (t, e) {
|
||
var i;
|
||
return e && (i = {
|
||
dataProjection: e.dataProjection ? e.dataProjection : this.readProjection(t),
|
||
featureProjection: e.featureProjection
|
||
}), this.adaptOptions(i)
|
||
}, Mc.prototype.adaptOptions = function (t) {
|
||
return p({dataProjection: this.dataProjection, featureProjection: this.defaultFeatureProjection}, t)
|
||
}, Mc.prototype.getLastExtent = function () {
|
||
return null
|
||
}, Mc.prototype.getType = function () {
|
||
return n()
|
||
}, Mc.prototype.readFeature = function (t, e) {
|
||
return n()
|
||
}, Mc.prototype.readFeatures = function (t, e) {
|
||
return n()
|
||
}, Mc.prototype.readGeometry = function (t, e) {
|
||
return n()
|
||
}, Mc.prototype.readProjection = function (t) {
|
||
return n()
|
||
}, Mc.prototype.writeFeature = function (t, e) {
|
||
return n()
|
||
}, Mc.prototype.writeFeatures = function (t, e) {
|
||
return n()
|
||
}, Mc.prototype.writeGeometry = function (t, e) {
|
||
return n()
|
||
};
|
||
var Ac = Mc;
|
||
|
||
function kc(t, e, i) {
|
||
var r, o = i ? We(i.featureProjection) : null, n = i ? We(i.dataProjection) : null;
|
||
if (r = o && n && !Qe(o, n) ? Array.isArray(t) ? ri(t, n, o) : (e ? t.clone() : t).transform(e ? o : n, e ? n : o) : t, e && i && void 0 !== i.decimals && !Array.isArray(r)) {
|
||
var s = Math.pow(10, i.decimals);
|
||
r === t && (r = t.clone()), r.applyTransform(function (t) {
|
||
for (var e = 0, i = t.length; e < i; ++e) t[e] = Math.round(t[e] * s) / s;
|
||
return t
|
||
})
|
||
}
|
||
return r
|
||
}
|
||
|
||
function Fc(t) {
|
||
if ("string" == typeof t) {
|
||
var e = JSON.parse(t);
|
||
return e || null
|
||
}
|
||
return null !== t ? t : null
|
||
}
|
||
|
||
var Nc = function (t) {
|
||
function e() {
|
||
t.call(this)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getType = function () {
|
||
return gh.JSON
|
||
}, e.prototype.readFeature = function (t, e) {
|
||
return this.readFeatureFromObject(Fc(t), this.getReadOptions(t, e))
|
||
}, e.prototype.readFeatures = function (t, e) {
|
||
return this.readFeaturesFromObject(Fc(t), this.getReadOptions(t, e))
|
||
}, e.prototype.readFeatureFromObject = function (t, e) {
|
||
return n()
|
||
}, e.prototype.readFeaturesFromObject = function (t, e) {
|
||
return n()
|
||
}, e.prototype.readGeometry = function (t, e) {
|
||
return this.readGeometryFromObject(Fc(t), this.getReadOptions(t, e))
|
||
}, e.prototype.readGeometryFromObject = function (t, e) {
|
||
return n()
|
||
}, e.prototype.readProjection = function (t) {
|
||
return this.readProjectionFromObject(Fc(t))
|
||
}, e.prototype.readProjectionFromObject = function (t) {
|
||
return n()
|
||
}, e.prototype.writeFeature = function (t, e) {
|
||
return JSON.stringify(this.writeFeatureObject(t, e))
|
||
}, e.prototype.writeFeatureObject = function (t, e) {
|
||
return n()
|
||
}, e.prototype.writeFeatures = function (t, e) {
|
||
return JSON.stringify(this.writeFeaturesObject(t, e))
|
||
}, e.prototype.writeFeaturesObject = function (t, e) {
|
||
return n()
|
||
}, e.prototype.writeGeometry = function (t, e) {
|
||
return JSON.stringify(this.writeGeometryObject(t, e))
|
||
}, e.prototype.writeGeometryObject = function (t, e) {
|
||
return n()
|
||
}, e
|
||
}(Ac), Dc = function (t) {
|
||
function e(e, i, r) {
|
||
if (t.call(this), this.ends_ = [], this.maxDelta_ = -1, this.maxDeltaRevision_ = -1, Array.isArray(e[0])) this.setCoordinates(e, i); else if (void 0 !== i && r) this.setFlatCoordinates(i, e), this.ends_ = r; else {
|
||
for (var o = this.getLayout(), n = e, s = [], a = [], l = 0, h = n.length; l < h; ++l) {
|
||
var u = n[l];
|
||
0 === l && (o = u.getLayout()), Q(s, u.getFlatCoordinates()), a.push(s.length)
|
||
}
|
||
this.setFlatCoordinates(o, s), this.ends_ = a
|
||
}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.appendLineString = function (t) {
|
||
this.flatCoordinates ? Q(this.flatCoordinates, t.getFlatCoordinates().slice()) : this.flatCoordinates = t.getFlatCoordinates().slice(), this.ends_.push(this.flatCoordinates.length), this.changed()
|
||
}, e.prototype.clone = function () {
|
||
return new e(this.flatCoordinates.slice(), this.layout, this.ends_.slice())
|
||
}, e.prototype.closestPointXY = function (t, e, i, r) {
|
||
return r < ct(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(Pi(this.flatCoordinates, 0, this.ends_, this.stride, 0)), this.maxDeltaRevision_ = this.getRevision()), Oi(this.flatCoordinates, 0, this.ends_, this.stride, this.maxDelta_, !1, t, e, i, r))
|
||
}, e.prototype.getCoordinateAtM = function (t, e, i) {
|
||
if (this.layout != qt.XYM && this.layout != qt.XYZM || 0 === this.flatCoordinates.length) return null;
|
||
var r = void 0 !== e && e, o = void 0 !== i && i;
|
||
return Zr(this.flatCoordinates, 0, this.ends_, this.stride, t, r, o)
|
||
}, e.prototype.getCoordinates = function () {
|
||
return Gi(this.flatCoordinates, 0, this.ends_, this.stride)
|
||
}, e.prototype.getEnds = function () {
|
||
return this.ends_
|
||
}, e.prototype.getLineString = function (t) {
|
||
return t < 0 || this.ends_.length <= t ? null : new Jr(this.flatCoordinates.slice(0 === t ? 0 : this.ends_[t - 1], this.ends_[t]), this.layout)
|
||
}, e.prototype.getLineStrings = function () {
|
||
for (var t = this.flatCoordinates, e = this.ends_, i = this.layout, r = [], o = 0, n = 0, s = e.length; n < s; ++n) {
|
||
var a = e[n], l = new Jr(t.slice(o, a), i);
|
||
r.push(l), o = a
|
||
}
|
||
return r
|
||
}, e.prototype.getFlatMidpoints = function () {
|
||
for (var t = [], e = this.flatCoordinates, i = 0, r = this.ends_, o = this.stride, n = 0, s = r.length; n < s; ++n) {
|
||
var a = r[n];
|
||
Q(t, Xr(e, i, a, o, .5)), i = a
|
||
}
|
||
return t
|
||
}, e.prototype.getSimplifiedGeometryInternal = function (t) {
|
||
var i = [], r = [];
|
||
return i.length = Ui(this.flatCoordinates, 0, this.ends_, this.stride, t, i, 0, r), new e(i, qt.XY, r)
|
||
}, e.prototype.getType = function () {
|
||
return Zt.MULTI_LINE_STRING
|
||
}, e.prototype.intersectsExtent = function (t) {
|
||
return rr(this.flatCoordinates, 0, this.ends_, this.stride, t)
|
||
}, e.prototype.setCoordinates = function (t, e) {
|
||
this.setLayout(e, t, 2), this.flatCoordinates || (this.flatCoordinates = []);
|
||
var i = Fi(this.flatCoordinates, 0, t, this.stride, this.ends_);
|
||
this.flatCoordinates.length = 0 === i.length ? 0 : i[i.length - 1], this.changed()
|
||
}, e
|
||
}(bi), Gc = function (t) {
|
||
function e(e, i) {
|
||
t.call(this), i && !Array.isArray(e[0]) ? this.setFlatCoordinates(i, e) : this.setCoordinates(e, i)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.appendPoint = function (t) {
|
||
this.flatCoordinates ? Q(this.flatCoordinates, t.getFlatCoordinates()) : this.flatCoordinates = t.getFlatCoordinates().slice(), this.changed()
|
||
}, e.prototype.clone = function () {
|
||
return new e(this.flatCoordinates.slice(), this.layout)
|
||
}, e.prototype.closestPointXY = function (t, e, i, r) {
|
||
if (r < ct(this.getExtent(), t, e)) return r;
|
||
for (var o = this.flatCoordinates, n = this.stride, s = 0, a = o.length; s < a; s += n) {
|
||
var l = oe(t, e, o[s], o[s + 1]);
|
||
if (l < r) {
|
||
r = l;
|
||
for (var h = 0; h < n; ++h) i[h] = o[s + h];
|
||
i.length = n
|
||
}
|
||
}
|
||
return r
|
||
}, e.prototype.getCoordinates = function () {
|
||
return Di(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride)
|
||
}, e.prototype.getPoint = function (t) {
|
||
var e = this.flatCoordinates ? this.flatCoordinates.length / this.stride : 0;
|
||
return t < 0 || e <= t ? null : new qi(this.flatCoordinates.slice(t * this.stride, (t + 1) * this.stride), this.layout)
|
||
}, e.prototype.getPoints = function () {
|
||
for (var t = this.flatCoordinates, e = this.layout, i = this.stride, r = [], o = 0, n = t.length; o < n; o += i) {
|
||
var s = new qi(t.slice(o, o + i), e);
|
||
r.push(s)
|
||
}
|
||
return r
|
||
}, e.prototype.getType = function () {
|
||
return Zt.MULTI_POINT
|
||
}, e.prototype.intersectsExtent = function (t) {
|
||
for (var e = this.flatCoordinates, i = this.stride, r = 0, o = e.length; r < o; r += i) {
|
||
if (ft(t, e[r], e[r + 1])) return !0
|
||
}
|
||
return !1
|
||
}, e.prototype.setCoordinates = function (t, e) {
|
||
this.setLayout(e, t, 1), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = ki(this.flatCoordinates, 0, t, this.stride), this.changed()
|
||
}, e
|
||
}(bi);
|
||
|
||
function jc(t, e, i, r) {
|
||
for (var o = [], n = [1 / 0, 1 / 0, -1 / 0, -1 / 0], s = 0, a = i.length; s < a; ++s) {
|
||
var l = i[s];
|
||
n = wt(t, e, l[0], r), o.push((n[0] + n[2]) / 2, (n[1] + n[3]) / 2), e = l[l.length - 1]
|
||
}
|
||
return o
|
||
}
|
||
|
||
var zc = function (t) {
|
||
function e(e, i, r) {
|
||
if (t.call(this), this.endss_ = [], this.flatInteriorPointsRevision_ = -1, this.flatInteriorPoints_ = null, this.maxDelta_ = -1, this.maxDeltaRevision_ = -1, this.orientedRevision_ = -1, this.orientedFlatCoordinates_ = null, !r && !Array.isArray(e[0])) {
|
||
for (var o = this.getLayout(), n = e, s = [], a = [], l = 0, h = n.length; l < h; ++l) {
|
||
var u = n[l];
|
||
0 === l && (o = u.getLayout());
|
||
for (var c = s.length, p = u.getEnds(), d = 0, f = p.length; d < f; ++d) p[d] += c;
|
||
Q(s, u.getFlatCoordinates()), a.push(p)
|
||
}
|
||
i = o, e = s, r = a
|
||
}
|
||
void 0 !== i && r ? (this.setFlatCoordinates(i, e), this.endss_ = r) : this.setCoordinates(e, i)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.appendPolygon = function (t) {
|
||
var e;
|
||
if (this.flatCoordinates) {
|
||
var i = this.flatCoordinates.length;
|
||
Q(this.flatCoordinates, t.getFlatCoordinates());
|
||
for (var r = 0, o = (e = t.getEnds().slice()).length; r < o; ++r) e[r] += i
|
||
} else this.flatCoordinates = t.getFlatCoordinates().slice(), e = t.getEnds().slice(), this.endss_.push();
|
||
this.endss_.push(e), this.changed()
|
||
}, e.prototype.clone = function () {
|
||
for (var t = this.endss_.length, i = new Array(t), r = 0; r < t; ++r) i[r] = this.endss_[r].slice();
|
||
return new e(this.flatCoordinates.slice(), this.layout, i)
|
||
}, e.prototype.closestPointXY = function (t, e, i, r) {
|
||
return r < ct(this.getExtent(), t, e) ? r : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(Li(this.flatCoordinates, 0, this.endss_, this.stride, 0)), this.maxDeltaRevision_ = this.getRevision()), Mi(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, this.maxDelta_, !0, t, e, i, r))
|
||
}, e.prototype.containsXY = function (t, e) {
|
||
return $i(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, t, e)
|
||
}, e.prototype.getArea = function () {
|
||
return Ei(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride)
|
||
}, e.prototype.getCoordinates = function (t) {
|
||
var e;
|
||
return void 0 !== t ? pr(e = this.getOrientedFlatCoordinates().slice(), 0, this.endss_, this.stride, t) : e = this.flatCoordinates, ji(e, 0, this.endss_, this.stride)
|
||
}, e.prototype.getEndss = function () {
|
||
return this.endss_
|
||
}, e.prototype.getFlatInteriorPoints = function () {
|
||
if (this.flatInteriorPointsRevision_ != this.getRevision()) {
|
||
var t = jc(this.flatCoordinates, 0, this.endss_, this.stride);
|
||
this.flatInteriorPoints_ = tr(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, t), this.flatInteriorPointsRevision_ = this.getRevision()
|
||
}
|
||
return this.flatInteriorPoints_
|
||
}, e.prototype.getInteriorPoints = function () {
|
||
return new Gc(this.getFlatInteriorPoints().slice(), qt.XYM)
|
||
}, e.prototype.getOrientedFlatCoordinates = function () {
|
||
if (this.orientedRevision_ != this.getRevision()) {
|
||
var t = this.flatCoordinates;
|
||
ur(t, 0, this.endss_, this.stride) ? this.orientedFlatCoordinates_ = t : (this.orientedFlatCoordinates_ = t.slice(), this.orientedFlatCoordinates_.length = pr(this.orientedFlatCoordinates_, 0, this.endss_, this.stride)), this.orientedRevision_ = this.getRevision()
|
||
}
|
||
return this.orientedFlatCoordinates_
|
||
}, e.prototype.getSimplifiedGeometryInternal = function (t) {
|
||
var i = [], r = [];
|
||
return i.length = Hi(this.flatCoordinates, 0, this.endss_, this.stride, Math.sqrt(t), i, 0, r), new e(i, qt.XY, r)
|
||
}, e.prototype.getPolygon = function (t) {
|
||
if (t < 0 || this.endss_.length <= t) return null;
|
||
var e;
|
||
if (0 === t) e = 0; else {
|
||
var i = this.endss_[t - 1];
|
||
e = i[i.length - 1]
|
||
}
|
||
var r = this.endss_[t].slice(), o = r[r.length - 1];
|
||
if (0 !== e) for (var n = 0, s = r.length; n < s; ++n) r[n] -= e;
|
||
return new fr(this.flatCoordinates.slice(e, o), this.layout, r)
|
||
}, e.prototype.getPolygons = function () {
|
||
for (var t = this.layout, e = this.flatCoordinates, i = this.endss_, r = [], o = 0, n = 0, s = i.length; n < s; ++n) {
|
||
var a = i[n].slice(), l = a[a.length - 1];
|
||
if (0 !== o) for (var h = 0, u = a.length; h < u; ++h) a[h] -= o;
|
||
var c = new fr(e.slice(o, l), t, a);
|
||
r.push(c), o = l
|
||
}
|
||
return r
|
||
}, e.prototype.getType = function () {
|
||
return Zt.MULTI_POLYGON
|
||
}, e.prototype.intersectsExtent = function (t) {
|
||
return sr(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, t)
|
||
}, e.prototype.setCoordinates = function (t, e) {
|
||
this.setLayout(e, t, 3), this.flatCoordinates || (this.flatCoordinates = []);
|
||
var i = Ni(this.flatCoordinates, 0, t, this.stride, this.endss_);
|
||
if (0 === i.length) this.flatCoordinates.length = 0; else {
|
||
var r = i[i.length - 1];
|
||
this.flatCoordinates.length = 0 === r.length ? 0 : r[r.length - 1]
|
||
}
|
||
this.changed()
|
||
}, e
|
||
}(bi), Uc = {};
|
||
Uc[Zt.POINT] = function (t) {
|
||
var e;
|
||
e = void 0 !== t.m && void 0 !== t.z ? new qi([t.x, t.y, t.z, t.m], qt.XYZM) : void 0 !== t.z ? new qi([t.x, t.y, t.z], qt.XYZ) : void 0 !== t.m ? new qi([t.x, t.y, t.m], qt.XYM) : new qi([t.x, t.y]);
|
||
return e
|
||
}, Uc[Zt.LINE_STRING] = function (t) {
|
||
var e = Yc(t);
|
||
return new Jr(t.paths[0], e)
|
||
}, Uc[Zt.POLYGON] = function (t) {
|
||
var e = Yc(t);
|
||
return new fr(t.rings, e)
|
||
}, Uc[Zt.MULTI_POINT] = function (t) {
|
||
var e = Yc(t);
|
||
return new Gc(t.points, e)
|
||
}, Uc[Zt.MULTI_LINE_STRING] = function (t) {
|
||
var e = Yc(t);
|
||
return new Dc(t.paths, e)
|
||
}, Uc[Zt.MULTI_POLYGON] = function (t) {
|
||
var e = Yc(t);
|
||
return new zc(t.rings, e)
|
||
};
|
||
var Bc = {};
|
||
|
||
function Vc(t, e) {
|
||
if (!t) return null;
|
||
var i;
|
||
if ("number" == typeof t.x && "number" == typeof t.y) i = Zt.POINT; else if (t.points) i = Zt.MULTI_POINT; else if (t.paths) {
|
||
i = 1 === t.paths.length ? Zt.LINE_STRING : Zt.MULTI_LINE_STRING
|
||
} else if (t.rings) {
|
||
var r = t, o = Yc(r), n = function (t, e) {
|
||
var i, r, o = [], n = [], s = [];
|
||
for (i = 0, r = t.length; i < r; ++i) {
|
||
o.length = 0, ki(o, 0, t[i], e.length);
|
||
var a = lr(o, 0, o.length, e.length);
|
||
a ? n.push([t[i]]) : s.push(t[i])
|
||
}
|
||
for (; s.length;) {
|
||
var l = s.shift(), h = !1;
|
||
for (i = n.length - 1; i >= 0; i--) {
|
||
var u = n[i][0], c = dt(new Xi(u).getExtent(), new Xi(l).getExtent());
|
||
if (c) {
|
||
n[i].push(l), h = !0;
|
||
break
|
||
}
|
||
}
|
||
h || n.push([l.reverse()])
|
||
}
|
||
return n
|
||
}(r.rings, o);
|
||
1 === n.length ? (i = Zt.POLYGON, t.rings = n[0]) : (i = Zt.MULTI_POLYGON, t.rings = n)
|
||
}
|
||
return kc((0, Uc[i])(t), !1, e)
|
||
}
|
||
|
||
function Yc(t) {
|
||
var e = qt.XY;
|
||
return !0 === t.hasZ && !0 === t.hasM ? e = qt.XYZM : !0 === t.hasZ ? e = qt.XYZ : !0 === t.hasM && (e = qt.XYM), e
|
||
}
|
||
|
||
function Wc(t) {
|
||
var e = t.getLayout();
|
||
return {hasZ: e === qt.XYZ || e === qt.XYZM, hasM: e === qt.XYM || e === qt.XYZM}
|
||
}
|
||
|
||
function Hc(t, e) {
|
||
return (0, Bc[t.getType()])(kc(t, !0, e), e)
|
||
}
|
||
|
||
Bc[Zt.POINT] = function (t, e) {
|
||
var i, r = t.getCoordinates(), o = t.getLayout();
|
||
o === qt.XYZ ? i = {x: r[0], y: r[1], z: r[2]} : o === qt.XYM ? i = {
|
||
x: r[0],
|
||
y: r[1],
|
||
m: r[2]
|
||
} : o === qt.XYZM ? i = {x: r[0], y: r[1], z: r[2], m: r[3]} : o === qt.XY ? i = {
|
||
x: r[0],
|
||
y: r[1]
|
||
} : W(!1, 34);
|
||
return i
|
||
}, Bc[Zt.LINE_STRING] = function (t, e) {
|
||
var i = t, r = Wc(i);
|
||
return {hasZ: r.hasZ, hasM: r.hasM, paths: [i.getCoordinates()]}
|
||
}, Bc[Zt.POLYGON] = function (t, e) {
|
||
var i = t, r = Wc(i);
|
||
return {hasZ: r.hasZ, hasM: r.hasM, rings: i.getCoordinates(!1)}
|
||
}, Bc[Zt.MULTI_POINT] = function (t, e) {
|
||
var i = t, r = Wc(i);
|
||
return {hasZ: r.hasZ, hasM: r.hasM, points: i.getCoordinates()}
|
||
}, Bc[Zt.MULTI_LINE_STRING] = function (t, e) {
|
||
var i = t, r = Wc(i);
|
||
return {hasZ: r.hasZ, hasM: r.hasM, paths: i.getCoordinates()}
|
||
}, Bc[Zt.MULTI_POLYGON] = function (t, e) {
|
||
for (var i = Wc(t), r = t.getCoordinates(!1), o = [], n = 0; n < r.length; n++) for (var s = r[n].length - 1; s >= 0; s--) o.push(r[n][s]);
|
||
return {hasZ: i.hasZ, hasM: i.hasM, rings: o}
|
||
};
|
||
var Xc = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this), this.geometryName_ = i.geometryName
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.readFeatureFromObject = function (t, e) {
|
||
var i = t, r = Vc(i.geometry, e), o = new X;
|
||
return this.geometryName_ && o.setGeometryName(this.geometryName_), o.setGeometry(r), e && e.idField && i.attributes[e.idField] && o.setId(i.attributes[e.idField]), i.attributes && o.setProperties(i.attributes), o
|
||
}, e.prototype.readFeaturesFromObject = function (t, e) {
|
||
var i = e || {};
|
||
if (t.features) {
|
||
var r = [], o = t.features;
|
||
i.idField = t.objectIdFieldName;
|
||
for (var n = 0, s = o.length; n < s; ++n) r.push(this.readFeatureFromObject(o[n], i));
|
||
return r
|
||
}
|
||
return [this.readFeatureFromObject(t, i)]
|
||
}, e.prototype.readGeometryFromObject = function (t, e) {
|
||
return Vc(t, e)
|
||
}, e.prototype.readProjectionFromObject = function (t) {
|
||
return t.spatialReference && void 0 !== t.spatialReference.wkid ? We("EPSG:" + t.spatialReference.wkid) : null
|
||
}, e.prototype.writeGeometryObject = function (t, e) {
|
||
return Hc(t, this.adaptOptions(e))
|
||
}, e.prototype.writeFeatureObject = function (t, e) {
|
||
e = this.adaptOptions(e);
|
||
var i = {}, r = t.getGeometry();
|
||
r && (i.geometry = Hc(r, e), e && e.featureProjection && (i.geometry.spatialReference = {wkid: Number(We(e.featureProjection).getCode().split(":").pop())}));
|
||
var o = t.getProperties();
|
||
return delete o[t.getGeometryName()], g(o) ? i.attributes = {} : i.attributes = o, i
|
||
}, e.prototype.writeFeaturesObject = function (t, e) {
|
||
e = this.adaptOptions(e);
|
||
for (var i = [], r = 0, o = t.length; r < o; ++r) i.push(this.writeFeatureObject(t[r], e));
|
||
return {features: i}
|
||
}, e
|
||
}(Nc), qc = document.implementation.createDocument("", "", null),
|
||
Zc = "http://www.w3.org/2001/XMLSchema-instance";
|
||
|
||
function Kc(t, e) {
|
||
return qc.createElementNS(t, e)
|
||
}
|
||
|
||
function Jc(t, e) {
|
||
return $c(t, e, []).join("")
|
||
}
|
||
|
||
function $c(t, e, i) {
|
||
var r;
|
||
if (t.nodeType == Node.CDATA_SECTION_NODE || t.nodeType == Node.TEXT_NODE) e ? i.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g, "")) : i.push(t.nodeValue); else for (r = t.firstChild; r; r = r.nextSibling) $c(r, e, i);
|
||
return i
|
||
}
|
||
|
||
function Qc(t) {
|
||
return "documentElement" in t
|
||
}
|
||
|
||
function tp(t, e, i) {
|
||
return t.getAttributeNS(e, i) || ""
|
||
}
|
||
|
||
function ep(t) {
|
||
return (new DOMParser).parseFromString(t, "application/xml")
|
||
}
|
||
|
||
function ip(t, e) {
|
||
return function (i, r) {
|
||
var o = t.call(void 0 !== e ? e : this, i, r);
|
||
void 0 !== o && Q(r[r.length - 1], o)
|
||
}
|
||
}
|
||
|
||
function rp(t, e) {
|
||
return function (i, r) {
|
||
var o = t.call(void 0 !== e ? e : this, i, r);
|
||
void 0 !== o && r[r.length - 1].push(o)
|
||
}
|
||
}
|
||
|
||
function op(t, e) {
|
||
return function (i, r) {
|
||
var o = t.call(void 0 !== e ? e : this, i, r);
|
||
void 0 !== o && (r[r.length - 1] = o)
|
||
}
|
||
}
|
||
|
||
function np(t, e, i) {
|
||
return function (r, o) {
|
||
var n = t.call(void 0 !== i ? i : this, r, o);
|
||
if (void 0 !== n) {
|
||
var s = o[o.length - 1], a = void 0 !== e ? e : r.localName;
|
||
(a in s ? s[a] : s[a] = []).push(n)
|
||
}
|
||
}
|
||
}
|
||
|
||
function sp(t, e, i) {
|
||
return function (r, o) {
|
||
var n = t.call(void 0 !== i ? i : this, r, o);
|
||
void 0 !== n && (o[o.length - 1][void 0 !== e ? e : r.localName] = n)
|
||
}
|
||
}
|
||
|
||
function ap(t, e) {
|
||
return function (i, r, o) {
|
||
t.call(void 0 !== e ? e : this, i, r, o), o[o.length - 1].node.appendChild(i)
|
||
}
|
||
}
|
||
|
||
function lp(t, e) {
|
||
var i, r;
|
||
return function (e, o, n) {
|
||
if (void 0 === i) {
|
||
i = {};
|
||
var s = {};
|
||
s[e.localName] = t, i[e.namespaceURI] = s, r = hp(e.localName)
|
||
}
|
||
gp(i, r, o, n)
|
||
}
|
||
}
|
||
|
||
function hp(t, e) {
|
||
var i = t;
|
||
return function (t, r, o) {
|
||
var n = r[r.length - 1].node, s = i;
|
||
return void 0 === s && (s = o), Kc(void 0 !== e ? e : n.namespaceURI, s)
|
||
}
|
||
}
|
||
|
||
var up = hp();
|
||
|
||
function cp(t, e) {
|
||
for (var i = e.length, r = new Array(i), o = 0; o < i; ++o) r[o] = t[e[o]];
|
||
return r
|
||
}
|
||
|
||
function pp(t, e, i) {
|
||
var r, o, n = void 0 !== i ? i : {};
|
||
for (r = 0, o = t.length; r < o; ++r) n[t[r]] = e;
|
||
return n
|
||
}
|
||
|
||
function dp(t, e, i, r) {
|
||
var o;
|
||
for (o = e.firstElementChild; o; o = o.nextElementSibling) {
|
||
var n = t[o.namespaceURI];
|
||
if (void 0 !== n) {
|
||
var s = n[o.localName];
|
||
void 0 !== s && s.call(r, o, i)
|
||
}
|
||
}
|
||
}
|
||
|
||
function fp(t, e, i, r, o) {
|
||
return r.push(t), dp(e, i, r, o), r.pop()
|
||
}
|
||
|
||
function gp(t, e, i, r, o, n) {
|
||
for (var s, a, l = (void 0 !== o ? o : i).length, h = 0; h < l; ++h) void 0 !== (s = i[h]) && void 0 !== (a = e.call(void 0 !== n ? n : this, s, r, void 0 !== o ? o[h] : void 0)) && t[a.namespaceURI][a.localName].call(n, a, s, r)
|
||
}
|
||
|
||
function mp(t, e, i, r, o, n, s) {
|
||
return o.push(t), gp(e, i, r, o, n, s), o.pop()
|
||
}
|
||
|
||
var yp = function (t) {
|
||
function e() {
|
||
t.call(this), this.xmlSerializer_ = new XMLSerializer
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getType = function () {
|
||
return gh.XML
|
||
}, e.prototype.readFeature = function (t, e) {
|
||
if (t) {
|
||
if ("string" == typeof t) {
|
||
var i = ep(t);
|
||
return this.readFeatureFromDocument(i, e)
|
||
}
|
||
return Qc(t) ? this.readFeatureFromDocument(t, e) : this.readFeatureFromNode(t, e)
|
||
}
|
||
return null
|
||
}, e.prototype.readFeatureFromDocument = function (t, e) {
|
||
var i = this.readFeaturesFromDocument(t, e);
|
||
return i.length > 0 ? i[0] : null
|
||
}, e.prototype.readFeatureFromNode = function (t, e) {
|
||
return null
|
||
}, e.prototype.readFeatures = function (t, e) {
|
||
if (t) {
|
||
if ("string" == typeof t) {
|
||
var i = ep(t);
|
||
return this.readFeaturesFromDocument(i, e)
|
||
}
|
||
return Qc(t) ? this.readFeaturesFromDocument(t, e) : this.readFeaturesFromNode(t, e)
|
||
}
|
||
return []
|
||
}, e.prototype.readFeaturesFromDocument = function (t, e) {
|
||
for (var i = [], r = t.firstChild; r; r = r.nextSibling) r.nodeType == Node.ELEMENT_NODE && Q(i, this.readFeaturesFromNode(r, e));
|
||
return i
|
||
}, e.prototype.readFeaturesFromNode = function (t, e) {
|
||
return n()
|
||
}, e.prototype.readGeometry = function (t, e) {
|
||
if (t) {
|
||
if ("string" == typeof t) {
|
||
var i = ep(t);
|
||
return this.readGeometryFromDocument(i, e)
|
||
}
|
||
return Qc(t) ? this.readGeometryFromDocument(t, e) : this.readGeometryFromNode(t, e)
|
||
}
|
||
return null
|
||
}, e.prototype.readGeometryFromDocument = function (t, e) {
|
||
return null
|
||
}, e.prototype.readGeometryFromNode = function (t, e) {
|
||
return null
|
||
}, e.prototype.readProjection = function (t) {
|
||
if (t) {
|
||
if ("string" == typeof t) {
|
||
var e = ep(t);
|
||
return this.readProjectionFromDocument(e)
|
||
}
|
||
return Qc(t) ? this.readProjectionFromDocument(t) : this.readProjectionFromNode(t)
|
||
}
|
||
return null
|
||
}, e.prototype.readProjectionFromDocument = function (t) {
|
||
return this.dataProjection
|
||
}, e.prototype.readProjectionFromNode = function (t) {
|
||
return this.dataProjection
|
||
}, e.prototype.writeFeature = function (t, e) {
|
||
var i = this.writeFeatureNode(t, e);
|
||
return this.xmlSerializer_.serializeToString(i)
|
||
}, e.prototype.writeFeatureNode = function (t, e) {
|
||
return null
|
||
}, e.prototype.writeFeatures = function (t, e) {
|
||
var i = this.writeFeaturesNode(t, e);
|
||
return this.xmlSerializer_.serializeToString(i)
|
||
}, e.prototype.writeFeaturesNode = function (t, e) {
|
||
return null
|
||
}, e.prototype.writeGeometry = function (t, e) {
|
||
var i = this.writeGeometryNode(t, e);
|
||
return this.xmlSerializer_.serializeToString(i)
|
||
}, e.prototype.writeGeometryNode = function (t, e) {
|
||
return null
|
||
}, e
|
||
}(Ac), vp = "http://www.opengis.net/gml", _p = /^[\s\xa0]*$/, xp = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = e || {};
|
||
this.featureType = i.featureType, this.featureNS = i.featureNS, this.srsName = i.srsName, this.schemaLocation = "", this.FEATURE_COLLECTION_PARSERS = {}, this.FEATURE_COLLECTION_PARSERS[this.namespace] = {
|
||
featureMember: rp(this.readFeaturesInternal),
|
||
featureMembers: op(this.readFeaturesInternal)
|
||
}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.readFeaturesInternal = function (t, e) {
|
||
var i = t.localName, r = null;
|
||
if ("FeatureCollection" == i) r = fp([], this.FEATURE_COLLECTION_PARSERS, t, e, this); else if ("featureMembers" == i || "featureMember" == i) {
|
||
var o = e[0], n = o.featureType, s = o.featureNS;
|
||
if (!n && t.childNodes) {
|
||
n = [], s = {};
|
||
for (var a = 0, l = t.childNodes.length; a < l; ++a) {
|
||
var h = t.childNodes[a];
|
||
if (1 === h.nodeType) {
|
||
var u = h.nodeName.split(":").pop();
|
||
if (-1 === n.indexOf(u)) {
|
||
var c = "", p = 0, d = h.namespaceURI;
|
||
for (var f in s) {
|
||
if (s[f] === d) {
|
||
c = f;
|
||
break
|
||
}
|
||
++p
|
||
}
|
||
c || (s[c = "p" + p] = d), n.push(c + ":" + u)
|
||
}
|
||
}
|
||
}
|
||
"featureMember" != i && (o.featureType = n, o.featureNS = s)
|
||
}
|
||
if ("string" == typeof s) {
|
||
var g = s;
|
||
(s = {}).p0 = g
|
||
}
|
||
var m = {}, y = Array.isArray(n) ? n : [n];
|
||
for (var v in s) {
|
||
for (var _ = {}, x = 0, w = y.length; x < w; ++x) {
|
||
(-1 === y[x].indexOf(":") ? "p0" : y[x].split(":")[0]) === v && (_[y[x].split(":").pop()] = "featureMembers" == i ? rp(this.readFeatureElement, this) : op(this.readFeatureElement, this))
|
||
}
|
||
m[s[v]] = _
|
||
}
|
||
r = fp("featureMember" == i ? void 0 : [], m, t, e)
|
||
}
|
||
return null === r && (r = []), r
|
||
}, e.prototype.readGeometryElement = function (t, e) {
|
||
var i = e[0];
|
||
i.srsName = t.firstElementChild.getAttribute("srsName"), i.srsDimension = t.firstElementChild.getAttribute("srsDimension");
|
||
var r = fp(null, this.GEOMETRY_PARSERS, t, e, this);
|
||
return r ? kc(r, !1, i) : void 0
|
||
}, e.prototype.readFeatureElementInternal = function (t, e, i) {
|
||
for (var r, o = {}, n = t.firstElementChild; n; n = n.nextElementSibling) {
|
||
var s = void 0, a = n.localName;
|
||
0 === n.childNodes.length || 1 === n.childNodes.length && (3 === n.firstChild.nodeType || 4 === n.firstChild.nodeType) ? (s = Jc(n, !1), _p.test(s) && (s = void 0)) : (i && (s = this.readGeometryElement(n, e)), s ? "boundedBy" !== a && (r = a) : s = this.readFeatureElementInternal(n, e, !1)), o[a] ? (o[a] instanceof Array || (o[a] = [o[a]]), o[a].push(s)) : o[a] = s;
|
||
var l = n.attributes.length;
|
||
if (l > 0) {
|
||
o[a] = {_content_: o[a]};
|
||
for (var h = 0; h < l; h++) {
|
||
var u = n.attributes[h].name;
|
||
o[a][u] = n.attributes[h].value
|
||
}
|
||
}
|
||
}
|
||
if (i) {
|
||
var c = new X(o);
|
||
r && c.setGeometryName(r);
|
||
var p = t.getAttribute("fid") || tp(t, this.namespace, "id");
|
||
return p && c.setId(p), c
|
||
}
|
||
return o
|
||
}, e.prototype.readFeatureElement = function (t, e) {
|
||
return this.readFeatureElementInternal(t, e, !0)
|
||
}, e.prototype.readPoint = function (t, e) {
|
||
var i = this.readFlatCoordinatesFromNode_(t, e);
|
||
if (i) return new qi(i, qt.XYZ)
|
||
}, e.prototype.readMultiPoint = function (t, e) {
|
||
var i = fp([], this.MULTIPOINT_PARSERS_, t, e, this);
|
||
return i ? new Gc(i) : void 0
|
||
}, e.prototype.readMultiLineString = function (t, e) {
|
||
var i = fp([], this.MULTILINESTRING_PARSERS_, t, e, this);
|
||
if (i) return new Dc(i)
|
||
}, e.prototype.readMultiPolygon = function (t, e) {
|
||
var i = fp([], this.MULTIPOLYGON_PARSERS_, t, e, this);
|
||
if (i) return new zc(i)
|
||
}, e.prototype.pointMemberParser_ = function (t, e) {
|
||
dp(this.POINTMEMBER_PARSERS_, t, e, this)
|
||
}, e.prototype.lineStringMemberParser_ = function (t, e) {
|
||
dp(this.LINESTRINGMEMBER_PARSERS_, t, e, this)
|
||
}, e.prototype.polygonMemberParser_ = function (t, e) {
|
||
dp(this.POLYGONMEMBER_PARSERS_, t, e, this)
|
||
}, e.prototype.readLineString = function (t, e) {
|
||
var i = this.readFlatCoordinatesFromNode_(t, e);
|
||
return i ? new Jr(i, qt.XYZ) : void 0
|
||
}, e.prototype.readFlatLinearRing_ = function (t, e) {
|
||
var i = fp(null, this.GEOMETRY_FLAT_COORDINATES_PARSERS, t, e, this);
|
||
return i || void 0
|
||
}, e.prototype.readLinearRing = function (t, e) {
|
||
var i = this.readFlatCoordinatesFromNode_(t, e);
|
||
if (i) return new Xi(i, qt.XYZ)
|
||
}, e.prototype.readPolygon = function (t, e) {
|
||
var i = fp([null], this.FLAT_LINEAR_RINGS_PARSERS, t, e, this);
|
||
if (i && i[0]) {
|
||
var r, o, n = i[0], s = [n.length];
|
||
for (r = 1, o = i.length; r < o; ++r) Q(n, i[r]), s.push(n.length);
|
||
return new fr(n, qt.XYZ, s)
|
||
}
|
||
}, e.prototype.readFlatCoordinatesFromNode_ = function (t, e) {
|
||
return fp(null, this.GEOMETRY_FLAT_COORDINATES_PARSERS, t, e, this)
|
||
}, e.prototype.readGeometryFromNode = function (t, e) {
|
||
var i = this.readGeometryElement(t, [this.getReadOptions(t, e || {})]);
|
||
return i || null
|
||
}, e.prototype.readFeaturesFromNode = function (t, e) {
|
||
var i = {featureType: this.featureType, featureNS: this.featureNS};
|
||
return e && p(i, this.getReadOptions(t, e)), this.readFeaturesInternal(t, [i]) || []
|
||
}, e.prototype.readProjectionFromNode = function (t) {
|
||
return We(this.srsName ? this.srsName : t.firstElementChild.getAttribute("srsName"))
|
||
}, e
|
||
}(yp);
|
||
xp.prototype.namespace = vp, xp.prototype.FLAT_LINEAR_RINGS_PARSERS = {"http://www.opengis.net/gml": {}}, xp.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {"http://www.opengis.net/gml": {}}, xp.prototype.GEOMETRY_PARSERS = {"http://www.opengis.net/gml": {}}, xp.prototype.MULTIPOINT_PARSERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
pointMember: rp(xp.prototype.pointMemberParser_),
|
||
pointMembers: rp(xp.prototype.pointMemberParser_)
|
||
}
|
||
}, xp.prototype.MULTILINESTRING_PARSERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
lineStringMember: rp(xp.prototype.lineStringMemberParser_),
|
||
lineStringMembers: rp(xp.prototype.lineStringMemberParser_)
|
||
}
|
||
}, xp.prototype.MULTIPOLYGON_PARSERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
polygonMember: rp(xp.prototype.polygonMemberParser_),
|
||
polygonMembers: rp(xp.prototype.polygonMemberParser_)
|
||
}
|
||
}, xp.prototype.POINTMEMBER_PARSERS_ = {"http://www.opengis.net/gml": {Point: rp(xp.prototype.readFlatCoordinatesFromNode_)}}, xp.prototype.LINESTRINGMEMBER_PARSERS_ = {"http://www.opengis.net/gml": {LineString: rp(xp.prototype.readLineString)}}, xp.prototype.POLYGONMEMBER_PARSERS_ = {"http://www.opengis.net/gml": {Polygon: rp(xp.prototype.readPolygon)}}, xp.prototype.RING_PARSERS = {"http://www.opengis.net/gml": {LinearRing: op(xp.prototype.readFlatLinearRing_)}};
|
||
var wp = xp;
|
||
|
||
function bp(t) {
|
||
return Cp(Jc(t, !1))
|
||
}
|
||
|
||
function Cp(t) {
|
||
var e = /^\s*(true|1)|(false|0)\s*$/.exec(t);
|
||
return e ? void 0 !== e[1] || !1 : void 0
|
||
}
|
||
|
||
function Sp(t) {
|
||
var e = Jc(t, !1), i = Date.parse(e);
|
||
return isNaN(i) ? void 0 : i / 1e3
|
||
}
|
||
|
||
function Ep(t) {
|
||
return Tp(Jc(t, !1))
|
||
}
|
||
|
||
function Tp(t) {
|
||
var e = /^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t);
|
||
return e ? parseFloat(e[1]) : void 0
|
||
}
|
||
|
||
function Rp(t) {
|
||
return Pp(Jc(t, !1))
|
||
}
|
||
|
||
function Pp(t) {
|
||
var e = /^\s*(\d+)\s*$/.exec(t);
|
||
return e ? parseInt(e[1], 10) : void 0
|
||
}
|
||
|
||
function Lp(t) {
|
||
return Jc(t, !1).trim()
|
||
}
|
||
|
||
function Ip(t, e) {
|
||
Fp(t, e ? "1" : "0")
|
||
}
|
||
|
||
function Op(t, e) {
|
||
t.appendChild(qc.createCDATASection(e))
|
||
}
|
||
|
||
function Mp(t, e) {
|
||
var i = new Date(1e3 * e),
|
||
r = i.getUTCFullYear() + "-" + Ar(i.getUTCMonth() + 1, 2) + "-" + Ar(i.getUTCDate(), 2) + "T" + Ar(i.getUTCHours(), 2) + ":" + Ar(i.getUTCMinutes(), 2) + ":" + Ar(i.getUTCSeconds(), 2) + "Z";
|
||
t.appendChild(qc.createTextNode(r))
|
||
}
|
||
|
||
function Ap(t, e) {
|
||
var i = e.toPrecision();
|
||
t.appendChild(qc.createTextNode(i))
|
||
}
|
||
|
||
function kp(t, e) {
|
||
var i = e.toString();
|
||
t.appendChild(qc.createTextNode(i))
|
||
}
|
||
|
||
function Fp(t, e) {
|
||
t.appendChild(qc.createTextNode(e))
|
||
}
|
||
|
||
var Np = vp + " http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd", Dp = {
|
||
MultiLineString: "lineStringMember",
|
||
MultiCurve: "curveMember",
|
||
MultiPolygon: "polygonMember",
|
||
MultiSurface: "surfaceMember"
|
||
}, Gp = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, i), this.surface_ = void 0 !== i.surface && i.surface, this.curve_ = void 0 !== i.curve && i.curve, this.multiCurve_ = void 0 === i.multiCurve || i.multiCurve, this.multiSurface_ = void 0 === i.multiSurface || i.multiSurface, this.schemaLocation = i.schemaLocation ? i.schemaLocation : Np, this.hasZ = void 0 !== i.hasZ && i.hasZ
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.readMultiCurve_ = function (t, e) {
|
||
var i = fp([], this.MULTICURVE_PARSERS_, t, e, this);
|
||
return i ? new Dc(i) : void 0
|
||
}, e.prototype.readMultiSurface_ = function (t, e) {
|
||
var i = fp([], this.MULTISURFACE_PARSERS_, t, e, this);
|
||
if (i) return new zc(i)
|
||
}, e.prototype.curveMemberParser_ = function (t, e) {
|
||
dp(this.CURVEMEMBER_PARSERS_, t, e, this)
|
||
}, e.prototype.surfaceMemberParser_ = function (t, e) {
|
||
dp(this.SURFACEMEMBER_PARSERS_, t, e, this)
|
||
}, e.prototype.readPatch_ = function (t, e) {
|
||
return fp([null], this.PATCHES_PARSERS_, t, e, this)
|
||
}, e.prototype.readSegment_ = function (t, e) {
|
||
return fp([null], this.SEGMENTS_PARSERS_, t, e, this)
|
||
}, e.prototype.readPolygonPatch_ = function (t, e) {
|
||
return fp([null], this.FLAT_LINEAR_RINGS_PARSERS, t, e, this)
|
||
}, e.prototype.readLineStringSegment_ = function (t, e) {
|
||
return fp([null], this.GEOMETRY_FLAT_COORDINATES_PARSERS, t, e, this)
|
||
}, e.prototype.interiorParser_ = function (t, e) {
|
||
var i = fp(void 0, this.RING_PARSERS, t, e, this);
|
||
i && e[e.length - 1].push(i)
|
||
}, e.prototype.exteriorParser_ = function (t, e) {
|
||
var i = fp(void 0, this.RING_PARSERS, t, e, this);
|
||
i && (e[e.length - 1][0] = i)
|
||
}, e.prototype.readSurface_ = function (t, e) {
|
||
var i = fp([null], this.SURFACE_PARSERS_, t, e, this);
|
||
if (i && i[0]) {
|
||
var r, o, n = i[0], s = [n.length];
|
||
for (r = 1, o = i.length; r < o; ++r) Q(n, i[r]), s.push(n.length);
|
||
return new fr(n, qt.XYZ, s)
|
||
}
|
||
}, e.prototype.readCurve_ = function (t, e) {
|
||
var i = fp([null], this.CURVE_PARSERS_, t, e, this);
|
||
return i ? new Jr(i, qt.XYZ) : void 0
|
||
}, e.prototype.readEnvelope_ = function (t, e) {
|
||
var i = fp([null], this.ENVELOPE_PARSERS_, t, e, this);
|
||
return yt(i[1][0], i[1][1], i[2][0], i[2][1])
|
||
}, e.prototype.readFlatPos_ = function (t, e) {
|
||
for (var i, r = Jc(t, !1), o = /^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/, n = []; i = o.exec(r);) n.push(parseFloat(i[1])), r = r.substr(i[0].length);
|
||
if ("" === r) {
|
||
var s, a, l = e[0].srsName, h = "enu";
|
||
if (l) h = We(l).getAxisOrientation();
|
||
if ("neu" === h) for (s = 0, a = n.length; s < a; s += 3) {
|
||
var u = n[s], c = n[s + 1];
|
||
n[s] = c, n[s + 1] = u
|
||
}
|
||
var p = n.length;
|
||
if (2 == p && n.push(0), 0 !== p) return n
|
||
}
|
||
}, e.prototype.readFlatPosList_ = function (t, e) {
|
||
var i = Jc(t, !1).replace(/^\s*|\s*$/g, ""), r = e[0], o = r.srsName, n = r.srsDimension, s = "enu";
|
||
o && (s = We(o).getAxisOrientation());
|
||
var a, l, h, u = i.split(/\s+/), c = 2;
|
||
t.getAttribute("srsDimension") ? c = Pp(t.getAttribute("srsDimension")) : t.getAttribute("dimension") ? c = Pp(t.getAttribute("dimension")) : t.parentNode.getAttribute("srsDimension") ? c = Pp(t.parentNode.getAttribute("srsDimension")) : n && (c = Pp(n));
|
||
for (var p = [], d = 0, f = u.length; d < f; d += c) a = parseFloat(u[d]), l = parseFloat(u[d + 1]), h = 3 === c ? parseFloat(u[d + 2]) : 0, "en" === s.substr(0, 2) ? p.push(a, l, h) : p.push(l, a, h);
|
||
return p
|
||
}, e.prototype.writePos_ = function (t, e, i) {
|
||
var r = i[i.length - 1], o = r.hasZ, n = o ? "3" : "2";
|
||
t.setAttribute("srsDimension", n);
|
||
var s = r.srsName, a = "enu";
|
||
s && (a = We(s).getAxisOrientation());
|
||
var l, h = e.getCoordinates();
|
||
(l = "en" === a.substr(0, 2) ? h[0] + " " + h[1] : h[1] + " " + h[0], o) && (l += " " + (h[2] || 0));
|
||
Fp(t, l)
|
||
}, e.prototype.getCoords_ = function (t, e, i) {
|
||
var r = "enu";
|
||
e && (r = We(e).getAxisOrientation());
|
||
var o = "en" === r.substr(0, 2) ? t[0] + " " + t[1] : t[1] + " " + t[0];
|
||
i && (o += " " + (t[2] || 0));
|
||
return o
|
||
}, e.prototype.writePosList_ = function (t, e, i) {
|
||
var r = i[i.length - 1], o = r.hasZ, n = o ? "3" : "2";
|
||
t.setAttribute("srsDimension", n);
|
||
for (var s, a = r.srsName, l = e.getCoordinates(), h = l.length, u = new Array(h), c = 0; c < h; ++c) s = l[c], u[c] = this.getCoords_(s, a, o);
|
||
Fp(t, u.join(" "))
|
||
}, e.prototype.writePoint_ = function (t, e, i) {
|
||
var r = i[i.length - 1].srsName;
|
||
r && t.setAttribute("srsName", r);
|
||
var o = Kc(t.namespaceURI, "pos");
|
||
t.appendChild(o), this.writePos_(o, e, i)
|
||
}, e.prototype.writeEnvelope = function (t, e, i) {
|
||
var r = i[i.length - 1].srsName;
|
||
r && t.setAttribute("srsName", r);
|
||
var o = [e[0] + " " + e[1], e[2] + " " + e[3]];
|
||
mp({node: t}, this.ENVELOPE_SERIALIZERS_, up, o, i, ["lowerCorner", "upperCorner"], this)
|
||
}, e.prototype.writeLinearRing_ = function (t, e, i) {
|
||
var r = i[i.length - 1].srsName;
|
||
r && t.setAttribute("srsName", r);
|
||
var o = Kc(t.namespaceURI, "posList");
|
||
t.appendChild(o), this.writePosList_(o, e, i)
|
||
}, e.prototype.RING_NODE_FACTORY_ = function (t, e, i) {
|
||
var r = e[e.length - 1], o = r.node, n = r.exteriorWritten;
|
||
return void 0 === n && (r.exteriorWritten = !0), Kc(o.namespaceURI, void 0 !== n ? "interior" : "exterior")
|
||
}, e.prototype.writeSurfaceOrPolygon_ = function (t, e, i) {
|
||
var r = i[i.length - 1], o = r.hasZ, n = r.srsName;
|
||
if ("PolygonPatch" !== t.nodeName && n && t.setAttribute("srsName", n), "Polygon" === t.nodeName || "PolygonPatch" === t.nodeName) {
|
||
var s = e.getLinearRings();
|
||
mp({
|
||
node: t,
|
||
hasZ: o,
|
||
srsName: n
|
||
}, this.RING_SERIALIZERS_, this.RING_NODE_FACTORY_, s, i, void 0, this)
|
||
} else if ("Surface" === t.nodeName) {
|
||
var a = Kc(t.namespaceURI, "patches");
|
||
t.appendChild(a), this.writeSurfacePatches_(a, e, i)
|
||
}
|
||
}, e.prototype.writeCurveOrLineString_ = function (t, e, i) {
|
||
var r = i[i.length - 1].srsName;
|
||
if ("LineStringSegment" !== t.nodeName && r && t.setAttribute("srsName", r), "LineString" === t.nodeName || "LineStringSegment" === t.nodeName) {
|
||
var o = Kc(t.namespaceURI, "posList");
|
||
t.appendChild(o), this.writePosList_(o, e, i)
|
||
} else if ("Curve" === t.nodeName) {
|
||
var n = Kc(t.namespaceURI, "segments");
|
||
t.appendChild(n), this.writeCurveSegments_(n, e, i)
|
||
}
|
||
}, e.prototype.writeMultiSurfaceOrPolygon_ = function (t, e, i) {
|
||
var r = i[i.length - 1], o = r.hasZ, n = r.srsName, s = r.surface;
|
||
n && t.setAttribute("srsName", n);
|
||
var a = e.getPolygons();
|
||
mp({
|
||
node: t,
|
||
hasZ: o,
|
||
srsName: n,
|
||
surface: s
|
||
}, this.SURFACEORPOLYGONMEMBER_SERIALIZERS_, this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, a, i, void 0, this)
|
||
}, e.prototype.writeMultiPoint_ = function (t, e, i) {
|
||
var r = i[i.length - 1], o = r.srsName, n = r.hasZ;
|
||
o && t.setAttribute("srsName", o);
|
||
var s = e.getPoints();
|
||
mp({node: t, hasZ: n, srsName: o}, this.POINTMEMBER_SERIALIZERS_, hp("pointMember"), s, i, void 0, this)
|
||
}, e.prototype.writeMultiCurveOrLineString_ = function (t, e, i) {
|
||
var r = i[i.length - 1], o = r.hasZ, n = r.srsName, s = r.curve;
|
||
n && t.setAttribute("srsName", n);
|
||
var a = e.getLineStrings();
|
||
mp({
|
||
node: t,
|
||
hasZ: o,
|
||
srsName: n,
|
||
curve: s
|
||
}, this.LINESTRINGORCURVEMEMBER_SERIALIZERS_, this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, a, i, void 0, this)
|
||
}, e.prototype.writeRing_ = function (t, e, i) {
|
||
var r = Kc(t.namespaceURI, "LinearRing");
|
||
t.appendChild(r), this.writeLinearRing_(r, e, i)
|
||
}, e.prototype.writeSurfaceOrPolygonMember_ = function (t, e, i) {
|
||
var r = this.GEOMETRY_NODE_FACTORY_(e, i);
|
||
r && (t.appendChild(r), this.writeSurfaceOrPolygon_(r, e, i))
|
||
}, e.prototype.writePointMember_ = function (t, e, i) {
|
||
var r = Kc(t.namespaceURI, "Point");
|
||
t.appendChild(r), this.writePoint_(r, e, i)
|
||
}, e.prototype.writeLineStringOrCurveMember_ = function (t, e, i) {
|
||
var r = this.GEOMETRY_NODE_FACTORY_(e, i);
|
||
r && (t.appendChild(r), this.writeCurveOrLineString_(r, e, i))
|
||
}, e.prototype.writeSurfacePatches_ = function (t, e, i) {
|
||
var r = Kc(t.namespaceURI, "PolygonPatch");
|
||
t.appendChild(r), this.writeSurfaceOrPolygon_(r, e, i)
|
||
}, e.prototype.writeCurveSegments_ = function (t, e, i) {
|
||
var r = Kc(t.namespaceURI, "LineStringSegment");
|
||
t.appendChild(r), this.writeCurveOrLineString_(r, e, i)
|
||
}, e.prototype.writeGeometryElement = function (t, e, i) {
|
||
var r, o = i[i.length - 1], n = p({}, o);
|
||
n.node = t, r = Array.isArray(e) ? o.dataProjection ? ri(e, o.featureProjection, o.dataProjection) : e : kc(e, !0, o), mp(n, this.GEOMETRY_SERIALIZERS_, this.GEOMETRY_NODE_FACTORY_, [r], i, void 0, this)
|
||
}, e.prototype.writeFeatureElement = function (t, e, i) {
|
||
var r = e.getId();
|
||
r && t.setAttribute("fid", r);
|
||
var o = i[i.length - 1], n = o.featureNS, s = e.getGeometryName();
|
||
o.serializers || (o.serializers = {}, o.serializers[n] = {});
|
||
var a = e.getProperties(), l = [], h = [];
|
||
for (var u in a) {
|
||
var c = a[u];
|
||
null !== c && (l.push(u), h.push(c), u == s || "function" == typeof c.getSimplifiedGeometry ? u in o.serializers[n] || (o.serializers[n][u] = ap(this.writeGeometryElement, this)) : u in o.serializers[n] || (o.serializers[n][u] = ap(Fp)))
|
||
}
|
||
var d = p({}, o);
|
||
d.node = t, mp(d, o.serializers, hp(void 0, n), h, i, l)
|
||
}, e.prototype.writeFeatureMembers_ = function (t, e, i) {
|
||
var r = i[i.length - 1], o = r.featureType, n = r.featureNS, s = {};
|
||
s[n] = {}, s[n][o] = ap(this.writeFeatureElement, this);
|
||
var a = p({}, r);
|
||
a.node = t, mp(a, s, hp(o, n), e, i)
|
||
}, e.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function (t, e, i) {
|
||
var r = e[e.length - 1].node;
|
||
return Kc(this.namespace, Dp[r.nodeName])
|
||
}, e.prototype.GEOMETRY_NODE_FACTORY_ = function (t, e, i) {
|
||
var r, o = e[e.length - 1], n = o.multiSurface, s = o.surface, a = o.curve, l = o.multiCurve;
|
||
return Array.isArray(t) ? r = "Envelope" : "MultiPolygon" === (r = t.getType()) && !0 === n ? r = "MultiSurface" : "Polygon" === r && !0 === s ? r = "Surface" : "LineString" === r && !0 === a ? r = "Curve" : "MultiLineString" === r && !0 === l && (r = "MultiCurve"), Kc(this.namespace, r)
|
||
}, e.prototype.writeGeometryNode = function (t, e) {
|
||
e = this.adaptOptions(e);
|
||
var i = Kc(this.namespace, "geom"), r = {
|
||
node: i,
|
||
hasZ: this.hasZ,
|
||
srsName: this.srsName,
|
||
curve: this.curve_,
|
||
surface: this.surface_,
|
||
multiSurface: this.multiSurface_,
|
||
multiCurve: this.multiCurve_
|
||
};
|
||
return e && p(r, e), this.writeGeometryElement(i, t, [r]), i
|
||
}, e.prototype.writeFeaturesNode = function (t, e) {
|
||
e = this.adaptOptions(e);
|
||
var i = Kc(this.namespace, "featureMembers");
|
||
i.setAttributeNS(Zc, "xsi:schemaLocation", this.schemaLocation);
|
||
var r = {
|
||
srsName: this.srsName,
|
||
hasZ: this.hasZ,
|
||
curve: this.curve_,
|
||
surface: this.surface_,
|
||
multiSurface: this.multiSurface_,
|
||
multiCurve: this.multiCurve_,
|
||
featureNS: this.featureNS,
|
||
featureType: this.featureType
|
||
};
|
||
return e && p(r, e), this.writeFeatureMembers_(i, t, [r]), i
|
||
}, e
|
||
}(wp);
|
||
Gp.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {
|
||
"http://www.opengis.net/gml": {
|
||
pos: op(Gp.prototype.readFlatPos_),
|
||
posList: op(Gp.prototype.readFlatPosList_)
|
||
}
|
||
}, Gp.prototype.FLAT_LINEAR_RINGS_PARSERS = {
|
||
"http://www.opengis.net/gml": {
|
||
interior: Gp.prototype.interiorParser_,
|
||
exterior: Gp.prototype.exteriorParser_
|
||
}
|
||
}, Gp.prototype.GEOMETRY_PARSERS = {
|
||
"http://www.opengis.net/gml": {
|
||
Point: op(wp.prototype.readPoint),
|
||
MultiPoint: op(wp.prototype.readMultiPoint),
|
||
LineString: op(wp.prototype.readLineString),
|
||
MultiLineString: op(wp.prototype.readMultiLineString),
|
||
LinearRing: op(wp.prototype.readLinearRing),
|
||
Polygon: op(wp.prototype.readPolygon),
|
||
MultiPolygon: op(wp.prototype.readMultiPolygon),
|
||
Surface: op(Gp.prototype.readSurface_),
|
||
MultiSurface: op(Gp.prototype.readMultiSurface_),
|
||
Curve: op(Gp.prototype.readCurve_),
|
||
MultiCurve: op(Gp.prototype.readMultiCurve_),
|
||
Envelope: op(Gp.prototype.readEnvelope_)
|
||
}
|
||
}, Gp.prototype.MULTICURVE_PARSERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
curveMember: rp(Gp.prototype.curveMemberParser_),
|
||
curveMembers: rp(Gp.prototype.curveMemberParser_)
|
||
}
|
||
}, Gp.prototype.MULTISURFACE_PARSERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
surfaceMember: rp(Gp.prototype.surfaceMemberParser_),
|
||
surfaceMembers: rp(Gp.prototype.surfaceMemberParser_)
|
||
}
|
||
}, Gp.prototype.CURVEMEMBER_PARSERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
LineString: rp(wp.prototype.readLineString),
|
||
Curve: rp(Gp.prototype.readCurve_)
|
||
}
|
||
}, Gp.prototype.SURFACEMEMBER_PARSERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
Polygon: rp(wp.prototype.readPolygon),
|
||
Surface: rp(Gp.prototype.readSurface_)
|
||
}
|
||
}, Gp.prototype.SURFACE_PARSERS_ = {"http://www.opengis.net/gml": {patches: op(Gp.prototype.readPatch_)}}, Gp.prototype.CURVE_PARSERS_ = {"http://www.opengis.net/gml": {segments: op(Gp.prototype.readSegment_)}}, Gp.prototype.ENVELOPE_PARSERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
lowerCorner: rp(Gp.prototype.readFlatPosList_),
|
||
upperCorner: rp(Gp.prototype.readFlatPosList_)
|
||
}
|
||
}, Gp.prototype.PATCHES_PARSERS_ = {"http://www.opengis.net/gml": {PolygonPatch: op(Gp.prototype.readPolygonPatch_)}}, Gp.prototype.SEGMENTS_PARSERS_ = {"http://www.opengis.net/gml": {LineStringSegment: op(Gp.prototype.readLineStringSegment_)}}, Gp.prototype.writeFeatures, Gp.prototype.RING_SERIALIZERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
exterior: ap(Gp.prototype.writeRing_),
|
||
interior: ap(Gp.prototype.writeRing_)
|
||
}
|
||
}, Gp.prototype.ENVELOPE_SERIALIZERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
lowerCorner: ap(Fp),
|
||
upperCorner: ap(Fp)
|
||
}
|
||
}, Gp.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
surfaceMember: ap(Gp.prototype.writeSurfaceOrPolygonMember_),
|
||
polygonMember: ap(Gp.prototype.writeSurfaceOrPolygonMember_)
|
||
}
|
||
}, Gp.prototype.POINTMEMBER_SERIALIZERS_ = {"http://www.opengis.net/gml": {pointMember: ap(Gp.prototype.writePointMember_)}}, Gp.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
lineStringMember: ap(Gp.prototype.writeLineStringOrCurveMember_),
|
||
curveMember: ap(Gp.prototype.writeLineStringOrCurveMember_)
|
||
}
|
||
}, Gp.prototype.GEOMETRY_SERIALIZERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
Curve: ap(Gp.prototype.writeCurveOrLineString_),
|
||
MultiCurve: ap(Gp.prototype.writeMultiCurveOrLineString_),
|
||
Point: ap(Gp.prototype.writePoint_),
|
||
MultiPoint: ap(Gp.prototype.writeMultiPoint_),
|
||
LineString: ap(Gp.prototype.writeCurveOrLineString_),
|
||
MultiLineString: ap(Gp.prototype.writeMultiCurveOrLineString_),
|
||
LinearRing: ap(Gp.prototype.writeLinearRing_),
|
||
Polygon: ap(Gp.prototype.writeSurfaceOrPolygon_),
|
||
MultiPolygon: ap(Gp.prototype.writeMultiSurfaceOrPolygon_),
|
||
Surface: ap(Gp.prototype.writeSurfaceOrPolygon_),
|
||
MultiSurface: ap(Gp.prototype.writeMultiSurfaceOrPolygon_),
|
||
Envelope: ap(Gp.prototype.writeEnvelope)
|
||
}
|
||
};
|
||
var jp = Gp, zp = jp;
|
||
zp.prototype.writeFeatures, zp.prototype.writeFeaturesNode;
|
||
var Up = zp, Bp = vp + " http://schemas.opengis.net/gml/2.1.2/feature.xsd", Vp = {
|
||
MultiLineString: "lineStringMember",
|
||
MultiCurve: "curveMember",
|
||
MultiPolygon: "polygonMember",
|
||
MultiSurface: "surfaceMember"
|
||
}, Yp = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, i), this.FEATURE_COLLECTION_PARSERS[vp].featureMember = rp(this.readFeaturesInternal), this.schemaLocation = i.schemaLocation ? i.schemaLocation : Bp
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.readFlatCoordinates_ = function (t, e) {
|
||
var i = Jc(t, !1).replace(/^\s*|\s*$/g, ""), r = e[0].srsName, o = "enu";
|
||
if (r) {
|
||
var n = We(r);
|
||
n && (o = n.getAxisOrientation())
|
||
}
|
||
for (var s = i.trim().split(/\s+/), a = [], l = 0, h = s.length; l < h; l++) {
|
||
var u = s[l].split(/,+/), c = parseFloat(u[0]), p = parseFloat(u[1]),
|
||
d = 3 === u.length ? parseFloat(u[2]) : 0;
|
||
"en" === o.substr(0, 2) ? a.push(c, p, d) : a.push(p, c, d)
|
||
}
|
||
return a
|
||
}, e.prototype.readBox_ = function (t, e) {
|
||
var i = fp([null], this.BOX_PARSERS_, t, e, this);
|
||
return yt(i[1][0], i[1][1], i[1][3], i[1][4])
|
||
}, e.prototype.innerBoundaryIsParser_ = function (t, e) {
|
||
var i = fp(void 0, this.RING_PARSERS, t, e, this);
|
||
i && e[e.length - 1].push(i)
|
||
}, e.prototype.outerBoundaryIsParser_ = function (t, e) {
|
||
var i = fp(void 0, this.RING_PARSERS, t, e, this);
|
||
i && (e[e.length - 1][0] = i)
|
||
}, e.prototype.GEOMETRY_NODE_FACTORY_ = function (t, e, i) {
|
||
var r, o = e[e.length - 1], n = o.multiSurface, s = o.surface, a = o.multiCurve;
|
||
return Array.isArray(t) ? r = "Envelope" : "MultiPolygon" === (r = t.getType()) && !0 === n ? r = "MultiSurface" : "Polygon" === r && !0 === s ? r = "Surface" : "MultiLineString" === r && !0 === a && (r = "MultiCurve"), Kc("http://www.opengis.net/gml", r)
|
||
}, e.prototype.writeFeatureElement = function (t, e, i) {
|
||
var r = e.getId();
|
||
r && t.setAttribute("fid", r);
|
||
var o = i[i.length - 1], n = o.featureNS, s = e.getGeometryName();
|
||
o.serializers || (o.serializers = {}, o.serializers[n] = {});
|
||
var a = e.getProperties(), l = [], h = [];
|
||
for (var u in a) {
|
||
var c = a[u];
|
||
null !== c && (l.push(u), h.push(c), u == s || "function" == typeof c.getSimplifiedGeometry ? u in o.serializers[n] || (o.serializers[n][u] = ap(this.writeGeometryElement, this)) : u in o.serializers[n] || (o.serializers[n][u] = ap(Fp)))
|
||
}
|
||
var d = p({}, o);
|
||
d.node = t, mp(d, o.serializers, hp(void 0, n), h, i, l)
|
||
}, e.prototype.writeCurveOrLineString_ = function (t, e, i) {
|
||
var r = i[i.length - 1].srsName;
|
||
if ("LineStringSegment" !== t.nodeName && r && t.setAttribute("srsName", r), "LineString" === t.nodeName || "LineStringSegment" === t.nodeName) {
|
||
var o = this.createCoordinatesNode_(t.namespaceURI);
|
||
t.appendChild(o), this.writeCoordinates_(o, e, i)
|
||
} else if ("Curve" === t.nodeName) {
|
||
var n = Kc(t.namespaceURI, "segments");
|
||
t.appendChild(n), this.writeCurveSegments_(n, e, i)
|
||
}
|
||
}, e.prototype.writeLineStringOrCurveMember_ = function (t, e, i) {
|
||
var r = this.GEOMETRY_NODE_FACTORY_(e, i);
|
||
r && (t.appendChild(r), this.writeCurveOrLineString_(r, e, i))
|
||
}, e.prototype.writeMultiCurveOrLineString_ = function (t, e, i) {
|
||
var r = i[i.length - 1], o = r.hasZ, n = r.srsName, s = r.curve;
|
||
n && t.setAttribute("srsName", n);
|
||
var a = e.getLineStrings();
|
||
mp({
|
||
node: t,
|
||
hasZ: o,
|
||
srsName: n,
|
||
curve: s
|
||
}, this.LINESTRINGORCURVEMEMBER_SERIALIZERS_, this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, a, i, void 0, this)
|
||
}, e.prototype.writeGeometryElement = function (t, e, i) {
|
||
var r, o = i[i.length - 1], n = p({}, o);
|
||
n.node = t, r = Array.isArray(e) ? o.dataProjection ? ri(e, o.featureProjection, o.dataProjection) : e : kc(e, !0, o), mp(n, this.GEOMETRY_SERIALIZERS_, this.GEOMETRY_NODE_FACTORY_, [r], i, void 0, this)
|
||
}, e.prototype.createCoordinatesNode_ = function (t) {
|
||
var e = Kc(t, "coordinates");
|
||
return e.setAttribute("decimal", "."), e.setAttribute("cs", ","), e.setAttribute("ts", " "), e
|
||
}, e.prototype.writeCoordinates_ = function (t, e, i) {
|
||
for (var r = i[i.length - 1], o = r.hasZ, n = r.srsName, s = e.getCoordinates(), a = s.length, l = new Array(a), h = 0; h < a; ++h) {
|
||
var u = s[h];
|
||
l[h] = this.getCoords_(u, n, o)
|
||
}
|
||
Fp(t, l.join(" "))
|
||
}, e.prototype.writeCurveSegments_ = function (t, e, i) {
|
||
var r = Kc(t.namespaceURI, "LineStringSegment");
|
||
t.appendChild(r), this.writeCurveOrLineString_(r, e, i)
|
||
}, e.prototype.writeSurfaceOrPolygon_ = function (t, e, i) {
|
||
var r = i[i.length - 1], o = r.hasZ, n = r.srsName;
|
||
if ("PolygonPatch" !== t.nodeName && n && t.setAttribute("srsName", n), "Polygon" === t.nodeName || "PolygonPatch" === t.nodeName) {
|
||
var s = e.getLinearRings();
|
||
mp({
|
||
node: t,
|
||
hasZ: o,
|
||
srsName: n
|
||
}, this.RING_SERIALIZERS_, this.RING_NODE_FACTORY_, s, i, void 0, this)
|
||
} else if ("Surface" === t.nodeName) {
|
||
var a = Kc(t.namespaceURI, "patches");
|
||
t.appendChild(a), this.writeSurfacePatches_(a, e, i)
|
||
}
|
||
}, e.prototype.RING_NODE_FACTORY_ = function (t, e, i) {
|
||
var r = e[e.length - 1], o = r.node, n = r.exteriorWritten;
|
||
return void 0 === n && (r.exteriorWritten = !0), Kc(o.namespaceURI, void 0 !== n ? "innerBoundaryIs" : "outerBoundaryIs")
|
||
}, e.prototype.writeSurfacePatches_ = function (t, e, i) {
|
||
var r = Kc(t.namespaceURI, "PolygonPatch");
|
||
t.appendChild(r), this.writeSurfaceOrPolygon_(r, e, i)
|
||
}, e.prototype.writeRing_ = function (t, e, i) {
|
||
var r = Kc(t.namespaceURI, "LinearRing");
|
||
t.appendChild(r), this.writeLinearRing_(r, e, i)
|
||
}, e.prototype.getCoords_ = function (t, e, i) {
|
||
var r = "enu";
|
||
e && (r = We(e).getAxisOrientation());
|
||
var o = "en" === r.substr(0, 2) ? t[0] + "," + t[1] : t[1] + "," + t[0];
|
||
i && (o += "," + (t[2] || 0));
|
||
return o
|
||
}, e.prototype.writePoint_ = function (t, e, i) {
|
||
var r = i[i.length - 1], o = r.hasZ, n = r.srsName;
|
||
n && t.setAttribute("srsName", n);
|
||
var s = this.createCoordinatesNode_(t.namespaceURI);
|
||
t.appendChild(s);
|
||
var a = e.getCoordinates();
|
||
Fp(s, this.getCoords_(a, n, o))
|
||
}, e.prototype.writeMultiPoint_ = function (t, e, i) {
|
||
var r = i[i.length - 1], o = r.hasZ, n = r.srsName;
|
||
n && t.setAttribute("srsName", n);
|
||
var s = e.getPoints();
|
||
mp({node: t, hasZ: o, srsName: n}, this.POINTMEMBER_SERIALIZERS_, hp("pointMember"), s, i, void 0, this)
|
||
}, e.prototype.writePointMember_ = function (t, e, i) {
|
||
var r = Kc(t.namespaceURI, "Point");
|
||
t.appendChild(r), this.writePoint_(r, e, i)
|
||
}, e.prototype.writeLinearRing_ = function (t, e, i) {
|
||
var r = i[i.length - 1].srsName;
|
||
r && t.setAttribute("srsName", r);
|
||
var o = this.createCoordinatesNode_(t.namespaceURI);
|
||
t.appendChild(o), this.writeCoordinates_(o, e, i)
|
||
}, e.prototype.writeMultiSurfaceOrPolygon_ = function (t, e, i) {
|
||
var r = i[i.length - 1], o = r.hasZ, n = r.srsName, s = r.surface;
|
||
n && t.setAttribute("srsName", n);
|
||
var a = e.getPolygons();
|
||
mp({
|
||
node: t,
|
||
hasZ: o,
|
||
srsName: n,
|
||
surface: s
|
||
}, this.SURFACEORPOLYGONMEMBER_SERIALIZERS_, this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, a, i, void 0, this)
|
||
}, e.prototype.writeSurfaceOrPolygonMember_ = function (t, e, i) {
|
||
var r = this.GEOMETRY_NODE_FACTORY_(e, i);
|
||
r && (t.appendChild(r), this.writeSurfaceOrPolygon_(r, e, i))
|
||
}, e.prototype.writeEnvelope = function (t, e, i) {
|
||
var r = i[i.length - 1].srsName;
|
||
r && t.setAttribute("srsName", r);
|
||
var o = [e[0] + " " + e[1], e[2] + " " + e[3]];
|
||
mp({node: t}, this.ENVELOPE_SERIALIZERS_, up, o, i, ["lowerCorner", "upperCorner"], this)
|
||
}, e.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function (t, e, i) {
|
||
var r = e[e.length - 1].node;
|
||
return Kc("http://www.opengis.net/gml", Vp[r.nodeName])
|
||
}, e
|
||
}(wp);
|
||
Yp.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {"http://www.opengis.net/gml": {coordinates: op(Yp.prototype.readFlatCoordinates_)}}, Yp.prototype.FLAT_LINEAR_RINGS_PARSERS = {
|
||
"http://www.opengis.net/gml": {
|
||
innerBoundaryIs: Yp.prototype.innerBoundaryIsParser_,
|
||
outerBoundaryIs: Yp.prototype.outerBoundaryIsParser_
|
||
}
|
||
}, Yp.prototype.BOX_PARSERS_ = {"http://www.opengis.net/gml": {coordinates: rp(Yp.prototype.readFlatCoordinates_)}}, Yp.prototype.GEOMETRY_PARSERS = {
|
||
"http://www.opengis.net/gml": {
|
||
Point: op(wp.prototype.readPoint),
|
||
MultiPoint: op(wp.prototype.readMultiPoint),
|
||
LineString: op(wp.prototype.readLineString),
|
||
MultiLineString: op(wp.prototype.readMultiLineString),
|
||
LinearRing: op(wp.prototype.readLinearRing),
|
||
Polygon: op(wp.prototype.readPolygon),
|
||
MultiPolygon: op(wp.prototype.readMultiPolygon),
|
||
Box: op(Yp.prototype.readBox_)
|
||
}
|
||
}, Yp.prototype.GEOMETRY_SERIALIZERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
Curve: ap(Yp.prototype.writeCurveOrLineString_),
|
||
MultiCurve: ap(Yp.prototype.writeMultiCurveOrLineString_),
|
||
Point: ap(Yp.prototype.writePoint_),
|
||
MultiPoint: ap(Yp.prototype.writeMultiPoint_),
|
||
LineString: ap(Yp.prototype.writeCurveOrLineString_),
|
||
MultiLineString: ap(Yp.prototype.writeMultiCurveOrLineString_),
|
||
LinearRing: ap(Yp.prototype.writeLinearRing_),
|
||
Polygon: ap(Yp.prototype.writeSurfaceOrPolygon_),
|
||
MultiPolygon: ap(Yp.prototype.writeMultiSurfaceOrPolygon_),
|
||
Surface: ap(Yp.prototype.writeSurfaceOrPolygon_),
|
||
MultiSurface: ap(Yp.prototype.writeMultiSurfaceOrPolygon_),
|
||
Envelope: ap(Yp.prototype.writeEnvelope)
|
||
}
|
||
}, Yp.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
lineStringMember: ap(Yp.prototype.writeLineStringOrCurveMember_),
|
||
curveMember: ap(Yp.prototype.writeLineStringOrCurveMember_)
|
||
}
|
||
}, Yp.prototype.RING_SERIALIZERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
outerBoundaryIs: ap(Yp.prototype.writeRing_),
|
||
innerBoundaryIs: ap(Yp.prototype.writeRing_)
|
||
}
|
||
}, Yp.prototype.POINTMEMBER_SERIALIZERS_ = {"http://www.opengis.net/gml": {pointMember: ap(Yp.prototype.writePointMember_)}}, Yp.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
surfaceMember: ap(Yp.prototype.writeSurfaceOrPolygonMember_),
|
||
polygonMember: ap(Yp.prototype.writeSurfaceOrPolygonMember_)
|
||
}
|
||
}, Yp.prototype.ENVELOPE_SERIALIZERS_ = {
|
||
"http://www.opengis.net/gml": {
|
||
lowerCorner: ap(Fp),
|
||
upperCorner: ap(Fp)
|
||
}
|
||
};
|
||
var Wp = Yp, Hp = [null, "http://www.topografix.com/GPX/1/0", "http://www.topografix.com/GPX/1/1"],
|
||
Xp = {rte: wd, trk: bd, wpt: Cd}, qp = pp(Hp, {rte: rp(wd), trk: rp(bd), wpt: rp(Cd)}),
|
||
Zp = pp(Hp, {text: sp(Lp, "linkText"), type: sp(Lp, "linkType")}), Kp = pp(Hp, {
|
||
rte: ap(function (t, e, i) {
|
||
var r = i[0], o = e.getProperties(), n = {node: t};
|
||
n.properties = o;
|
||
var s = e.getGeometry();
|
||
if (s.getType() == Zt.LINE_STRING) {
|
||
var a = kc(s, !0, r);
|
||
n.geometryLayout = a.getLayout(), o.rtept = a.getCoordinates()
|
||
}
|
||
var l = i[i.length - 1].node, h = sd[l.namespaceURI], u = cp(o, h);
|
||
mp(n, ad, up, u, i, h)
|
||
}), trk: ap(function (t, e, i) {
|
||
var r = i[0], o = e.getProperties(), n = {node: t};
|
||
n.properties = o;
|
||
var s = e.getGeometry();
|
||
if (s.getType() == Zt.MULTI_LINE_STRING) {
|
||
var a = kc(s, !0, r);
|
||
o.trkseg = a.getLineStrings()
|
||
}
|
||
var l = i[i.length - 1].node, h = hd[l.namespaceURI], u = cp(o, h);
|
||
mp(n, ud, up, u, i, h)
|
||
}), wpt: ap(function (t, e, i) {
|
||
var r = i[0], o = i[i.length - 1];
|
||
o.properties = e.getProperties();
|
||
var n = e.getGeometry();
|
||
if (n.getType() == Zt.POINT) {
|
||
var s = kc(n, !0, r);
|
||
o.geometryLayout = s.getLayout(), Ed(t, s.getCoordinates(), i)
|
||
}
|
||
})
|
||
}), Jp = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = e || {};
|
||
this.dataProjection = We("EPSG:4326"), this.readExtensions_ = i.readExtensions
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleReadExtensions_ = function (t) {
|
||
t || (t = []);
|
||
for (var e = 0, i = t.length; e < i; ++e) {
|
||
var r = t[e];
|
||
if (this.readExtensions_) {
|
||
var o = r.get("extensionsNode_") || null;
|
||
this.readExtensions_(r, o)
|
||
}
|
||
r.set("extensionsNode_", void 0)
|
||
}
|
||
}, e.prototype.readFeatureFromNode = function (t, e) {
|
||
if (!K(Hp, t.namespaceURI)) return null;
|
||
var i = Xp[t.localName];
|
||
if (!i) return null;
|
||
var r = i(t, [this.getReadOptions(t, e)]);
|
||
return r ? (this.handleReadExtensions_([r]), r) : null
|
||
}, e.prototype.readFeaturesFromNode = function (t, e) {
|
||
if (!K(Hp, t.namespaceURI)) return [];
|
||
if ("gpx" == t.localName) {
|
||
var i = fp([], qp, t, [this.getReadOptions(t, e)]);
|
||
return i ? (this.handleReadExtensions_(i), i) : []
|
||
}
|
||
return []
|
||
}, e.prototype.writeFeaturesNode = function (t, e) {
|
||
e = this.adaptOptions(e);
|
||
var i = Kc("http://www.topografix.com/GPX/1/1", "gpx");
|
||
return i.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xsi", Zc), i.setAttributeNS(Zc, "xsi:schemaLocation", "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"), i.setAttribute("version", "1.1"), i.setAttribute("creator", "OpenLayers"), mp({node: i}, Kp, md, t, [e]), i
|
||
}, e
|
||
}(yp), $p = pp(Hp, {
|
||
name: sp(Lp),
|
||
cmt: sp(Lp),
|
||
desc: sp(Lp),
|
||
src: sp(Lp),
|
||
link: _d,
|
||
number: sp(Rp),
|
||
extensions: xd,
|
||
type: sp(Lp),
|
||
rtept: function (t, e) {
|
||
var i = fp({}, Qp, t, e);
|
||
if (i) {
|
||
var r = e[e.length - 1], o = r.flatCoordinates, n = r.layoutOptions;
|
||
yd(o, n, t, i)
|
||
}
|
||
}
|
||
}), Qp = pp(Hp, {ele: sp(Ep), time: sp(Sp)}), td = pp(Hp, {
|
||
name: sp(Lp),
|
||
cmt: sp(Lp),
|
||
desc: sp(Lp),
|
||
src: sp(Lp),
|
||
link: _d,
|
||
number: sp(Rp),
|
||
type: sp(Lp),
|
||
extensions: xd,
|
||
trkseg: function (t, e) {
|
||
var i = e[e.length - 1];
|
||
dp(ed, t, e);
|
||
var r = i.flatCoordinates;
|
||
i.ends.push(r.length)
|
||
}
|
||
}), ed = pp(Hp, {
|
||
trkpt: function (t, e) {
|
||
var i = fp({}, id, t, e);
|
||
if (i) {
|
||
var r = e[e.length - 1], o = r.flatCoordinates, n = r.layoutOptions;
|
||
yd(o, n, t, i)
|
||
}
|
||
}
|
||
}), id = pp(Hp, {ele: sp(Ep), time: sp(Sp)}), rd = pp(Hp, {
|
||
ele: sp(Ep),
|
||
time: sp(Sp),
|
||
magvar: sp(Ep),
|
||
geoidheight: sp(Ep),
|
||
name: sp(Lp),
|
||
cmt: sp(Lp),
|
||
desc: sp(Lp),
|
||
src: sp(Lp),
|
||
link: _d,
|
||
sym: sp(Lp),
|
||
type: sp(Lp),
|
||
fix: sp(Lp),
|
||
sat: sp(Rp),
|
||
hdop: sp(Ep),
|
||
vdop: sp(Ep),
|
||
pdop: sp(Ep),
|
||
ageofdgpsdata: sp(Ep),
|
||
dgpsid: sp(Rp),
|
||
extensions: xd
|
||
}), od = ["text", "type"], nd = pp(Hp, {text: ap(Fp), type: ap(Fp)}),
|
||
sd = pp(Hp, ["name", "cmt", "desc", "src", "link", "number", "type", "rtept"]), ad = pp(Hp, {
|
||
name: ap(Fp),
|
||
cmt: ap(Fp),
|
||
desc: ap(Fp),
|
||
src: ap(Fp),
|
||
link: ap(Sd),
|
||
number: ap(kp),
|
||
type: ap(Fp),
|
||
rtept: lp(ap(Ed))
|
||
}), ld = pp(Hp, ["ele", "time"]),
|
||
hd = pp(Hp, ["name", "cmt", "desc", "src", "link", "number", "type", "trkseg"]), ud = pp(Hp, {
|
||
name: ap(Fp),
|
||
cmt: ap(Fp),
|
||
desc: ap(Fp),
|
||
src: ap(Fp),
|
||
link: ap(Sd),
|
||
number: ap(kp),
|
||
type: ap(Fp),
|
||
trkseg: lp(ap(function (t, e, i) {
|
||
var r = {node: t};
|
||
r.geometryLayout = e.getLayout(), r.properties = {}, mp(r, pd, cd, e.getCoordinates(), i)
|
||
}))
|
||
}), cd = hp("trkpt"), pd = pp(Hp, {trkpt: ap(Ed)}),
|
||
dd = pp(Hp, ["ele", "time", "magvar", "geoidheight", "name", "cmt", "desc", "src", "link", "sym", "type", "fix", "sat", "hdop", "vdop", "pdop", "ageofdgpsdata", "dgpsid"]),
|
||
fd = pp(Hp, {
|
||
ele: ap(Ap),
|
||
time: ap(Mp),
|
||
magvar: ap(Ap),
|
||
geoidheight: ap(Ap),
|
||
name: ap(Fp),
|
||
cmt: ap(Fp),
|
||
desc: ap(Fp),
|
||
src: ap(Fp),
|
||
link: ap(Sd),
|
||
sym: ap(Fp),
|
||
type: ap(Fp),
|
||
fix: ap(Fp),
|
||
sat: ap(kp),
|
||
hdop: ap(Ap),
|
||
vdop: ap(Ap),
|
||
pdop: ap(Ap),
|
||
ageofdgpsdata: ap(Ap),
|
||
dgpsid: ap(kp)
|
||
}), gd = {Point: "wpt", LineString: "rte", MultiLineString: "trk"};
|
||
|
||
function md(t, e, i) {
|
||
var r = t.getGeometry();
|
||
if (r) {
|
||
var o = gd[r.getType()];
|
||
if (o) return Kc(e[e.length - 1].node.namespaceURI, o)
|
||
}
|
||
}
|
||
|
||
function yd(t, e, i, r) {
|
||
return t.push(parseFloat(i.getAttribute("lon")), parseFloat(i.getAttribute("lat"))), "ele" in r ? (t.push(r.ele), delete r.ele, e.hasZ = !0) : t.push(0), "time" in r ? (t.push(r.time), delete r.time, e.hasM = !0) : t.push(0), t
|
||
}
|
||
|
||
function vd(t, e, i) {
|
||
var r = qt.XY, o = 2;
|
||
if (t.hasZ && t.hasM ? (r = qt.XYZM, o = 4) : t.hasZ ? (r = qt.XYZ, o = 3) : t.hasM && (r = qt.XYM, o = 3), 4 !== o) {
|
||
for (var n = 0, s = e.length / 4; n < s; n++) e[n * o] = e[4 * n], e[n * o + 1] = e[4 * n + 1], t.hasZ && (e[n * o + 2] = e[4 * n + 2]), t.hasM && (e[n * o + 2] = e[4 * n + 3]);
|
||
if (e.length = e.length / 4 * o, i) for (var a = 0, l = i.length; a < l; a++) i[a] = i[a] / 4 * o
|
||
}
|
||
return r
|
||
}
|
||
|
||
function _d(t, e) {
|
||
var i = e[e.length - 1], r = t.getAttribute("href");
|
||
null !== r && (i.link = r), dp(Zp, t, e)
|
||
}
|
||
|
||
function xd(t, e) {
|
||
e[e.length - 1].extensionsNode_ = t
|
||
}
|
||
|
||
function wd(t, e) {
|
||
var i = e[0], r = fp({flatCoordinates: [], layoutOptions: {}}, $p, t, e);
|
||
if (r) {
|
||
var o = r.flatCoordinates;
|
||
delete r.flatCoordinates;
|
||
var n = r.layoutOptions;
|
||
delete r.layoutOptions;
|
||
var s = vd(n, o), a = new Jr(o, s);
|
||
kc(a, !1, i);
|
||
var l = new X(a);
|
||
return l.setProperties(r), l
|
||
}
|
||
}
|
||
|
||
function bd(t, e) {
|
||
var i = e[0], r = fp({flatCoordinates: [], ends: [], layoutOptions: {}}, td, t, e);
|
||
if (r) {
|
||
var o = r.flatCoordinates;
|
||
delete r.flatCoordinates;
|
||
var n = r.ends;
|
||
delete r.ends;
|
||
var s = r.layoutOptions;
|
||
delete r.layoutOptions;
|
||
var a = vd(s, o, n), l = new Dc(o, a, n);
|
||
kc(l, !1, i);
|
||
var h = new X(l);
|
||
return h.setProperties(r), h
|
||
}
|
||
}
|
||
|
||
function Cd(t, e) {
|
||
var i = e[0], r = fp({}, rd, t, e);
|
||
if (r) {
|
||
var o = {}, n = yd([], o, t, r), s = vd(o, n), a = new qi(n, s);
|
||
kc(a, !1, i);
|
||
var l = new X(a);
|
||
return l.setProperties(r), l
|
||
}
|
||
}
|
||
|
||
function Sd(t, e, i) {
|
||
t.setAttribute("href", e);
|
||
var r = i[i.length - 1].properties, o = [r.linkText, r.linkType];
|
||
mp({node: t}, nd, up, o, i, od)
|
||
}
|
||
|
||
function Ed(t, e, i) {
|
||
var r = i[i.length - 1], o = r.node.namespaceURI, n = r.properties;
|
||
switch (t.setAttributeNS(null, "lat", String(e[1])), t.setAttributeNS(null, "lon", String(e[0])), r.geometryLayout) {
|
||
case qt.XYZM:
|
||
0 !== e[3] && (n.time = e[3]);
|
||
case qt.XYZ:
|
||
0 !== e[2] && (n.ele = e[2]);
|
||
break;
|
||
case qt.XYM:
|
||
0 !== e[2] && (n.time = e[2])
|
||
}
|
||
var s = "rtept" == t.nodeName ? ld[o] : dd[o], a = cp(n, s);
|
||
mp({node: t, properties: n}, fd, up, a, i, s)
|
||
}
|
||
|
||
var Td = Jp;
|
||
|
||
function Rd(t) {
|
||
for (var e = [], i = 0, r = t.length; i < r; ++i) e.push(t[i].clone());
|
||
return e
|
||
}
|
||
|
||
var Pd = function (t) {
|
||
function e(e) {
|
||
t.call(this), this.geometries_ = e || null, this.listenGeometriesChange_()
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.unlistenGeometriesChange_ = function () {
|
||
if (this.geometries_) for (var t = 0, e = this.geometries_.length; t < e; ++t) C(this.geometries_[t], F.CHANGE, this.changed, this)
|
||
}, e.prototype.listenGeometriesChange_ = function () {
|
||
if (this.geometries_) for (var t = 0, e = this.geometries_.length; t < e; ++t) w(this.geometries_[t], F.CHANGE, this.changed, this)
|
||
}, e.prototype.clone = function () {
|
||
var t = new e(null);
|
||
return t.setGeometries(this.geometries_), t
|
||
}, e.prototype.closestPointXY = function (t, e, i, r) {
|
||
if (r < ct(this.getExtent(), t, e)) return r;
|
||
for (var o = this.geometries_, n = 0, s = o.length; n < s; ++n) r = o[n].closestPointXY(t, e, i, r);
|
||
return r
|
||
}, e.prototype.containsXY = function (t, e) {
|
||
for (var i = this.geometries_, r = 0, o = i.length; r < o; ++r) if (i[r].containsXY(t, e)) return !0;
|
||
return !1
|
||
}, e.prototype.computeExtent = function (t) {
|
||
vt(t);
|
||
for (var e = this.geometries_, i = 0, r = e.length; i < r; ++i) Ct(t, e[i].getExtent());
|
||
return t
|
||
}, e.prototype.getGeometries = function () {
|
||
return Rd(this.geometries_)
|
||
}, e.prototype.getGeometriesArray = function () {
|
||
return this.geometries_
|
||
}, e.prototype.getSimplifiedGeometry = function (t) {
|
||
if (this.simplifiedGeometryRevision != this.getRevision() && (d(this.simplifiedGeometryCache), this.simplifiedGeometryMaxMinSquaredTolerance = 0, this.simplifiedGeometryRevision = this.getRevision()), t < 0 || 0 !== this.simplifiedGeometryMaxMinSquaredTolerance && t < this.simplifiedGeometryMaxMinSquaredTolerance) return this;
|
||
var i = t.toString();
|
||
if (this.simplifiedGeometryCache.hasOwnProperty(i)) return this.simplifiedGeometryCache[i];
|
||
for (var r = [], o = this.geometries_, n = !1, s = 0, a = o.length; s < a; ++s) {
|
||
var l = o[s], h = l.getSimplifiedGeometry(t);
|
||
r.push(h), h !== l && (n = !0)
|
||
}
|
||
if (n) {
|
||
var u = new e(null);
|
||
return u.setGeometriesArray(r), this.simplifiedGeometryCache[i] = u, u
|
||
}
|
||
return this.simplifiedGeometryMaxMinSquaredTolerance = t, this
|
||
}, e.prototype.getType = function () {
|
||
return Zt.GEOMETRY_COLLECTION
|
||
}, e.prototype.intersectsExtent = function (t) {
|
||
for (var e = this.geometries_, i = 0, r = e.length; i < r; ++i) if (e[i].intersectsExtent(t)) return !0;
|
||
return !1
|
||
}, e.prototype.isEmpty = function () {
|
||
return 0 === this.geometries_.length
|
||
}, e.prototype.rotate = function (t, e) {
|
||
for (var i = this.geometries_, r = 0, o = i.length; r < o; ++r) i[r].rotate(t, e);
|
||
this.changed()
|
||
}, e.prototype.scale = function (t, e, i) {
|
||
var r = i;
|
||
r || (r = At(this.getExtent()));
|
||
for (var o = this.geometries_, n = 0, s = o.length; n < s; ++n) o[n].scale(t, e, r);
|
||
this.changed()
|
||
}, e.prototype.setGeometries = function (t) {
|
||
this.setGeometriesArray(Rd(t))
|
||
}, e.prototype.setGeometriesArray = function (t) {
|
||
this.unlistenGeometriesChange_(), this.geometries_ = t, this.listenGeometriesChange_(), this.changed()
|
||
}, e.prototype.applyTransform = function (t) {
|
||
for (var e = this.geometries_, i = 0, r = e.length; i < r; ++i) e[i].applyTransform(t);
|
||
this.changed()
|
||
}, e.prototype.translate = function (t, e) {
|
||
for (var i = this.geometries_, r = 0, o = i.length; r < o; ++r) i[r].translate(t, e);
|
||
this.changed()
|
||
}, e.prototype.disposeInternal = function () {
|
||
this.unlistenGeometriesChange_(), t.prototype.disposeInternal.call(this)
|
||
}, e
|
||
}(_i);
|
||
|
||
function Ld(t, e) {
|
||
if (!t) return null;
|
||
var i;
|
||
switch (t.type) {
|
||
case Zt.POINT:
|
||
i = function (t) {
|
||
return new qi(t.coordinates)
|
||
}(t);
|
||
break;
|
||
case Zt.LINE_STRING:
|
||
i = function (t) {
|
||
return new Jr(t.coordinates)
|
||
}(t);
|
||
break;
|
||
case Zt.POLYGON:
|
||
i = function (t) {
|
||
return new fr(t.coordinates)
|
||
}(t);
|
||
break;
|
||
case Zt.MULTI_POINT:
|
||
i = function (t) {
|
||
return new Gc(t.coordinates)
|
||
}(t);
|
||
break;
|
||
case Zt.MULTI_LINE_STRING:
|
||
i = function (t) {
|
||
return new Dc(t.coordinates)
|
||
}(t);
|
||
break;
|
||
case Zt.MULTI_POLYGON:
|
||
i = function (t) {
|
||
return new zc(t.coordinates)
|
||
}(t);
|
||
break;
|
||
case Zt.GEOMETRY_COLLECTION:
|
||
i = function (t, e) {
|
||
var i = t.geometries.map(function (t) {
|
||
return Ld(t, e)
|
||
});
|
||
return new Pd(i)
|
||
}(t);
|
||
break;
|
||
default:
|
||
throw new Error("Unsupported GeoJSON type: " + t.type)
|
||
}
|
||
return kc(i, !1, e)
|
||
}
|
||
|
||
function Id(t, e) {
|
||
var i, r = (t = kc(t, !0, e)).getType();
|
||
switch (r) {
|
||
case Zt.POINT:
|
||
i = function (t, e) {
|
||
return {type: "Point", coordinates: t.getCoordinates()}
|
||
}(t);
|
||
break;
|
||
case Zt.LINE_STRING:
|
||
i = function (t, e) {
|
||
return {type: "LineString", coordinates: t.getCoordinates()}
|
||
}(t);
|
||
break;
|
||
case Zt.POLYGON:
|
||
i = function (t, e) {
|
||
var i;
|
||
e && (i = e.rightHanded);
|
||
return {type: "Polygon", coordinates: t.getCoordinates(i)}
|
||
}(t, e);
|
||
break;
|
||
case Zt.MULTI_POINT:
|
||
i = function (t, e) {
|
||
return {type: "MultiPoint", coordinates: t.getCoordinates()}
|
||
}(t);
|
||
break;
|
||
case Zt.MULTI_LINE_STRING:
|
||
i = function (t, e) {
|
||
return {type: "MultiLineString", coordinates: t.getCoordinates()}
|
||
}(t);
|
||
break;
|
||
case Zt.MULTI_POLYGON:
|
||
i = function (t, e) {
|
||
var i;
|
||
e && (i = e.rightHanded);
|
||
return {type: "MultiPolygon", coordinates: t.getCoordinates(i)}
|
||
}(t, e);
|
||
break;
|
||
case Zt.GEOMETRY_COLLECTION:
|
||
i = function (t, e) {
|
||
return {
|
||
type: "GeometryCollection", geometries: t.getGeometriesArray().map(function (t) {
|
||
var i = p({}, e);
|
||
return delete i.featureProjection, Id(t, i)
|
||
})
|
||
}
|
||
}(t, e);
|
||
break;
|
||
case Zt.CIRCLE:
|
||
i = {type: "GeometryCollection", geometries: []};
|
||
break;
|
||
default:
|
||
throw new Error("Unsupported geometry type: " + r)
|
||
}
|
||
return i
|
||
}
|
||
|
||
var Od = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this), this.dataProjection = We(i.dataProjection ? i.dataProjection : "EPSG:4326"), i.featureProjection && (this.defaultFeatureProjection = We(i.featureProjection)), this.geometryName_ = i.geometryName, this.extractGeometryName_ = i.extractGeometryName
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.readFeatureFromObject = function (t, e) {
|
||
var i = null, r = Ld((i = "Feature" === t.type ? t : {
|
||
type: "Feature",
|
||
geometry: t,
|
||
properties: null
|
||
}).geometry, e), o = new X;
|
||
return this.geometryName_ ? o.setGeometryName(this.geometryName_) : this.extractGeometryName_ && "geometry_name" in i !== void 0 && o.setGeometryName(i.geometry_name), o.setGeometry(r), "id" in i && o.setId(i.id), i.properties && o.setProperties(i.properties), o
|
||
}, e.prototype.readFeaturesFromObject = function (t, e) {
|
||
var i = null;
|
||
if ("FeatureCollection" === t.type) {
|
||
i = [];
|
||
for (var r = t.features, o = 0, n = r.length; o < n; ++o) i.push(this.readFeatureFromObject(r[o], e))
|
||
} else i = [this.readFeatureFromObject(t, e)];
|
||
return i
|
||
}, e.prototype.readGeometryFromObject = function (t, e) {
|
||
return Ld(t, e)
|
||
}, e.prototype.readProjectionFromObject = function (t) {
|
||
var e, i = t.crs;
|
||
return i ? "name" == i.type ? e = We(i.properties.name) : W(!1, 36) : e = this.dataProjection, e
|
||
}, e.prototype.writeFeatureObject = function (t, e) {
|
||
e = this.adaptOptions(e);
|
||
var i = {type: "Feature", geometry: null, properties: null}, r = t.getId();
|
||
void 0 !== r && (i.id = r);
|
||
var o = t.getGeometry();
|
||
o && (i.geometry = Id(o, e));
|
||
var n = t.getProperties();
|
||
return delete n[t.getGeometryName()], g(n) || (i.properties = n), i
|
||
}, e.prototype.writeFeaturesObject = function (t, e) {
|
||
e = this.adaptOptions(e);
|
||
for (var i = [], r = 0, o = t.length; r < o; ++r) i.push(this.writeFeatureObject(t[r], e));
|
||
return {type: "FeatureCollection", features: i}
|
||
}, e.prototype.writeGeometryObject = function (t, e) {
|
||
return Id(t, this.adaptOptions(e))
|
||
}, e
|
||
}(Nc);
|
||
|
||
function Md(t) {
|
||
return "string" == typeof t ? t : ""
|
||
}
|
||
|
||
var Ad = function (t) {
|
||
function e() {
|
||
t.call(this)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getType = function () {
|
||
return gh.TEXT
|
||
}, e.prototype.readFeature = function (t, e) {
|
||
return this.readFeatureFromText(Md(t), this.adaptOptions(e))
|
||
}, e.prototype.readFeatureFromText = function (t, e) {
|
||
return n()
|
||
}, e.prototype.readFeatures = function (t, e) {
|
||
return this.readFeaturesFromText(Md(t), this.adaptOptions(e))
|
||
}, e.prototype.readFeaturesFromText = function (t, e) {
|
||
return n()
|
||
}, e.prototype.readGeometry = function (t, e) {
|
||
return this.readGeometryFromText(Md(t), this.adaptOptions(e))
|
||
}, e.prototype.readGeometryFromText = function (t, e) {
|
||
return n()
|
||
}, e.prototype.readProjection = function (t) {
|
||
return this.readProjectionFromText(Md(t))
|
||
}, e.prototype.readProjectionFromText = function (t) {
|
||
return this.dataProjection
|
||
}, e.prototype.writeFeature = function (t, e) {
|
||
return this.writeFeatureText(t, this.adaptOptions(e))
|
||
}, e.prototype.writeFeatureText = function (t, e) {
|
||
return n()
|
||
}, e.prototype.writeFeatures = function (t, e) {
|
||
return this.writeFeaturesText(t, this.adaptOptions(e))
|
||
}, e.prototype.writeFeaturesText = function (t, e) {
|
||
return n()
|
||
}, e.prototype.writeGeometry = function (t, e) {
|
||
return this.writeGeometryText(t, this.adaptOptions(e))
|
||
}, e.prototype.writeGeometryText = function (t, e) {
|
||
return n()
|
||
}, e
|
||
}(Ac), kd = {BAROMETRIC: "barometric", GPS: "gps", NONE: "none"},
|
||
Fd = /^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,
|
||
Nd = /^H.([A-Z]{3}).*?:(.*)/, Dd = /^HFDTE(\d{2})(\d{2})(\d{2})/, Gd = /\r\n|\r|\n/, jd = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = e || {};
|
||
this.dataProjection = We("EPSG:4326"), this.altitudeMode_ = i.altitudeMode ? i.altitudeMode : kd.NONE
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.readFeatureFromText = function (t, e) {
|
||
var i, r, o = this.altitudeMode_, n = t.split(Gd), s = {}, a = [], l = 2e3, h = 0, u = 1, c = -1;
|
||
for (i = 0, r = n.length; i < r; ++i) {
|
||
var p = n[i], d = void 0;
|
||
if ("B" == p.charAt(0)) {
|
||
if (d = Fd.exec(p)) {
|
||
var f = parseInt(d[1], 10), g = parseInt(d[2], 10), m = parseInt(d[3], 10),
|
||
y = parseInt(d[4], 10) + parseInt(d[5], 10) / 6e4;
|
||
"S" == d[6] && (y = -y);
|
||
var v = parseInt(d[7], 10) + parseInt(d[8], 10) / 6e4;
|
||
if ("W" == d[9] && (v = -v), a.push(v, y), o != kd.NONE) {
|
||
var _ = void 0;
|
||
_ = o == kd.GPS ? parseInt(d[11], 10) : o == kd.BAROMETRIC ? parseInt(d[12], 10) : 0, a.push(_)
|
||
}
|
||
var x = Date.UTC(l, h, u, f, g, m);
|
||
x < c && (x = Date.UTC(l, h, u + 1, f, g, m)), a.push(x / 1e3), c = x
|
||
}
|
||
} else "H" == p.charAt(0) && ((d = Dd.exec(p)) ? (u = parseInt(d[1], 10), h = parseInt(d[2], 10) - 1, l = 2e3 + parseInt(d[3], 10)) : (d = Nd.exec(p)) && (s[d[1]] = d[2].trim()))
|
||
}
|
||
if (0 === a.length) return null;
|
||
var w = o == kd.NONE ? qt.XYM : qt.XYZM, b = new Jr(a, w), C = new X(kc(b, !1, e));
|
||
return C.setProperties(s), C
|
||
}, e.prototype.readFeaturesFromText = function (t, e) {
|
||
var i = this.readFeatureFromText(t, e);
|
||
return i ? [i] : []
|
||
}, e
|
||
}(Ad), zd = {FRACTION: "fraction", PIXELS: "pixels"}, Ud = function (t) {
|
||
function e(e, i, r, o, n, s) {
|
||
t.call(this), this.hitDetectionImage_ = null, this.image_ = e || new Image, null !== o && (this.image_.crossOrigin = o), this.canvas_ = s ? document.createElement("canvas") : null, this.color_ = s, this.imageListenerKeys_ = null, this.imageState_ = n, this.size_ = r, this.src_ = i, this.tainted_
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.isTainted_ = function () {
|
||
if (void 0 === this.tainted_ && this.imageState_ === So.LOADED) {
|
||
this.tainted_ = !1;
|
||
var t = Ao(1, 1);
|
||
try {
|
||
t.drawImage(this.image_, 0, 0), t.getImageData(0, 0, 1, 1)
|
||
} catch (t) {
|
||
this.tainted_ = !0
|
||
}
|
||
}
|
||
return !0 === this.tainted_
|
||
}, e.prototype.dispatchChangeEvent_ = function () {
|
||
this.dispatchEvent(F.CHANGE)
|
||
}, e.prototype.handleImageError_ = function () {
|
||
this.imageState_ = So.ERROR, this.unlistenImage_(), this.dispatchChangeEvent_()
|
||
}, e.prototype.handleImageLoad_ = function () {
|
||
this.imageState_ = So.LOADED, this.size_ && (this.image_.width = this.size_[0], this.image_.height = this.size_[1]), this.size_ = [this.image_.width, this.image_.height], this.unlistenImage_(), this.replaceColor_(), this.dispatchChangeEvent_()
|
||
}, e.prototype.getImage = function (t) {
|
||
return this.canvas_ ? this.canvas_ : this.image_
|
||
}, e.prototype.getImageState = function () {
|
||
return this.imageState_
|
||
}, e.prototype.getHitDetectionImage = function (t) {
|
||
if (!this.hitDetectionImage_) if (this.isTainted_()) {
|
||
var e = this.size_[0], i = this.size_[1], r = Ao(e, i);
|
||
r.fillRect(0, 0, e, i), this.hitDetectionImage_ = r.canvas
|
||
} else this.hitDetectionImage_ = this.image_;
|
||
return this.hitDetectionImage_
|
||
}, e.prototype.getSize = function () {
|
||
return this.size_
|
||
}, e.prototype.getSrc = function () {
|
||
return this.src_
|
||
}, e.prototype.load = function () {
|
||
if (this.imageState_ == So.IDLE) {
|
||
this.imageState_ = So.LOADING, this.imageListenerKeys_ = [b(this.image_, F.ERROR, this.handleImageError_, this), b(this.image_, F.LOAD, this.handleImageLoad_, this)];
|
||
try {
|
||
this.image_.src = this.src_
|
||
} catch (t) {
|
||
this.handleImageError_()
|
||
}
|
||
}
|
||
}, e.prototype.replaceColor_ = function () {
|
||
if (this.color_ && !this.isTainted_()) {
|
||
this.canvas_.width = this.image_.width, this.canvas_.height = this.image_.height;
|
||
var t = this.canvas_.getContext("2d");
|
||
t.drawImage(this.image_, 0, 0);
|
||
for (var e = t.getImageData(0, 0, this.image_.width, this.image_.height), i = e.data, r = this.color_[0] / 255, o = this.color_[1] / 255, n = this.color_[2] / 255, s = 0, a = i.length; s < a; s += 4) i[s] *= r, i[s + 1] *= o, i[s + 2] *= n;
|
||
t.putImageData(e, 0, 0)
|
||
}
|
||
}, e.prototype.unlistenImage_ = function () {
|
||
this.imageListenerKeys_.forEach(S), this.imageListenerKeys_ = null
|
||
}, e
|
||
}(k);
|
||
|
||
function Bd(t, e, i, r, o, n) {
|
||
var s = $a.get(e, r, n);
|
||
return s || (s = new Ud(t, e, i, r, o, n), $a.set(e, r, n, s)), s
|
||
}
|
||
|
||
var Vd = Ud, Yd = {
|
||
BOTTOM_LEFT: "bottom-left",
|
||
BOTTOM_RIGHT: "bottom-right",
|
||
TOP_LEFT: "top-left",
|
||
TOP_RIGHT: "top-right"
|
||
}, Wd = function (t) {
|
||
this.opacity_ = t.opacity, this.rotateWithView_ = t.rotateWithView, this.rotation_ = t.rotation, this.scale_ = t.scale
|
||
};
|
||
Wd.prototype.clone = function () {
|
||
return new Wd({
|
||
opacity: this.getOpacity(),
|
||
scale: this.getScale(),
|
||
rotation: this.getRotation(),
|
||
rotateWithView: this.getRotateWithView()
|
||
})
|
||
}, Wd.prototype.getOpacity = function () {
|
||
return this.opacity_
|
||
}, Wd.prototype.getRotateWithView = function () {
|
||
return this.rotateWithView_
|
||
}, Wd.prototype.getRotation = function () {
|
||
return this.rotation_
|
||
}, Wd.prototype.getScale = function () {
|
||
return this.scale_
|
||
}, Wd.prototype.getSnapToPixel = function () {
|
||
return !1
|
||
}, Wd.prototype.getAnchor = function () {
|
||
return n()
|
||
}, Wd.prototype.getImage = function (t) {
|
||
return n()
|
||
}, Wd.prototype.getHitDetectionImage = function (t) {
|
||
return n()
|
||
}, Wd.prototype.getImageState = function () {
|
||
return n()
|
||
}, Wd.prototype.getImageSize = function () {
|
||
return n()
|
||
}, Wd.prototype.getHitDetectionImageSize = function () {
|
||
return n()
|
||
}, Wd.prototype.getOrigin = function () {
|
||
return n()
|
||
}, Wd.prototype.getSize = function () {
|
||
return n()
|
||
}, Wd.prototype.setOpacity = function (t) {
|
||
this.opacity_ = t
|
||
}, Wd.prototype.setRotateWithView = function (t) {
|
||
this.rotateWithView_ = t
|
||
}, Wd.prototype.setRotation = function (t) {
|
||
this.rotation_ = t
|
||
}, Wd.prototype.setScale = function (t) {
|
||
this.scale_ = t
|
||
}, Wd.prototype.setSnapToPixel = function (t) {
|
||
}, Wd.prototype.listenImageChange = function (t, e) {
|
||
return n()
|
||
}, Wd.prototype.load = function () {
|
||
n()
|
||
}, Wd.prototype.unlistenImageChange = function (t, e) {
|
||
n()
|
||
};
|
||
var Hd = Wd, Xd = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = void 0 !== i.opacity ? i.opacity : 1, o = void 0 !== i.rotation ? i.rotation : 0,
|
||
n = void 0 !== i.scale ? i.scale : 1, s = void 0 !== i.rotateWithView && i.rotateWithView;
|
||
t.call(this, {
|
||
opacity: r,
|
||
rotation: o,
|
||
scale: n,
|
||
rotateWithView: s
|
||
}), this.anchor_ = void 0 !== i.anchor ? i.anchor : [.5, .5], this.normalizedAnchor_ = null, this.anchorOrigin_ = void 0 !== i.anchorOrigin ? i.anchorOrigin : Yd.TOP_LEFT, this.anchorXUnits_ = void 0 !== i.anchorXUnits ? i.anchorXUnits : zd.FRACTION, this.anchorYUnits_ = void 0 !== i.anchorYUnits ? i.anchorYUnits : zd.FRACTION, this.crossOrigin_ = void 0 !== i.crossOrigin ? i.crossOrigin : null;
|
||
var l = void 0 !== i.img ? i.img : null, h = void 0 !== i.imgSize ? i.imgSize : null, u = i.src;
|
||
W(!(void 0 !== u && l), 4), W(!l || l && h, 5), void 0 !== u && 0 !== u.length || !l || (u = l.src || a(l)), W(void 0 !== u && u.length > 0, 6);
|
||
var c = void 0 !== i.src ? So.IDLE : So.LOADED;
|
||
this.color_ = void 0 !== i.color ? lo(i.color) : null, this.iconImage_ = Bd(l, u, h, this.crossOrigin_, c, this.color_), this.offset_ = void 0 !== i.offset ? i.offset : [0, 0], this.offsetOrigin_ = void 0 !== i.offsetOrigin ? i.offsetOrigin : Yd.TOP_LEFT, this.origin_ = null, this.size_ = void 0 !== i.size ? i.size : null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.clone = function () {
|
||
return new e({
|
||
anchor: this.anchor_.slice(),
|
||
anchorOrigin: this.anchorOrigin_,
|
||
anchorXUnits: this.anchorXUnits_,
|
||
anchorYUnits: this.anchorYUnits_,
|
||
crossOrigin: this.crossOrigin_,
|
||
color: this.color_ && this.color_.slice ? this.color_.slice() : this.color_ || void 0,
|
||
src: this.getSrc(),
|
||
offset: this.offset_.slice(),
|
||
offsetOrigin: this.offsetOrigin_,
|
||
size: null !== this.size_ ? this.size_.slice() : void 0,
|
||
opacity: this.getOpacity(),
|
||
scale: this.getScale(),
|
||
rotation: this.getRotation(),
|
||
rotateWithView: this.getRotateWithView()
|
||
})
|
||
}, e.prototype.getAnchor = function () {
|
||
if (this.normalizedAnchor_) return this.normalizedAnchor_;
|
||
var t = this.anchor_, e = this.getSize();
|
||
if (this.anchorXUnits_ == zd.FRACTION || this.anchorYUnits_ == zd.FRACTION) {
|
||
if (!e) return null;
|
||
t = this.anchor_.slice(), this.anchorXUnits_ == zd.FRACTION && (t[0] *= e[0]), this.anchorYUnits_ == zd.FRACTION && (t[1] *= e[1])
|
||
}
|
||
if (this.anchorOrigin_ != Yd.TOP_LEFT) {
|
||
if (!e) return null;
|
||
t === this.anchor_ && (t = this.anchor_.slice()), this.anchorOrigin_ != Yd.TOP_RIGHT && this.anchorOrigin_ != Yd.BOTTOM_RIGHT || (t[0] = -t[0] + e[0]), this.anchorOrigin_ != Yd.BOTTOM_LEFT && this.anchorOrigin_ != Yd.BOTTOM_RIGHT || (t[1] = -t[1] + e[1])
|
||
}
|
||
return this.normalizedAnchor_ = t, this.normalizedAnchor_
|
||
}, e.prototype.setAnchor = function (t) {
|
||
this.anchor_ = t, this.normalizedAnchor_ = null
|
||
}, e.prototype.getColor = function () {
|
||
return this.color_
|
||
}, e.prototype.getImage = function (t) {
|
||
return this.iconImage_.getImage(t)
|
||
}, e.prototype.getImageSize = function () {
|
||
return this.iconImage_.getSize()
|
||
}, e.prototype.getHitDetectionImageSize = function () {
|
||
return this.getImageSize()
|
||
}, e.prototype.getImageState = function () {
|
||
return this.iconImage_.getImageState()
|
||
}, e.prototype.getHitDetectionImage = function (t) {
|
||
return this.iconImage_.getHitDetectionImage(t)
|
||
}, e.prototype.getOrigin = function () {
|
||
if (this.origin_) return this.origin_;
|
||
var t = this.offset_;
|
||
if (this.offsetOrigin_ != Yd.TOP_LEFT) {
|
||
var e = this.getSize(), i = this.iconImage_.getSize();
|
||
if (!e || !i) return null;
|
||
t = t.slice(), this.offsetOrigin_ != Yd.TOP_RIGHT && this.offsetOrigin_ != Yd.BOTTOM_RIGHT || (t[0] = i[0] - e[0] - t[0]), this.offsetOrigin_ != Yd.BOTTOM_LEFT && this.offsetOrigin_ != Yd.BOTTOM_RIGHT || (t[1] = i[1] - e[1] - t[1])
|
||
}
|
||
return this.origin_ = t, this.origin_
|
||
}, e.prototype.getSrc = function () {
|
||
return this.iconImage_.getSrc()
|
||
}, e.prototype.getSize = function () {
|
||
return this.size_ ? this.size_ : this.iconImage_.getSize()
|
||
}, e.prototype.listenImageChange = function (t, e) {
|
||
return w(this.iconImage_, F.CHANGE, t, e)
|
||
}, e.prototype.load = function () {
|
||
this.iconImage_.load()
|
||
}, e.prototype.unlistenImageChange = function (t, e) {
|
||
C(this.iconImage_, F.CHANGE, t, e)
|
||
}, e
|
||
}(Hd), qd = function (t) {
|
||
function e(e) {
|
||
var i = void 0 !== e.rotateWithView && e.rotateWithView;
|
||
t.call(this, {
|
||
opacity: 1,
|
||
rotateWithView: i,
|
||
rotation: void 0 !== e.rotation ? e.rotation : 0,
|
||
scale: 1
|
||
}), this.checksums_ = null, this.canvas_ = null, this.hitDetectionCanvas_ = null, this.fill_ = void 0 !== e.fill ? e.fill : null, this.origin_ = [0, 0], this.points_ = e.points, this.radius_ = void 0 !== e.radius ? e.radius : e.radius1, this.radius2_ = e.radius2, this.angle_ = void 0 !== e.angle ? e.angle : 0, this.stroke_ = void 0 !== e.stroke ? e.stroke : null, this.anchor_ = null, this.size_ = null, this.imageSize_ = null, this.hitDetectionImageSize_ = null, this.atlasManager_ = e.atlasManager, this.render_(this.atlasManager_)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.clone = function () {
|
||
var t = new e({
|
||
fill: this.getFill() ? this.getFill().clone() : void 0,
|
||
points: this.getPoints(),
|
||
radius: this.getRadius(),
|
||
radius2: this.getRadius2(),
|
||
angle: this.getAngle(),
|
||
stroke: this.getStroke() ? this.getStroke().clone() : void 0,
|
||
rotation: this.getRotation(),
|
||
rotateWithView: this.getRotateWithView(),
|
||
atlasManager: this.atlasManager_
|
||
});
|
||
return t.setOpacity(this.getOpacity()), t.setScale(this.getScale()), t
|
||
}, e.prototype.getAnchor = function () {
|
||
return this.anchor_
|
||
}, e.prototype.getAngle = function () {
|
||
return this.angle_
|
||
}, e.prototype.getFill = function () {
|
||
return this.fill_
|
||
}, e.prototype.getHitDetectionImage = function (t) {
|
||
return this.hitDetectionCanvas_
|
||
}, e.prototype.getImage = function (t) {
|
||
return this.canvas_
|
||
}, e.prototype.getImageSize = function () {
|
||
return this.imageSize_
|
||
}, e.prototype.getHitDetectionImageSize = function () {
|
||
return this.hitDetectionImageSize_
|
||
}, e.prototype.getImageState = function () {
|
||
return So.LOADED
|
||
}, e.prototype.getOrigin = function () {
|
||
return this.origin_
|
||
}, e.prototype.getPoints = function () {
|
||
return this.points_
|
||
}, e.prototype.getRadius = function () {
|
||
return this.radius_
|
||
}, e.prototype.getRadius2 = function () {
|
||
return this.radius2_
|
||
}, e.prototype.getSize = function () {
|
||
return this.size_
|
||
}, e.prototype.getStroke = function () {
|
||
return this.stroke_
|
||
}, e.prototype.listenImageChange = function (t, e) {
|
||
}, e.prototype.load = function () {
|
||
}, e.prototype.unlistenImageChange = function (t, e) {
|
||
}, e.prototype.render_ = function (t) {
|
||
var e, i, r = "", o = "", n = 0, s = null, a = 0, l = 0;
|
||
this.stroke_ && (null === (i = this.stroke_.getColor()) && (i = Ia), i = Wa(i), void 0 === (l = this.stroke_.getWidth()) && (l = 1), s = this.stroke_.getLineDash(), a = this.stroke_.getLineDashOffset(), Er || (s = null, a = 0), void 0 === (o = this.stroke_.getLineJoin()) && (o = "round"), void 0 === (r = this.stroke_.getLineCap()) && (r = "round"), void 0 === (n = this.stroke_.getMiterLimit()) && (n = 10));
|
||
var h = 2 * (this.radius_ + l) + 1, u = {
|
||
strokeStyle: i,
|
||
strokeWidth: l,
|
||
size: h,
|
||
lineCap: r,
|
||
lineDash: s,
|
||
lineDashOffset: a,
|
||
lineJoin: o,
|
||
miterLimit: n
|
||
};
|
||
if (void 0 === t) {
|
||
var c = Ao(h, h);
|
||
this.canvas_ = c.canvas, e = h = this.canvas_.width, this.draw_(u, c, 0, 0), this.createHitDetectionCanvas_(u)
|
||
} else {
|
||
h = Math.round(h);
|
||
var p, d = !this.fill_;
|
||
d && (p = this.drawHitDetectionCanvas_.bind(this, u));
|
||
var f = this.getChecksum(), g = t.add(f, h, h, this.draw_.bind(this, u), p);
|
||
this.canvas_ = g.image, this.origin_ = [g.offsetX, g.offsetY], e = g.image.width, d ? (this.hitDetectionCanvas_ = g.hitImage, this.hitDetectionImageSize_ = [g.hitImage.width, g.hitImage.height]) : (this.hitDetectionCanvas_ = this.canvas_, this.hitDetectionImageSize_ = [e, e])
|
||
}
|
||
this.anchor_ = [h / 2, h / 2], this.size_ = [h, h], this.imageSize_ = [e, e]
|
||
}, e.prototype.draw_ = function (t, e, i, r) {
|
||
var o, n, s;
|
||
e.setTransform(1, 0, 0, 1, 0, 0), e.translate(i, r), e.beginPath();
|
||
var a = this.points_;
|
||
if (a === 1 / 0) e.arc(t.size / 2, t.size / 2, this.radius_, 0, 2 * Math.PI, !0); else {
|
||
var l = void 0 !== this.radius2_ ? this.radius2_ : this.radius_;
|
||
for (l !== this.radius_ && (a *= 2), o = 0; o <= a; o++) n = 2 * o * Math.PI / a - Math.PI / 2 + this.angle_, s = o % 2 == 0 ? this.radius_ : l, e.lineTo(t.size / 2 + s * Math.cos(n), t.size / 2 + s * Math.sin(n))
|
||
}
|
||
if (this.fill_) {
|
||
var h = this.fill_.getColor();
|
||
null === h && (h = Pa), e.fillStyle = Wa(h), e.fill()
|
||
}
|
||
this.stroke_ && (e.strokeStyle = t.strokeStyle, e.lineWidth = t.strokeWidth, t.lineDash && (e.setLineDash(t.lineDash), e.lineDashOffset = t.lineDashOffset), e.lineCap = t.lineCap, e.lineJoin = t.lineJoin, e.miterLimit = t.miterLimit, e.stroke()), e.closePath()
|
||
}, e.prototype.createHitDetectionCanvas_ = function (t) {
|
||
if (this.hitDetectionImageSize_ = [t.size, t.size], this.fill_) this.hitDetectionCanvas_ = this.canvas_; else {
|
||
var e = Ao(t.size, t.size);
|
||
this.hitDetectionCanvas_ = e.canvas, this.drawHitDetectionCanvas_(t, e, 0, 0)
|
||
}
|
||
}, e.prototype.drawHitDetectionCanvas_ = function (t, e, i, r) {
|
||
e.setTransform(1, 0, 0, 1, 0, 0), e.translate(i, r), e.beginPath();
|
||
var o = this.points_;
|
||
if (o === 1 / 0) e.arc(t.size / 2, t.size / 2, this.radius_, 0, 2 * Math.PI, !0); else {
|
||
var n, s, a, l = void 0 !== this.radius2_ ? this.radius2_ : this.radius_;
|
||
for (l !== this.radius_ && (o *= 2), n = 0; n <= o; n++) a = 2 * n * Math.PI / o - Math.PI / 2 + this.angle_, s = n % 2 == 0 ? this.radius_ : l, e.lineTo(t.size / 2 + s * Math.cos(a), t.size / 2 + s * Math.sin(a))
|
||
}
|
||
e.fillStyle = oo(Pa), e.fill(), this.stroke_ && (e.strokeStyle = t.strokeStyle, e.lineWidth = t.strokeWidth, t.lineDash && (e.setLineDash(t.lineDash), e.lineDashOffset = t.lineDashOffset), e.stroke()), e.closePath()
|
||
}, e.prototype.getChecksum = function () {
|
||
var t = this.stroke_ ? this.stroke_.getChecksum() : "-",
|
||
e = this.fill_ ? this.fill_.getChecksum() : "-";
|
||
if (!this.checksums_ || t != this.checksums_[1] || e != this.checksums_[2] || this.radius_ != this.checksums_[3] || this.radius2_ != this.checksums_[4] || this.angle_ != this.checksums_[5] || this.points_ != this.checksums_[6]) {
|
||
var i = "r" + t + e + (void 0 !== this.radius_ ? this.radius_.toString() : "-") + (void 0 !== this.radius2_ ? this.radius2_.toString() : "-") + (void 0 !== this.angle_ ? this.angle_.toString() : "-") + (void 0 !== this.points_ ? this.points_.toString() : "-");
|
||
this.checksums_ = [i, t, e, this.radius_, this.radius2_, this.angle_, this.points_]
|
||
}
|
||
return this.checksums_[0]
|
||
}, e
|
||
}(Hd), Zd = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {
|
||
points: 1 / 0,
|
||
fill: i.fill,
|
||
radius: i.radius,
|
||
stroke: i.stroke,
|
||
atlasManager: i.atlasManager
|
||
})
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.clone = function () {
|
||
var t = new e({
|
||
fill: this.getFill() ? this.getFill().clone() : void 0,
|
||
stroke: this.getStroke() ? this.getStroke().clone() : void 0,
|
||
radius: this.getRadius(),
|
||
atlasManager: this.atlasManager_
|
||
});
|
||
return t.setOpacity(this.getOpacity()), t.setScale(this.getScale()), t
|
||
}, e.prototype.setRadius = function (t) {
|
||
this.radius_ = t, this.render_(this.atlasManager_)
|
||
}, e
|
||
}(qd), Kd = function (t) {
|
||
var e = t || {};
|
||
this.geometry_ = null, this.geometryFunction_ = ef, void 0 !== e.geometry && this.setGeometry(e.geometry), this.fill_ = void 0 !== e.fill ? e.fill : null, this.image_ = void 0 !== e.image ? e.image : null, this.renderer_ = void 0 !== e.renderer ? e.renderer : null, this.stroke_ = void 0 !== e.stroke ? e.stroke : null, this.text_ = void 0 !== e.text ? e.text : null, this.zIndex_ = e.zIndex
|
||
};
|
||
|
||
function Jd(t) {
|
||
var e;
|
||
if ("function" == typeof t) e = t; else {
|
||
var i;
|
||
if (Array.isArray(t)) i = t; else W("function" == typeof t.getZIndex, 41), i = [t];
|
||
e = function () {
|
||
return i
|
||
}
|
||
}
|
||
return e
|
||
}
|
||
|
||
Kd.prototype.clone = function () {
|
||
var t = this.getGeometry();
|
||
return t && "object" == typeof t && (t = t.clone()), new Kd({
|
||
geometry: t,
|
||
fill: this.getFill() ? this.getFill().clone() : void 0,
|
||
image: this.getImage() ? this.getImage().clone() : void 0,
|
||
stroke: this.getStroke() ? this.getStroke().clone() : void 0,
|
||
text: this.getText() ? this.getText().clone() : void 0,
|
||
zIndex: this.getZIndex()
|
||
})
|
||
}, Kd.prototype.getRenderer = function () {
|
||
return this.renderer_
|
||
}, Kd.prototype.setRenderer = function (t) {
|
||
this.renderer_ = t
|
||
}, Kd.prototype.getGeometry = function () {
|
||
return this.geometry_
|
||
}, Kd.prototype.getGeometryFunction = function () {
|
||
return this.geometryFunction_
|
||
}, Kd.prototype.getFill = function () {
|
||
return this.fill_
|
||
}, Kd.prototype.setFill = function (t) {
|
||
this.fill_ = t
|
||
}, Kd.prototype.getImage = function () {
|
||
return this.image_
|
||
}, Kd.prototype.setImage = function (t) {
|
||
this.image_ = t
|
||
}, Kd.prototype.getStroke = function () {
|
||
return this.stroke_
|
||
}, Kd.prototype.setStroke = function (t) {
|
||
this.stroke_ = t
|
||
}, Kd.prototype.getText = function () {
|
||
return this.text_
|
||
}, Kd.prototype.setText = function (t) {
|
||
this.text_ = t
|
||
}, Kd.prototype.getZIndex = function () {
|
||
return this.zIndex_
|
||
}, Kd.prototype.setGeometry = function (t) {
|
||
"function" == typeof t ? this.geometryFunction_ = t : "string" == typeof t ? this.geometryFunction_ = function (e) {
|
||
return e.get(t)
|
||
} : t ? void 0 !== t && (this.geometryFunction_ = function () {
|
||
return t
|
||
}) : this.geometryFunction_ = ef, this.geometry_ = t
|
||
}, Kd.prototype.setZIndex = function (t) {
|
||
this.zIndex_ = t
|
||
};
|
||
var $d = null;
|
||
|
||
function Qd(t, e) {
|
||
if (!$d) {
|
||
var i = new po({color: "rgba(255,255,255,0.4)"}), r = new go({color: "#3399CC", width: 1.25});
|
||
$d = [new Kd({image: new Zd({fill: i, stroke: r, radius: 5}), fill: i, stroke: r})]
|
||
}
|
||
return $d
|
||
}
|
||
|
||
function tf() {
|
||
var t = {}, e = [255, 255, 255, 1], i = [0, 153, 255, 1];
|
||
return t[Zt.POLYGON] = [new Kd({fill: new po({color: [255, 255, 255, .5]})})], t[Zt.MULTI_POLYGON] = t[Zt.POLYGON], t[Zt.LINE_STRING] = [new Kd({
|
||
stroke: new go({
|
||
color: e,
|
||
width: 5
|
||
})
|
||
}), new Kd({
|
||
stroke: new go({
|
||
color: i,
|
||
width: 3
|
||
})
|
||
})], t[Zt.MULTI_LINE_STRING] = t[Zt.LINE_STRING], t[Zt.CIRCLE] = t[Zt.POLYGON].concat(t[Zt.LINE_STRING]), t[Zt.POINT] = [new Kd({
|
||
image: new Zd({
|
||
radius: 6,
|
||
fill: new po({color: i}),
|
||
stroke: new go({color: e, width: 1.5})
|
||
}), zIndex: 1 / 0
|
||
})], t[Zt.MULTI_POINT] = t[Zt.POINT], t[Zt.GEOMETRY_COLLECTION] = t[Zt.POLYGON].concat(t[Zt.LINE_STRING], t[Zt.POINT]), t
|
||
}
|
||
|
||
function ef(t) {
|
||
return t.getGeometry()
|
||
}
|
||
|
||
var rf, of, nf, sf, af, lf, hf, uf = Kd, cf = ["http://www.google.com/kml/ext/2.2"],
|
||
pf = [null, "http://earth.google.com/kml/2.0", "http://earth.google.com/kml/2.1", "http://earth.google.com/kml/2.2", "http://www.opengis.net/kml/2.2"],
|
||
df = {fraction: zd.FRACTION, pixels: zd.PIXELS, insetPixels: zd.PIXELS}, ff = pp(pf, {
|
||
ExtendedData: ag,
|
||
Region: lg,
|
||
MultiGeometry: sp($f, "geometry"),
|
||
LineString: sp(Zf, "geometry"),
|
||
LinearRing: sp(Kf, "geometry"),
|
||
Point: sp(Qf, "geometry"),
|
||
Polygon: sp(eg, "geometry"),
|
||
Style: sp(rg),
|
||
StyleMap: function (t, e) {
|
||
var i = Ff(t, e);
|
||
if (!i) return;
|
||
var r = e[e.length - 1];
|
||
Array.isArray(i) ? r.Style = i : "string" == typeof i ? r.styleUrl = i : W(!1, 38)
|
||
},
|
||
address: sp(Lp),
|
||
description: sp(Lp),
|
||
name: sp(Lp),
|
||
open: sp(bp),
|
||
phoneNumber: sp(Lp),
|
||
styleUrl: sp(Mf),
|
||
visibility: sp(bp)
|
||
}, pp(cf, {
|
||
MultiTrack: sp(function (t, e) {
|
||
var i = fp([], Bf, t, e);
|
||
if (!i) return;
|
||
return new Dc(i)
|
||
}, "geometry"), Track: sp(Yf, "geometry")
|
||
})), gf = pp(pf, {
|
||
ExtendedData: ag, Region: lg, Link: function (t, e) {
|
||
dp(mf, t, e)
|
||
}, address: sp(Lp), description: sp(Lp), name: sp(Lp), open: sp(bp), phoneNumber: sp(Lp), visibility: sp(bp)
|
||
}), mf = pp(pf, {href: sp(Mf)}), yf = pp(pf, {
|
||
LatLonAltBox: function (t, e) {
|
||
var i = fp({}, cg, t, e);
|
||
if (!i) return;
|
||
var r = e[e.length - 1],
|
||
o = [parseFloat(i.west), parseFloat(i.south), parseFloat(i.east), parseFloat(i.north)];
|
||
r.extent = o, r.altitudeMode = i.altitudeMode, r.minAltitude = parseFloat(i.minAltitude), r.maxAltitude = parseFloat(i.maxAltitude)
|
||
}, Lod: function (t, e) {
|
||
var i = fp({}, pg, t, e);
|
||
if (!i) return;
|
||
var r = e[e.length - 1];
|
||
r.minLodPixels = parseFloat(i.minLodPixels), r.maxLodPixels = parseFloat(i.maxLodPixels), r.minFadeExtent = parseFloat(i.minFadeExtent), r.maxFadeExtent = parseFloat(i.maxFadeExtent)
|
||
}
|
||
}), vf = pp(pf, ["Document", "Placemark"]), _f = pp(pf, {
|
||
Document: ap(function (t, e, i) {
|
||
mp({node: t}, yg, vg, e, i, void 0, this)
|
||
}), Placemark: ap(Bg)
|
||
}), xf = null;
|
||
var wf, bf = null;
|
||
var Cf, Sf = null;
|
||
var Ef = null;
|
||
var Tf = null;
|
||
var Rf = null;
|
||
var Pf = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = e || {};
|
||
Rf || (xf = new po({color: rf = [255, 255, 255, 1]}), of = [20, 2], nf = zd.PIXELS, sf = zd.PIXELS, af = [64, 64], lf = "https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png", hf = .5, bf = new Xd({
|
||
anchor: of,
|
||
anchorOrigin: Yd.BOTTOM_LEFT,
|
||
anchorXUnits: nf,
|
||
anchorYUnits: sf,
|
||
crossOrigin: "anonymous",
|
||
rotation: 0,
|
||
scale: hf,
|
||
size: af,
|
||
src: lf
|
||
}), wf = "NO_IMAGE", Sf = new go({color: rf, width: 1}), Cf = new go({
|
||
color: [51, 51, 51, 1],
|
||
width: 2
|
||
}), Ef = new vo({font: "bold 16px Helvetica", fill: xf, stroke: Cf, scale: .8}), Tf = new uf({
|
||
fill: xf,
|
||
image: bf,
|
||
text: Ef,
|
||
stroke: Sf,
|
||
zIndex: 0
|
||
}), Rf = [Tf]), this.dataProjection = We("EPSG:4326"), this.defaultStyle_ = i.defaultStyle ? i.defaultStyle : Rf, this.extractStyles_ = void 0 === i.extractStyles || i.extractStyles, this.writeStyles_ = void 0 === i.writeStyles || i.writeStyles, this.sharedStyles_ = {}, this.showPointNames_ = void 0 === i.showPointNames || i.showPointNames
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.readDocumentOrFolder_ = function (t, e) {
|
||
var i = fp([], pp(pf, {
|
||
Document: ip(this.readDocumentOrFolder_, this),
|
||
Folder: ip(this.readDocumentOrFolder_, this),
|
||
Placemark: rp(this.readPlacemark_, this),
|
||
Style: this.readSharedStyle_.bind(this),
|
||
StyleMap: this.readSharedStyleMap_.bind(this)
|
||
}), t, e, this);
|
||
return i || void 0
|
||
}, e.prototype.readPlacemark_ = function (t, e) {
|
||
var i = fp({geometry: null}, ff, t, e);
|
||
if (i) {
|
||
var r = new X, o = t.getAttribute("id");
|
||
null !== o && r.setId(o);
|
||
var n = e[0], s = i.geometry;
|
||
if (s && kc(s, !1, n), r.setGeometry(s), delete i.geometry, this.extractStyles_) {
|
||
var a = function (t, e, i, r, o) {
|
||
return function (n, s) {
|
||
var a, l = o, h = "";
|
||
if (l) {
|
||
var u = n.getGeometry();
|
||
u && (l = u.getType() === Zt.POINT)
|
||
}
|
||
if (l && (h = n.get("name"), l = l && !!h), t) return l ? (a = Lf(t[0], h), t.concat(a)) : t;
|
||
if (e) {
|
||
var c = function t(e, i, r) {
|
||
return Array.isArray(e) ? e : "string" == typeof e ? (!(e in r) && "#" + e in r && (e = "#" + e), t(r[e], i, r)) : i
|
||
}(e, i, r);
|
||
return l ? (a = Lf(c[0], h), c.concat(a)) : c
|
||
}
|
||
return l ? (a = Lf(i[0], h), i.concat(a)) : i
|
||
}
|
||
}(i.Style, i.styleUrl, this.defaultStyle_, this.sharedStyles_, this.showPointNames_);
|
||
r.setStyle(a)
|
||
}
|
||
return delete i.Style, r.setProperties(i), r
|
||
}
|
||
}, e.prototype.readSharedStyle_ = function (t, e) {
|
||
var i = t.getAttribute("id");
|
||
if (null !== i) {
|
||
var r = rg(t, e);
|
||
if (r) {
|
||
var o, n = t.baseURI;
|
||
if (n && "about:blank" != n || (n = window.location.href), n) o = new URL("#" + i, n).href; else o = "#" + i;
|
||
this.sharedStyles_[o] = r
|
||
}
|
||
}
|
||
}, e.prototype.readSharedStyleMap_ = function (t, e) {
|
||
var i = t.getAttribute("id");
|
||
if (null !== i) {
|
||
var r = Ff(t, e);
|
||
if (r) {
|
||
var o, n = t.baseURI;
|
||
if (n && "about:blank" != n || (n = window.location.href), n) o = new URL("#" + i, n).href; else o = "#" + i;
|
||
this.sharedStyles_[o] = r
|
||
}
|
||
}
|
||
}, e.prototype.readFeatureFromNode = function (t, e) {
|
||
if (!K(pf, t.namespaceURI)) return null;
|
||
var i = this.readPlacemark_(t, [this.getReadOptions(t, e)]);
|
||
return i || null
|
||
}, e.prototype.readFeaturesFromNode = function (t, e) {
|
||
if (!K(pf, t.namespaceURI)) return [];
|
||
var i, r = t.localName;
|
||
if ("Document" == r || "Folder" == r) return (i = this.readDocumentOrFolder_(t, [this.getReadOptions(t, e)])) || [];
|
||
if ("Placemark" == r) {
|
||
var o = this.readPlacemark_(t, [this.getReadOptions(t, e)]);
|
||
return o ? [o] : []
|
||
}
|
||
if ("kml" == r) {
|
||
i = [];
|
||
for (var n = t.firstElementChild; n; n = n.nextElementSibling) {
|
||
var s = this.readFeaturesFromNode(n, e);
|
||
s && Q(i, s)
|
||
}
|
||
return i
|
||
}
|
||
return []
|
||
}, e.prototype.readName = function (t) {
|
||
if (t) {
|
||
if ("string" == typeof t) {
|
||
var e = ep(t);
|
||
return this.readNameFromDocument(e)
|
||
}
|
||
return Qc(t) ? this.readNameFromDocument(t) : this.readNameFromNode(t)
|
||
}
|
||
}, e.prototype.readNameFromDocument = function (t) {
|
||
for (var e = t.firstChild; e; e = e.nextSibling) if (e.nodeType == Node.ELEMENT_NODE) {
|
||
var i = this.readNameFromNode(e);
|
||
if (i) return i
|
||
}
|
||
}, e.prototype.readNameFromNode = function (t) {
|
||
for (var e = t.firstElementChild; e; e = e.nextElementSibling) if (K(pf, e.namespaceURI) && "name" == e.localName) return Lp(e);
|
||
for (var i = t.firstElementChild; i; i = i.nextElementSibling) {
|
||
var r = i.localName;
|
||
if (K(pf, i.namespaceURI) && ("Document" == r || "Folder" == r || "Placemark" == r || "kml" == r)) {
|
||
var o = this.readNameFromNode(i);
|
||
if (o) return o
|
||
}
|
||
}
|
||
}, e.prototype.readNetworkLinks = function (t) {
|
||
var e = [];
|
||
if ("string" == typeof t) {
|
||
var i = ep(t);
|
||
Q(e, this.readNetworkLinksFromDocument(i))
|
||
} else Qc(t) ? Q(e, this.readNetworkLinksFromDocument(t)) : Q(e, this.readNetworkLinksFromNode(t));
|
||
return e
|
||
}, e.prototype.readNetworkLinksFromDocument = function (t) {
|
||
for (var e = [], i = t.firstChild; i; i = i.nextSibling) i.nodeType == Node.ELEMENT_NODE && Q(e, this.readNetworkLinksFromNode(i));
|
||
return e
|
||
}, e.prototype.readNetworkLinksFromNode = function (t) {
|
||
for (var e = [], i = t.firstElementChild; i; i = i.nextElementSibling) if (K(pf, i.namespaceURI) && "NetworkLink" == i.localName) {
|
||
var r = fp({}, gf, i, []);
|
||
e.push(r)
|
||
}
|
||
for (var o = t.firstElementChild; o; o = o.nextElementSibling) {
|
||
var n = o.localName;
|
||
!K(pf, o.namespaceURI) || "Document" != n && "Folder" != n && "kml" != n || Q(e, this.readNetworkLinksFromNode(o))
|
||
}
|
||
return e
|
||
}, e.prototype.readRegion = function (t) {
|
||
var e = [];
|
||
if ("string" == typeof t) {
|
||
var i = ep(t);
|
||
Q(e, this.readRegionFromDocument(i))
|
||
} else Qc(t) ? Q(e, this.readRegionFromDocument(t)) : Q(e, this.readRegionFromNode(t));
|
||
return e
|
||
}, e.prototype.readRegionFromDocument = function (t) {
|
||
for (var e = [], i = t.firstChild; i; i = i.nextSibling) i.nodeType == Node.ELEMENT_NODE && Q(e, this.readRegionFromNode(i));
|
||
return e
|
||
}, e.prototype.readRegionFromNode = function (t) {
|
||
for (var e = [], i = t.firstElementChild; i; i = i.nextElementSibling) if (K(pf, i.namespaceURI) && "Region" == i.localName) {
|
||
var r = fp({}, yf, i, []);
|
||
e.push(r)
|
||
}
|
||
for (var o = t.firstElementChild; o; o = o.nextElementSibling) {
|
||
var n = o.localName;
|
||
!K(pf, o.namespaceURI) || "Document" != n && "Folder" != n && "kml" != n || Q(e, this.readRegionFromNode(o))
|
||
}
|
||
return e
|
||
}, e.prototype.writeFeaturesNode = function (t, e) {
|
||
e = this.adaptOptions(e);
|
||
var i = Kc(pf[4], "kml"), r = "http://www.w3.org/2000/xmlns/";
|
||
i.setAttributeNS(r, "xmlns:gx", cf[0]), i.setAttributeNS(r, "xmlns:xsi", Zc), i.setAttributeNS(Zc, "xsi:schemaLocation", "http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");
|
||
var o = {node: i}, n = {};
|
||
t.length > 1 ? n.Document = t : 1 == t.length && (n.Placemark = t[0]);
|
||
var s = vf[i.namespaceURI], a = cp(n, s);
|
||
return mp(o, _f, up, a, [e], s, this), i
|
||
}, e
|
||
}(yp);
|
||
|
||
function Lf(t, e) {
|
||
var i = null, r = [0, 0], o = "start";
|
||
if (t.getImage()) {
|
||
var n = t.getImage().getImageSize();
|
||
if (null === n && (n = af), 2 == n.length) {
|
||
var s = t.getImage().getScale();
|
||
r[0] = s * n[0] / 2, r[1] = -s * n[1] / 2, o = "left"
|
||
}
|
||
}
|
||
if (null !== t.getText()) {
|
||
var a = t.getText();
|
||
(i = a.clone()).setFont(a.getFont() || Ef.getFont()), i.setScale(a.getScale() || Ef.getScale()), i.setFill(a.getFill() || Ef.getFill()), i.setStroke(a.getStroke() || Cf)
|
||
} else i = Ef.clone();
|
||
return i.setText(e), i.setOffsetX(r[0]), i.setOffsetY(r[1]), i.setTextAlign(o), new uf({text: i})
|
||
}
|
||
|
||
function If(t) {
|
||
var e = Jc(t, !1), i = /^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);
|
||
if (i) {
|
||
var r = i[1];
|
||
return [parseInt(r.substr(6, 2), 16), parseInt(r.substr(4, 2), 16), parseInt(r.substr(2, 2), 16), parseInt(r.substr(0, 2), 16) / 255]
|
||
}
|
||
}
|
||
|
||
function Of(t) {
|
||
for (var e, i = Jc(t, !1), r = [], o = /^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i; e = o.exec(i);) {
|
||
var n = parseFloat(e[1]), s = parseFloat(e[2]), a = e[3] ? parseFloat(e[3]) : 0;
|
||
r.push(n, s, a), i = i.substr(e[0].length)
|
||
}
|
||
if ("" === i) return r
|
||
}
|
||
|
||
function Mf(t) {
|
||
var e = Jc(t, !1).trim(), i = t.baseURI;
|
||
return i && "about:blank" != i || (i = window.location.href), i ? new URL(e, i).href : e
|
||
}
|
||
|
||
function Af(t) {
|
||
return Ep(t)
|
||
}
|
||
|
||
var kf = pp(pf, {
|
||
Pair: function (t, e) {
|
||
var i = fp({}, hg, t, e);
|
||
if (!i) return;
|
||
var r = i.key;
|
||
if (r && "normal" == r) {
|
||
var o = i.styleUrl;
|
||
o && (e[e.length - 1] = o);
|
||
var n = i.Style;
|
||
n && (e[e.length - 1] = n)
|
||
}
|
||
}
|
||
});
|
||
|
||
function Ff(t, e) {
|
||
return fp(void 0, kf, t, e)
|
||
}
|
||
|
||
var Nf = pp(pf, {
|
||
Icon: sp(function (t, e) {
|
||
var i = fp({}, Wf, t, e);
|
||
return i || null
|
||
}), heading: sp(Ep), hotSpot: sp(function (t) {
|
||
var e, i = t.getAttribute("xunits"), r = t.getAttribute("yunits");
|
||
return e = "insetPixels" !== i ? "insetPixels" !== r ? Yd.BOTTOM_LEFT : Yd.TOP_LEFT : "insetPixels" !== r ? Yd.BOTTOM_RIGHT : Yd.TOP_RIGHT, {
|
||
x: parseFloat(t.getAttribute("x")),
|
||
xunits: df[i],
|
||
y: parseFloat(t.getAttribute("y")),
|
||
yunits: df[r],
|
||
origin: e
|
||
}
|
||
}), scale: sp(Af)
|
||
});
|
||
var Df = pp(pf, {color: sp(If), scale: sp(Af)});
|
||
var Gf = pp(pf, {color: sp(If), width: sp(Ep)});
|
||
var jf = pp(pf, {color: sp(If), fill: sp(bp), outline: sp(bp)});
|
||
var zf = pp(pf, {coordinates: op(Of)});
|
||
|
||
function Uf(t, e) {
|
||
return fp(null, zf, t, e)
|
||
}
|
||
|
||
var Bf = pp(cf, {Track: rp(Yf)});
|
||
var Vf = pp(pf, {
|
||
when: function (t, e) {
|
||
var i = e[e.length - 1].whens, r = Jc(t, !1), o = Date.parse(r);
|
||
i.push(isNaN(o) ? 0 : o)
|
||
}
|
||
}, pp(cf, {
|
||
coord: function (t, e) {
|
||
var i = e[e.length - 1].flatCoordinates, r = Jc(t, !1),
|
||
o = /^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(r);
|
||
if (o) {
|
||
var n = parseFloat(o[1]), s = parseFloat(o[2]), a = parseFloat(o[3]);
|
||
i.push(n, s, a, 0)
|
||
} else i.push(0, 0, 0, 0)
|
||
}
|
||
}));
|
||
|
||
function Yf(t, e) {
|
||
var i = fp({flatCoordinates: [], whens: []}, Vf, t, e);
|
||
if (i) {
|
||
for (var r = i.flatCoordinates, o = i.whens, n = 0, s = Math.min(r.length, o.length); n < s; ++n) r[4 * n + 3] = o[n];
|
||
return new Jr(r, qt.XYZM)
|
||
}
|
||
}
|
||
|
||
var Wf = pp(pf, {href: sp(Mf)}, pp(cf, {x: sp(Ep), y: sp(Ep), w: sp(Ep), h: sp(Ep)}));
|
||
var Hf = pp(pf, {coordinates: op(Of)});
|
||
|
||
function Xf(t, e) {
|
||
return fp(null, Hf, t, e)
|
||
}
|
||
|
||
var qf = pp(pf, {extrude: sp(bp), tessellate: sp(bp), altitudeMode: sp(Lp)});
|
||
|
||
function Zf(t, e) {
|
||
var i = fp({}, qf, t, e), r = Xf(t, e);
|
||
if (r) {
|
||
var o = new Jr(r, qt.XYZ);
|
||
return o.setProperties(i), o
|
||
}
|
||
}
|
||
|
||
function Kf(t, e) {
|
||
var i = fp({}, qf, t, e), r = Xf(t, e);
|
||
if (r) {
|
||
var o = new fr(r, qt.XYZ, [r.length]);
|
||
return o.setProperties(i), o
|
||
}
|
||
}
|
||
|
||
var Jf = pp(pf, {
|
||
LineString: rp(Zf),
|
||
LinearRing: rp(Kf),
|
||
MultiGeometry: rp($f),
|
||
Point: rp(Qf),
|
||
Polygon: rp(eg)
|
||
});
|
||
|
||
function $f(t, e) {
|
||
var i, r = fp([], Jf, t, e);
|
||
if (!r) return null;
|
||
if (0 === r.length) return new Pd(r);
|
||
for (var o, n, s = !0, a = r[0].getType(), l = 1, h = r.length; l < h; ++l) if (r[l].getType() != a) {
|
||
s = !1;
|
||
break
|
||
}
|
||
if (s) if (a == Zt.POINT) {
|
||
var u = r[0];
|
||
o = u.getLayout(), n = u.getFlatCoordinates();
|
||
for (var c = 1, p = r.length; c < p; ++c) Q(n, r[c].getFlatCoordinates());
|
||
og(i = new Gc(n, o), r)
|
||
} else a == Zt.LINE_STRING ? og(i = new Dc(r), r) : a == Zt.POLYGON ? og(i = new zc(r), r) : a == Zt.GEOMETRY_COLLECTION ? i = new Pd(r) : W(!1, 37); else i = new Pd(r);
|
||
return i
|
||
}
|
||
|
||
function Qf(t, e) {
|
||
var i = fp({}, qf, t, e), r = Xf(t, e);
|
||
if (r) {
|
||
var o = new qi(r, qt.XYZ);
|
||
return o.setProperties(i), o
|
||
}
|
||
}
|
||
|
||
var tg = pp(pf, {
|
||
innerBoundaryIs: function (t, e) {
|
||
var i = fp(void 0, dg, t, e);
|
||
if (i) {
|
||
var r = e[e.length - 1];
|
||
r.push(i)
|
||
}
|
||
}, outerBoundaryIs: function (t, e) {
|
||
var i = fp(void 0, fg, t, e);
|
||
if (i) {
|
||
var r = e[e.length - 1];
|
||
r[0] = i
|
||
}
|
||
}
|
||
});
|
||
|
||
function eg(t, e) {
|
||
var i = fp({}, qf, t, e), r = fp([null], tg, t, e);
|
||
if (r && r[0]) {
|
||
for (var o = r[0], n = [o.length], s = 1, a = r.length; s < a; ++s) Q(o, r[s]), n.push(o.length);
|
||
var l = new fr(o, qt.XYZ, n);
|
||
return l.setProperties(i), l
|
||
}
|
||
}
|
||
|
||
var ig = pp(pf, {
|
||
IconStyle: function (t, e) {
|
||
var i = fp({}, Nf, t, e);
|
||
if (i) {
|
||
var r, o, n, s, a = e[e.length - 1], l = "Icon" in i ? i.Icon : {},
|
||
h = !("Icon" in i) || Object.keys(l).length > 0, u = l.href;
|
||
u ? r = u : h && (r = lf);
|
||
var c, p = Yd.BOTTOM_LEFT, d = i.hotSpot;
|
||
d ? (o = [d.x, d.y], n = d.xunits, s = d.yunits, p = d.origin) : r === lf ? (o = of, n = nf, s = sf) : /^http:\/\/maps\.(?:google|gstatic)\.com\//.test(r) && (o = [.5, 0], n = zd.FRACTION, s = zd.FRACTION);
|
||
var f, g = l.x, m = l.y;
|
||
void 0 !== g && void 0 !== m && (c = [g, m]);
|
||
var y, v = l.w, _ = l.h;
|
||
void 0 !== v && void 0 !== _ && (f = [v, _]);
|
||
var x = i.heading;
|
||
void 0 !== x && (y = ae(x));
|
||
var w = i.scale;
|
||
if (h) {
|
||
r == lf && (f = af, void 0 === w && (w = hf));
|
||
var b = new Xd({
|
||
anchor: o,
|
||
anchorOrigin: p,
|
||
anchorXUnits: n,
|
||
anchorYUnits: s,
|
||
crossOrigin: "anonymous",
|
||
offset: c,
|
||
offsetOrigin: Yd.BOTTOM_LEFT,
|
||
rotation: y,
|
||
scale: w,
|
||
size: f,
|
||
src: r
|
||
});
|
||
a.imageStyle = b
|
||
} else a.imageStyle = wf
|
||
}
|
||
}, LabelStyle: function (t, e) {
|
||
var i = fp({}, Df, t, e);
|
||
if (i) {
|
||
var r = e[e.length - 1],
|
||
o = new vo({fill: new po({color: "color" in i ? i.color : rf}), scale: i.scale});
|
||
r.textStyle = o
|
||
}
|
||
}, LineStyle: function (t, e) {
|
||
var i = fp({}, Gf, t, e);
|
||
if (i) {
|
||
var r = e[e.length - 1],
|
||
o = new go({color: "color" in i ? i.color : rf, width: "width" in i ? i.width : 1});
|
||
r.strokeStyle = o
|
||
}
|
||
}, PolyStyle: function (t, e) {
|
||
var i = fp({}, jf, t, e);
|
||
if (i) {
|
||
var r = e[e.length - 1], o = new po({color: "color" in i ? i.color : rf});
|
||
r.fillStyle = o;
|
||
var n = i.fill;
|
||
void 0 !== n && (r.fill = n);
|
||
var s = i.outline;
|
||
void 0 !== s && (r.outline = s)
|
||
}
|
||
}
|
||
});
|
||
|
||
function rg(t, e) {
|
||
var i = fp({}, ig, t, e);
|
||
if (!i) return null;
|
||
var r, o = "fillStyle" in i ? i.fillStyle : xf, n = i.fill;
|
||
void 0 === n || n || (o = null), "imageStyle" in i ? i.imageStyle != wf && (r = i.imageStyle) : r = bf;
|
||
var s = "textStyle" in i ? i.textStyle : Ef, a = "strokeStyle" in i ? i.strokeStyle : Sf, l = i.outline;
|
||
return void 0 === l || l || (a = null), [new uf({fill: o, image: r, stroke: a, text: s, zIndex: void 0})]
|
||
}
|
||
|
||
function og(t, e) {
|
||
var i, r, o, n = e.length, s = new Array(e.length), a = new Array(e.length), l = new Array(e.length);
|
||
i = r = o = !1;
|
||
for (var h = 0; h < n; ++h) {
|
||
var u = e[h];
|
||
s[h] = u.get("extrude"), a[h] = u.get("tessellate"), l[h] = u.get("altitudeMode"), i = i || void 0 !== s[h], r = r || void 0 !== a[h], o = o || l[h]
|
||
}
|
||
i && t.set("extrude", s), r && t.set("tessellate", a), o && t.set("altitudeMode", l)
|
||
}
|
||
|
||
var ng = pp(pf, {displayName: sp(Lp), value: sp(Lp)});
|
||
var sg = pp(pf, {
|
||
Data: function (t, e) {
|
||
var i = t.getAttribute("name");
|
||
dp(ng, t, e);
|
||
var r = e[e.length - 1];
|
||
null !== i ? r[i] = r.value : null !== r.displayName && (r[r.displayName] = r.value), delete r.value
|
||
}, SchemaData: function (t, e) {
|
||
dp(ug, t, e)
|
||
}
|
||
});
|
||
|
||
function ag(t, e) {
|
||
dp(sg, t, e)
|
||
}
|
||
|
||
function lg(t, e) {
|
||
dp(yf, t, e)
|
||
}
|
||
|
||
var hg = pp(pf, {Style: sp(rg), key: sp(Lp), styleUrl: sp(Mf)});
|
||
var ug = pp(pf, {
|
||
SimpleData: function (t, e) {
|
||
var i = t.getAttribute("name");
|
||
if (null !== i) {
|
||
var r = Lp(t), o = e[e.length - 1];
|
||
o[i] = r
|
||
}
|
||
}
|
||
});
|
||
var cg = pp(pf, {
|
||
altitudeMode: sp(Lp),
|
||
minAltitude: sp(Ep),
|
||
maxAltitude: sp(Ep),
|
||
north: sp(Ep),
|
||
south: sp(Ep),
|
||
east: sp(Ep),
|
||
west: sp(Ep)
|
||
});
|
||
var pg = pp(pf, {minLodPixels: sp(Ep), maxLodPixels: sp(Ep), minFadeExtent: sp(Ep), maxFadeExtent: sp(Ep)});
|
||
var dg = pp(pf, {LinearRing: op(Uf)});
|
||
var fg = pp(pf, {LinearRing: op(Uf)});
|
||
|
||
function gg(t, e) {
|
||
for (var i = lo(e), r = [255 * (4 == i.length ? i[3] : 1), i[2], i[1], i[0]], o = 0; o < 4; ++o) {
|
||
var n = Math.floor(r[o]).toString(16);
|
||
r[o] = 1 == n.length ? "0" + n : n
|
||
}
|
||
Fp(t, r.join(""))
|
||
}
|
||
|
||
var mg = pp(pf, {
|
||
Data: ap(function (t, e, i) {
|
||
t.setAttribute("name", e.name);
|
||
var r = {node: t}, o = e.value;
|
||
"object" == typeof o ? (null !== o && o.displayName && mp(r, mg, up, [o.displayName], i, ["displayName"]), null !== o && o.value && mp(r, mg, up, [o.value], i, ["value"])) : mp(r, mg, up, [o], i, ["value"])
|
||
}), value: ap(function (t, e) {
|
||
Fp(t, e)
|
||
}), displayName: ap(function (t, e) {
|
||
Op(t, e)
|
||
})
|
||
});
|
||
var yg = pp(pf, {Placemark: ap(Bg)}), vg = function (t, e, i) {
|
||
return Kc(e[e.length - 1].node.namespaceURI, "Placemark")
|
||
};
|
||
var _g = hp("Data");
|
||
var xg = pp(pf, ["href"], pp(cf, ["x", "y", "w", "h"])),
|
||
wg = pp(pf, {href: ap(Fp)}, pp(cf, {x: ap(Ap), y: ap(Ap), w: ap(Ap), h: ap(Ap)})), bg = function (t, e, i) {
|
||
return Kc(cf[0], "gx:" + i)
|
||
};
|
||
var Cg = pp(pf, ["scale", "heading", "Icon", "hotSpot"]), Sg = pp(pf, {
|
||
Icon: ap(function (t, e, i) {
|
||
var r = {node: t}, o = i[i.length - 1].node, n = xg[o.namespaceURI], s = cp(e, n);
|
||
mp(r, wg, up, s, i, n), s = cp(e, n = xg[cf[0]]), mp(r, wg, bg, s, i, n)
|
||
}), heading: ap(Ap), hotSpot: ap(function (t, e) {
|
||
t.setAttribute("x", String(e.x)), t.setAttribute("y", String(e.y)), t.setAttribute("xunits", e.xunits), t.setAttribute("yunits", e.yunits)
|
||
}), scale: ap($g)
|
||
});
|
||
var Eg = pp(pf, ["color", "scale"]), Tg = pp(pf, {color: ap(gg), scale: ap($g)});
|
||
var Rg = pp(pf, ["color", "width"]), Pg = pp(pf, {color: ap(gg), width: ap(Ap)});
|
||
var Lg = {
|
||
Point: "Point",
|
||
LineString: "LineString",
|
||
LinearRing: "LinearRing",
|
||
Polygon: "Polygon",
|
||
MultiPoint: "MultiGeometry",
|
||
MultiLineString: "MultiGeometry",
|
||
MultiPolygon: "MultiGeometry",
|
||
GeometryCollection: "MultiGeometry"
|
||
}, Ig = function (t, e, i) {
|
||
if (t) return Kc(e[e.length - 1].node.namespaceURI, Lg[t.getType()])
|
||
}, Og = hp("Point"), Mg = hp("LineString"), Ag = hp("LinearRing"), kg = hp("Polygon"),
|
||
Fg = pp(pf, {LineString: ap(Wg), Point: ap(Wg), Polygon: ap(Zg), GeometryCollection: ap(Ng)});
|
||
|
||
function Ng(t, e, i) {
|
||
var r, o, n = {node: t}, s = e.getType();
|
||
s == Zt.GEOMETRY_COLLECTION ? (r = e.getGeometries(), o = Ig) : s == Zt.MULTI_POINT ? (r = e.getPoints(), o = Og) : s == Zt.MULTI_LINE_STRING ? (r = e.getLineStrings(), o = Mg) : s == Zt.MULTI_POLYGON ? (r = e.getPolygons(), o = kg) : W(!1, 39), mp(n, Fg, o, r, i)
|
||
}
|
||
|
||
var Dg = pp(pf, {LinearRing: ap(Wg)});
|
||
|
||
function Gg(t, e, i) {
|
||
mp({node: t}, Dg, Ag, [e], i)
|
||
}
|
||
|
||
var jg = pp(pf, {
|
||
ExtendedData: ap(function (t, e, i) {
|
||
for (var r = {node: t}, o = e.names, n = e.values, s = o.length, a = 0; a < s; a++) mp(r, mg, _g, [{
|
||
name: o[a],
|
||
value: n[a]
|
||
}], i)
|
||
}),
|
||
MultiGeometry: ap(Ng),
|
||
LineString: ap(Wg),
|
||
LinearRing: ap(Wg),
|
||
Point: ap(Wg),
|
||
Polygon: ap(Zg),
|
||
Style: ap(function (t, e, i) {
|
||
var r = {node: t}, o = {}, n = e.getFill(), s = e.getStroke(), a = e.getImage(), l = e.getText();
|
||
a && "function" == typeof a.getSrc && (o.IconStyle = a);
|
||
l && (o.LabelStyle = l);
|
||
s && (o.LineStyle = s);
|
||
n && (o.PolyStyle = n);
|
||
var h = i[i.length - 1].node, u = Qg[h.namespaceURI], c = cp(o, u);
|
||
mp(r, tm, up, c, i, u)
|
||
}),
|
||
address: ap(Fp),
|
||
description: ap(Fp),
|
||
name: ap(Fp),
|
||
open: ap(Ip),
|
||
phoneNumber: ap(Fp),
|
||
styleUrl: ap(Fp),
|
||
visibility: ap(Ip)
|
||
}), zg = pp(pf, ["name", "open", "visibility", "address", "phoneNumber", "description", "styleUrl", "Style"]),
|
||
Ug = hp("ExtendedData");
|
||
|
||
function Bg(t, e, i) {
|
||
var r = {node: t};
|
||
e.getId() && t.setAttribute("id", e.getId());
|
||
var o = e.getProperties(),
|
||
n = {address: 1, description: 1, name: 1, open: 1, phoneNumber: 1, styleUrl: 1, visibility: 1};
|
||
n[e.getGeometryName()] = 1;
|
||
var s = Object.keys(o || {}).sort().filter(function (t) {
|
||
return !n[t]
|
||
});
|
||
if (s.length > 0) {
|
||
var a = cp(o, s);
|
||
mp(r, jg, Ug, [{names: s, values: a}], i)
|
||
}
|
||
var l = e.getStyleFunction();
|
||
if (l) {
|
||
var h = l(e, 0);
|
||
if (h) {
|
||
var u = Array.isArray(h) ? h[0] : h;
|
||
this.writeStyles_ && (o.Style = u);
|
||
var c = u.getText();
|
||
c && (o.name = c.getText())
|
||
}
|
||
}
|
||
var p = i[i.length - 1].node, d = zg[p.namespaceURI], f = cp(o, d);
|
||
mp(r, jg, up, f, i, d);
|
||
var g = i[0], m = e.getGeometry();
|
||
m && (m = kc(m, !0, g)), mp(r, jg, Ig, [m], i)
|
||
}
|
||
|
||
var Vg = pp(pf, ["extrude", "tessellate", "altitudeMode", "coordinates"]), Yg = pp(pf, {
|
||
extrude: ap(Ip), tessellate: ap(Ip), altitudeMode: ap(Fp), coordinates: ap(function (t, e, i) {
|
||
var r, o = i[i.length - 1], n = o.layout, s = o.stride;
|
||
n == qt.XY || n == qt.XYM ? r = 2 : n == qt.XYZ || n == qt.XYZM ? r = 3 : W(!1, 34);
|
||
var a = e.length, l = "";
|
||
if (a > 0) {
|
||
l += e[0];
|
||
for (var h = 1; h < r; ++h) l += "," + e[h];
|
||
for (var u = s; u < a; u += s) {
|
||
l += " " + e[u];
|
||
for (var c = 1; c < r; ++c) l += "," + e[u + c]
|
||
}
|
||
}
|
||
Fp(t, l)
|
||
})
|
||
});
|
||
|
||
function Wg(t, e, i) {
|
||
var r = e.getFlatCoordinates(), o = {node: t};
|
||
o.layout = e.getLayout(), o.stride = e.getStride();
|
||
var n = e.getProperties();
|
||
n.coordinates = r;
|
||
var s = i[i.length - 1].node, a = Vg[s.namespaceURI], l = cp(n, a);
|
||
mp(o, Yg, up, l, i, a)
|
||
}
|
||
|
||
var Hg = pp(pf, {outerBoundaryIs: ap(Gg), innerBoundaryIs: ap(Gg)}), Xg = hp("innerBoundaryIs"),
|
||
qg = hp("outerBoundaryIs");
|
||
|
||
function Zg(t, e, i) {
|
||
var r = e.getLinearRings(), o = r.shift(), n = {node: t};
|
||
mp(n, Hg, Xg, r, i), mp(n, Hg, qg, [o], i)
|
||
}
|
||
|
||
var Kg = pp(pf, {color: ap(gg)}), Jg = hp("color");
|
||
|
||
function $g(t, e) {
|
||
Ap(t, Math.round(1e6 * e) / 1e6)
|
||
}
|
||
|
||
var Qg = pp(pf, ["IconStyle", "LabelStyle", "LineStyle", "PolyStyle"]), tm = pp(pf, {
|
||
IconStyle: ap(function (t, e, i) {
|
||
var r = {node: t}, o = {}, n = e.getSrc(), s = e.getSize(), a = e.getImageSize(), l = {href: n};
|
||
if (s) {
|
||
l.w = s[0], l.h = s[1];
|
||
var h = e.getAnchor(), u = e.getOrigin();
|
||
if (u && a && 0 !== u[0] && u[1] !== s[1] && (l.x = u[0], l.y = a[1] - (u[1] + s[1])), h && (h[0] !== s[0] / 2 || h[1] !== s[1] / 2)) {
|
||
var c = {x: h[0], xunits: zd.PIXELS, y: s[1] - h[1], yunits: zd.PIXELS};
|
||
o.hotSpot = c
|
||
}
|
||
}
|
||
o.Icon = l;
|
||
var p = e.getScale();
|
||
1 !== p && (o.scale = p);
|
||
var d = e.getRotation();
|
||
0 !== d && (o.heading = d);
|
||
var f = i[i.length - 1].node, g = Cg[f.namespaceURI], m = cp(o, g);
|
||
mp(r, Sg, up, m, i, g)
|
||
}), LabelStyle: ap(function (t, e, i) {
|
||
var r = {node: t}, o = {}, n = e.getFill();
|
||
n && (o.color = n.getColor());
|
||
var s = e.getScale();
|
||
s && 1 !== s && (o.scale = s);
|
||
var a = i[i.length - 1].node, l = Eg[a.namespaceURI], h = cp(o, l);
|
||
mp(r, Tg, up, h, i, l)
|
||
}), LineStyle: ap(function (t, e, i) {
|
||
var r = {node: t}, o = {color: e.getColor(), width: e.getWidth()}, n = i[i.length - 1].node,
|
||
s = Rg[n.namespaceURI], a = cp(o, s);
|
||
mp(r, Pg, up, a, i, s)
|
||
}), PolyStyle: ap(function (t, e, i) {
|
||
mp({node: t}, Kg, Jg, [e.getColor()], i)
|
||
})
|
||
});
|
||
var em = Pf, im = i(9), rm = i.n(im), om = [1, 0, 0, 1, 0, 0], nm = function (t, e, i, r, o) {
|
||
this.extent_, this.id_ = o, this.type_ = t, this.flatCoordinates_ = e, this.flatInteriorPoints_ = null, this.flatMidpoints_ = null, this.ends_ = i, this.properties_ = r
|
||
};
|
||
nm.prototype.get = function (t) {
|
||
return this.properties_[t]
|
||
}, nm.prototype.getExtent = function () {
|
||
return this.extent_ || (this.extent_ = this.type_ === Zt.POINT ? _t(this.flatCoordinates_) : wt(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2)), this.extent_
|
||
}, nm.prototype.getFlatInteriorPoint = function () {
|
||
if (!this.flatInteriorPoints_) {
|
||
var t = At(this.getExtent());
|
||
this.flatInteriorPoints_ = Qi(this.flatCoordinates_, 0, this.ends_, 2, t, 0)
|
||
}
|
||
return this.flatInteriorPoints_
|
||
}, nm.prototype.getFlatInteriorPoints = function () {
|
||
if (!this.flatInteriorPoints_) {
|
||
var t = jc(this.flatCoordinates_, 0, this.ends_, 2);
|
||
this.flatInteriorPoints_ = tr(this.flatCoordinates_, 0, this.ends_, 2, t)
|
||
}
|
||
return this.flatInteriorPoints_
|
||
}, nm.prototype.getFlatMidpoint = function () {
|
||
return this.flatMidpoints_ || (this.flatMidpoints_ = Xr(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2, .5)), this.flatMidpoints_
|
||
}, nm.prototype.getFlatMidpoints = function () {
|
||
if (!this.flatMidpoints_) {
|
||
this.flatMidpoints_ = [];
|
||
for (var t = this.flatCoordinates_, e = 0, i = this.ends_, r = 0, o = i.length; r < o; ++r) {
|
||
var n = i[r], s = Xr(t, e, n, 2, .5);
|
||
Q(this.flatMidpoints_, s), e = n
|
||
}
|
||
}
|
||
return this.flatMidpoints_
|
||
}, nm.prototype.getId = function () {
|
||
return this.id_
|
||
}, nm.prototype.getOrientedFlatCoordinates = function () {
|
||
return this.flatCoordinates_
|
||
}, nm.prototype.getGeometry = function () {
|
||
return this
|
||
}, nm.prototype.getSimplifiedGeometry = function (t) {
|
||
return this
|
||
}, nm.prototype.getProperties = function () {
|
||
return this.properties_
|
||
}, nm.prototype.getStride = function () {
|
||
return 2
|
||
}, nm.prototype.getStyleFunction = function () {
|
||
}, nm.prototype.getType = function () {
|
||
return this.type_
|
||
}, nm.prototype.transform = function (t, e) {
|
||
var i = (t = We(t)).getExtent(), r = t.getWorldExtent(), o = Nt(r) / Nt(i);
|
||
gi(om, r[0], r[3], o, -o, 0, 0, 0), Kt(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2, om, this.flatCoordinates_)
|
||
}, nm.prototype.getEnds = nm.prototype.getEndss = function () {
|
||
return this.ends_
|
||
}, nm.prototype.getFlatCoordinates = nm.prototype.getOrientedFlatCoordinates;
|
||
var sm = nm;
|
||
|
||
function am(t, e, i) {
|
||
if (3 === t) {
|
||
var r = {keys: [], values: [], features: []}, o = i.readVarint() + i.pos;
|
||
i.readFields(lm, r, o), r.length = r.features.length, r.length && (e[r.name] = r)
|
||
}
|
||
}
|
||
|
||
function lm(t, e, i) {
|
||
if (15 === t) e.version = i.readVarint(); else if (1 === t) e.name = i.readString(); else if (5 === t) e.extent = i.readVarint(); else if (2 === t) e.features.push(i.pos); else if (3 === t) e.keys.push(i.readString()); else if (4 === t) {
|
||
for (var r = null, o = i.readVarint() + i.pos; i.pos < o;) r = 1 === (t = i.readVarint() >> 3) ? i.readString() : 2 === t ? i.readFloat() : 3 === t ? i.readDouble() : 4 === t ? i.readVarint64() : 5 === t ? i.readVarint() : 6 === t ? i.readSVarint() : 7 === t ? i.readBoolean() : null;
|
||
e.values.push(r)
|
||
}
|
||
}
|
||
|
||
function hm(t, e, i) {
|
||
if (1 == t) e.id = i.readVarint(); else if (2 == t) for (var r = i.readVarint() + i.pos; i.pos < r;) {
|
||
var o = e.layer.keys[i.readVarint()], n = e.layer.values[i.readVarint()];
|
||
e.properties[o] = n
|
||
} else 3 == t ? e.type = i.readVarint() : 4 == t && (e.geometry = i.pos)
|
||
}
|
||
|
||
function um(t, e, i) {
|
||
t.pos = e.features[i];
|
||
var r = t.readVarint() + t.pos, o = {layer: e, type: 0, properties: {}};
|
||
return t.readFields(hm, o, r), o
|
||
}
|
||
|
||
var cm = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = e || {};
|
||
this.dataProjection = new xe({
|
||
code: "",
|
||
units: ve.TILE_PIXELS
|
||
}), this.featureClass_ = i.featureClass ? i.featureClass : sm, this.geometryName_ = i.geometryName, this.layerName_ = i.layerName ? i.layerName : "layer", this.layers_ = i.layers ? i.layers : null, this.extent_ = null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.readRawGeometry_ = function (t, e, i, r) {
|
||
t.pos = e.geometry;
|
||
for (var o = t.readVarint() + t.pos, n = 1, s = 0, a = 0, l = 0, h = 0, u = 0; t.pos < o;) {
|
||
if (!s) {
|
||
var c = t.readVarint();
|
||
n = 7 & c, s = c >> 3
|
||
}
|
||
s--, 1 === n || 2 === n ? (a += t.readSVarint(), l += t.readSVarint(), 1 === n && h > u && (r.push(h), u = h), i.push(a, l), h += 2) : 7 === n ? h > u && (i.push(i[u], i[u + 1]), h += 2) : W(!1, 59)
|
||
}
|
||
h > u && (r.push(h), u = h)
|
||
}, e.prototype.createFeature_ = function (t, e, i) {
|
||
var r, o = e.type;
|
||
if (0 === o) return null;
|
||
var n = e.id, s = e.properties;
|
||
s[this.layerName_] = e.layer.name;
|
||
var a = [], l = [];
|
||
this.readRawGeometry_(t, e, a, l);
|
||
var h = function (t, e) {
|
||
var i;
|
||
1 === t ? i = 1 === e ? Zt.POINT : Zt.MULTI_POINT : 2 === t ? i = 1 === e ? Zt.LINE_STRING : Zt.MULTI_LINE_STRING : 3 === t && (i = Zt.POLYGON);
|
||
return i
|
||
}(o, l.length);
|
||
if (this.featureClass_ === sm) r = new this.featureClass_(h, a, l, s, n); else {
|
||
var u;
|
||
if (h == Zt.POLYGON) {
|
||
for (var c = [], p = 0, d = 0, f = 0, g = l.length; f < g; ++f) {
|
||
var m = l[f];
|
||
lr(a, p, m, 2) || (c.push(l.slice(d, f)), d = f), p = m
|
||
}
|
||
u = c.length > 1 ? new zc(a, qt.XY, c) : new fr(a, qt.XY, l)
|
||
} else u = h === Zt.POINT ? new qi(a, qt.XY) : h === Zt.LINE_STRING ? new Jr(a, qt.XY) : h === Zt.POLYGON ? new fr(a, qt.XY, l) : h === Zt.MULTI_POINT ? new Gc(a, qt.XY) : h === Zt.MULTI_LINE_STRING ? new Dc(a, qt.XY, l) : null;
|
||
r = new (0, this.featureClass_), this.geometryName_ && r.setGeometryName(this.geometryName_);
|
||
var y = kc(u, !1, this.adaptOptions(i));
|
||
r.setGeometry(y), r.setId(n), r.setProperties(s)
|
||
}
|
||
return r
|
||
}, e.prototype.getLastExtent = function () {
|
||
return this.extent_
|
||
}, e.prototype.getType = function () {
|
||
return gh.ARRAY_BUFFER
|
||
}, e.prototype.readFeatures = function (t, e) {
|
||
var i = this.layers_, r = new rm.a(t), o = r.readFields(am, {}), n = [];
|
||
for (var s in o) if (!i || -1 != i.indexOf(s)) {
|
||
for (var a = o[s], l = 0, h = a.length; l < h; ++l) {
|
||
var u = um(r, a, l);
|
||
n.push(this.createFeature_(r, u))
|
||
}
|
||
this.extent_ = a ? [0, 0, a.extent, a.extent] : null
|
||
}
|
||
return n
|
||
}, e.prototype.readProjection = function (t) {
|
||
return this.dataProjection
|
||
}, e.prototype.setLayers = function (t) {
|
||
this.layers_ = t
|
||
}, e
|
||
}(Ac), pm = [null], dm = pp(pm, {
|
||
nd: function (t, e) {
|
||
e[e.length - 1].ndrefs.push(t.getAttribute("ref"))
|
||
}, tag: ym
|
||
}), fm = pp(pm, {
|
||
node: function (t, e) {
|
||
var i = e[0], r = e[e.length - 1], o = t.getAttribute("id"),
|
||
n = [parseFloat(t.getAttribute("lon")), parseFloat(t.getAttribute("lat"))];
|
||
r.nodes[o] = n;
|
||
var s = fp({tags: {}}, mm, t, e);
|
||
if (!g(s.tags)) {
|
||
var a = new qi(n);
|
||
kc(a, !1, i);
|
||
var l = new X(a);
|
||
l.setId(o), l.setProperties(s.tags), r.features.push(l)
|
||
}
|
||
}, way: function (t, e) {
|
||
var i = fp({id: t.getAttribute("id"), ndrefs: [], tags: {}}, dm, t, e);
|
||
e[e.length - 1].ways.push(i)
|
||
}
|
||
}), gm = function (t) {
|
||
function e() {
|
||
t.call(this), this.dataProjection = We("EPSG:4326")
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.readFeaturesFromNode = function (t, e) {
|
||
var i = this.getReadOptions(t, e);
|
||
if ("osm" == t.localName) {
|
||
for (var r = fp({nodes: {}, ways: [], features: []}, fm, t, [i]), o = 0; o < r.ways.length; o++) {
|
||
for (var n = r.ways[o], s = [], a = 0, l = n.ndrefs.length; a < l; a++) {
|
||
Q(s, r.nodes[n.ndrefs[a]])
|
||
}
|
||
var h = void 0;
|
||
kc(h = n.ndrefs[0] == n.ndrefs[n.ndrefs.length - 1] ? new fr(s, qt.XY, [s.length]) : new Jr(s, qt.XY), !1, i);
|
||
var u = new X(h);
|
||
u.setId(n.id), u.setProperties(n.tags), r.features.push(u)
|
||
}
|
||
if (r.features) return r.features
|
||
}
|
||
return []
|
||
}, e
|
||
}(yp), mm = pp(pm, {tag: ym});
|
||
|
||
function ym(t, e) {
|
||
e[e.length - 1].tags[t.getAttribute("k")] = t.getAttribute("v")
|
||
}
|
||
|
||
var vm = gm, _m = "http://www.w3.org/1999/xlink";
|
||
|
||
function xm(t) {
|
||
return t.getAttributeNS(_m, "href")
|
||
}
|
||
|
||
var wm = function () {
|
||
};
|
||
wm.prototype.read = function (t) {
|
||
if (t) {
|
||
if ("string" == typeof t) {
|
||
var e = ep(t);
|
||
return this.readFromDocument(e)
|
||
}
|
||
return Qc(t) ? this.readFromDocument(t) : this.readFromNode(t)
|
||
}
|
||
return null
|
||
}, wm.prototype.readFromDocument = function (t) {
|
||
}, wm.prototype.readFromNode = function (t) {
|
||
};
|
||
var bm = wm, Cm = [null, "http://www.opengis.net/ows/1.1"], Sm = pp(Cm, {
|
||
ServiceIdentification: sp(function (t, e) {
|
||
return fp({}, Dm, t, e)
|
||
}), ServiceProvider: sp(function (t, e) {
|
||
return fp({}, Gm, t, e)
|
||
}), OperationsMetadata: sp(function (t, e) {
|
||
return fp({}, Am, t, e)
|
||
})
|
||
}), Em = function (t) {
|
||
function e() {
|
||
t.call(this)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.readFromDocument = function (t) {
|
||
for (var e = t.firstChild; e; e = e.nextSibling) if (e.nodeType == Node.ELEMENT_NODE) return this.readFromNode(e);
|
||
return null
|
||
}, e.prototype.readFromNode = function (t) {
|
||
var e = fp({}, Sm, t, []);
|
||
return e || null
|
||
}, e
|
||
}(bm), Tm = pp(Cm, {
|
||
DeliveryPoint: sp(Lp),
|
||
City: sp(Lp),
|
||
AdministrativeArea: sp(Lp),
|
||
PostalCode: sp(Lp),
|
||
Country: sp(Lp),
|
||
ElectronicMailAddress: sp(Lp)
|
||
}), Rm = pp(Cm, {
|
||
Value: np(function (t, e) {
|
||
return Lp(t)
|
||
})
|
||
}), Pm = pp(Cm, {
|
||
AllowedValues: sp(function (t, e) {
|
||
return fp({}, Rm, t, e)
|
||
})
|
||
}), Lm = pp(Cm, {
|
||
Phone: sp(function (t, e) {
|
||
return fp({}, km, t, e)
|
||
}), Address: sp(function (t, e) {
|
||
return fp({}, Tm, t, e)
|
||
})
|
||
}), Im = pp(Cm, {
|
||
HTTP: sp(function (t, e) {
|
||
return fp({}, Om, t, e)
|
||
})
|
||
}), Om = pp(Cm, {
|
||
Get: np(function (t, e) {
|
||
var i = xm(t);
|
||
if (!i) return;
|
||
return fp({href: i}, Fm, t, e)
|
||
}), Post: void 0
|
||
}), Mm = pp(Cm, {
|
||
DCP: sp(function (t, e) {
|
||
return fp({}, Im, t, e)
|
||
})
|
||
}), Am = pp(Cm, {
|
||
Operation: function (t, e) {
|
||
var i = t.getAttribute("name"), r = fp({}, Mm, t, e);
|
||
if (!r) return;
|
||
e[e.length - 1][i] = r
|
||
}
|
||
}), km = pp(Cm, {Voice: sp(Lp), Facsimile: sp(Lp)}), Fm = pp(Cm, {
|
||
Constraint: np(function (t, e) {
|
||
var i = t.getAttribute("name");
|
||
if (!i) return;
|
||
return fp({name: i}, Pm, t, e)
|
||
})
|
||
}), Nm = pp(Cm, {
|
||
IndividualName: sp(Lp), PositionName: sp(Lp), ContactInfo: sp(function (t, e) {
|
||
return fp({}, Lm, t, e)
|
||
})
|
||
}), Dm = pp(Cm, {
|
||
Abstract: sp(Lp),
|
||
AccessConstraints: sp(Lp),
|
||
Fees: sp(Lp),
|
||
Title: sp(Lp),
|
||
ServiceTypeVersion: sp(Lp),
|
||
ServiceType: sp(Lp)
|
||
}), Gm = pp(Cm, {
|
||
ProviderName: sp(Lp), ProviderSite: sp(xm), ServiceContact: sp(function (t, e) {
|
||
return fp({}, Nm, t, e)
|
||
})
|
||
});
|
||
var jm = Em;
|
||
|
||
function zm(t, e, i, r, o, n) {
|
||
var s, a;
|
||
void 0 !== o ? (s = o, a = void 0 !== n ? n : 0) : (s = [], a = 0);
|
||
for (var l = e; l < i;) {
|
||
var h = t[l++];
|
||
s[a++] = t[l++], s[a++] = h;
|
||
for (var u = 2; u < r; ++u) s[a++] = t[l++]
|
||
}
|
||
return s.length = a, s
|
||
}
|
||
|
||
function Um(t, e, i) {
|
||
var r, o = i || 1e5, n = new Array(e);
|
||
for (r = 0; r < e; ++r) n[r] = 0;
|
||
for (var s = 0, a = t.length; s < a;) for (r = 0; r < e; ++r, ++s) {
|
||
var l = t[s], h = l - n[r];
|
||
n[r] = l, t[s] = h
|
||
}
|
||
return Vm(t, o)
|
||
}
|
||
|
||
function Bm(t, e, i) {
|
||
var r, o = i || 1e5, n = new Array(e);
|
||
for (r = 0; r < e; ++r) n[r] = 0;
|
||
for (var s = Ym(t, o), a = 0, l = s.length; a < l;) for (r = 0; r < e; ++r, ++a) n[r] += s[a], s[a] = n[r];
|
||
return s
|
||
}
|
||
|
||
function Vm(t, e) {
|
||
for (var i = e || 1e5, r = 0, o = t.length; r < o; ++r) t[r] = Math.round(t[r] * i);
|
||
return Wm(t)
|
||
}
|
||
|
||
function Ym(t, e) {
|
||
for (var i = e || 1e5, r = Hm(t), o = 0, n = r.length; o < n; ++o) r[o] /= i;
|
||
return r
|
||
}
|
||
|
||
function Wm(t) {
|
||
for (var e = 0, i = t.length; e < i; ++e) {
|
||
var r = t[e];
|
||
t[e] = r < 0 ? ~(r << 1) : r << 1
|
||
}
|
||
return Xm(t)
|
||
}
|
||
|
||
function Hm(t) {
|
||
for (var e = qm(t), i = 0, r = e.length; i < r; ++i) {
|
||
var o = e[i];
|
||
e[i] = 1 & o ? ~(o >> 1) : o >> 1
|
||
}
|
||
return e
|
||
}
|
||
|
||
function Xm(t) {
|
||
for (var e = "", i = 0, r = t.length; i < r; ++i) e += Zm(t[i]);
|
||
return e
|
||
}
|
||
|
||
function qm(t) {
|
||
for (var e = [], i = 0, r = 0, o = 0, n = t.length; o < n; ++o) {
|
||
var s = t.charCodeAt(o) - 63;
|
||
i |= (31 & s) << r, s < 32 ? (e.push(i), i = 0, r = 0) : r += 5
|
||
}
|
||
return e
|
||
}
|
||
|
||
function Zm(t) {
|
||
for (var e, i = ""; t >= 32;) e = 63 + (32 | 31 & t), i += String.fromCharCode(e), t >>= 5;
|
||
return e = t + 63, i += String.fromCharCode(e)
|
||
}
|
||
|
||
var Km = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = e || {};
|
||
this.dataProjection = We("EPSG:4326"), this.factor_ = i.factor ? i.factor : 1e5, this.geometryLayout_ = i.geometryLayout ? i.geometryLayout : qt.XY
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.readFeatureFromText = function (t, e) {
|
||
var i = this.readGeometryFromText(t, e);
|
||
return new X(i)
|
||
}, e.prototype.readFeaturesFromText = function (t, e) {
|
||
return [this.readFeatureFromText(t, e)]
|
||
}, e.prototype.readGeometryFromText = function (t, e) {
|
||
var i = xi(this.geometryLayout_), r = Bm(t, i, this.factor_);
|
||
zm(r, 0, r.length, i, r);
|
||
var o = Di(r, 0, r.length, i);
|
||
return kc(new Jr(o, this.geometryLayout_), !1, this.adaptOptions(e))
|
||
}, e.prototype.writeFeatureText = function (t, e) {
|
||
var i = t.getGeometry();
|
||
return i ? this.writeGeometryText(i, e) : (W(!1, 40), "")
|
||
}, e.prototype.writeFeaturesText = function (t, e) {
|
||
return this.writeFeatureText(t[0], e)
|
||
}, e.prototype.writeGeometryText = function (t, e) {
|
||
var i = (t = kc(t, !0, this.adaptOptions(e))).getFlatCoordinates(), r = t.getStride();
|
||
return zm(i, 0, i.length, r, i), Um(i, r, this.factor_)
|
||
}, e
|
||
}(Ad), Jm = {
|
||
Point: function (t, e, i) {
|
||
var r = t.coordinates;
|
||
e && i && iy(r, e, i);
|
||
return new qi(r)
|
||
}, LineString: function (t, e) {
|
||
var i = $m(t.arcs, e);
|
||
return new Jr(i)
|
||
}, Polygon: function (t, e) {
|
||
for (var i = [], r = 0, o = t.arcs.length; r < o; ++r) i[r] = $m(t.arcs[r], e);
|
||
return new fr(i)
|
||
}, MultiPoint: function (t, e, i) {
|
||
var r = t.coordinates;
|
||
if (e && i) for (var o = 0, n = r.length; o < n; ++o) iy(r[o], e, i);
|
||
return new Gc(r)
|
||
}, MultiLineString: function (t, e) {
|
||
for (var i = [], r = 0, o = t.arcs.length; r < o; ++r) i[r] = $m(t.arcs[r], e);
|
||
return new Dc(i)
|
||
}, MultiPolygon: function (t, e) {
|
||
for (var i = [], r = 0, o = t.arcs.length; r < o; ++r) {
|
||
for (var n = t.arcs[r], s = [], a = 0, l = n.length; a < l; ++a) s[a] = $m(n[a], e);
|
||
i[r] = s
|
||
}
|
||
return new zc(i)
|
||
}
|
||
};
|
||
|
||
function $m(t, e) {
|
||
for (var i, r, o = [], n = 0, s = t.length; n < s; ++n) i = t[n], n > 0 && o.pop(), r = i >= 0 ? e[i] : e[~i].slice().reverse(), o.push.apply(o, r);
|
||
for (var a = 0, l = o.length; a < l; ++a) o[a] = o[a].slice();
|
||
return o
|
||
}
|
||
|
||
function Qm(t, e, i, r, o, n, s) {
|
||
for (var a = t.geometries, l = [], h = 0, u = a.length; h < u; ++h) l[h] = ty(a[h], e, i, r, o, n, s);
|
||
return l
|
||
}
|
||
|
||
function ty(t, e, i, r, o, n, s) {
|
||
var a, l = t.type, h = Jm[l];
|
||
a = "Point" === l || "MultiPoint" === l ? h(t, i, r) : h(t, e);
|
||
var u = new X;
|
||
u.setGeometry(kc(a, !1, s)), void 0 !== t.id && u.setId(t.id);
|
||
var c = t.properties;
|
||
return o && (c || (c = {}), c[o] = n), c && u.setProperties(c), u
|
||
}
|
||
|
||
function ey(t, e, i) {
|
||
for (var r = 0, o = 0, n = 0, s = t.length; n < s; ++n) {
|
||
var a = t[n];
|
||
r += a[0], o += a[1], a[0] = r, a[1] = o, iy(a, e, i)
|
||
}
|
||
}
|
||
|
||
function iy(t, e, i) {
|
||
t[0] = t[0] * e[0] + i[0], t[1] = t[1] * e[1] + i[1]
|
||
}
|
||
|
||
var ry = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = e || {};
|
||
this.layerName_ = i.layerName, this.layers_ = i.layers ? i.layers : null, this.dataProjection = We(i.dataProjection ? i.dataProjection : "EPSG:4326")
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.readFeaturesFromObject = function (t, e) {
|
||
if ("Topology" == t.type) {
|
||
var i, r = t, o = null, n = null;
|
||
r.transform && (o = (i = r.transform).scale, n = i.translate);
|
||
var s = r.arcs;
|
||
i && function (t, e, i) {
|
||
for (var r = 0, o = t.length; r < o; ++r) ey(t[r], e, i)
|
||
}(s, o, n);
|
||
var a, l = [], h = r.objects, u = this.layerName_;
|
||
for (var c in h) this.layers_ && -1 == this.layers_.indexOf(c) || ("GeometryCollection" === h[c].type ? (a = h[c], l.push.apply(l, Qm(a, s, o, n, u, c, e))) : (a = h[c], l.push(ty(a, s, o, n, u, c, e))));
|
||
return l
|
||
}
|
||
return []
|
||
}, e.prototype.readProjectionFromObject = function (t) {
|
||
return this.dataProjection
|
||
}, e
|
||
}(Nc), oy = function (t) {
|
||
this.tagName_ = t
|
||
};
|
||
oy.prototype.getTagName = function () {
|
||
return this.tagName_
|
||
};
|
||
var ny = oy, sy = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e), this.conditions = i, W(this.conditions.length >= 2, 57)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(ny), ay = function (t) {
|
||
function e(e) {
|
||
t.call(this, "And", Array.prototype.slice.call(arguments))
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(sy), ly = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, "BBOX"), this.geometryName = e, this.extent = i, this.srsName = r
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(ny), hy = function (t) {
|
||
function e(e, i, r, o) {
|
||
t.call(this, e), this.geometryName = i || "the_geom", this.geometry = r, this.srsName = o
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(ny), uy = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, "Contains", e, i, r)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(hy), cy = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e), this.propertyName = i
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(ny), py = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, "During", e), this.begin = i, this.end = r
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(cy), dy = function (t) {
|
||
function e(e, i, r, o) {
|
||
t.call(this, e, i), this.expression = r, this.matchCase = o
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(cy), fy = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, "PropertyIsEqualTo", e, i, r)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(dy), gy = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, "PropertyIsGreaterThan", e, i)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(dy), my = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, "PropertyIsGreaterThanOrEqualTo", e, i)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(dy), yy = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, "Intersects", e, i, r)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(hy), vy = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, "PropertyIsBetween", e), this.lowerBoundary = i, this.upperBoundary = r
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(cy), _y = function (t) {
|
||
function e(e, i, r, o, n, s) {
|
||
t.call(this, "PropertyIsLike", e), this.pattern = i, this.wildCard = void 0 !== r ? r : "*", this.singleChar = void 0 !== o ? o : ".", this.escapeChar = void 0 !== n ? n : "!", this.matchCase = s
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(cy), xy = function (t) {
|
||
function e(e) {
|
||
t.call(this, "PropertyIsNull", e)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(cy), wy = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, "PropertyIsLessThan", e, i)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(dy), by = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, "PropertyIsLessThanOrEqualTo", e, i)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(dy), Cy = function (t) {
|
||
function e(e) {
|
||
t.call(this, "Not"), this.condition = e
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(ny), Sy = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, "PropertyIsNotEqualTo", e, i, r)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(dy), Ey = function (t) {
|
||
function e(e) {
|
||
t.call(this, "Or", Array.prototype.slice.call(arguments))
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(sy), Ty = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, "Within", e, i, r)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(hy);
|
||
|
||
function Ry(t) {
|
||
var e = [null].concat(Array.prototype.slice.call(arguments));
|
||
return new (Function.prototype.bind.apply(ay, e))
|
||
}
|
||
|
||
function Py(t, e, i) {
|
||
return new ly(t, e, i)
|
||
}
|
||
|
||
var Ly = {"http://www.opengis.net/gml": {boundedBy: sp(wp.prototype.readGeometryElement, "bounds")}},
|
||
Iy = {"http://www.opengis.net/wfs": {totalInserted: sp(Rp), totalUpdated: sp(Rp), totalDeleted: sp(Rp)}},
|
||
Oy = {
|
||
"http://www.opengis.net/wfs": {
|
||
TransactionSummary: sp(function (t, e) {
|
||
return fp({}, Iy, t, e)
|
||
}, "transactionSummary"), InsertResults: sp(function (t, e) {
|
||
return fp([], Vy, t, e)
|
||
}, "insertIds")
|
||
}
|
||
}, My = {"http://www.opengis.net/wfs": {PropertyName: ap(Fp)}}, Ay = {
|
||
"http://www.opengis.net/wfs": {
|
||
Insert: ap(function (t, e, i) {
|
||
var r = i[i.length - 1], o = r.featureType, n = r.featureNS, s = r.gmlVersion, a = Kc(n, o);
|
||
t.appendChild(a), 2 === s ? Wp.prototype.writeFeatureElement(a, e, i) : jp.prototype.writeFeatureElement(a, e, i)
|
||
}), Update: ap(function (t, e, i) {
|
||
var r = i[i.length - 1];
|
||
W(void 0 !== e.getId(), 27);
|
||
var o = r.featureType, n = r.featurePrefix, s = r.featureNS, a = Wy(n, o), l = e.getGeometryName();
|
||
t.setAttribute("typeName", a), t.setAttributeNS(Fy, "xmlns:" + n, s);
|
||
var h = e.getId();
|
||
if (void 0 !== h) {
|
||
for (var u = e.getKeys(), c = [], p = 0, d = u.length; p < d; p++) {
|
||
var f = e.get(u[p]);
|
||
if (void 0 !== f) {
|
||
var g = u[p];
|
||
f && "function" == typeof f.getSimplifiedGeometry && (g = l), c.push({
|
||
name: g,
|
||
value: f
|
||
})
|
||
}
|
||
}
|
||
mp({
|
||
gmlVersion: r.gmlVersion,
|
||
node: t,
|
||
hasZ: r.hasZ,
|
||
srsName: r.srsName
|
||
}, Ay, hp("Property"), c, i), Yy(t, h, i)
|
||
}
|
||
}), Delete: ap(function (t, e, i) {
|
||
var r = i[i.length - 1];
|
||
W(void 0 !== e.getId(), 26);
|
||
var o = r.featureType, n = r.featurePrefix, s = r.featureNS, a = Wy(n, o);
|
||
t.setAttribute("typeName", a), t.setAttributeNS(Fy, "xmlns:" + n, s);
|
||
var l = e.getId();
|
||
void 0 !== l && Yy(t, l, i)
|
||
}), Property: ap(function (t, e, i) {
|
||
var r = Kc(Dy, "Name"), o = i[i.length - 1].gmlVersion;
|
||
if (t.appendChild(r), Fp(r, e.name), void 0 !== e.value && null !== e.value) {
|
||
var n = Kc(Dy, "Value");
|
||
t.appendChild(n), e.value && "function" == typeof e.value.getSimplifiedGeometry ? 2 === o ? Wp.prototype.writeGeometryElement(n, e.value, i) : jp.prototype.writeGeometryElement(n, e.value, i) : Fp(n, e.value)
|
||
}
|
||
}), Native: ap(function (t, e, i) {
|
||
e.vendorId && t.setAttribute("vendorId", e.vendorId);
|
||
void 0 !== e.safeToIgnore && t.setAttribute("safeToIgnore", String(e.safeToIgnore));
|
||
void 0 !== e.value && Fp(t, e.value)
|
||
})
|
||
}
|
||
}, ky = "feature", Fy = "http://www.w3.org/2000/xmlns/", Ny = "http://www.opengis.net/ogc",
|
||
Dy = "http://www.opengis.net/wfs", Gy = "http://www.opengis.net/fes", jy = {
|
||
"1.1.0": "http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd",
|
||
"1.0.0": "http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"
|
||
}, zy = "1.1.0", Uy = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = e || {};
|
||
this.featureType_ = i.featureType, this.featureNS_ = i.featureNS, this.gmlFormat_ = i.gmlFormat ? i.gmlFormat : new jp, this.schemaLocation_ = i.schemaLocation ? i.schemaLocation : jy[zy]
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getFeatureType = function () {
|
||
return this.featureType_
|
||
}, e.prototype.setFeatureType = function (t) {
|
||
this.featureType_ = t
|
||
}, e.prototype.readFeaturesFromNode = function (t, e) {
|
||
var i = {node: t};
|
||
p(i, {
|
||
featureType: this.featureType_,
|
||
featureNS: this.featureNS_
|
||
}), p(i, this.getReadOptions(t, e || {}));
|
||
var r = [i];
|
||
this.gmlFormat_.FEATURE_COLLECTION_PARSERS[vp].featureMember = rp(wp.prototype.readFeaturesInternal);
|
||
var o = fp([], this.gmlFormat_.FEATURE_COLLECTION_PARSERS, t, r, this.gmlFormat_);
|
||
return o || (o = []), o
|
||
}, e.prototype.readTransactionResponse = function (t) {
|
||
if (t) {
|
||
if ("string" == typeof t) {
|
||
var e = ep(t);
|
||
return this.readTransactionResponseFromDocument(e)
|
||
}
|
||
return Qc(t) ? this.readTransactionResponseFromDocument(t) : this.readTransactionResponseFromNode(t)
|
||
}
|
||
}, e.prototype.readFeatureCollectionMetadata = function (t) {
|
||
if (t) {
|
||
if ("string" == typeof t) {
|
||
var e = ep(t);
|
||
return this.readFeatureCollectionMetadataFromDocument(e)
|
||
}
|
||
return Qc(t) ? this.readFeatureCollectionMetadataFromDocument(t) : this.readFeatureCollectionMetadataFromNode(t)
|
||
}
|
||
}, e.prototype.readFeatureCollectionMetadataFromDocument = function (t) {
|
||
for (var e = t.firstChild; e; e = e.nextSibling) if (e.nodeType == Node.ELEMENT_NODE) return this.readFeatureCollectionMetadataFromNode(e)
|
||
}, e.prototype.readFeatureCollectionMetadataFromNode = function (t) {
|
||
var e = {}, i = Pp(t.getAttribute("numberOfFeatures"));
|
||
return e.numberOfFeatures = i, fp(e, Ly, t, [], this.gmlFormat_)
|
||
}, e.prototype.readTransactionResponseFromDocument = function (t) {
|
||
for (var e = t.firstChild; e; e = e.nextSibling) if (e.nodeType == Node.ELEMENT_NODE) return this.readTransactionResponseFromNode(e)
|
||
}, e.prototype.readTransactionResponseFromNode = function (t) {
|
||
return fp({}, Oy, t, [])
|
||
}, e.prototype.writeGetFeature = function (t) {
|
||
var e, i = Kc(Dy, "GetFeature");
|
||
if (i.setAttribute("service", "WFS"), i.setAttribute("version", "1.1.0"), t && (t.handle && i.setAttribute("handle", t.handle), t.outputFormat && i.setAttribute("outputFormat", t.outputFormat), void 0 !== t.maxFeatures && i.setAttribute("maxFeatures", String(t.maxFeatures)), t.resultType && i.setAttribute("resultType", t.resultType), void 0 !== t.startIndex && i.setAttribute("startIndex", String(t.startIndex)), void 0 !== t.count && i.setAttribute("count", String(t.count)), void 0 !== t.viewParams && i.setAttribute("viewParams ", t.viewParams), e = t.filter, t.bbox)) {
|
||
W(t.geometryName, 12);
|
||
var r = Py(t.geometryName, t.bbox, t.srsName);
|
||
e = e ? Ry(e, r) : r
|
||
}
|
||
i.setAttributeNS(Zc, "xsi:schemaLocation", this.schemaLocation_);
|
||
var o = {node: i};
|
||
return p(o, {
|
||
srsName: t.srsName,
|
||
featureNS: t.featureNS ? t.featureNS : this.featureNS_,
|
||
featurePrefix: t.featurePrefix,
|
||
geometryName: t.geometryName,
|
||
filter: e,
|
||
propertyNames: t.propertyNames ? t.propertyNames : []
|
||
}), W(Array.isArray(t.featureTypes), 11), function (t, e, i) {
|
||
var r = i[i.length - 1], o = p({}, r);
|
||
o.node = t, mp(o, Hy, hp("Query"), e, i)
|
||
}(i, t.featureTypes, [o]), i
|
||
}, e.prototype.writeTransaction = function (t, e, i, r) {
|
||
var o, n, s = [], a = Kc(Dy, "Transaction"), l = r.version ? r.version : zy, h = "1.0.0" === l ? 2 : 3;
|
||
a.setAttribute("service", "WFS"), a.setAttribute("version", l), r && (o = r.gmlOptions ? r.gmlOptions : {}, r.handle && a.setAttribute("handle", r.handle));
|
||
var u = jy[l];
|
||
a.setAttributeNS(Zc, "xsi:schemaLocation", u);
|
||
var c = r.featurePrefix ? r.featurePrefix : ky;
|
||
return t && (n = p({node: a}, {
|
||
featureNS: r.featureNS,
|
||
featureType: r.featureType,
|
||
featurePrefix: c,
|
||
gmlVersion: h,
|
||
hasZ: r.hasZ,
|
||
srsName: r.srsName
|
||
}), p(n, o), mp(n, Ay, hp("Insert"), t, s)), e && (n = p({node: a}, {
|
||
featureNS: r.featureNS,
|
||
featureType: r.featureType,
|
||
featurePrefix: c,
|
||
gmlVersion: h,
|
||
hasZ: r.hasZ,
|
||
srsName: r.srsName
|
||
}), p(n, o), mp(n, Ay, hp("Update"), e, s)), i && mp({
|
||
node: a,
|
||
featureNS: r.featureNS,
|
||
featureType: r.featureType,
|
||
featurePrefix: c,
|
||
gmlVersion: h,
|
||
srsName: r.srsName
|
||
}, Ay, hp("Delete"), i, s), r.nativeElements && mp({
|
||
node: a,
|
||
featureNS: r.featureNS,
|
||
featureType: r.featureType,
|
||
featurePrefix: c,
|
||
gmlVersion: h,
|
||
srsName: r.srsName
|
||
}, Ay, hp("Native"), r.nativeElements, s), a
|
||
}, e.prototype.readProjectionFromDocument = function (t) {
|
||
for (var e = t.firstChild; e; e = e.nextSibling) if (e.nodeType == Node.ELEMENT_NODE) return this.readProjectionFromNode(e);
|
||
return null
|
||
}, e.prototype.readProjectionFromNode = function (t) {
|
||
if (t.firstElementChild && t.firstElementChild.firstElementChild) for (var e = (t = t.firstElementChild.firstElementChild).firstElementChild; e; e = e.nextElementSibling) if (0 !== e.childNodes.length && (1 !== e.childNodes.length || 3 !== e.firstChild.nodeType)) {
|
||
var i = [{}];
|
||
return this.gmlFormat_.readGeometryElement(e, i), We(i.pop().srsName)
|
||
}
|
||
return null
|
||
}, e
|
||
}(yp);
|
||
var By = {
|
||
"http://www.opengis.net/ogc": {
|
||
FeatureId: rp(function (t, e) {
|
||
return t.getAttribute("fid")
|
||
})
|
||
}
|
||
};
|
||
var Vy = {
|
||
"http://www.opengis.net/wfs": {
|
||
Feature: function (t, e) {
|
||
dp(By, t, e)
|
||
}
|
||
}
|
||
};
|
||
|
||
function Yy(t, e, i) {
|
||
var r = Kc(Ny, "Filter"), o = Kc(Ny, "FeatureId");
|
||
r.appendChild(o), o.setAttribute("fid", e), t.appendChild(r)
|
||
}
|
||
|
||
function Wy(t, e) {
|
||
var i = (t = t || ky) + ":";
|
||
return 0 === e.indexOf(i) ? e : i + e
|
||
}
|
||
|
||
var Hy = {
|
||
"http://www.opengis.net/wfs": {
|
||
Query: ap(function (t, e, i) {
|
||
var r, o = i[i.length - 1], n = o.featurePrefix, s = o.featureNS, a = o.propertyNames,
|
||
l = o.srsName;
|
||
r = n ? Wy(n, e) : e;
|
||
t.setAttribute("typeName", r), l && t.setAttribute("srsName", l);
|
||
s && t.setAttributeNS(Fy, "xmlns:" + n, s);
|
||
var h = p({}, o);
|
||
h.node = t, mp(h, My, hp("PropertyName"), a, i);
|
||
var u = o.filter;
|
||
if (u) {
|
||
var c = Kc(Ny, "Filter");
|
||
t.appendChild(c), Xy(c, u, i)
|
||
}
|
||
})
|
||
}, "http://www.opengis.net/ogc": {
|
||
During: ap(function (t, e, i) {
|
||
var r = Kc(Gy, "ValueReference");
|
||
Fp(r, e.propertyName), t.appendChild(r);
|
||
var o = Kc(vp, "TimePeriod");
|
||
t.appendChild(o);
|
||
var n = Kc(vp, "begin");
|
||
o.appendChild(n), Qy(n, e.begin);
|
||
var s = Kc(vp, "end");
|
||
o.appendChild(s), Qy(s, e.end)
|
||
}),
|
||
And: ap(qy),
|
||
Or: ap(qy),
|
||
Not: ap(function (t, e, i) {
|
||
var r = {node: t}, o = e.condition;
|
||
mp(r, Hy, hp(o.getTagName()), [o], i)
|
||
}),
|
||
BBOX: ap(function (t, e, i) {
|
||
i[i.length - 1].srsName = e.srsName, Jy(t, e.geometryName), jp.prototype.writeGeometryElement(t, e.extent, i)
|
||
}),
|
||
Contains: ap(function (t, e, i) {
|
||
i[i.length - 1].srsName = e.srsName, Jy(t, e.geometryName), jp.prototype.writeGeometryElement(t, e.geometry, i)
|
||
}),
|
||
Intersects: ap(function (t, e, i) {
|
||
i[i.length - 1].srsName = e.srsName, Jy(t, e.geometryName), jp.prototype.writeGeometryElement(t, e.geometry, i)
|
||
}),
|
||
Within: ap(function (t, e, i) {
|
||
i[i.length - 1].srsName = e.srsName, Jy(t, e.geometryName), jp.prototype.writeGeometryElement(t, e.geometry, i)
|
||
}),
|
||
PropertyIsEqualTo: ap(Zy),
|
||
PropertyIsNotEqualTo: ap(Zy),
|
||
PropertyIsLessThan: ap(Zy),
|
||
PropertyIsLessThanOrEqualTo: ap(Zy),
|
||
PropertyIsGreaterThan: ap(Zy),
|
||
PropertyIsGreaterThanOrEqualTo: ap(Zy),
|
||
PropertyIsNull: ap(function (t, e, i) {
|
||
Jy(t, e.propertyName)
|
||
}),
|
||
PropertyIsBetween: ap(function (t, e, i) {
|
||
Jy(t, e.propertyName);
|
||
var r = Kc(Ny, "LowerBoundary");
|
||
t.appendChild(r), $y(r, "" + e.lowerBoundary);
|
||
var o = Kc(Ny, "UpperBoundary");
|
||
t.appendChild(o), $y(o, "" + e.upperBoundary)
|
||
}),
|
||
PropertyIsLike: ap(function (t, e, i) {
|
||
t.setAttribute("wildCard", e.wildCard), t.setAttribute("singleChar", e.singleChar), t.setAttribute("escapeChar", e.escapeChar), void 0 !== e.matchCase && t.setAttribute("matchCase", e.matchCase.toString());
|
||
Jy(t, e.propertyName), $y(t, "" + e.pattern)
|
||
})
|
||
}
|
||
};
|
||
|
||
function Xy(t, e, i) {
|
||
mp({node: t}, Hy, hp(e.getTagName()), [e], i)
|
||
}
|
||
|
||
function qy(t, e, i) {
|
||
for (var r = {node: t}, o = e.conditions, n = 0, s = o.length; n < s; ++n) {
|
||
var a = o[n];
|
||
mp(r, Hy, hp(a.getTagName()), [a], i)
|
||
}
|
||
}
|
||
|
||
function Zy(t, e, i) {
|
||
void 0 !== e.matchCase && t.setAttribute("matchCase", e.matchCase.toString()), Jy(t, e.propertyName), $y(t, "" + e.expression)
|
||
}
|
||
|
||
function Ky(t, e, i) {
|
||
var r = Kc(Ny, t);
|
||
Fp(r, i), e.appendChild(r)
|
||
}
|
||
|
||
function Jy(t, e) {
|
||
Ky("PropertyName", t, e)
|
||
}
|
||
|
||
function $y(t, e) {
|
||
Ky("Literal", t, e)
|
||
}
|
||
|
||
function Qy(t, e) {
|
||
var i = Kc(vp, "TimeInstant");
|
||
t.appendChild(i);
|
||
var r = Kc(vp, "timePosition");
|
||
i.appendChild(r), Fp(r, e)
|
||
}
|
||
|
||
var tv = Uy,
|
||
ev = {POINT: qi, LINESTRING: Jr, POLYGON: fr, MULTIPOINT: Gc, MULTILINESTRING: Dc, MULTIPOLYGON: zc},
|
||
iv = "EMPTY", rv = "Z", ov = "M", nv = 1, sv = 2, av = 3, lv = 4, hv = 5, uv = 6, cv = {};
|
||
for (var pv in Zt) cv[pv] = Zt[pv].toUpperCase();
|
||
var dv = function (t) {
|
||
this.wkt = t, this.index_ = -1
|
||
};
|
||
dv.prototype.isAlpha_ = function (t) {
|
||
return t >= "a" && t <= "z" || t >= "A" && t <= "Z"
|
||
}, dv.prototype.isNumeric_ = function (t, e) {
|
||
return t >= "0" && t <= "9" || "." == t && !(void 0 !== e && e)
|
||
}, dv.prototype.isWhiteSpace_ = function (t) {
|
||
return " " == t || "\t" == t || "\r" == t || "\n" == t
|
||
}, dv.prototype.nextChar_ = function () {
|
||
return this.wkt.charAt(++this.index_)
|
||
}, dv.prototype.nextToken = function () {
|
||
var t, e = this.nextChar_(), i = this.index_, r = e;
|
||
if ("(" == e) t = sv; else if ("," == e) t = hv; else if (")" == e) t = av; else if (this.isNumeric_(e) || "-" == e) t = lv, r = this.readNumber_(); else if (this.isAlpha_(e)) t = nv, r = this.readText_(); else {
|
||
if (this.isWhiteSpace_(e)) return this.nextToken();
|
||
if ("" !== e) throw new Error("Unexpected character: " + e);
|
||
t = uv
|
||
}
|
||
return {position: i, value: r, type: t}
|
||
}, dv.prototype.readNumber_ = function () {
|
||
var t, e = this.index_, i = !1, r = !1;
|
||
do {
|
||
"." == t ? i = !0 : "e" != t && "E" != t || (r = !0), t = this.nextChar_()
|
||
} while (this.isNumeric_(t, i) || !r && ("e" == t || "E" == t) || r && ("-" == t || "+" == t));
|
||
return parseFloat(this.wkt.substring(e, this.index_--))
|
||
}, dv.prototype.readText_ = function () {
|
||
var t, e = this.index_;
|
||
do {
|
||
t = this.nextChar_()
|
||
} while (this.isAlpha_(t));
|
||
return this.wkt.substring(e, this.index_--).toUpperCase()
|
||
};
|
||
var fv = function (t) {
|
||
this.lexer_ = t, this.token_, this.layout_ = qt.XY
|
||
};
|
||
|
||
function gv(t) {
|
||
var e = t.getCoordinates();
|
||
return 0 === e.length ? "" : e.join(" ")
|
||
}
|
||
|
||
function mv(t) {
|
||
for (var e = t.getCoordinates(), i = [], r = 0, o = e.length; r < o; ++r) i.push(e[r].join(" "));
|
||
return i.join(",")
|
||
}
|
||
|
||
function yv(t) {
|
||
for (var e = [], i = t.getLinearRings(), r = 0, o = i.length; r < o; ++r) e.push("(" + mv(i[r]) + ")");
|
||
return e.join(",")
|
||
}
|
||
|
||
fv.prototype.consume_ = function () {
|
||
this.token_ = this.lexer_.nextToken()
|
||
}, fv.prototype.isTokenType = function (t) {
|
||
return this.token_.type == t
|
||
}, fv.prototype.match = function (t) {
|
||
var e = this.isTokenType(t);
|
||
return e && this.consume_(), e
|
||
}, fv.prototype.parse = function () {
|
||
return this.consume_(), this.parseGeometry_()
|
||
}, fv.prototype.parseGeometryLayout_ = function () {
|
||
var t = qt.XY, e = this.token_;
|
||
if (this.isTokenType(nv)) {
|
||
var i = e.value;
|
||
i === rv ? t = qt.XYZ : i === ov ? t = qt.XYM : "ZM" === i && (t = qt.XYZM), t !== qt.XY && this.consume_()
|
||
}
|
||
return t
|
||
}, fv.prototype.parseGeometryCollectionText_ = function () {
|
||
if (this.match(sv)) {
|
||
var t = [];
|
||
do {
|
||
t.push(this.parseGeometry_())
|
||
} while (this.match(hv));
|
||
if (this.match(av)) return t
|
||
} else if (this.isEmptyGeometry_()) return [];
|
||
throw new Error(this.formatErrorMessage_())
|
||
}, fv.prototype.parsePointText_ = function () {
|
||
if (this.match(sv)) {
|
||
var t = this.parsePoint_();
|
||
if (this.match(av)) return t
|
||
} else if (this.isEmptyGeometry_()) return null;
|
||
throw new Error(this.formatErrorMessage_())
|
||
}, fv.prototype.parseLineStringText_ = function () {
|
||
if (this.match(sv)) {
|
||
var t = this.parsePointList_();
|
||
if (this.match(av)) return t
|
||
} else if (this.isEmptyGeometry_()) return [];
|
||
throw new Error(this.formatErrorMessage_())
|
||
}, fv.prototype.parsePolygonText_ = function () {
|
||
if (this.match(sv)) {
|
||
var t = this.parseLineStringTextList_();
|
||
if (this.match(av)) return t
|
||
} else if (this.isEmptyGeometry_()) return [];
|
||
throw new Error(this.formatErrorMessage_())
|
||
}, fv.prototype.parseMultiPointText_ = function () {
|
||
var t;
|
||
if (this.match(sv)) {
|
||
if (t = this.token_.type == sv ? this.parsePointTextList_() : this.parsePointList_(), this.match(av)) return t
|
||
} else if (this.isEmptyGeometry_()) return [];
|
||
throw new Error(this.formatErrorMessage_())
|
||
}, fv.prototype.parseMultiLineStringText_ = function () {
|
||
if (this.match(sv)) {
|
||
var t = this.parseLineStringTextList_();
|
||
if (this.match(av)) return t
|
||
} else if (this.isEmptyGeometry_()) return [];
|
||
throw new Error(this.formatErrorMessage_())
|
||
}, fv.prototype.parseMultiPolygonText_ = function () {
|
||
if (this.match(sv)) {
|
||
var t = this.parsePolygonTextList_();
|
||
if (this.match(av)) return t
|
||
} else if (this.isEmptyGeometry_()) return [];
|
||
throw new Error(this.formatErrorMessage_())
|
||
}, fv.prototype.parsePoint_ = function () {
|
||
for (var t = [], e = this.layout_.length, i = 0; i < e; ++i) {
|
||
var r = this.token_;
|
||
if (!this.match(lv)) break;
|
||
t.push(r.value)
|
||
}
|
||
if (t.length == e) return t;
|
||
throw new Error(this.formatErrorMessage_())
|
||
}, fv.prototype.parsePointList_ = function () {
|
||
for (var t = [this.parsePoint_()]; this.match(hv);) t.push(this.parsePoint_());
|
||
return t
|
||
}, fv.prototype.parsePointTextList_ = function () {
|
||
for (var t = [this.parsePointText_()]; this.match(hv);) t.push(this.parsePointText_());
|
||
return t
|
||
}, fv.prototype.parseLineStringTextList_ = function () {
|
||
for (var t = [this.parseLineStringText_()]; this.match(hv);) t.push(this.parseLineStringText_());
|
||
return t
|
||
}, fv.prototype.parsePolygonTextList_ = function () {
|
||
for (var t = [this.parsePolygonText_()]; this.match(hv);) t.push(this.parsePolygonText_());
|
||
return t
|
||
}, fv.prototype.isEmptyGeometry_ = function () {
|
||
var t = this.isTokenType(nv) && this.token_.value == iv;
|
||
return t && this.consume_(), t
|
||
}, fv.prototype.formatErrorMessage_ = function () {
|
||
return "Unexpected `" + this.token_.value + "` at position " + this.token_.position + " in `" + this.lexer_.wkt + "`"
|
||
}, fv.prototype.parseGeometry_ = function () {
|
||
var t = this.token_;
|
||
if (this.match(nv)) {
|
||
var e = t.value;
|
||
if (this.layout_ = this.parseGeometryLayout_(), "GEOMETRYCOLLECTION" == e) {
|
||
var i = this.parseGeometryCollectionText_();
|
||
return new Pd(i)
|
||
}
|
||
var r, o = ev[e];
|
||
if (!o) throw new Error("Invalid geometry type: " + e);
|
||
switch (e) {
|
||
case"POINT":
|
||
r = this.parsePointText_();
|
||
break;
|
||
case"LINESTRING":
|
||
r = this.parseLineStringText_();
|
||
break;
|
||
case"POLYGON":
|
||
r = this.parsePolygonText_();
|
||
break;
|
||
case"MULTIPOINT":
|
||
r = this.parseMultiPointText_();
|
||
break;
|
||
case"MULTILINESTRING":
|
||
r = this.parseMultiLineStringText_();
|
||
break;
|
||
case"MULTIPOLYGON":
|
||
r = this.parseMultiPolygonText_();
|
||
break;
|
||
default:
|
||
throw new Error("Invalid geometry type: " + e)
|
||
}
|
||
return r || (r = o === ev.POINT ? [NaN, NaN] : []), new o(r, this.layout_)
|
||
}
|
||
throw new Error(this.formatErrorMessage_())
|
||
};
|
||
var vv = {
|
||
Point: gv, LineString: mv, Polygon: yv, MultiPoint: function (t) {
|
||
for (var e = [], i = t.getPoints(), r = 0, o = i.length; r < o; ++r) e.push("(" + gv(i[r]) + ")");
|
||
return e.join(",")
|
||
}, MultiLineString: function (t) {
|
||
for (var e = [], i = t.getLineStrings(), r = 0, o = i.length; r < o; ++r) e.push("(" + mv(i[r]) + ")");
|
||
return e.join(",")
|
||
}, MultiPolygon: function (t) {
|
||
for (var e = [], i = t.getPolygons(), r = 0, o = i.length; r < o; ++r) e.push("(" + yv(i[r]) + ")");
|
||
return e.join(",")
|
||
}, GeometryCollection: function (t) {
|
||
for (var e = [], i = t.getGeometries(), r = 0, o = i.length; r < o; ++r) e.push(_v(i[r]));
|
||
return e.join(",")
|
||
}
|
||
};
|
||
|
||
function _v(t) {
|
||
var e = t.getType(), i = (0, vv[e])(t);
|
||
if (e = e.toUpperCase(), "function" == typeof t.getFlatCoordinates) {
|
||
var r = function (t) {
|
||
var e = t.getLayout(), i = "";
|
||
return e !== qt.XYZ && e !== qt.XYZM || (i += rv), e !== qt.XYM && e !== qt.XYZM || (i += ov), i
|
||
}(t);
|
||
r.length > 0 && (e += " " + r)
|
||
}
|
||
return 0 === i.length ? e + " " + iv : e + "(" + i + ")"
|
||
}
|
||
|
||
var xv = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = e || {};
|
||
this.splitCollection_ = void 0 !== i.splitCollection && i.splitCollection
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.parse_ = function (t) {
|
||
var e = new dv(t);
|
||
return new fv(e).parse()
|
||
}, e.prototype.readFeatureFromText = function (t, e) {
|
||
var i = this.readGeometryFromText(t, e);
|
||
if (i) {
|
||
var r = new X;
|
||
return r.setGeometry(i), r
|
||
}
|
||
return null
|
||
}, e.prototype.readFeaturesFromText = function (t, e) {
|
||
for (var i = [], r = this.readGeometryFromText(t, e), o = [], n = 0, s = (i = this.splitCollection_ && r.getType() == Zt.GEOMETRY_COLLECTION ? r.getGeometriesArray() : [r]).length; n < s; ++n) {
|
||
var a = new X;
|
||
a.setGeometry(i[n]), o.push(a)
|
||
}
|
||
return o
|
||
}, e.prototype.readGeometryFromText = function (t, e) {
|
||
var i = this.parse_(t);
|
||
return i ? kc(i, !1, e) : null
|
||
}, e.prototype.writeFeatureText = function (t, e) {
|
||
var i = t.getGeometry();
|
||
return i ? this.writeGeometryText(i, e) : ""
|
||
}, e.prototype.writeFeaturesText = function (t, e) {
|
||
if (1 == t.length) return this.writeFeatureText(t[0], e);
|
||
for (var i = [], r = 0, o = t.length; r < o; ++r) i.push(t[r].getGeometry());
|
||
var n = new Pd(i);
|
||
return this.writeGeometryText(n, e)
|
||
}, e.prototype.writeGeometryText = function (t, e) {
|
||
return _v(kc(t, !0, e))
|
||
}, e
|
||
}(Ad), wv = [null, "http://www.opengis.net/wms"], bv = pp(wv, {
|
||
Service: sp(function (t, e) {
|
||
return fp({}, Ev, t, e)
|
||
}), Capability: sp(function (t, e) {
|
||
return fp({}, Cv, t, e)
|
||
})
|
||
}), Cv = pp(wv, {
|
||
Request: sp(function (t, e) {
|
||
return fp({}, Av, t, e)
|
||
}), Exception: sp(function (t, e) {
|
||
return fp([], Lv, t, e)
|
||
}), Layer: sp(function (t, e) {
|
||
return fp({}, Iv, t, e)
|
||
})
|
||
}), Sv = function (t) {
|
||
function e() {
|
||
t.call(this), this.version = void 0
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.readFromDocument = function (t) {
|
||
for (var e = t.firstChild; e; e = e.nextSibling) if (e.nodeType == Node.ELEMENT_NODE) return this.readFromNode(e);
|
||
return null
|
||
}, e.prototype.readFromNode = function (t) {
|
||
this.version = t.getAttribute("version").trim();
|
||
var e = fp({version: this.version}, bv, t, []);
|
||
return e || null
|
||
}, e
|
||
}(bm), Ev = pp(wv, {
|
||
Name: sp(Lp),
|
||
Title: sp(Lp),
|
||
Abstract: sp(Lp),
|
||
KeywordList: sp(Vv),
|
||
OnlineResource: sp(xm),
|
||
ContactInformation: sp(function (t, e) {
|
||
return fp({}, Tv, t, e)
|
||
}),
|
||
Fees: sp(Lp),
|
||
AccessConstraints: sp(Lp),
|
||
LayerLimit: sp(Rp),
|
||
MaxWidth: sp(Rp),
|
||
MaxHeight: sp(Rp)
|
||
}), Tv = pp(wv, {
|
||
ContactPersonPrimary: sp(function (t, e) {
|
||
return fp({}, Rv, t, e)
|
||
}), ContactPosition: sp(Lp), ContactAddress: sp(function (t, e) {
|
||
return fp({}, Pv, t, e)
|
||
}), ContactVoiceTelephone: sp(Lp), ContactFacsimileTelephone: sp(Lp), ContactElectronicMailAddress: sp(Lp)
|
||
}), Rv = pp(wv, {ContactPerson: sp(Lp), ContactOrganization: sp(Lp)}), Pv = pp(wv, {
|
||
AddressType: sp(Lp),
|
||
Address: sp(Lp),
|
||
City: sp(Lp),
|
||
StateOrProvince: sp(Lp),
|
||
PostCode: sp(Lp),
|
||
Country: sp(Lp)
|
||
}), Lv = pp(wv, {Format: rp(Lp)}), Iv = pp(wv, {
|
||
Name: sp(Lp),
|
||
Title: sp(Lp),
|
||
Abstract: sp(Lp),
|
||
KeywordList: sp(Vv),
|
||
CRS: np(Lp),
|
||
EX_GeographicBoundingBox: sp(function (t, e) {
|
||
var i = fp({}, Mv, t, e);
|
||
if (!i) return;
|
||
var r = i.westBoundLongitude, o = i.southBoundLatitude, n = i.eastBoundLongitude,
|
||
s = i.northBoundLatitude;
|
||
if (void 0 === r || void 0 === o || void 0 === n || void 0 === s) return;
|
||
return [r, o, n, s]
|
||
}),
|
||
BoundingBox: np(function (t, e) {
|
||
var i = [Tp(t.getAttribute("minx")), Tp(t.getAttribute("miny")), Tp(t.getAttribute("maxx")), Tp(t.getAttribute("maxy"))],
|
||
r = [Tp(t.getAttribute("resx")), Tp(t.getAttribute("resy"))];
|
||
return {crs: t.getAttribute("CRS"), extent: i, res: r}
|
||
}),
|
||
Dimension: np(function (t, e) {
|
||
return {
|
||
name: t.getAttribute("name"),
|
||
units: t.getAttribute("units"),
|
||
unitSymbol: t.getAttribute("unitSymbol"),
|
||
default: t.getAttribute("default"),
|
||
multipleValues: Cp(t.getAttribute("multipleValues")),
|
||
nearestValue: Cp(t.getAttribute("nearestValue")),
|
||
current: Cp(t.getAttribute("current")),
|
||
values: Lp(t)
|
||
}
|
||
}),
|
||
Attribution: sp(function (t, e) {
|
||
return fp({}, Ov, t, e)
|
||
}),
|
||
AuthorityURL: np(function (t, e) {
|
||
var i = zv(t, e);
|
||
if (i) return i.name = t.getAttribute("name"), i;
|
||
return
|
||
}),
|
||
Identifier: np(Lp),
|
||
MetadataURL: np(function (t, e) {
|
||
var i = zv(t, e);
|
||
if (i) return i.type = t.getAttribute("type"), i;
|
||
return
|
||
}),
|
||
DataURL: np(zv),
|
||
FeatureListURL: np(zv),
|
||
Style: np(function (t, e) {
|
||
return fp({}, Dv, t, e)
|
||
}),
|
||
MinScaleDenominator: sp(Ep),
|
||
MaxScaleDenominator: sp(Ep),
|
||
Layer: np(function (t, e) {
|
||
var i = e[e.length - 1], r = fp({}, Iv, t, e);
|
||
if (!r) return;
|
||
var o = Cp(t.getAttribute("queryable"));
|
||
void 0 === o && (o = i.queryable);
|
||
r.queryable = void 0 !== o && o;
|
||
var n = Pp(t.getAttribute("cascaded"));
|
||
void 0 === n && (n = i.cascaded);
|
||
r.cascaded = n;
|
||
var s = Cp(t.getAttribute("opaque"));
|
||
void 0 === s && (s = i.opaque);
|
||
r.opaque = void 0 !== s && s;
|
||
var a = Cp(t.getAttribute("noSubsets"));
|
||
void 0 === a && (a = i.noSubsets);
|
||
r.noSubsets = void 0 !== a && a;
|
||
var l = Tp(t.getAttribute("fixedWidth"));
|
||
l || (l = i.fixedWidth);
|
||
r.fixedWidth = l;
|
||
var h = Tp(t.getAttribute("fixedHeight"));
|
||
h || (h = i.fixedHeight);
|
||
r.fixedHeight = h, ["Style", "CRS", "AuthorityURL"].forEach(function (t) {
|
||
if (t in i) {
|
||
var e = r[t] || [];
|
||
r[t] = e.concat(i[t])
|
||
}
|
||
});
|
||
return ["EX_GeographicBoundingBox", "BoundingBox", "Dimension", "Attribution", "MinScaleDenominator", "MaxScaleDenominator"].forEach(function (t) {
|
||
if (!(t in r)) {
|
||
var e = i[t];
|
||
r[t] = e
|
||
}
|
||
}), r
|
||
})
|
||
}), Ov = pp(wv, {Title: sp(Lp), OnlineResource: sp(xm), LogoURL: sp(Bv)}), Mv = pp(wv, {
|
||
westBoundLongitude: sp(Ep),
|
||
eastBoundLongitude: sp(Ep),
|
||
southBoundLatitude: sp(Ep),
|
||
northBoundLatitude: sp(Ep)
|
||
}), Av = pp(wv, {GetCapabilities: sp(Uv), GetMap: sp(Uv), GetFeatureInfo: sp(Uv)}), kv = pp(wv, {
|
||
Format: np(Lp), DCPType: np(function (t, e) {
|
||
return fp({}, Fv, t, e)
|
||
})
|
||
}), Fv = pp(wv, {
|
||
HTTP: sp(function (t, e) {
|
||
return fp({}, Nv, t, e)
|
||
})
|
||
}), Nv = pp(wv, {Get: sp(zv), Post: sp(zv)}), Dv = pp(wv, {
|
||
Name: sp(Lp),
|
||
Title: sp(Lp),
|
||
Abstract: sp(Lp),
|
||
LegendURL: np(Bv),
|
||
StyleSheetURL: sp(zv),
|
||
StyleURL: sp(zv)
|
||
}), Gv = pp(wv, {Format: sp(Lp), OnlineResource: sp(xm)}), jv = pp(wv, {Keyword: rp(Lp)});
|
||
|
||
function zv(t, e) {
|
||
return fp({}, Gv, t, e)
|
||
}
|
||
|
||
function Uv(t, e) {
|
||
return fp({}, kv, t, e)
|
||
}
|
||
|
||
function Bv(t, e) {
|
||
var i = zv(t, e);
|
||
if (i) {
|
||
var r = [Pp(t.getAttribute("width")), Pp(t.getAttribute("height"))];
|
||
return i.size = r, i
|
||
}
|
||
}
|
||
|
||
function Vv(t, e) {
|
||
return fp([], jv, t, e)
|
||
}
|
||
|
||
var Yv = Sv, Wv = function (t) {
|
||
function e(e) {
|
||
t.call(this);
|
||
var i = e || {};
|
||
this.featureNS_ = "http://mapserver.gis.umn.edu/mapserver", this.gmlFormat_ = new Wp, this.layers_ = i.layers ? i.layers : null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getLayers = function () {
|
||
return this.layers_
|
||
}, e.prototype.setLayers = function (t) {
|
||
this.layers_ = t
|
||
}, e.prototype.readFeatures_ = function (t, e) {
|
||
t.setAttribute("namespaceURI", this.featureNS_);
|
||
var i = t.localName, r = [];
|
||
if (0 === t.childNodes.length) return r;
|
||
if ("msGMLOutput" == i) for (var o = 0, n = t.childNodes.length; o < n; o++) {
|
||
var s = t.childNodes[o];
|
||
if (s.nodeType === Node.ELEMENT_NODE) {
|
||
var a = s, l = e[0], h = a.localName.replace("_layer", "");
|
||
if (!this.layers_ || K(this.layers_, h)) {
|
||
var u = h + "_feature";
|
||
l.featureType = u, l.featureNS = this.featureNS_;
|
||
var c = {};
|
||
c[u] = rp(this.gmlFormat_.readFeatureElement, this.gmlFormat_);
|
||
var p = pp([l.featureNS, null], c);
|
||
a.setAttribute("namespaceURI", this.featureNS_);
|
||
var d = fp([], p, a, e, this.gmlFormat_);
|
||
d && Q(r, d)
|
||
}
|
||
}
|
||
}
|
||
if ("FeatureCollection" == i) {
|
||
var f = fp([], this.gmlFormat_.FEATURE_COLLECTION_PARSERS, t, [{}], this.gmlFormat_);
|
||
f && (r = f)
|
||
}
|
||
return r
|
||
}, e.prototype.readFeaturesFromNode = function (t, e) {
|
||
var i = {};
|
||
return e && p(i, this.getReadOptions(t, e)), this.readFeatures_(t, [i])
|
||
}, e
|
||
}(yp), Hv = [null, "http://www.opengis.net/wmts/1.0"], Xv = [null, "http://www.opengis.net/ows/1.1"],
|
||
qv = pp(Hv, {
|
||
Contents: sp(function (t, e) {
|
||
return fp({}, Kv, t, e)
|
||
})
|
||
}), Zv = function (t) {
|
||
function e() {
|
||
t.call(this), this.owsParser_ = new jm
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.readFromDocument = function (t) {
|
||
for (var e = t.firstChild; e; e = e.nextSibling) if (e.nodeType == Node.ELEMENT_NODE) return this.readFromNode(e);
|
||
return null
|
||
}, e.prototype.readFromNode = function (t) {
|
||
var e = t.getAttribute("version").trim(), i = this.owsParser_.readFromNode(t);
|
||
return i ? (i.version = e, (i = fp(i, qv, t, [])) || null) : null
|
||
}, e
|
||
}(bm), Kv = pp(Hv, {
|
||
Layer: np(function (t, e) {
|
||
return fp({}, Jv, t, e)
|
||
}), TileMatrixSet: np(function (t, e) {
|
||
return fp({}, o_, t, e)
|
||
})
|
||
}), Jv = pp(Hv, {
|
||
Style: np(function (t, e) {
|
||
var i = fp({}, $v, t, e);
|
||
if (!i) return;
|
||
var r = "true" === t.getAttribute("isDefault");
|
||
return i.isDefault = r, i
|
||
}), Format: np(Lp), TileMatrixSetLink: np(function (t, e) {
|
||
return fp({}, Qv, t, e)
|
||
}), Dimension: np(function (t, e) {
|
||
return fp({}, i_, t, e)
|
||
}), ResourceURL: np(function (t, e) {
|
||
var i = t.getAttribute("format"), r = t.getAttribute("template"), o = t.getAttribute("resourceType"),
|
||
n = {};
|
||
i && (n.format = i);
|
||
r && (n.template = r);
|
||
o && (n.resourceType = o);
|
||
return n
|
||
})
|
||
}, pp(Xv, {
|
||
Title: sp(Lp), Abstract: sp(Lp), WGS84BoundingBox: sp(function (t, e) {
|
||
var i = fp([], r_, t, e);
|
||
if (2 != i.length) return;
|
||
return lt(i)
|
||
}), Identifier: sp(Lp)
|
||
})), $v = pp(Hv, {
|
||
LegendURL: np(function (t, e) {
|
||
var i = {};
|
||
return i.format = t.getAttribute("format"), i.href = xm(t), i
|
||
})
|
||
}, pp(Xv, {Title: sp(Lp), Identifier: sp(Lp)})), Qv = pp(Hv, {
|
||
TileMatrixSet: sp(Lp), TileMatrixSetLimits: sp(function (t, e) {
|
||
return fp([], t_, t, e)
|
||
})
|
||
}), t_ = pp(Hv, {
|
||
TileMatrixLimits: rp(function (t, e) {
|
||
return fp({}, e_, t, e)
|
||
})
|
||
}), e_ = pp(Hv, {
|
||
TileMatrix: sp(Lp),
|
||
MinTileRow: sp(Rp),
|
||
MaxTileRow: sp(Rp),
|
||
MinTileCol: sp(Rp),
|
||
MaxTileCol: sp(Rp)
|
||
}), i_ = pp(Hv, {Default: sp(Lp), Value: np(Lp)}, pp(Xv, {Identifier: sp(Lp)})),
|
||
r_ = pp(Xv, {LowerCorner: rp(s_), UpperCorner: rp(s_)}), o_ = pp(Hv, {
|
||
WellKnownScaleSet: sp(Lp), TileMatrix: np(function (t, e) {
|
||
return fp({}, n_, t, e)
|
||
})
|
||
}, pp(Xv, {SupportedCRS: sp(Lp), Identifier: sp(Lp)})), n_ = pp(Hv, {
|
||
TopLeftCorner: sp(s_),
|
||
ScaleDenominator: sp(Ep),
|
||
TileWidth: sp(Rp),
|
||
TileHeight: sp(Rp),
|
||
MatrixWidth: sp(Rp),
|
||
MatrixHeight: sp(Rp)
|
||
}, pp(Xv, {Identifier: sp(Lp)}));
|
||
|
||
function s_(t, e) {
|
||
var i = Lp(t).split(/\s+/);
|
||
if (i && 2 == i.length) {
|
||
var r = +i[0], o = +i[1];
|
||
if (!isNaN(r) && !isNaN(o)) return [r, o]
|
||
}
|
||
}
|
||
|
||
var a_ = Zv, l_ = function (t) {
|
||
function e(e, i, r) {
|
||
if (t.call(this), void 0 !== r && void 0 === i) this.setFlatCoordinates(r, e); else {
|
||
var o = i || 0;
|
||
this.setCenterAndRadius(e, o, r)
|
||
}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.clone = function () {
|
||
return new e(this.flatCoordinates.slice(), void 0, this.layout)
|
||
}, e.prototype.closestPointXY = function (t, e, i, r) {
|
||
var o = this.flatCoordinates, n = t - o[0], s = e - o[1], a = n * n + s * s;
|
||
if (a < r) {
|
||
if (0 === a) for (var l = 0; l < this.stride; ++l) i[l] = o[l]; else {
|
||
var h = this.getRadius() / Math.sqrt(a);
|
||
i[0] = o[0] + h * n, i[1] = o[1] + h * s;
|
||
for (var u = 2; u < this.stride; ++u) i[u] = o[u]
|
||
}
|
||
return i.length = this.stride, a
|
||
}
|
||
return r
|
||
}, e.prototype.containsXY = function (t, e) {
|
||
var i = this.flatCoordinates, r = t - i[0], o = e - i[1];
|
||
return r * r + o * o <= this.getRadiusSquared_()
|
||
}, e.prototype.getCenter = function () {
|
||
return this.flatCoordinates.slice(0, this.stride)
|
||
}, e.prototype.computeExtent = function (t) {
|
||
var e = this.flatCoordinates, i = e[this.stride] - e[0];
|
||
return yt(e[0] - i, e[1] - i, e[0] + i, e[1] + i, t)
|
||
}, e.prototype.getRadius = function () {
|
||
return Math.sqrt(this.getRadiusSquared_())
|
||
}, e.prototype.getRadiusSquared_ = function () {
|
||
var t = this.flatCoordinates[this.stride] - this.flatCoordinates[0],
|
||
e = this.flatCoordinates[this.stride + 1] - this.flatCoordinates[1];
|
||
return t * t + e * e
|
||
}, e.prototype.getType = function () {
|
||
return Zt.CIRCLE
|
||
}, e.prototype.intersectsExtent = function (t) {
|
||
if (Bt(t, this.getExtent())) {
|
||
var e = this.getCenter();
|
||
return t[0] <= e[0] && t[2] >= e[0] || (t[1] <= e[1] && t[3] >= e[1] || Lt(t, this.intersectsCoordinate, this))
|
||
}
|
||
return !1
|
||
}, e.prototype.setCenter = function (t) {
|
||
var e = this.stride, i = this.flatCoordinates[e] - this.flatCoordinates[0], r = t.slice();
|
||
r[e] = r[0] + i;
|
||
for (var o = 1; o < e; ++o) r[e + o] = t[o];
|
||
this.setFlatCoordinates(this.layout, r), this.changed()
|
||
}, e.prototype.setCenterAndRadius = function (t, e, i) {
|
||
this.setLayout(i, t, 0), this.flatCoordinates || (this.flatCoordinates = []);
|
||
var r = this.flatCoordinates, o = Ai(r, 0, t, this.stride);
|
||
r[o++] = r[0] + e;
|
||
for (var n = 1, s = this.stride; n < s; ++n) r[o++] = r[n];
|
||
r.length = o, this.changed()
|
||
}, e.prototype.getCoordinates = function () {
|
||
return null
|
||
}, e.prototype.setCoordinates = function (t, e) {
|
||
}, e.prototype.setRadius = function (t) {
|
||
this.flatCoordinates[this.stride] = this.flatCoordinates[0] + t, this.changed()
|
||
}, e
|
||
}(bi);
|
||
l_.prototype.transform;
|
||
var h_ = l_, u_ = "addfeatures", c_ = function (t) {
|
||
function e(e, i, r, o) {
|
||
t.call(this, e), this.features = r, this.file = i, this.projection = o
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A);
|
||
|
||
function p_(t) {
|
||
for (var e = t.dataTransfer.files, i = 0, r = e.length; i < r; ++i) {
|
||
var o = e.item(i), n = new FileReader;
|
||
n.addEventListener(F.LOAD, this.handleResult_.bind(this, o)), n.readAsText(o)
|
||
}
|
||
}
|
||
|
||
function d_(t) {
|
||
t.stopPropagation(), t.preventDefault(), t.dataTransfer.dropEffect = "copy"
|
||
}
|
||
|
||
var f_ = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {handleEvent: P}), this.formatConstructors_ = i.formatConstructors ? i.formatConstructors : [], this.projection_ = i.projection ? We(i.projection) : null, this.dropListenKeys_ = null, this.source_ = i.source || null, this.target = i.target ? i.target : null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleResult_ = function (t, e) {
|
||
var i = e.target.result, r = this.getMap(), o = this.projection_;
|
||
o || (o = r.getView().getProjection());
|
||
for (var n = this.formatConstructors_, s = [], a = 0, l = n.length; a < l; ++a) {
|
||
var h = new n[a];
|
||
if ((s = this.tryReadFeatures_(h, i, {featureProjection: o})) && s.length > 0) break
|
||
}
|
||
this.source_ && (this.source_.clear(), this.source_.addFeatures(s)), this.dispatchEvent(new c_(u_, t, s, o))
|
||
}, e.prototype.registerListeners_ = function () {
|
||
var t = this.getMap();
|
||
if (t) {
|
||
var e = this.target ? this.target : t.getViewport();
|
||
this.dropListenKeys_ = [w(e, F.DROP, p_, this), w(e, F.DRAGENTER, d_, this), w(e, F.DRAGOVER, d_, this), w(e, F.DROP, d_, this)]
|
||
}
|
||
}, e.prototype.setActive = function (e) {
|
||
t.prototype.setActive.call(this, e), e ? this.registerListeners_() : this.unregisterListeners_()
|
||
}, e.prototype.setMap = function (e) {
|
||
this.unregisterListeners_(), t.prototype.setMap.call(this, e), this.getActive() && this.registerListeners_()
|
||
}, e.prototype.tryReadFeatures_ = function (t, e, i) {
|
||
try {
|
||
return t.readFeatures(e, i)
|
||
} catch (t) {
|
||
return null
|
||
}
|
||
}, e.prototype.unregisterListeners_ = function () {
|
||
this.dropListenKeys_ && (this.dropListenKeys_.forEach(S), this.dropListenKeys_ = null)
|
||
}, e
|
||
}(zs), g_ = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, i), this.condition_ = i.condition ? i.condition : $s, this.lastAngle_ = void 0, this.lastMagnitude_ = void 0, this.lastScaleDelta_ = 0, this.duration_ = void 0 !== i.duration ? i.duration : 400
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleDragEvent = function (t) {
|
||
if (ta(t)) {
|
||
var e = t.map, i = e.getSize(), r = t.pixel, o = r[0] - i[0] / 2, n = i[1] / 2 - r[1],
|
||
s = Math.atan2(n, o), a = Math.sqrt(o * o + n * n), l = e.getView();
|
||
if (l.getConstraints().rotation !== qn && void 0 !== this.lastAngle_) {
|
||
var h = s - this.lastAngle_;
|
||
Ns(l, l.getRotation() - h)
|
||
}
|
||
if (this.lastAngle_ = s, void 0 !== this.lastMagnitude_) {
|
||
var u = this.lastMagnitude_ * (l.getResolution() / a);
|
||
js(l, u)
|
||
}
|
||
void 0 !== this.lastMagnitude_ && (this.lastScaleDelta_ = this.lastMagnitude_ / a), this.lastMagnitude_ = a
|
||
}
|
||
}, e.prototype.handleUpEvent = function (t) {
|
||
if (!ta(t)) return !0;
|
||
var e = t.map.getView();
|
||
e.setHint($n.INTERACTING, -1);
|
||
var i = this.lastScaleDelta_ - 1;
|
||
return Fs(e, e.getRotation()), Ds(e, e.getResolution(), void 0, this.duration_, i), this.lastScaleDelta_ = 0, !1
|
||
}, e.prototype.handleDownEvent = function (t) {
|
||
return !!ta(t) && (!!this.condition_(t) && (t.map.getView().setHint($n.INTERACTING, 1), this.lastAngle_ = void 0, this.lastMagnitude_ = void 0, !0))
|
||
}, e
|
||
}(ra), m_ = "renderOrder", y_ = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = p({}, i);
|
||
delete r.style, delete r.renderBuffer, delete r.updateWhileAnimating, delete r.updateWhileInteracting, t.call(this, r), this.declutter_ = void 0 !== i.declutter && i.declutter, this.renderBuffer_ = void 0 !== i.renderBuffer ? i.renderBuffer : 100, this.style_ = null, this.styleFunction_ = void 0, this.setStyle(i.style), this.updateWhileAnimating_ = void 0 !== i.updateWhileAnimating && i.updateWhileAnimating, this.updateWhileInteracting_ = void 0 !== i.updateWhileInteracting && i.updateWhileInteracting, this.renderMode_ = i.renderMode || Ea.VECTOR, this.type = Vo.VECTOR
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getDeclutter = function () {
|
||
return this.declutter_
|
||
}, e.prototype.setDeclutter = function (t) {
|
||
this.declutter_ = t
|
||
}, e.prototype.getRenderBuffer = function () {
|
||
return this.renderBuffer_
|
||
}, e.prototype.getRenderOrder = function () {
|
||
return this.get(m_)
|
||
}, e.prototype.getStyle = function () {
|
||
return this.style_
|
||
}, e.prototype.getStyleFunction = function () {
|
||
return this.styleFunction_
|
||
}, e.prototype.getUpdateWhileAnimating = function () {
|
||
return this.updateWhileAnimating_
|
||
}, e.prototype.getUpdateWhileInteracting = function () {
|
||
return this.updateWhileInteracting_
|
||
}, e.prototype.setRenderOrder = function (t) {
|
||
this.set(m_, t)
|
||
}, e.prototype.setStyle = function (t) {
|
||
this.style_ = void 0 !== t ? t : Qd, this.styleFunction_ = null === t ? void 0 : Jd(this.style_), this.changed()
|
||
}, e.prototype.getRenderMode = function () {
|
||
return this.renderMode_
|
||
}, e
|
||
}(Ts);
|
||
y_.prototype.getSource;
|
||
var v_ = y_;
|
||
|
||
function __(t, e) {
|
||
return [[-1 / 0, -1 / 0, 1 / 0, 1 / 0]]
|
||
}
|
||
|
||
var x_ = {
|
||
ADDFEATURE: "addfeature",
|
||
CHANGEFEATURE: "changefeature",
|
||
CLEAR: "clear",
|
||
REMOVEFEATURE: "removefeature"
|
||
}, w_ = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e), this.feature = i
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A), b_ = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {
|
||
attributions: i.attributions,
|
||
projection: void 0,
|
||
state: hs.READY,
|
||
wrapX: void 0 === i.wrapX || i.wrapX
|
||
}), this.loader_ = I, this.format_ = i.format, this.overlaps_ = null == i.overlaps || i.overlaps, this.url_ = i.url, void 0 !== i.loader ? this.loader_ = i.loader : void 0 !== this.url_ && (W(this.format_, 7), this.loader_ = yh(this.url_, this.format_)), this.strategy_ = void 0 !== i.strategy ? i.strategy : __;
|
||
var r, o, n = void 0 === i.useSpatialIndex || i.useSpatialIndex;
|
||
this.featuresRtree_ = n ? new Eu : null, this.loadedExtentsRtree_ = new Eu, this.nullGeometryFeatures_ = {}, this.idIndex_ = {}, this.undefIdIndex_ = {}, this.featureChangeKeys_ = {}, this.featuresCollection_ = null, Array.isArray(i.features) ? o = i.features : i.features && (o = (r = i.features).getArray()), n || void 0 !== r || (r = new Y(o)), void 0 !== o && this.addFeaturesInternal(o), void 0 !== r && this.bindFeaturesCollection_(r)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.addFeature = function (t) {
|
||
this.addFeatureInternal(t), this.changed()
|
||
}, e.prototype.addFeatureInternal = function (t) {
|
||
var e = a(t);
|
||
if (this.addToIndex_(e, t)) {
|
||
this.setupChangeEvents_(e, t);
|
||
var i = t.getGeometry();
|
||
if (i) {
|
||
var r = i.getExtent();
|
||
this.featuresRtree_ && this.featuresRtree_.insert(r, t)
|
||
} else this.nullGeometryFeatures_[e] = t;
|
||
this.dispatchEvent(new w_(x_.ADDFEATURE, t))
|
||
}
|
||
}, e.prototype.setupChangeEvents_ = function (t, e) {
|
||
this.featureChangeKeys_[t] = [w(e, F.CHANGE, this.handleFeatureChange_, this), w(e, c.PROPERTYCHANGE, this.handleFeatureChange_, this)]
|
||
}, e.prototype.addToIndex_ = function (t, e) {
|
||
var i = !0, r = e.getId();
|
||
return void 0 !== r ? r.toString() in this.idIndex_ ? i = !1 : this.idIndex_[r.toString()] = e : (W(!(t in this.undefIdIndex_), 30), this.undefIdIndex_[t] = e), i
|
||
}, e.prototype.addFeatures = function (t) {
|
||
this.addFeaturesInternal(t), this.changed()
|
||
}, e.prototype.addFeaturesInternal = function (t) {
|
||
for (var e = [], i = [], r = [], o = 0, n = t.length; o < n; o++) {
|
||
var s = t[o], l = a(s);
|
||
this.addToIndex_(l, s) && i.push(s)
|
||
}
|
||
for (var h = 0, u = i.length; h < u; h++) {
|
||
var c = i[h], p = a(c);
|
||
this.setupChangeEvents_(p, c);
|
||
var d = c.getGeometry();
|
||
if (d) {
|
||
var f = d.getExtent();
|
||
e.push(f), r.push(c)
|
||
} else this.nullGeometryFeatures_[p] = c
|
||
}
|
||
this.featuresRtree_ && this.featuresRtree_.load(e, r);
|
||
for (var g = 0, m = i.length; g < m; g++) this.dispatchEvent(new w_(x_.ADDFEATURE, i[g]))
|
||
}, e.prototype.bindFeaturesCollection_ = function (t) {
|
||
var e = !1;
|
||
w(this, x_.ADDFEATURE, function (i) {
|
||
e || (e = !0, t.push(i.feature), e = !1)
|
||
}), w(this, x_.REMOVEFEATURE, function (i) {
|
||
e || (e = !0, t.remove(i.feature), e = !1)
|
||
}), w(t, u.ADD, function (t) {
|
||
e || (e = !0, this.addFeature(t.element), e = !1)
|
||
}, this), w(t, u.REMOVE, function (t) {
|
||
e || (e = !0, this.removeFeature(t.element), e = !1)
|
||
}, this), this.featuresCollection_ = t
|
||
}, e.prototype.clear = function (t) {
|
||
if (t) {
|
||
for (var e in this.featureChangeKeys_) {
|
||
this.featureChangeKeys_[e].forEach(S)
|
||
}
|
||
this.featuresCollection_ || (this.featureChangeKeys_ = {}, this.idIndex_ = {}, this.undefIdIndex_ = {})
|
||
} else if (this.featuresRtree_) for (var i in this.featuresRtree_.forEach(this.removeFeatureInternal, this), this.nullGeometryFeatures_) this.removeFeatureInternal(this.nullGeometryFeatures_[i]);
|
||
this.featuresCollection_ && this.featuresCollection_.clear(), this.featuresRtree_ && this.featuresRtree_.clear(), this.loadedExtentsRtree_.clear(), this.nullGeometryFeatures_ = {};
|
||
var r = new w_(x_.CLEAR);
|
||
this.dispatchEvent(r), this.changed()
|
||
}, e.prototype.forEachFeature = function (t) {
|
||
if (this.featuresRtree_) return this.featuresRtree_.forEach(t);
|
||
this.featuresCollection_ && this.featuresCollection_.forEach(t)
|
||
}, e.prototype.forEachFeatureAtCoordinateDirect = function (t, e) {
|
||
var i = [t[0], t[1], t[0], t[1]];
|
||
return this.forEachFeatureInExtent(i, function (i) {
|
||
return i.getGeometry().intersectsCoordinate(t) ? e(i) : void 0
|
||
})
|
||
}, e.prototype.forEachFeatureInExtent = function (t, e) {
|
||
if (this.featuresRtree_) return this.featuresRtree_.forEachInExtent(t, e);
|
||
this.featuresCollection_ && this.featuresCollection_.forEach(e)
|
||
}, e.prototype.forEachFeatureIntersectingExtent = function (t, e) {
|
||
return this.forEachFeatureInExtent(t, function (i) {
|
||
if (i.getGeometry().intersectsExtent(t)) {
|
||
var r = e(i);
|
||
if (r) return r
|
||
}
|
||
})
|
||
}, e.prototype.getFeaturesCollection = function () {
|
||
return this.featuresCollection_
|
||
}, e.prototype.getFeatures = function () {
|
||
var t;
|
||
return this.featuresCollection_ ? t = this.featuresCollection_.getArray() : this.featuresRtree_ && (t = this.featuresRtree_.getAll(), g(this.nullGeometryFeatures_) || Q(t, f(this.nullGeometryFeatures_))), t
|
||
}, e.prototype.getFeaturesAtCoordinate = function (t) {
|
||
var e = [];
|
||
return this.forEachFeatureAtCoordinateDirect(t, function (t) {
|
||
e.push(t)
|
||
}), e
|
||
}, e.prototype.getFeaturesInExtent = function (t) {
|
||
return this.featuresRtree_.getInExtent(t)
|
||
}, e.prototype.getClosestFeatureToCoordinate = function (t, e) {
|
||
var i = t[0], r = t[1], o = null, n = [NaN, NaN], s = 1 / 0, a = [-1 / 0, -1 / 0, 1 / 0, 1 / 0],
|
||
l = e || P;
|
||
return this.featuresRtree_.forEachInExtent(a, function (t) {
|
||
if (l(t)) {
|
||
var e = t.getGeometry(), h = s;
|
||
if ((s = e.closestPointXY(i, r, n, s)) < h) {
|
||
o = t;
|
||
var u = Math.sqrt(s);
|
||
a[0] = i - u, a[1] = r - u, a[2] = i + u, a[3] = r + u
|
||
}
|
||
}
|
||
}), o
|
||
}, e.prototype.getExtent = function (t) {
|
||
return this.featuresRtree_.getExtent(t)
|
||
}, e.prototype.getFeatureById = function (t) {
|
||
var e = this.idIndex_[t.toString()];
|
||
return void 0 !== e ? e : null
|
||
}, e.prototype.getFormat = function () {
|
||
return this.format_
|
||
}, e.prototype.getOverlaps = function () {
|
||
return this.overlaps_
|
||
}, e.prototype.getUrl = function () {
|
||
return this.url_
|
||
}, e.prototype.handleFeatureChange_ = function (t) {
|
||
var e = t.target, i = a(e), r = e.getGeometry();
|
||
if (r) {
|
||
var o = r.getExtent();
|
||
i in this.nullGeometryFeatures_ ? (delete this.nullGeometryFeatures_[i], this.featuresRtree_ && this.featuresRtree_.insert(o, e)) : this.featuresRtree_ && this.featuresRtree_.update(o, e)
|
||
} else i in this.nullGeometryFeatures_ || (this.featuresRtree_ && this.featuresRtree_.remove(e), this.nullGeometryFeatures_[i] = e);
|
||
var n = e.getId();
|
||
if (void 0 !== n) {
|
||
var s = n.toString();
|
||
i in this.undefIdIndex_ ? (delete this.undefIdIndex_[i], this.idIndex_[s] = e) : this.idIndex_[s] !== e && (this.removeFromIdIndex_(e), this.idIndex_[s] = e)
|
||
} else i in this.undefIdIndex_ || (this.removeFromIdIndex_(e), this.undefIdIndex_[i] = e);
|
||
this.changed(), this.dispatchEvent(new w_(x_.CHANGEFEATURE, e))
|
||
}, e.prototype.hasFeature = function (t) {
|
||
var e = t.getId();
|
||
return void 0 !== e ? e in this.idIndex_ : a(t) in this.undefIdIndex_
|
||
}, e.prototype.isEmpty = function () {
|
||
return this.featuresRtree_.isEmpty() && g(this.nullGeometryFeatures_)
|
||
}, e.prototype.loadFeatures = function (t, e, i) {
|
||
var r = this, o = this.loadedExtentsRtree_, n = this.strategy_(t, e);
|
||
this.loading = !1;
|
||
for (var s = function (t, s) {
|
||
var a = n[t];
|
||
o.forEachInExtent(a, function (t) {
|
||
return dt(t.extent, a)
|
||
}) || (r.loader_.call(r, a, e, i), o.insert(a, {extent: a.slice()}), r.loading = r.loader_ !== I)
|
||
}, a = 0, l = n.length; a < l; ++a) s(a)
|
||
}, e.prototype.removeLoadedExtent = function (t) {
|
||
var e, i = this.loadedExtentsRtree_;
|
||
i.forEachInExtent(t, function (i) {
|
||
if (bt(i.extent, t)) return e = i, !0
|
||
}), e && i.remove(e)
|
||
}, e.prototype.removeFeature = function (t) {
|
||
var e = a(t);
|
||
e in this.nullGeometryFeatures_ ? delete this.nullGeometryFeatures_[e] : this.featuresRtree_ && this.featuresRtree_.remove(t), this.removeFeatureInternal(t), this.changed()
|
||
}, e.prototype.removeFeatureInternal = function (t) {
|
||
var e = a(t);
|
||
this.featureChangeKeys_[e].forEach(S), delete this.featureChangeKeys_[e];
|
||
var i = t.getId();
|
||
void 0 !== i ? delete this.idIndex_[i.toString()] : delete this.undefIdIndex_[e], this.dispatchEvent(new w_(x_.REMOVEFEATURE, t))
|
||
}, e.prototype.removeFromIdIndex_ = function (t) {
|
||
var e = !1;
|
||
for (var i in this.idIndex_) if (this.idIndex_[i] === t) {
|
||
delete this.idIndex_[i], e = !0;
|
||
break
|
||
}
|
||
return e
|
||
}, e.prototype.setLoader = function (t) {
|
||
this.loader_ = t
|
||
}, e
|
||
}(Yu), C_ = {POINT: "Point", LINE_STRING: "LineString", POLYGON: "Polygon", CIRCLE: "Circle"}, S_ = "drawstart",
|
||
E_ = "drawend", T_ = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e), this.feature = i
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A);
|
||
|
||
function R_() {
|
||
return function (t, e) {
|
||
var i = lt(t), r = [[Ot(i), Mt(i), zt(i), jt(i), Ot(i)]], o = e;
|
||
return o ? o.setCoordinates(r) : o = new fr(r), o
|
||
}
|
||
}
|
||
|
||
var P_ = function (t) {
|
||
function e(e) {
|
||
var i = e;
|
||
i.stopDown || (i.stopDown = L), t.call(this, i), this.shouldHandle_ = !1, this.downPx_ = null, this.downTimeout_, this.lastDragTime_, this.freehand_ = !1, this.source_ = e.source ? e.source : null, this.features_ = e.features ? e.features : null, this.snapTolerance_ = e.snapTolerance ? e.snapTolerance : 12, this.type_ = e.type, this.mode_ = function (t) {
|
||
var e;
|
||
t === Zt.POINT || t === Zt.MULTI_POINT ? e = C_.POINT : t === Zt.LINE_STRING || t === Zt.MULTI_LINE_STRING ? e = C_.LINE_STRING : t === Zt.POLYGON || t === Zt.MULTI_POLYGON ? e = C_.POLYGON : t === Zt.CIRCLE && (e = C_.CIRCLE);
|
||
return e
|
||
}(this.type_), this.stopClick_ = !!e.stopClick, this.minPoints_ = e.minPoints ? e.minPoints : this.mode_ === C_.POLYGON ? 3 : 2, this.maxPoints_ = e.maxPoints ? e.maxPoints : 1 / 0, this.finishCondition_ = e.finishCondition ? e.finishCondition : P;
|
||
var r, o = e.geometryFunction;
|
||
if (!o) if (this.type_ === Zt.CIRCLE) o = function (t, e) {
|
||
var i = e || new h_([NaN, NaN]), r = Vr(t[0], t[1]);
|
||
return i.setCenterAndRadius(t[0], Math.sqrt(r)), i
|
||
}; else {
|
||
var n, s = this.mode_;
|
||
s === C_.POINT ? n = qi : s === C_.LINE_STRING ? n = Jr : s === C_.POLYGON && (n = fr), o = function (t, e) {
|
||
var i = e;
|
||
return i ? s === C_.POLYGON ? t[0].length ? i.setCoordinates([t[0].concat([t[0][0]])]) : i.setCoordinates([]) : i.setCoordinates(t) : i = new n(t), i
|
||
}
|
||
}
|
||
this.geometryFunction_ = o, this.dragVertexDelay_ = void 0 !== e.dragVertexDelay ? e.dragVertexDelay : 500, this.finishCoordinate_ = null, this.sketchFeature_ = null, this.sketchPoint_ = null, this.sketchCoords_ = null, this.sketchLine_ = null, this.sketchLineCoords_ = null, this.squaredClickTolerance_ = e.clickTolerance ? e.clickTolerance * e.clickTolerance : 36, this.overlay_ = new v_({
|
||
source: new b_({
|
||
useSpatialIndex: !1,
|
||
wrapX: !!e.wrapX && e.wrapX
|
||
}), style: e.style ? e.style : (r = tf(), function (t, e) {
|
||
return r[t.getGeometry().getType()]
|
||
}), updateWhileInteracting: !0
|
||
}), this.geometryName_ = e.geometryName, this.condition_ = e.condition ? e.condition : Js, this.freehandCondition_, e.freehand ? this.freehandCondition_ = Hs : this.freehandCondition_ = e.freehandCondition ? e.freehandCondition : $s, w(this, z(As.ACTIVE), this.updateState_, this)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.setMap = function (e) {
|
||
t.prototype.setMap.call(this, e), this.updateState_()
|
||
}, e.prototype.getOverlay = function () {
|
||
return this.overlay_
|
||
}, e.prototype.handleEvent = function (e) {
|
||
e.originalEvent.type === F.CONTEXTMENU && e.preventDefault(), this.freehand_ = this.mode_ !== C_.POINT && this.freehandCondition_(e);
|
||
var i = e.type === Ho.POINTERMOVE, r = !0;
|
||
!this.freehand_ && this.lastDragTime_ && e.type === Ho.POINTERDRAG && (Date.now() - this.lastDragTime_ >= this.dragVertexDelay_ ? (this.downPx_ = e.pixel, this.shouldHandle_ = !this.freehand_, i = !0) : this.lastDragTime_ = void 0, this.shouldHandle_ && void 0 !== this.downTimeout_ && (clearTimeout(this.downTimeout_), this.downTimeout_ = void 0));
|
||
return this.freehand_ && e.type === Ho.POINTERDRAG && null !== this.sketchFeature_ ? (this.addToDrawing_(e), r = !1) : this.freehand_ && e.type === Ho.POINTERDOWN ? r = !1 : i ? (r = e.type === Ho.POINTERMOVE) && this.freehand_ ? r = this.handlePointerMove_(e) : (e.pointerEvent.pointerType == $o || e.type === Ho.POINTERDRAG && void 0 === this.downTimeout_) && this.handlePointerMove_(e) : e.type === Ho.DBLCLICK && (r = !1), t.prototype.handleEvent.call(this, e) && r
|
||
}, e.prototype.handleDownEvent = function (t) {
|
||
return this.shouldHandle_ = !this.freehand_, this.freehand_ ? (this.downPx_ = t.pixel, this.finishCoordinate_ || this.startDrawing_(t), !0) : !!this.condition_(t) && (this.lastDragTime_ = Date.now(), this.downTimeout_ = setTimeout(function () {
|
||
this.handlePointerMove_(new Xo(Ho.POINTERMOVE, t.map, t.pointerEvent, !1, t.frameState))
|
||
}.bind(this), this.dragVertexDelay_), this.downPx_ = t.pixel, !0)
|
||
}, e.prototype.handleUpEvent = function (t) {
|
||
var e = !0;
|
||
this.downTimeout_ && (clearTimeout(this.downTimeout_), this.downTimeout_ = void 0), this.handlePointerMove_(t);
|
||
var i = this.mode_ === C_.CIRCLE;
|
||
return this.shouldHandle_ ? (this.finishCoordinate_ ? this.freehand_ || i ? this.finishDrawing() : this.atFinish_(t) ? this.finishCondition_(t) && this.finishDrawing() : this.addToDrawing_(t) : (this.startDrawing_(t), this.mode_ === C_.POINT && this.finishDrawing()), e = !1) : this.freehand_ && (this.finishCoordinate_ = null, this.abortDrawing_()), !e && this.stopClick_ && t.stopPropagation(), e
|
||
}, e.prototype.handlePointerMove_ = function (t) {
|
||
if (this.downPx_ && (!this.freehand_ && this.shouldHandle_ || this.freehand_ && !this.shouldHandle_)) {
|
||
var e = this.downPx_, i = t.pixel, r = e[0] - i[0], o = e[1] - i[1], n = r * r + o * o;
|
||
if (this.shouldHandle_ = this.freehand_ ? n > this.squaredClickTolerance_ : n <= this.squaredClickTolerance_, !this.shouldHandle_) return !0
|
||
}
|
||
return this.finishCoordinate_ ? this.modifyDrawing_(t) : this.createOrUpdateSketchPoint_(t), !0
|
||
}, e.prototype.atFinish_ = function (t) {
|
||
var e = !1;
|
||
if (this.sketchFeature_) {
|
||
var i = !1, r = [this.finishCoordinate_];
|
||
if (this.mode_ === C_.LINE_STRING) i = this.sketchCoords_.length > this.minPoints_; else if (this.mode_ === C_.POLYGON) {
|
||
var o = this.sketchCoords_;
|
||
i = o[0].length > this.minPoints_, r = [o[0][0], o[0][o[0].length - 2]]
|
||
}
|
||
if (i) for (var n = t.map, s = 0, a = r.length; s < a; s++) {
|
||
var l = r[s], h = n.getPixelFromCoordinate(l), u = t.pixel, c = u[0] - h[0], p = u[1] - h[1],
|
||
d = this.freehand_ ? 1 : this.snapTolerance_;
|
||
if (e = Math.sqrt(c * c + p * p) <= d) {
|
||
this.finishCoordinate_ = l;
|
||
break
|
||
}
|
||
}
|
||
}
|
||
return e
|
||
}, e.prototype.createOrUpdateSketchPoint_ = function (t) {
|
||
var e = t.coordinate.slice();
|
||
this.sketchPoint_ ? this.sketchPoint_.getGeometry().setCoordinates(e) : (this.sketchPoint_ = new X(new qi(e)), this.updateSketchFeatures_())
|
||
}, e.prototype.startDrawing_ = function (t) {
|
||
var e = t.coordinate;
|
||
this.finishCoordinate_ = e, this.mode_ === C_.POINT ? this.sketchCoords_ = e.slice() : this.mode_ === C_.POLYGON ? (this.sketchCoords_ = [[e.slice(), e.slice()]], this.sketchLineCoords_ = this.sketchCoords_[0]) : this.sketchCoords_ = [e.slice(), e.slice()], this.sketchLineCoords_ && (this.sketchLine_ = new X(new Jr(this.sketchLineCoords_)));
|
||
var i = this.geometryFunction_(this.sketchCoords_);
|
||
this.sketchFeature_ = new X, this.geometryName_ && this.sketchFeature_.setGeometryName(this.geometryName_), this.sketchFeature_.setGeometry(i), this.updateSketchFeatures_(), this.dispatchEvent(new T_(S_, this.sketchFeature_))
|
||
}, e.prototype.modifyDrawing_ = function (t) {
|
||
var e, i, r, o = t.coordinate, n = this.sketchFeature_.getGeometry();
|
||
(this.mode_ === C_.POINT ? i = this.sketchCoords_ : this.mode_ === C_.POLYGON ? (i = (e = this.sketchCoords_[0])[e.length - 1], this.atFinish_(t) && (o = this.finishCoordinate_.slice())) : i = (e = this.sketchCoords_)[e.length - 1], i[0] = o[0], i[1] = o[1], this.geometryFunction_(this.sketchCoords_, n), this.sketchPoint_) && this.sketchPoint_.getGeometry().setCoordinates(o);
|
||
if (n.getType() == Zt.POLYGON && this.mode_ !== C_.POLYGON) {
|
||
this.sketchLine_ || (this.sketchLine_ = new X);
|
||
var s = n.getLinearRing(0);
|
||
(r = this.sketchLine_.getGeometry()) ? (r.setFlatCoordinates(s.getLayout(), s.getFlatCoordinates()), r.changed()) : (r = new Jr(s.getFlatCoordinates(), s.getLayout()), this.sketchLine_.setGeometry(r))
|
||
} else this.sketchLineCoords_ && (r = this.sketchLine_.getGeometry()).setCoordinates(this.sketchLineCoords_);
|
||
this.updateSketchFeatures_()
|
||
}, e.prototype.addToDrawing_ = function (t) {
|
||
var e, i, r = t.coordinate, o = this.sketchFeature_.getGeometry();
|
||
this.mode_ === C_.LINE_STRING ? (this.finishCoordinate_ = r.slice(), (i = this.sketchCoords_).length >= this.maxPoints_ && (this.freehand_ ? i.pop() : e = !0), i.push(r.slice()), this.geometryFunction_(i, o)) : this.mode_ === C_.POLYGON && ((i = this.sketchCoords_[0]).length >= this.maxPoints_ && (this.freehand_ ? i.pop() : e = !0), i.push(r.slice()), e && (this.finishCoordinate_ = i[0]), this.geometryFunction_(this.sketchCoords_, o)), this.updateSketchFeatures_(), e && this.finishDrawing()
|
||
}, e.prototype.removeLastPoint = function () {
|
||
if (this.sketchFeature_) {
|
||
var t, e = this.sketchFeature_.getGeometry();
|
||
this.mode_ === C_.LINE_STRING ? ((t = this.sketchCoords_).splice(-2, 1), this.geometryFunction_(t, e), t.length >= 2 && (this.finishCoordinate_ = t[t.length - 2].slice())) : this.mode_ === C_.POLYGON && ((t = this.sketchCoords_[0]).splice(-2, 1), this.sketchLine_.getGeometry().setCoordinates(t), this.geometryFunction_(this.sketchCoords_, e)), 0 === t.length && (this.finishCoordinate_ = null), this.updateSketchFeatures_()
|
||
}
|
||
}, e.prototype.finishDrawing = function () {
|
||
var t = this.abortDrawing_();
|
||
if (t) {
|
||
var e = this.sketchCoords_, i = t.getGeometry();
|
||
this.mode_ === C_.LINE_STRING ? (e.pop(), this.geometryFunction_(e, i)) : this.mode_ === C_.POLYGON && (e[0].pop(), this.geometryFunction_(e, i), e = i.getCoordinates()), this.type_ === Zt.MULTI_POINT ? t.setGeometry(new Gc([e])) : this.type_ === Zt.MULTI_LINE_STRING ? t.setGeometry(new Dc([e])) : this.type_ === Zt.MULTI_POLYGON && t.setGeometry(new zc([e])), this.dispatchEvent(new T_(E_, t)), this.features_ && this.features_.push(t), this.source_ && this.source_.addFeature(t)
|
||
}
|
||
}, e.prototype.abortDrawing_ = function () {
|
||
this.finishCoordinate_ = null;
|
||
var t = this.sketchFeature_;
|
||
return t && (this.sketchFeature_ = null, this.sketchPoint_ = null, this.sketchLine_ = null, this.overlay_.getSource().clear(!0)), t
|
||
}, e.prototype.extend = function (t) {
|
||
var e = t.getGeometry();
|
||
this.sketchFeature_ = t, this.sketchCoords_ = e.getCoordinates();
|
||
var i = this.sketchCoords_[this.sketchCoords_.length - 1];
|
||
this.finishCoordinate_ = i.slice(), this.sketchCoords_.push(i.slice()), this.updateSketchFeatures_(), this.dispatchEvent(new T_(S_, this.sketchFeature_))
|
||
}, e.prototype.updateSketchFeatures_ = function () {
|
||
var t = [];
|
||
this.sketchFeature_ && t.push(this.sketchFeature_), this.sketchLine_ && t.push(this.sketchLine_), this.sketchPoint_ && t.push(this.sketchPoint_);
|
||
var e = this.overlay_.getSource();
|
||
e.clear(!0), e.addFeatures(t)
|
||
}, e.prototype.updateState_ = function () {
|
||
var t = this.getMap(), e = this.getActive();
|
||
t && e || this.abortDrawing_(), this.overlay_.setMap(e ? t : null)
|
||
}, e
|
||
}(ra), L_ = {EXTENTCHANGED: "extentchanged"}, I_ = function (t) {
|
||
function e(e) {
|
||
t.call(this, L_.EXTENTCHANGED), this.extent = e
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A);
|
||
|
||
function O_() {
|
||
var t = tf();
|
||
return function (e, i) {
|
||
return t[Zt.POINT]
|
||
}
|
||
}
|
||
|
||
function M_(t) {
|
||
return function (e) {
|
||
return lt([t, e])
|
||
}
|
||
}
|
||
|
||
function A_(t, e) {
|
||
return t[0] == e[0] ? function (i) {
|
||
return lt([t, [i[0], e[1]]])
|
||
} : t[1] == e[1] ? function (i) {
|
||
return lt([t, [e[0], i[1]]])
|
||
} : null
|
||
}
|
||
|
||
var k_ = function (t) {
|
||
function e(e) {
|
||
var i, r = e || {};
|
||
t.call(this, r), this.extent_ = null, this.pointerHandler_ = null, this.pixelTolerance_ = void 0 !== r.pixelTolerance ? r.pixelTolerance : 10, this.snappedToVertex_ = !1, this.extentFeature_ = null, this.vertexFeature_ = null, e || (e = {}), this.extentOverlay_ = new v_({
|
||
source: new b_({
|
||
useSpatialIndex: !1,
|
||
wrapX: !!e.wrapX
|
||
}), style: e.boxStyle ? e.boxStyle : (i = tf(), function (t, e) {
|
||
return i[Zt.POLYGON]
|
||
}), updateWhileAnimating: !0, updateWhileInteracting: !0
|
||
}), this.vertexOverlay_ = new v_({
|
||
source: new b_({useSpatialIndex: !1, wrapX: !!e.wrapX}),
|
||
style: e.pointerStyle ? e.pointerStyle : O_(),
|
||
updateWhileAnimating: !0,
|
||
updateWhileInteracting: !0
|
||
}), e.extent && this.setExtent(e.extent)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.snapToVertex_ = function (t, e) {
|
||
var i = e.getCoordinateFromPixel(t), r = this.getExtent();
|
||
if (r) {
|
||
var o = function (t) {
|
||
return [[[t[0], t[1]], [t[0], t[3]]], [[t[0], t[3]], [t[2], t[3]]], [[t[2], t[3]], [t[2], t[1]]], [[t[2], t[1]], [t[0], t[1]]]]
|
||
}(r);
|
||
o.sort(function (t, e) {
|
||
return Wr(i, t) - Wr(i, e)
|
||
});
|
||
var n = o[0], s = Dr(i, n), a = e.getPixelFromCoordinate(s);
|
||
if (Yr(t, a) <= this.pixelTolerance_) {
|
||
var l = e.getPixelFromCoordinate(n[0]), h = e.getPixelFromCoordinate(n[1]), u = Vr(a, l),
|
||
c = Vr(a, h), p = Math.sqrt(Math.min(u, c));
|
||
return this.snappedToVertex_ = p <= this.pixelTolerance_, this.snappedToVertex_ && (s = u > c ? n[1] : n[0]), s
|
||
}
|
||
}
|
||
return null
|
||
}, e.prototype.handlePointerMove_ = function (t) {
|
||
var e = t.pixel, i = t.map, r = this.snapToVertex_(e, i);
|
||
r || (r = i.getCoordinateFromPixel(e)), this.createOrUpdatePointerFeature_(r)
|
||
}, e.prototype.createOrUpdateExtentFeature_ = function (t) {
|
||
var e = this.extentFeature_;
|
||
return e ? t ? e.setGeometry(mr(t)) : e.setGeometry(void 0) : (e = new X(t ? mr(t) : {}), this.extentFeature_ = e, this.extentOverlay_.getSource().addFeature(e)), e
|
||
}, e.prototype.createOrUpdatePointerFeature_ = function (t) {
|
||
var e = this.vertexFeature_;
|
||
e ? e.getGeometry().setCoordinates(t) : (e = new X(new qi(t)), this.vertexFeature_ = e, this.vertexOverlay_.getSource().addFeature(e));
|
||
return e
|
||
}, e.prototype.handleEvent = function (e) {
|
||
return !e.pointerEvent || (e.type != Ho.POINTERMOVE || this.handlingDownUpSequence || this.handlePointerMove_(e), t.prototype.handleEvent.call(this, e), !1)
|
||
}, e.prototype.handleDownEvent = function (t) {
|
||
var e = t.pixel, i = t.map, r = this.getExtent(), o = this.snapToVertex_(e, i), n = function (t) {
|
||
var e = null, i = null;
|
||
return t[0] == r[0] ? e = r[2] : t[0] == r[2] && (e = r[0]), t[1] == r[1] ? i = r[3] : t[1] == r[3] && (i = r[1]), null !== e && null !== i ? [e, i] : null
|
||
};
|
||
if (o && r) {
|
||
var s = o[0] == r[0] || o[0] == r[2] ? o[0] : null, a = o[1] == r[1] || o[1] == r[3] ? o[1] : null;
|
||
null !== s && null !== a ? this.pointerHandler_ = M_(n(o)) : null !== s ? this.pointerHandler_ = A_(n([s, r[1]]), n([s, r[3]])) : null !== a && (this.pointerHandler_ = A_(n([r[0], a]), n([r[2], a])))
|
||
} else o = i.getCoordinateFromPixel(e), this.setExtent([o[0], o[1], o[0], o[1]]), this.pointerHandler_ = M_(o);
|
||
return !0
|
||
}, e.prototype.handleDragEvent = function (t) {
|
||
if (this.pointerHandler_) {
|
||
var e = t.coordinate;
|
||
this.setExtent(this.pointerHandler_(e)), this.createOrUpdatePointerFeature_(e)
|
||
}
|
||
return !0
|
||
}, e.prototype.handleUpEvent = function (t) {
|
||
this.pointerHandler_ = null;
|
||
var e = this.getExtent();
|
||
return e && 0 !== It(e) || this.setExtent(null), !1
|
||
}, e.prototype.setMap = function (e) {
|
||
this.extentOverlay_.setMap(e), this.vertexOverlay_.setMap(e), t.prototype.setMap.call(this, e)
|
||
}, e.prototype.getExtent = function () {
|
||
return this.extent_
|
||
}, e.prototype.setExtent = function (t) {
|
||
this.extent_ = t || null, this.createOrUpdateExtentFeature_(t), this.dispatchEvent(new I_(this.extent_))
|
||
}, e
|
||
}(ra), F_ = 1, N_ = "modifystart", D_ = "modifyend", G_ = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, e), this.features = i, this.mapBrowserEvent = r
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A);
|
||
|
||
function j_(t, e) {
|
||
return t.index - e.index
|
||
}
|
||
|
||
function z_(t, e) {
|
||
var i = e.geometry;
|
||
if (i.getType() === Zt.CIRCLE) {
|
||
var r = i;
|
||
if (e.index === F_) {
|
||
var o = Vr(r.getCenter(), t), n = Math.sqrt(o) - r.getRadius();
|
||
return n * n
|
||
}
|
||
}
|
||
return Wr(t, e.segment)
|
||
}
|
||
|
||
function U_(t, e) {
|
||
var i = e.geometry;
|
||
return i.getType() === Zt.CIRCLE && e.index === F_ ? i.getClosestPoint(t) : Dr(t, e.segment)
|
||
}
|
||
|
||
var B_ = function (t) {
|
||
function e(e) {
|
||
var i, r;
|
||
if (t.call(this, e), this.condition_ = e.condition ? e.condition : ea, this.defaultDeleteCondition_ = function (t) {
|
||
return Vs(t) && Ks(t)
|
||
}, this.deleteCondition_ = e.deleteCondition ? e.deleteCondition : this.defaultDeleteCondition_, this.insertVertexCondition_ = e.insertVertexCondition ? e.insertVertexCondition : Hs, this.vertexFeature_ = null, this.vertexSegments_ = null, this.lastPixel_ = [0, 0], this.ignoreNextSingleClick_ = !1, this.modified_ = !1, this.rBush_ = new Eu, this.pixelTolerance_ = void 0 !== e.pixelTolerance ? e.pixelTolerance : 10, this.snappedToVertex_ = !1, this.changingFeature_ = !1, this.dragSegments_ = [], this.overlay_ = new v_({
|
||
source: new b_({
|
||
useSpatialIndex: !1,
|
||
wrapX: !!e.wrapX
|
||
}), style: e.style ? e.style : (i = tf(), function (t, e) {
|
||
return i[Zt.POINT]
|
||
}), updateWhileAnimating: !0, updateWhileInteracting: !0
|
||
}), this.SEGMENT_WRITERS_ = {
|
||
Point: this.writePointGeometry_,
|
||
LineString: this.writeLineStringGeometry_,
|
||
LinearRing: this.writeLineStringGeometry_,
|
||
Polygon: this.writePolygonGeometry_,
|
||
MultiPoint: this.writeMultiPointGeometry_,
|
||
MultiLineString: this.writeMultiLineStringGeometry_,
|
||
MultiPolygon: this.writeMultiPolygonGeometry_,
|
||
Circle: this.writeCircleGeometry_,
|
||
GeometryCollection: this.writeGeometryCollectionGeometry_
|
||
}, this.source_ = null, e.source ? (this.source_ = e.source, r = new Y(this.source_.getFeatures()), w(this.source_, x_.ADDFEATURE, this.handleSourceAdd_, this), w(this.source_, x_.REMOVEFEATURE, this.handleSourceRemove_, this)) : r = e.features, !r) throw new Error("The modify interaction requires features or a source");
|
||
this.features_ = r, this.features_.forEach(this.addFeature_.bind(this)), w(this.features_, u.ADD, this.handleFeatureAdd_, this), w(this.features_, u.REMOVE, this.handleFeatureRemove_, this), this.lastPointerEvent_ = null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.addFeature_ = function (t) {
|
||
var e = t.getGeometry();
|
||
e && e.getType() in this.SEGMENT_WRITERS_ && this.SEGMENT_WRITERS_[e.getType()].call(this, t, e);
|
||
var i = this.getMap();
|
||
i && i.isRendered() && this.getActive() && this.handlePointerAtPixel_(this.lastPixel_, i), w(t, F.CHANGE, this.handleFeatureChange_, this)
|
||
}, e.prototype.willModifyFeatures_ = function (t) {
|
||
this.modified_ || (this.modified_ = !0, this.dispatchEvent(new G_(N_, this.features_, t)))
|
||
}, e.prototype.removeFeature_ = function (t) {
|
||
this.removeFeatureSegmentData_(t), this.vertexFeature_ && 0 === this.features_.getLength() && (this.overlay_.getSource().removeFeature(this.vertexFeature_), this.vertexFeature_ = null), C(t, F.CHANGE, this.handleFeatureChange_, this)
|
||
}, e.prototype.removeFeatureSegmentData_ = function (t) {
|
||
var e = this.rBush_, i = [];
|
||
e.forEach(function (e) {
|
||
t === e.feature && i.push(e)
|
||
});
|
||
for (var r = i.length - 1; r >= 0; --r) e.remove(i[r])
|
||
}, e.prototype.setActive = function (e) {
|
||
this.vertexFeature_ && !e && (this.overlay_.getSource().removeFeature(this.vertexFeature_), this.vertexFeature_ = null), t.prototype.setActive.call(this, e)
|
||
}, e.prototype.setMap = function (e) {
|
||
this.overlay_.setMap(e), t.prototype.setMap.call(this, e)
|
||
}, e.prototype.getOverlay = function () {
|
||
return this.overlay_
|
||
}, e.prototype.handleSourceAdd_ = function (t) {
|
||
t.feature && this.features_.push(t.feature)
|
||
}, e.prototype.handleSourceRemove_ = function (t) {
|
||
t.feature && this.features_.remove(t.feature)
|
||
}, e.prototype.handleFeatureAdd_ = function (t) {
|
||
this.addFeature_(t.element)
|
||
}, e.prototype.handleFeatureChange_ = function (t) {
|
||
if (!this.changingFeature_) {
|
||
var e = t.target;
|
||
this.removeFeature_(e), this.addFeature_(e)
|
||
}
|
||
}, e.prototype.handleFeatureRemove_ = function (t) {
|
||
var e = t.element;
|
||
this.removeFeature_(e)
|
||
}, e.prototype.writePointGeometry_ = function (t, e) {
|
||
var i = e.getCoordinates(), r = {feature: t, geometry: e, segment: [i, i]};
|
||
this.rBush_.insert(e.getExtent(), r)
|
||
}, e.prototype.writeMultiPointGeometry_ = function (t, e) {
|
||
for (var i = e.getCoordinates(), r = 0, o = i.length; r < o; ++r) {
|
||
var n = i[r], s = {feature: t, geometry: e, depth: [r], index: r, segment: [n, n]};
|
||
this.rBush_.insert(e.getExtent(), s)
|
||
}
|
||
}, e.prototype.writeLineStringGeometry_ = function (t, e) {
|
||
for (var i = e.getCoordinates(), r = 0, o = i.length - 1; r < o; ++r) {
|
||
var n = i.slice(r, r + 2), s = {feature: t, geometry: e, index: r, segment: n};
|
||
this.rBush_.insert(lt(n), s)
|
||
}
|
||
}, e.prototype.writeMultiLineStringGeometry_ = function (t, e) {
|
||
for (var i = e.getCoordinates(), r = 0, o = i.length; r < o; ++r) for (var n = i[r], s = 0, a = n.length - 1; s < a; ++s) {
|
||
var l = n.slice(s, s + 2), h = {feature: t, geometry: e, depth: [r], index: s, segment: l};
|
||
this.rBush_.insert(lt(l), h)
|
||
}
|
||
}, e.prototype.writePolygonGeometry_ = function (t, e) {
|
||
for (var i = e.getCoordinates(), r = 0, o = i.length; r < o; ++r) for (var n = i[r], s = 0, a = n.length - 1; s < a; ++s) {
|
||
var l = n.slice(s, s + 2), h = {feature: t, geometry: e, depth: [r], index: s, segment: l};
|
||
this.rBush_.insert(lt(l), h)
|
||
}
|
||
}, e.prototype.writeMultiPolygonGeometry_ = function (t, e) {
|
||
for (var i = e.getCoordinates(), r = 0, o = i.length; r < o; ++r) for (var n = i[r], s = 0, a = n.length; s < a; ++s) for (var l = n[s], h = 0, u = l.length - 1; h < u; ++h) {
|
||
var c = l.slice(h, h + 2), p = {feature: t, geometry: e, depth: [s, r], index: h, segment: c};
|
||
this.rBush_.insert(lt(c), p)
|
||
}
|
||
}, e.prototype.writeCircleGeometry_ = function (t, e) {
|
||
var i = e.getCenter(), r = {feature: t, geometry: e, index: 0, segment: [i, i]},
|
||
o = {feature: t, geometry: e, index: F_, segment: [i, i]}, n = [r, o];
|
||
r.featureSegments = o.featureSegments = n, this.rBush_.insert(_t(i), r), this.rBush_.insert(e.getExtent(), o)
|
||
}, e.prototype.writeGeometryCollectionGeometry_ = function (t, e) {
|
||
for (var i = e.getGeometriesArray(), r = 0; r < i.length; ++r) this.SEGMENT_WRITERS_[i[r].getType()].call(this, t, i[r])
|
||
}, e.prototype.createOrUpdateVertexFeature_ = function (t) {
|
||
var e = this.vertexFeature_;
|
||
e ? e.getGeometry().setCoordinates(t) : (e = new X(new qi(t)), this.vertexFeature_ = e, this.overlay_.getSource().addFeature(e));
|
||
return e
|
||
}, e.prototype.handleEvent = function (e) {
|
||
return !e.pointerEvent || (this.lastPointerEvent_ = e, e.map.getView().getInteracting() || e.type != Ho.POINTERMOVE || this.handlingDownUpSequence || this.handlePointerMove_(e), this.vertexFeature_ && this.deleteCondition_(e) && (i = !(e.type != Ho.SINGLECLICK || !this.ignoreNextSingleClick_) || this.removePoint()), e.type == Ho.SINGLECLICK && (this.ignoreNextSingleClick_ = !1), t.prototype.handleEvent.call(this, e) && !i);
|
||
var i
|
||
}, e.prototype.handleDragEvent = function (t) {
|
||
this.ignoreNextSingleClick_ = !1, this.willModifyFeatures_(t);
|
||
for (var e = t.coordinate, i = 0, r = this.dragSegments_.length; i < r; ++i) {
|
||
for (var o = this.dragSegments_[i], n = o[0], s = n.depth, a = n.geometry, l = void 0, h = n.segment, u = o[1]; e.length < a.getStride();) e.push(h[u][e.length]);
|
||
switch (a.getType()) {
|
||
case Zt.POINT:
|
||
l = e, h[0] = h[1] = e;
|
||
break;
|
||
case Zt.MULTI_POINT:
|
||
(l = a.getCoordinates())[n.index] = e, h[0] = h[1] = e;
|
||
break;
|
||
case Zt.LINE_STRING:
|
||
(l = a.getCoordinates())[n.index + u] = e, h[u] = e;
|
||
break;
|
||
case Zt.MULTI_LINE_STRING:
|
||
case Zt.POLYGON:
|
||
(l = a.getCoordinates())[s[0]][n.index + u] = e, h[u] = e;
|
||
break;
|
||
case Zt.MULTI_POLYGON:
|
||
(l = a.getCoordinates())[s[1]][s[0]][n.index + u] = e, h[u] = e;
|
||
break;
|
||
case Zt.CIRCLE:
|
||
h[0] = h[1] = e, 0 === n.index ? (this.changingFeature_ = !0, a.setCenter(e), this.changingFeature_ = !1) : (this.changingFeature_ = !0, a.setRadius(Yr(a.getCenter(), e)), this.changingFeature_ = !1)
|
||
}
|
||
l && this.setGeometryCoordinates_(a, l)
|
||
}
|
||
this.createOrUpdateVertexFeature_(e)
|
||
}, e.prototype.handleDownEvent = function (t) {
|
||
if (!this.condition_(t)) return !1;
|
||
this.handlePointerAtPixel_(t.pixel, t.map);
|
||
var e = t.map.getCoordinateFromPixel(t.pixel);
|
||
this.dragSegments_.length = 0, this.modified_ = !1;
|
||
var i = this.vertexFeature_;
|
||
if (i) {
|
||
var r = [], o = i.getGeometry().getCoordinates(), n = lt([o]), s = this.rBush_.getInExtent(n),
|
||
l = {};
|
||
s.sort(j_);
|
||
for (var h = 0, u = s.length; h < u; ++h) {
|
||
var c = s[h], p = c.segment, d = a(c.feature), f = c.depth;
|
||
if (f && (d += "-" + f.join("-")), l[d] || (l[d] = new Array(2)), c.geometry.getType() === Zt.CIRCLE && c.index === F_) zr(U_(e, c), o) && !l[d][0] && (this.dragSegments_.push([c, 0]), l[d][0] = c); else if (zr(p[0], o) && !l[d][0]) this.dragSegments_.push([c, 0]), l[d][0] = c; else if (zr(p[1], o) && !l[d][1]) {
|
||
if ((c.geometry.getType() === Zt.LINE_STRING || c.geometry.getType() === Zt.MULTI_LINE_STRING) && l[d][0] && 0 === l[d][0].index) continue;
|
||
this.dragSegments_.push([c, 1]), l[d][1] = c
|
||
} else this.insertVertexCondition_(t) && a(p) in this.vertexSegments_ && !l[d][0] && !l[d][1] && r.push([c, o])
|
||
}
|
||
r.length && this.willModifyFeatures_(t);
|
||
for (var g = r.length - 1; g >= 0; --g) this.insertVertex_.apply(this, r[g])
|
||
}
|
||
return !!this.vertexFeature_
|
||
}, e.prototype.handleUpEvent = function (t) {
|
||
for (var e = this.dragSegments_.length - 1; e >= 0; --e) {
|
||
var i = this.dragSegments_[e][0], r = i.geometry;
|
||
if (r.getType() === Zt.CIRCLE) {
|
||
var o = r.getCenter(), n = i.featureSegments[0], s = i.featureSegments[1];
|
||
n.segment[0] = n.segment[1] = o, s.segment[0] = s.segment[1] = o, this.rBush_.update(_t(o), n), this.rBush_.update(r.getExtent(), s)
|
||
} else this.rBush_.update(lt(i.segment), i)
|
||
}
|
||
return this.modified_ && (this.dispatchEvent(new G_(D_, this.features_, t)), this.modified_ = !1), !1
|
||
}, e.prototype.handlePointerMove_ = function (t) {
|
||
this.lastPixel_ = t.pixel, this.handlePointerAtPixel_(t.pixel, t.map)
|
||
}, e.prototype.handlePointerAtPixel_ = function (t, e) {
|
||
var i = e.getCoordinateFromPixel(t), r = ht(_t(i), e.getView().getResolution() * this.pixelTolerance_),
|
||
o = this.rBush_.getInExtent(r);
|
||
if (o.length > 0) {
|
||
o.sort(function (t, e) {
|
||
return z_(i, t) - z_(i, e)
|
||
});
|
||
var n = o[0], s = n.segment, l = U_(i, n), h = e.getPixelFromCoordinate(l), u = Yr(t, h);
|
||
if (u <= this.pixelTolerance_) {
|
||
var c = {};
|
||
if (n.geometry.getType() === Zt.CIRCLE && n.index === F_) this.snappedToVertex_ = !0, this.createOrUpdateVertexFeature_(l); else {
|
||
var p = e.getPixelFromCoordinate(s[0]), d = e.getPixelFromCoordinate(s[1]), f = Vr(h, p),
|
||
g = Vr(h, d);
|
||
u = Math.sqrt(Math.min(f, g)), this.snappedToVertex_ = u <= this.pixelTolerance_, this.snappedToVertex_ && (l = f > g ? s[1] : s[0]), this.createOrUpdateVertexFeature_(l);
|
||
for (var m = 1, y = o.length; m < y; ++m) {
|
||
var v = o[m].segment;
|
||
if (!(zr(s[0], v[0]) && zr(s[1], v[1]) || zr(s[0], v[1]) && zr(s[1], v[0]))) break;
|
||
c[a(v)] = !0
|
||
}
|
||
}
|
||
return c[a(s)] = !0, void (this.vertexSegments_ = c)
|
||
}
|
||
}
|
||
this.vertexFeature_ && (this.overlay_.getSource().removeFeature(this.vertexFeature_), this.vertexFeature_ = null)
|
||
}, e.prototype.insertVertex_ = function (t, e) {
|
||
for (var i, r = t.segment, o = t.feature, n = t.geometry, s = t.depth, a = t.index; e.length < n.getStride();) e.push(0);
|
||
switch (n.getType()) {
|
||
case Zt.MULTI_LINE_STRING:
|
||
case Zt.POLYGON:
|
||
(i = n.getCoordinates())[s[0]].splice(a + 1, 0, e);
|
||
break;
|
||
case Zt.MULTI_POLYGON:
|
||
(i = n.getCoordinates())[s[1]][s[0]].splice(a + 1, 0, e);
|
||
break;
|
||
case Zt.LINE_STRING:
|
||
(i = n.getCoordinates()).splice(a + 1, 0, e);
|
||
break;
|
||
default:
|
||
return
|
||
}
|
||
this.setGeometryCoordinates_(n, i);
|
||
var l = this.rBush_;
|
||
l.remove(t), this.updateSegmentIndices_(n, a, s, 1);
|
||
var h = {segment: [r[0], e], feature: o, geometry: n, depth: s, index: a};
|
||
l.insert(lt(h.segment), h), this.dragSegments_.push([h, 1]);
|
||
var u = {segment: [e, r[1]], feature: o, geometry: n, depth: s, index: a + 1};
|
||
l.insert(lt(u.segment), u), this.dragSegments_.push([u, 0]), this.ignoreNextSingleClick_ = !0
|
||
}, e.prototype.removePoint = function () {
|
||
if (this.lastPointerEvent_ && this.lastPointerEvent_.type != Ho.POINTERDRAG) {
|
||
var t = this.lastPointerEvent_;
|
||
return this.willModifyFeatures_(t), this.removeVertex_(), this.dispatchEvent(new G_(D_, this.features_, t)), this.modified_ = !1, !0
|
||
}
|
||
return !1
|
||
}, e.prototype.removeVertex_ = function () {
|
||
var t, e, i, r, o, n, s, l, h, u, c, p = this.dragSegments_, d = {}, f = !1;
|
||
for (o = p.length - 1; o >= 0; --o) c = a((u = (i = p[o])[0]).feature), u.depth && (c += "-" + u.depth.join("-")), c in d || (d[c] = {}), 0 === i[1] ? (d[c].right = u, d[c].index = u.index) : 1 == i[1] && (d[c].left = u, d[c].index = u.index + 1);
|
||
for (c in d) {
|
||
switch (h = d[c].right, s = d[c].left, (l = (n = d[c].index) - 1) < 0 && (l = 0), t = e = (r = (u = void 0 !== s ? s : h).geometry).getCoordinates(), f = !1, r.getType()) {
|
||
case Zt.MULTI_LINE_STRING:
|
||
e[u.depth[0]].length > 2 && (e[u.depth[0]].splice(n, 1), f = !0);
|
||
break;
|
||
case Zt.LINE_STRING:
|
||
e.length > 2 && (e.splice(n, 1), f = !0);
|
||
break;
|
||
case Zt.MULTI_POLYGON:
|
||
t = t[u.depth[1]];
|
||
case Zt.POLYGON:
|
||
(t = t[u.depth[0]]).length > 4 && (n == t.length - 1 && (n = 0), t.splice(n, 1), f = !0, 0 === n && (t.pop(), t.push(t[0]), l = t.length - 1))
|
||
}
|
||
if (f) {
|
||
this.setGeometryCoordinates_(r, e);
|
||
var g = [];
|
||
if (void 0 !== s && (this.rBush_.remove(s), g.push(s.segment[0])), void 0 !== h && (this.rBush_.remove(h), g.push(h.segment[1])), void 0 !== s && void 0 !== h) {
|
||
var m = {depth: u.depth, feature: u.feature, geometry: u.geometry, index: l, segment: g};
|
||
this.rBush_.insert(lt(m.segment), m)
|
||
}
|
||
this.updateSegmentIndices_(r, n, u.depth, -1), this.vertexFeature_ && (this.overlay_.getSource().removeFeature(this.vertexFeature_), this.vertexFeature_ = null), p.length = 0
|
||
}
|
||
}
|
||
return f
|
||
}, e.prototype.setGeometryCoordinates_ = function (t, e) {
|
||
this.changingFeature_ = !0, t.setCoordinates(e), this.changingFeature_ = !1
|
||
}, e.prototype.updateSegmentIndices_ = function (t, e, i, r) {
|
||
this.rBush_.forEachInExtent(t.getExtent(), function (o) {
|
||
o.geometry === t && (void 0 === i || void 0 === o.depth || it(o.depth, i)) && o.index > e && (o.index += r)
|
||
})
|
||
}, e
|
||
}(ra), V_ = {SELECT: "select"}, Y_ = function (t) {
|
||
function e(e, i, r, o) {
|
||
t.call(this, e), this.selected = i, this.deselected = r, this.mapBrowserEvent = o
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A);
|
||
|
||
function W_(t) {
|
||
if (!this.condition_(t)) return !0;
|
||
var e = this.addCondition_(t), i = this.removeCondition_(t), r = this.toggleCondition_(t),
|
||
o = !e && !i && !r, n = t.map, s = this.getFeatures(), a = [], l = [];
|
||
if (o) {
|
||
d(this.featureLayerAssociation_), n.forEachFeatureAtPixel(t.pixel, function (t, e) {
|
||
if (this.filter_(t, e)) return l.push(t), this.addFeatureLayerAssociation_(t, e), !this.multi_
|
||
}.bind(this), {layerFilter: this.layerFilter_, hitTolerance: this.hitTolerance_});
|
||
for (var h = s.getLength() - 1; h >= 0; --h) {
|
||
var u = s.item(h), c = l.indexOf(u);
|
||
c > -1 ? l.splice(c, 1) : (s.remove(u), a.push(u))
|
||
}
|
||
0 !== l.length && s.extend(l)
|
||
} else {
|
||
n.forEachFeatureAtPixel(t.pixel, function (t, o) {
|
||
if (this.filter_(t, o)) return !e && !r || K(s.getArray(), t) ? (i || r) && K(s.getArray(), t) && (a.push(t), this.removeFeatureLayerAssociation_(t)) : (l.push(t), this.addFeatureLayerAssociation_(t, o)), !this.multi_
|
||
}.bind(this), {layerFilter: this.layerFilter_, hitTolerance: this.hitTolerance_});
|
||
for (var p = a.length - 1; p >= 0; --p) s.remove(a[p]);
|
||
s.extend(l)
|
||
}
|
||
return (l.length > 0 || a.length > 0) && this.dispatchEvent(new Y_(V_.SELECT, l, a, t)), Zs(t)
|
||
}
|
||
|
||
function H_() {
|
||
var t = tf();
|
||
return Q(t[Zt.POLYGON], t[Zt.LINE_STRING]), Q(t[Zt.GEOMETRY_COLLECTION], t[Zt.LINE_STRING]), function (e, i) {
|
||
return e.getGeometry() ? t[e.getGeometry().getType()] : null
|
||
}
|
||
}
|
||
|
||
var X_ = function (t) {
|
||
function e(e) {
|
||
t.call(this, {handleEvent: W_});
|
||
var i = e || {};
|
||
this.condition_ = i.condition ? i.condition : Ks, this.addCondition_ = i.addCondition ? i.addCondition : qs, this.removeCondition_ = i.removeCondition ? i.removeCondition : qs, this.toggleCondition_ = i.toggleCondition ? i.toggleCondition : $s, this.multi_ = !!i.multi && i.multi, this.filter_ = i.filter ? i.filter : P, this.hitTolerance_ = i.hitTolerance ? i.hitTolerance : 0;
|
||
var r, o = new v_({
|
||
source: new b_({useSpatialIndex: !1, features: i.features, wrapX: i.wrapX}),
|
||
style: i.style ? i.style : H_(),
|
||
updateWhileAnimating: !0,
|
||
updateWhileInteracting: !0
|
||
});
|
||
if (this.featureOverlay_ = o, i.layers) if ("function" == typeof i.layers) r = i.layers; else {
|
||
var n = i.layers;
|
||
r = function (t) {
|
||
return K(n, t)
|
||
}
|
||
} else r = P;
|
||
this.layerFilter_ = r, this.featureLayerAssociation_ = {};
|
||
var s = this.getFeatures();
|
||
w(s, u.ADD, this.addFeature_, this), w(s, u.REMOVE, this.removeFeature_, this)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.addFeatureLayerAssociation_ = function (t, e) {
|
||
this.featureLayerAssociation_[a(t)] = e
|
||
}, e.prototype.getFeatures = function () {
|
||
return this.featureOverlay_.getSource().getFeaturesCollection()
|
||
}, e.prototype.getHitTolerance = function () {
|
||
return this.hitTolerance_
|
||
}, e.prototype.getLayer = function (t) {
|
||
return this.featureLayerAssociation_[a(t)]
|
||
}, e.prototype.getOverlay = function () {
|
||
return this.featureOverlay_
|
||
}, e.prototype.setHitTolerance = function (t) {
|
||
this.hitTolerance_ = t
|
||
}, e.prototype.setMap = function (e) {
|
||
var i = this.getMap(), r = this.getFeatures();
|
||
i && r.forEach(i.unskipFeature.bind(i)), t.prototype.setMap.call(this, e), this.featureOverlay_.setMap(e), e && r.forEach(e.skipFeature.bind(e))
|
||
}, e.prototype.addFeature_ = function (t) {
|
||
var e = this.getMap();
|
||
e && e.skipFeature(t.element)
|
||
}, e.prototype.removeFeature_ = function (t) {
|
||
var e = this.getMap();
|
||
e && e.unskipFeature(t.element)
|
||
}, e.prototype.removeFeatureLayerAssociation_ = function (t) {
|
||
delete this.featureLayerAssociation_[a(t)]
|
||
}, e
|
||
}(zs);
|
||
|
||
function q_(t) {
|
||
return t.feature ? t.feature : t.element ? t.element : void 0
|
||
}
|
||
|
||
var Z_ = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = i;
|
||
r.handleDownEvent || (r.handleDownEvent = P), r.stopDown || (r.stopDown = L), t.call(this, r), this.source_ = i.source ? i.source : null, this.vertex_ = void 0 === i.vertex || i.vertex, this.edge_ = void 0 === i.edge || i.edge, this.features_ = i.features ? i.features : null, this.featuresListenerKeys_ = [], this.featureChangeListenerKeys_ = {}, this.indexedFeaturesExtents_ = {}, this.pendingFeatures_ = {}, this.pixelCoordinate_ = null, this.pixelTolerance_ = void 0 !== i.pixelTolerance ? i.pixelTolerance : 10, this.sortByDistance_ = function (t, e) {
|
||
var i = Wr(this.pixelCoordinate_, t.segment), r = Wr(this.pixelCoordinate_, e.segment);
|
||
return i - r
|
||
}.bind(this), this.rBush_ = new Eu, this.SEGMENT_WRITERS_ = {
|
||
Point: this.writePointGeometry_,
|
||
LineString: this.writeLineStringGeometry_,
|
||
LinearRing: this.writeLineStringGeometry_,
|
||
Polygon: this.writePolygonGeometry_,
|
||
MultiPoint: this.writeMultiPointGeometry_,
|
||
MultiLineString: this.writeMultiLineStringGeometry_,
|
||
MultiPolygon: this.writeMultiPolygonGeometry_,
|
||
GeometryCollection: this.writeGeometryCollectionGeometry_,
|
||
Circle: this.writeCircleGeometry_
|
||
}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.addFeature = function (t, e) {
|
||
var i = void 0 === e || e, r = a(t), o = t.getGeometry();
|
||
if (o) {
|
||
var n = this.SEGMENT_WRITERS_[o.getType()];
|
||
n && (this.indexedFeaturesExtents_[r] = o.getExtent([1 / 0, 1 / 0, -1 / 0, -1 / 0]), n.call(this, t, o))
|
||
}
|
||
i && (this.featureChangeListenerKeys_[r] = w(t, F.CHANGE, this.handleFeatureChange_, this))
|
||
}, e.prototype.forEachFeatureAdd_ = function (t) {
|
||
this.addFeature(t)
|
||
}, e.prototype.forEachFeatureRemove_ = function (t) {
|
||
this.removeFeature(t)
|
||
}, e.prototype.getFeatures_ = function () {
|
||
var t;
|
||
return this.features_ ? t = this.features_ : this.source_ && (t = this.source_.getFeatures()), t
|
||
}, e.prototype.handleEvent = function (e) {
|
||
var i = this.snapTo(e.pixel, e.coordinate, e.map);
|
||
return i.snapped && (e.coordinate = i.vertex.slice(0, 2), e.pixel = i.vertexPixel), t.prototype.handleEvent.call(this, e)
|
||
}, e.prototype.handleFeatureAdd_ = function (t) {
|
||
var e = q_(t);
|
||
this.addFeature(e)
|
||
}, e.prototype.handleFeatureRemove_ = function (t) {
|
||
var e = q_(t);
|
||
this.removeFeature(e)
|
||
}, e.prototype.handleFeatureChange_ = function (t) {
|
||
var e = t.target;
|
||
if (this.handlingDownUpSequence) {
|
||
var i = a(e);
|
||
i in this.pendingFeatures_ || (this.pendingFeatures_[i] = e)
|
||
} else this.updateFeature_(e)
|
||
}, e.prototype.handleUpEvent = function (t) {
|
||
var e = f(this.pendingFeatures_);
|
||
return e.length && (e.forEach(this.updateFeature_.bind(this)), this.pendingFeatures_ = {}), !1
|
||
}, e.prototype.removeFeature = function (t, e) {
|
||
var i = void 0 === e || e, r = a(t), o = this.indexedFeaturesExtents_[r];
|
||
if (o) {
|
||
var n = this.rBush_, s = [];
|
||
n.forEachInExtent(o, function (e) {
|
||
t === e.feature && s.push(e)
|
||
});
|
||
for (var l = s.length - 1; l >= 0; --l) n.remove(s[l])
|
||
}
|
||
i && (S(this.featureChangeListenerKeys_[r]), delete this.featureChangeListenerKeys_[r])
|
||
}, e.prototype.setMap = function (e) {
|
||
var i = this.getMap(), r = this.featuresListenerKeys_, o = this.getFeatures_();
|
||
i && (r.forEach(S), r.length = 0, o.forEach(this.forEachFeatureRemove_.bind(this))), t.prototype.setMap.call(this, e), e && (this.features_ ? r.push(w(this.features_, u.ADD, this.handleFeatureAdd_, this), w(this.features_, u.REMOVE, this.handleFeatureRemove_, this)) : this.source_ && r.push(w(this.source_, x_.ADDFEATURE, this.handleFeatureAdd_, this), w(this.source_, x_.REMOVEFEATURE, this.handleFeatureRemove_, this)), o.forEach(this.forEachFeatureAdd_.bind(this)))
|
||
}, e.prototype.snapTo = function (t, e, i) {
|
||
var r = lt([i.getCoordinateFromPixel([t[0] - this.pixelTolerance_, t[1] + this.pixelTolerance_]), i.getCoordinateFromPixel([t[0] + this.pixelTolerance_, t[1] - this.pixelTolerance_])]),
|
||
o = this.rBush_.getInExtent(r);
|
||
this.vertex_ && !this.edge_ && (o = o.filter(function (t) {
|
||
return t.feature.getGeometry().getType() !== Zt.CIRCLE
|
||
}));
|
||
var n, s, a, l, h = !1, u = null, c = null;
|
||
if (o.length > 0) {
|
||
this.pixelCoordinate_ = e, o.sort(this.sortByDistance_);
|
||
var p = o[0].segment, d = o[0].feature.getGeometry().getType() === Zt.CIRCLE;
|
||
this.vertex_ && !this.edge_ ? (n = i.getPixelFromCoordinate(p[0]), s = i.getPixelFromCoordinate(p[1]), a = Vr(t, n), l = Vr(t, s), Math.sqrt(Math.min(a, l)) <= this.pixelTolerance_ && (h = !0, u = a > l ? p[1] : p[0], c = i.getPixelFromCoordinate(u))) : this.edge_ && (u = d ? Nr(e, o[0].feature.getGeometry()) : Dr(e, p), Yr(t, c = i.getPixelFromCoordinate(u)) <= this.pixelTolerance_ && (h = !0, this.vertex_ && !d && (n = i.getPixelFromCoordinate(p[0]), s = i.getPixelFromCoordinate(p[1]), a = Vr(c, n), l = Vr(c, s), Math.sqrt(Math.min(a, l)) <= this.pixelTolerance_ && (u = a > l ? p[1] : p[0], c = i.getPixelFromCoordinate(u))))), h && (c = [Math.round(c[0]), Math.round(c[1])])
|
||
}
|
||
return {snapped: h, vertex: u, vertexPixel: c}
|
||
}, e.prototype.updateFeature_ = function (t) {
|
||
this.removeFeature(t, !1), this.addFeature(t, !1)
|
||
}, e.prototype.writeCircleGeometry_ = function (t, e) {
|
||
for (var i = yr(e).getCoordinates()[0], r = 0, o = i.length - 1; r < o; ++r) {
|
||
var n = i.slice(r, r + 2), s = {feature: t, segment: n};
|
||
this.rBush_.insert(lt(n), s)
|
||
}
|
||
}, e.prototype.writeGeometryCollectionGeometry_ = function (t, e) {
|
||
for (var i = e.getGeometriesArray(), r = 0; r < i.length; ++r) {
|
||
var o = this.SEGMENT_WRITERS_[i[r].getType()];
|
||
o && o.call(this, t, i[r])
|
||
}
|
||
}, e.prototype.writeLineStringGeometry_ = function (t, e) {
|
||
for (var i = e.getCoordinates(), r = 0, o = i.length - 1; r < o; ++r) {
|
||
var n = i.slice(r, r + 2), s = {feature: t, segment: n};
|
||
this.rBush_.insert(lt(n), s)
|
||
}
|
||
}, e.prototype.writeMultiLineStringGeometry_ = function (t, e) {
|
||
for (var i = e.getCoordinates(), r = 0, o = i.length; r < o; ++r) for (var n = i[r], s = 0, a = n.length - 1; s < a; ++s) {
|
||
var l = n.slice(s, s + 2), h = {feature: t, segment: l};
|
||
this.rBush_.insert(lt(l), h)
|
||
}
|
||
}, e.prototype.writeMultiPointGeometry_ = function (t, e) {
|
||
for (var i = e.getCoordinates(), r = 0, o = i.length; r < o; ++r) {
|
||
var n = i[r], s = {feature: t, segment: [n, n]};
|
||
this.rBush_.insert(e.getExtent(), s)
|
||
}
|
||
}, e.prototype.writeMultiPolygonGeometry_ = function (t, e) {
|
||
for (var i = e.getCoordinates(), r = 0, o = i.length; r < o; ++r) for (var n = i[r], s = 0, a = n.length; s < a; ++s) for (var l = n[s], h = 0, u = l.length - 1; h < u; ++h) {
|
||
var c = l.slice(h, h + 2), p = {feature: t, segment: c};
|
||
this.rBush_.insert(lt(c), p)
|
||
}
|
||
}, e.prototype.writePointGeometry_ = function (t, e) {
|
||
var i = e.getCoordinates(), r = {feature: t, segment: [i, i]};
|
||
this.rBush_.insert(e.getExtent(), r)
|
||
}, e.prototype.writePolygonGeometry_ = function (t, e) {
|
||
for (var i = e.getCoordinates(), r = 0, o = i.length; r < o; ++r) for (var n = i[r], s = 0, a = n.length - 1; s < a; ++s) {
|
||
var l = n.slice(s, s + 2), h = {feature: t, segment: l};
|
||
this.rBush_.insert(lt(l), h)
|
||
}
|
||
}, e
|
||
}(ra), K_ = "translatestart", J_ = "translating", $_ = "translateend", Q_ = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, e), this.features = i, this.coordinate = r
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A), tx = function (t) {
|
||
function e(e) {
|
||
var i, r = e || {};
|
||
if (t.call(this, r), this.lastCoordinate_ = null, this.features_ = void 0 !== r.features ? r.features : null, r.layers) if ("function" == typeof r.layers) i = r.layers; else {
|
||
var o = r.layers;
|
||
i = function (t) {
|
||
return K(o, t)
|
||
}
|
||
} else i = P;
|
||
this.layerFilter_ = i, this.hitTolerance_ = r.hitTolerance ? r.hitTolerance : 0, this.lastFeature_ = null, w(this, z(As.ACTIVE), this.handleActiveChanged_, this)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.handleDownEvent = function (t) {
|
||
if (this.lastFeature_ = this.featuresAtPixel_(t.pixel, t.map), !this.lastCoordinate_ && this.lastFeature_) {
|
||
this.lastCoordinate_ = t.coordinate, this.handleMoveEvent(t);
|
||
var e = this.features_ || new Y([this.lastFeature_]);
|
||
return this.dispatchEvent(new Q_(K_, e, t.coordinate)), !0
|
||
}
|
||
return !1
|
||
}, e.prototype.handleUpEvent = function (t) {
|
||
if (this.lastCoordinate_) {
|
||
this.lastCoordinate_ = null, this.handleMoveEvent(t);
|
||
var e = this.features_ || new Y([this.lastFeature_]);
|
||
return this.dispatchEvent(new Q_($_, e, t.coordinate)), !0
|
||
}
|
||
return !1
|
||
}, e.prototype.handleDragEvent = function (t) {
|
||
if (this.lastCoordinate_) {
|
||
var e = t.coordinate, i = e[0] - this.lastCoordinate_[0], r = e[1] - this.lastCoordinate_[1],
|
||
o = this.features_ || new Y([this.lastFeature_]);
|
||
o.forEach(function (t) {
|
||
var e = t.getGeometry();
|
||
e.translate(i, r), t.setGeometry(e)
|
||
}), this.lastCoordinate_ = e, this.dispatchEvent(new Q_(J_, o, e))
|
||
}
|
||
}, e.prototype.handleMoveEvent = function (t) {
|
||
var e = t.map.getViewport();
|
||
this.featuresAtPixel_(t.pixel, t.map) ? (e.classList.remove(this.lastCoordinate_ ? "ol-grab" : "ol-grabbing"), e.classList.add(this.lastCoordinate_ ? "ol-grabbing" : "ol-grab")) : e.classList.remove("ol-grab", "ol-grabbing")
|
||
}, e.prototype.featuresAtPixel_ = function (t, e) {
|
||
return e.forEachFeatureAtPixel(t, function (t) {
|
||
if (!this.features_ || K(this.features_.getArray(), t)) return t
|
||
}.bind(this), {layerFilter: this.layerFilter_, hitTolerance: this.hitTolerance_})
|
||
}, e.prototype.getHitTolerance = function () {
|
||
return this.hitTolerance_
|
||
}, e.prototype.setHitTolerance = function (t) {
|
||
this.hitTolerance_ = t
|
||
}, e.prototype.setMap = function (e) {
|
||
var i = this.getMap();
|
||
t.prototype.setMap.call(this, e), this.updateState_(i)
|
||
}, e.prototype.handleActiveChanged_ = function () {
|
||
this.updateState_(null)
|
||
}, e.prototype.updateState_ = function (t) {
|
||
var e = this.getMap(), i = this.getActive();
|
||
e && i || (e = e || t) && e.getViewport().classList.remove("ol-grab", "ol-grabbing")
|
||
}, e
|
||
}(ra), ex = {BLUR: "blur", GRADIENT: "gradient", RADIUS: "radius"},
|
||
ix = ["#00f", "#0ff", "#0f0", "#ff0", "#f00"];
|
||
var rx = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = p({}, i);
|
||
delete r.gradient, delete r.radius, delete r.blur, delete r.shadow, delete r.weight, t.call(this, r), this.gradient_ = null, this.shadow_ = void 0 !== i.shadow ? i.shadow : 250, this.circleImage_ = void 0, this.styleCache_ = null, w(this, z(ex.GRADIENT), this.handleGradientChanged_, this), this.setGradient(i.gradient ? i.gradient : ix), this.setBlur(void 0 !== i.blur ? i.blur : 15), this.setRadius(void 0 !== i.radius ? i.radius : 8), w(this, z(ex.BLUR), this.handleStyleChanged_, this), w(this, z(ex.RADIUS), this.handleStyleChanged_, this), this.handleStyleChanged_();
|
||
var o, n = i.weight ? i.weight : "weight";
|
||
o = "string" == typeof n ? function (t) {
|
||
return t.get(n)
|
||
} : n, this.setStyle(function (t, e) {
|
||
var i = o(t), r = void 0 !== i ? te(i, 0, 1) : 1, n = 255 * r | 0, s = this.styleCache_[n];
|
||
return s || (s = [new uf({
|
||
image: new Xd({
|
||
opacity: r,
|
||
src: this.circleImage_
|
||
})
|
||
})], this.styleCache_[n] = s), s
|
||
}.bind(this)), this.setRenderOrder(null), w(this, eo.RENDER, this.handleRender_, this)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.createCircle_ = function () {
|
||
var t = this.getRadius(), e = this.getBlur(), i = t + e + 1, r = 2 * i, o = Ao(r, r);
|
||
o.shadowOffsetX = o.shadowOffsetY = this.shadow_, o.shadowBlur = e, o.shadowColor = "#000", o.beginPath();
|
||
var n = i - this.shadow_;
|
||
return o.arc(n, n, t, 0, 2 * Math.PI, !0), o.fill(), o.canvas.toDataURL()
|
||
}, e.prototype.getBlur = function () {
|
||
return this.get(ex.BLUR)
|
||
}, e.prototype.getGradient = function () {
|
||
return this.get(ex.GRADIENT)
|
||
}, e.prototype.getRadius = function () {
|
||
return this.get(ex.RADIUS)
|
||
}, e.prototype.handleGradientChanged_ = function () {
|
||
this.gradient_ = function (t) {
|
||
for (var e = Ao(1, 256), i = e.createLinearGradient(0, 0, 1, 256), r = 1 / (t.length - 1), o = 0, n = t.length; o < n; ++o) i.addColorStop(o * r, t[o]);
|
||
return e.fillStyle = i, e.fillRect(0, 0, 1, 256), e.getImageData(0, 0, 1, 256).data
|
||
}(this.getGradient())
|
||
}, e.prototype.handleStyleChanged_ = function () {
|
||
this.circleImage_ = this.createCircle_(), this.styleCache_ = new Array(256), this.changed()
|
||
}, e.prototype.handleRender_ = function (t) {
|
||
for (var e = t.context, i = e.canvas, r = e.getImageData(0, 0, i.width, i.height), o = r.data, n = 0, s = o.length; n < s; n += 4) {
|
||
var a = 4 * o[n + 3];
|
||
a && (o[n] = this.gradient_[a], o[n + 1] = this.gradient_[a + 1], o[n + 2] = this.gradient_[a + 2])
|
||
}
|
||
e.putImageData(r, 0, 0)
|
||
}, e.prototype.setBlur = function (t) {
|
||
this.set(ex.BLUR, t)
|
||
}, e.prototype.setGradient = function (t) {
|
||
this.set(ex.GRADIENT, t)
|
||
}, e.prototype.setRadius = function (t) {
|
||
this.set(ex.RADIUS, t)
|
||
}, e
|
||
}(v_), ox = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, i), this.type = Vo.IMAGE
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(Ts);
|
||
ox.prototype.getSource;
|
||
var nx = ox, sx = {PRELOAD: "preload", USE_INTERIM_TILES_ON_ERROR: "useInterimTilesOnError"},
|
||
ax = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = p({}, i);
|
||
delete r.preload, delete r.useInterimTilesOnError, t.call(this, r), this.setPreload(void 0 !== i.preload ? i.preload : 0), this.setUseInterimTilesOnError(void 0 === i.useInterimTilesOnError || i.useInterimTilesOnError), this.type = Vo.TILE
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getPreload = function () {
|
||
return this.get(sx.PRELOAD)
|
||
}, e.prototype.setPreload = function (t) {
|
||
this.set(sx.PRELOAD, t)
|
||
}, e.prototype.getUseInterimTilesOnError = function () {
|
||
return this.get(sx.USE_INTERIM_TILES_ON_ERROR)
|
||
}, e.prototype.setUseInterimTilesOnError = function (t) {
|
||
this.set(sx.USE_INTERIM_TILES_ON_ERROR, t)
|
||
}, e
|
||
}(Ts);
|
||
ax.prototype.getSource;
|
||
var lx = ax, hx = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = i.renderMode || $l.HYBRID;
|
||
W(null == r || r == $l.IMAGE || r == $l.HYBRID || r == $l.VECTOR, 28), i.declutter && r == $l.IMAGE && (r = $l.HYBRID), i.renderMode = r;
|
||
var o = p({}, i);
|
||
delete o.preload, delete o.useInterimTilesOnError, t.call(this, o), this.setPreload(i.preload ? i.preload : 0), this.setUseInterimTilesOnError(void 0 === i.useInterimTilesOnError || i.useInterimTilesOnError), this.type = Vo.VECTOR_TILE
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getPreload = function () {
|
||
return this.get(sx.PRELOAD)
|
||
}, e.prototype.getUseInterimTilesOnError = function () {
|
||
return this.get(sx.USE_INTERIM_TILES_ON_ERROR)
|
||
}, e.prototype.setPreload = function (t) {
|
||
this.set(sx.PRELOAD, t)
|
||
}, e.prototype.setUseInterimTilesOnError = function (t) {
|
||
this.set(sx.USE_INTERIM_TILES_ON_ERROR, t)
|
||
}, e
|
||
}(v_);
|
||
hx.prototype.getSource;
|
||
var ux = hx;
|
||
|
||
function cx(t, e, i, r) {
|
||
var o = ii(i, e, t), n = He(e, r, i), s = e.getMetersPerUnit();
|
||
void 0 !== s && (n *= s);
|
||
var a = t.getMetersPerUnit();
|
||
void 0 !== a && (n /= a);
|
||
var l = t.getExtent();
|
||
if (!l || pt(l, o)) {
|
||
var h = He(t, n, o) / n;
|
||
isFinite(h) && h > 0 && (n /= h)
|
||
}
|
||
return n
|
||
}
|
||
|
||
function px(t, e, i, r) {
|
||
var o = i - t, n = r - e, s = Math.sqrt(o * o + n * n);
|
||
return [Math.round(i + o / s), Math.round(r + n / s)]
|
||
}
|
||
|
||
function dx(t, e, i, r, o, n, s, a, l, h, u) {
|
||
var c = Ao(Math.round(i * t), Math.round(i * e));
|
||
if (0 === l.length) return c.canvas;
|
||
c.scale(i, i);
|
||
var p = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
||
l.forEach(function (t, e, i) {
|
||
Ct(p, t.extent)
|
||
});
|
||
var d = Ut(p), f = Nt(p), g = Ao(Math.round(i * d / r), Math.round(i * f / r)), m = i / r;
|
||
l.forEach(function (t, e, i) {
|
||
var r = t.extent[0] - p[0], o = -(t.extent[3] - p[3]), n = Ut(t.extent), s = Nt(t.extent);
|
||
g.drawImage(t.image, h, h, t.image.width - 2 * h, t.image.height - 2 * h, r * m, o * m, n * m, s * m)
|
||
});
|
||
var y = jt(s);
|
||
return a.getTriangles().forEach(function (t, e, o) {
|
||
var s = t.source, a = t.target, l = s[0][0], h = s[0][1], u = s[1][0], d = s[1][1], f = s[2][0],
|
||
m = s[2][1], v = (a[0][0] - y[0]) / n, _ = -(a[0][1] - y[1]) / n, x = (a[1][0] - y[0]) / n,
|
||
w = -(a[1][1] - y[1]) / n, b = (a[2][0] - y[0]) / n, C = -(a[2][1] - y[1]) / n, S = l, E = h;
|
||
l = 0, h = 0;
|
||
var T = ne([[u -= S, d -= E, 0, 0, x - v], [f -= S, m -= E, 0, 0, b - v], [0, 0, u, d, w - _], [0, 0, f, m, C - _]]);
|
||
if (T) {
|
||
c.save(), c.beginPath();
|
||
var R = (v + x + b) / 3, P = (_ + w + C) / 3, L = px(R, P, v, _), I = px(R, P, x, w),
|
||
O = px(R, P, b, C);
|
||
c.moveTo(I[0], I[1]), c.lineTo(L[0], L[1]), c.lineTo(O[0], O[1]), c.clip(), c.transform(T[0], T[2], T[1], T[3], v, _), c.translate(p[0] - S, p[3] - E), c.scale(r / i, -r / i), c.drawImage(g.canvas, 0, 0), c.restore()
|
||
}
|
||
}), u && (c.save(), c.strokeStyle = "black", c.lineWidth = 1, a.getTriangles().forEach(function (t, e, i) {
|
||
var r = t.target, o = (r[0][0] - y[0]) / n, s = -(r[0][1] - y[1]) / n, a = (r[1][0] - y[0]) / n,
|
||
l = -(r[1][1] - y[1]) / n, h = (r[2][0] - y[0]) / n, u = -(r[2][1] - y[1]) / n;
|
||
c.beginPath(), c.moveTo(a, l), c.lineTo(o, s), c.lineTo(h, u), c.closePath(), c.stroke()
|
||
}), c.restore()), c.canvas
|
||
}
|
||
|
||
var fx = function (t, e, i, r, o) {
|
||
this.sourceProj_ = t, this.targetProj_ = e;
|
||
var n = {}, s = ei(this.targetProj_, this.sourceProj_);
|
||
this.transformInv_ = function (t) {
|
||
var e = t[0] + "/" + t[1];
|
||
return n[e] || (n[e] = s(t)), n[e]
|
||
}, this.maxSourceExtent_ = r, this.errorThresholdSquared_ = o * o, this.triangles_ = [], this.wrapsXInSource_ = !1, this.canWrapXInSource_ = this.sourceProj_.canWrapX() && !!r && !!this.sourceProj_.getExtent() && Ut(r) == Ut(this.sourceProj_.getExtent()), this.sourceWorldWidth_ = this.sourceProj_.getExtent() ? Ut(this.sourceProj_.getExtent()) : null, this.targetWorldWidth_ = this.targetProj_.getExtent() ? Ut(this.targetProj_.getExtent()) : null;
|
||
var a = jt(i), l = zt(i), h = Mt(i), u = Ot(i), c = this.transformInv_(a), p = this.transformInv_(l),
|
||
d = this.transformInv_(h), f = this.transformInv_(u);
|
||
if (this.addQuad_(a, l, h, u, c, p, d, f, 10), this.wrapsXInSource_) {
|
||
var g = 1 / 0;
|
||
this.triangles_.forEach(function (t, e, i) {
|
||
g = Math.min(g, t.source[0][0], t.source[1][0], t.source[2][0])
|
||
}), this.triangles_.forEach(function (t) {
|
||
if (Math.max(t.source[0][0], t.source[1][0], t.source[2][0]) - g > this.sourceWorldWidth_ / 2) {
|
||
var e = [[t.source[0][0], t.source[0][1]], [t.source[1][0], t.source[1][1]], [t.source[2][0], t.source[2][1]]];
|
||
e[0][0] - g > this.sourceWorldWidth_ / 2 && (e[0][0] -= this.sourceWorldWidth_), e[1][0] - g > this.sourceWorldWidth_ / 2 && (e[1][0] -= this.sourceWorldWidth_), e[2][0] - g > this.sourceWorldWidth_ / 2 && (e[2][0] -= this.sourceWorldWidth_);
|
||
var i = Math.min(e[0][0], e[1][0], e[2][0]);
|
||
Math.max(e[0][0], e[1][0], e[2][0]) - i < this.sourceWorldWidth_ / 2 && (t.source = e)
|
||
}
|
||
}.bind(this))
|
||
}
|
||
n = {}
|
||
};
|
||
fx.prototype.addTriangle_ = function (t, e, i, r, o, n) {
|
||
this.triangles_.push({source: [r, o, n], target: [t, e, i]})
|
||
}, fx.prototype.addQuad_ = function (t, e, i, r, o, n, s, a, l) {
|
||
var h = lt([o, n, s, a]), u = this.sourceWorldWidth_ ? Ut(h) / this.sourceWorldWidth_ : null,
|
||
c = this.sourceWorldWidth_, p = this.sourceProj_.canWrapX() && u > .5 && u < 1, d = !1;
|
||
if (l > 0) {
|
||
if (this.targetProj_.isGlobal() && this.targetWorldWidth_) d = Ut(lt([t, e, i, r])) / this.targetWorldWidth_ > .25 || d;
|
||
!p && this.sourceProj_.isGlobal() && u && (d = u > .25 || d)
|
||
}
|
||
if (d || !this.maxSourceExtent_ || Bt(h, this.maxSourceExtent_)) {
|
||
if (!(d || isFinite(o[0]) && isFinite(o[1]) && isFinite(n[0]) && isFinite(n[1]) && isFinite(s[0]) && isFinite(s[1]) && isFinite(a[0]) && isFinite(a[1]))) {
|
||
if (!(l > 0)) return;
|
||
d = !0
|
||
}
|
||
if (l > 0) {
|
||
if (!d) {
|
||
var f, g = [(t[0] + i[0]) / 2, (t[1] + i[1]) / 2], m = this.transformInv_(g);
|
||
if (p) f = (le(o[0], c) + le(s[0], c)) / 2 - le(m[0], c); else f = (o[0] + s[0]) / 2 - m[0];
|
||
var y = (o[1] + s[1]) / 2 - m[1];
|
||
d = f * f + y * y > this.errorThresholdSquared_
|
||
}
|
||
if (d) {
|
||
if (Math.abs(t[0] - i[0]) <= Math.abs(t[1] - i[1])) {
|
||
var v = [(e[0] + i[0]) / 2, (e[1] + i[1]) / 2], _ = this.transformInv_(v),
|
||
x = [(r[0] + t[0]) / 2, (r[1] + t[1]) / 2], w = this.transformInv_(x);
|
||
this.addQuad_(t, e, v, x, o, n, _, w, l - 1), this.addQuad_(x, v, i, r, w, _, s, a, l - 1)
|
||
} else {
|
||
var b = [(t[0] + e[0]) / 2, (t[1] + e[1]) / 2], C = this.transformInv_(b),
|
||
S = [(i[0] + r[0]) / 2, (i[1] + r[1]) / 2], E = this.transformInv_(S);
|
||
this.addQuad_(t, b, S, r, o, C, E, a, l - 1), this.addQuad_(b, e, i, S, C, n, s, E, l - 1)
|
||
}
|
||
return
|
||
}
|
||
}
|
||
if (p) {
|
||
if (!this.canWrapXInSource_) return;
|
||
this.wrapsXInSource_ = !0
|
||
}
|
||
this.addTriangle_(t, i, r, o, s, a), this.addTriangle_(t, e, i, o, n, s)
|
||
}
|
||
}, fx.prototype.calculateSourceExtent = function () {
|
||
var t = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
||
return this.triangles_.forEach(function (e, i, r) {
|
||
var o = e.source;
|
||
St(t, o[0]), St(t, o[1]), St(t, o[2])
|
||
}), t
|
||
}, fx.prototype.getTriangles = function () {
|
||
return this.triangles_
|
||
};
|
||
var gx = fx, mx = function (t) {
|
||
function e(e, i, r, o, n, s) {
|
||
var a = e.getExtent(), l = i.getExtent(), h = l ? Dt(r, l) : r, u = cx(e, i, At(h), o),
|
||
c = new gx(e, i, h, a, u * Sa), p = s(c.calculateSourceExtent(), u, n), d = So.LOADED;
|
||
p && (d = So.IDLE);
|
||
var f = p ? p.getPixelRatio() : 1;
|
||
t.call(this, r, o, f, d), this.targetProj_ = i, this.maxSourceExtent_ = a, this.triangulation_ = c, this.targetResolution_ = o, this.targetExtent_ = r, this.sourceImage_ = p, this.sourcePixelRatio_ = f, this.canvas_ = null, this.sourceListenerKey_ = null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.disposeInternal = function () {
|
||
this.state == So.LOADING && this.unlistenSource_(), t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.getImage = function () {
|
||
return this.canvas_
|
||
}, e.prototype.getProjection = function () {
|
||
return this.targetProj_
|
||
}, e.prototype.reproject_ = function () {
|
||
var t = this.sourceImage_.getState();
|
||
if (t == So.LOADED) {
|
||
var e = Ut(this.targetExtent_) / this.targetResolution_,
|
||
i = Nt(this.targetExtent_) / this.targetResolution_;
|
||
this.canvas_ = dx(e, i, this.sourcePixelRatio_, this.sourceImage_.getResolution(), this.maxSourceExtent_, this.targetResolution_, this.targetExtent_, this.triangulation_, [{
|
||
extent: this.sourceImage_.getExtent(),
|
||
image: this.sourceImage_.getImage()
|
||
}], 0)
|
||
}
|
||
this.state = t, this.changed()
|
||
}, e.prototype.load = function () {
|
||
if (this.state == So.IDLE) {
|
||
this.state = So.LOADING, this.changed();
|
||
var t = this.sourceImage_.getState();
|
||
t == So.LOADED || t == So.ERROR ? this.reproject_() : (this.sourceListenerKey_ = w(this.sourceImage_, F.CHANGE, function (t) {
|
||
var e = this.sourceImage_.getState();
|
||
e != So.LOADED && e != So.ERROR || (this.unlistenSource_(), this.reproject_())
|
||
}, this), this.sourceImage_.load())
|
||
}
|
||
}, e.prototype.unlistenSource_ = function () {
|
||
S(this.sourceListenerKey_), this.sourceListenerKey_ = null
|
||
}, e
|
||
}(Co), yx = function (t) {
|
||
function e(e, i, r, o, n, s, a, l, h, u, c) {
|
||
t.call(this, n, Ro.IDLE), this.renderEdges_ = void 0 !== c && c, this.pixelRatio_ = a, this.gutter_ = l, this.canvas_ = null, this.sourceTileGrid_ = i, this.targetTileGrid_ = o, this.wrappedTileCoord_ = s || n, this.sourceTiles_ = [], this.sourcesListenerKeys_ = null, this.sourceZ_ = 0;
|
||
var p = o.getTileCoordExtent(this.wrappedTileCoord_), d = this.targetTileGrid_.getExtent(),
|
||
f = this.sourceTileGrid_.getExtent(), g = d ? Dt(p, d) : p;
|
||
if (0 !== It(g)) {
|
||
var m = e.getExtent();
|
||
m && (f = f ? Dt(f, m) : m);
|
||
var y = o.getResolution(this.wrappedTileCoord_[0]), v = cx(e, r, At(g), y);
|
||
if (!isFinite(v) || v <= 0) this.state = Ro.EMPTY; else {
|
||
var _ = void 0 !== u ? u : Sa;
|
||
if (this.triangulation_ = new gx(e, r, g, f, v * _), 0 !== this.triangulation_.getTriangles().length) {
|
||
this.sourceZ_ = i.getZForResolution(v);
|
||
var x = this.triangulation_.calculateSourceExtent();
|
||
if (f && (e.canWrapX() ? (x[1] = te(x[1], f[1], f[3]), x[3] = te(x[3], f[1], f[3])) : x = Dt(x, f)), It(x)) {
|
||
for (var w = i.getTileRangeForExtentAndZ(x, this.sourceZ_), b = w.minX; b <= w.maxX; b++) for (var C = w.minY; C <= w.maxY; C++) {
|
||
var S = h(this.sourceZ_, b, C, a);
|
||
S && this.sourceTiles_.push(S)
|
||
}
|
||
0 === this.sourceTiles_.length && (this.state = Ro.EMPTY)
|
||
} else this.state = Ro.EMPTY
|
||
} else this.state = Ro.EMPTY
|
||
}
|
||
} else this.state = Ro.EMPTY
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.disposeInternal = function () {
|
||
this.state == Ro.LOADING && this.unlistenSources_(), t.prototype.disposeInternal.call(this)
|
||
}, e.prototype.getImage = function () {
|
||
return this.canvas_
|
||
}, e.prototype.reproject_ = function () {
|
||
var t = [];
|
||
if (this.sourceTiles_.forEach(function (e, i, r) {
|
||
e && e.getState() == Ro.LOADED && t.push({
|
||
extent: this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),
|
||
image: e.getImage()
|
||
})
|
||
}.bind(this)), this.sourceTiles_.length = 0, 0 === t.length) this.state = Ro.ERROR; else {
|
||
var e = this.wrappedTileCoord_[0], i = this.targetTileGrid_.getTileSize(e),
|
||
r = "number" == typeof i ? i : i[0], o = "number" == typeof i ? i : i[1],
|
||
n = this.targetTileGrid_.getResolution(e),
|
||
s = this.sourceTileGrid_.getResolution(this.sourceZ_),
|
||
a = this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);
|
||
this.canvas_ = dx(r, o, this.pixelRatio_, s, this.sourceTileGrid_.getExtent(), n, a, this.triangulation_, t, this.gutter_, this.renderEdges_), this.state = Ro.LOADED
|
||
}
|
||
this.changed()
|
||
}, e.prototype.load = function () {
|
||
if (this.state == Ro.IDLE) {
|
||
this.state = Ro.LOADING, this.changed();
|
||
var t = 0;
|
||
this.sourcesListenerKeys_ = [], this.sourceTiles_.forEach(function (e, i, r) {
|
||
var o = e.getState();
|
||
if (o == Ro.IDLE || o == Ro.LOADING) {
|
||
t++;
|
||
var n = w(e, F.CHANGE, function (i) {
|
||
var r = e.getState();
|
||
r != Ro.LOADED && r != Ro.ERROR && r != Ro.EMPTY || (S(n), 0 === --t && (this.unlistenSources_(), this.reproject_()))
|
||
}, this);
|
||
this.sourcesListenerKeys_.push(n)
|
||
}
|
||
}.bind(this)), this.sourceTiles_.forEach(function (t, e, i) {
|
||
t.getState() == Ro.IDLE && t.load()
|
||
}), 0 === t && setTimeout(this.reproject_.bind(this), 0)
|
||
}
|
||
}, e.prototype.unlistenSources_ = function () {
|
||
this.sourcesListenerKeys_.forEach(S), this.sourcesListenerKeys_ = null
|
||
}, e
|
||
}(Mo);
|
||
|
||
function vx(t, e) {
|
||
var i = /\{z\}/g, r = /\{x\}/g, o = /\{y\}/g, n = /\{-y\}/g;
|
||
return function (s, a, l) {
|
||
return s ? t.replace(i, s[0].toString()).replace(r, s[1].toString()).replace(o, function () {
|
||
return (-s[2] - 1).toString()
|
||
}).replace(n, function () {
|
||
var t = s[0], i = e.getFullTileRange(t);
|
||
return W(i, 55), (i.getHeight() + s[2]).toString()
|
||
}) : void 0
|
||
}
|
||
}
|
||
|
||
function _x(t, e) {
|
||
for (var i = t.length, r = new Array(i), o = 0; o < i; ++o) r[o] = vx(t[o], e);
|
||
return xx(r)
|
||
}
|
||
|
||
function xx(t) {
|
||
return 1 === t.length ? t[0] : function (e, i, r) {
|
||
if (e) {
|
||
var o = le(ch(e), t.length);
|
||
return t[o](e, i, r)
|
||
}
|
||
}
|
||
}
|
||
|
||
function wx(t, e, i) {
|
||
}
|
||
|
||
function bx(t) {
|
||
var e = [], i = /\{([a-z])-([a-z])\}/.exec(t);
|
||
if (i) {
|
||
var r, o = i[1].charCodeAt(0), n = i[2].charCodeAt(0);
|
||
for (r = o; r <= n; ++r) e.push(t.replace(i[0], String.fromCharCode(r)));
|
||
return e
|
||
}
|
||
if (i = i = /\{(\d+)-(\d+)\}/.exec(t)) {
|
||
for (var s = parseInt(i[2], 10), a = parseInt(i[1], 10); a <= s; a++) e.push(t.replace(i[0], a.toString()));
|
||
return e
|
||
}
|
||
return e.push(t), e
|
||
}
|
||
|
||
function Cx(t, e, i, r) {
|
||
var o = document.createElement("script"), n = "olc_" + a(e);
|
||
|
||
function s() {
|
||
delete window[n], o.parentNode.removeChild(o)
|
||
}
|
||
|
||
o.async = !0, o.src = t + (-1 == t.indexOf("?") ? "?" : "&") + (r || "callback") + "=" + n;
|
||
var l = setTimeout(function () {
|
||
s(), i && i()
|
||
}, 1e4);
|
||
window[n] = function (t) {
|
||
clearTimeout(l), s(), e(t)
|
||
}, document.getElementsByTagName("head")[0].appendChild(o)
|
||
}
|
||
|
||
var Sx = {TILELOADSTART: "tileloadstart", TILELOADEND: "tileloadend", TILELOADERROR: "tileloaderror"},
|
||
Ex = function (t) {
|
||
function e(e) {
|
||
t.call(this, {
|
||
attributions: e.attributions,
|
||
cacheSize: e.cacheSize,
|
||
opaque: e.opaque,
|
||
projection: e.projection,
|
||
state: e.state,
|
||
tileGrid: e.tileGrid,
|
||
tilePixelRatio: e.tilePixelRatio,
|
||
wrapX: e.wrapX,
|
||
transition: e.transition,
|
||
key: e.key,
|
||
attributionsCollapsible: e.attributionsCollapsible
|
||
}), this.generateTileUrlFunction_ = !e.tileUrlFunction, this.tileLoadFunction = e.tileLoadFunction, this.tileUrlFunction = e.tileUrlFunction ? e.tileUrlFunction.bind(this) : wx, this.urls = null, e.urls ? this.setUrls(e.urls) : e.url && this.setUrl(e.url), e.tileUrlFunction && this.setTileUrlFunction(e.tileUrlFunction, this.key_), this.tileLoadingKeys_ = {}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getTileLoadFunction = function () {
|
||
return this.tileLoadFunction
|
||
}, e.prototype.getTileUrlFunction = function () {
|
||
return this.tileUrlFunction
|
||
}, e.prototype.getUrls = function () {
|
||
return this.urls
|
||
}, e.prototype.handleTileChange = function (t) {
|
||
var e, i = t.target, r = a(i), o = i.getState();
|
||
o == Ro.LOADING ? (this.tileLoadingKeys_[r] = !0, e = Sx.TILELOADSTART) : r in this.tileLoadingKeys_ && (delete this.tileLoadingKeys_[r], e = o == Ro.ERROR ? Sx.TILELOADERROR : o == Ro.LOADED || o == Ro.ABORT ? Sx.TILELOADEND : void 0), null != e && this.dispatchEvent(new ic(e, i))
|
||
}, e.prototype.setTileLoadFunction = function (t) {
|
||
this.tileCache.clear(), this.tileLoadFunction = t, this.changed()
|
||
}, e.prototype.setTileUrlFunction = function (t, e) {
|
||
this.tileUrlFunction = t, this.tileCache.pruneExceptNewestZ(), void 0 !== e ? this.setKey(e) : this.changed()
|
||
}, e.prototype.setUrl = function (t) {
|
||
var e = this.urls = bx(t);
|
||
this.setUrls(e)
|
||
}, e.prototype.setUrls = function (t) {
|
||
this.urls = t;
|
||
var e = t.join("\n");
|
||
this.generateTileUrlFunction_ ? this.setTileUrlFunction(_x(t, this.tileGrid), e) : this.setKey(e)
|
||
}, e.prototype.useTile = function (t, e, i) {
|
||
var r = lh(t, e, i);
|
||
this.tileCache.containsKey(r) && this.tileCache.get(r)
|
||
}, e
|
||
}(rc);
|
||
|
||
function Tx(t, e) {
|
||
t.getImage().src = e
|
||
}
|
||
|
||
var Rx = function (t) {
|
||
function e(e) {
|
||
t.call(this, {
|
||
attributions: e.attributions,
|
||
cacheSize: e.cacheSize,
|
||
opaque: e.opaque,
|
||
projection: e.projection,
|
||
state: e.state,
|
||
tileGrid: e.tileGrid,
|
||
tileLoadFunction: e.tileLoadFunction ? e.tileLoadFunction : Tx,
|
||
tilePixelRatio: e.tilePixelRatio,
|
||
tileUrlFunction: e.tileUrlFunction,
|
||
url: e.url,
|
||
urls: e.urls,
|
||
wrapX: e.wrapX,
|
||
transition: e.transition,
|
||
key: e.key,
|
||
attributionsCollapsible: e.attributionsCollapsible
|
||
}), this.crossOrigin = void 0 !== e.crossOrigin ? e.crossOrigin : null, this.tileClass = void 0 !== e.tileClass ? e.tileClass : zo, this.tileCacheForProjection = {}, this.tileGridForProjection = {}, this.reprojectionErrorThreshold_ = e.reprojectionErrorThreshold, this.renderReprojectionEdges_ = !1
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.canExpireCache = function () {
|
||
if (this.tileCache.canExpireCache()) return !0;
|
||
for (var t in this.tileCacheForProjection) if (this.tileCacheForProjection[t].canExpireCache()) return !0;
|
||
return !1
|
||
}, e.prototype.expireCache = function (t, e) {
|
||
var i = this.getTileCacheForProjection(t);
|
||
for (var r in this.tileCache.expireCache(this.tileCache == i ? e : {}), this.tileCacheForProjection) {
|
||
var o = this.tileCacheForProjection[r];
|
||
o.expireCache(o == i ? e : {})
|
||
}
|
||
}, e.prototype.getGutterForProjection = function (t) {
|
||
return this.getProjection() && t && !Qe(this.getProjection(), t) ? 0 : this.getGutter()
|
||
}, e.prototype.getGutter = function () {
|
||
return 0
|
||
}, e.prototype.getOpaque = function (e) {
|
||
return !(this.getProjection() && e && !Qe(this.getProjection(), e)) && t.prototype.getOpaque.call(this, e)
|
||
}, e.prototype.getTileGridForProjection = function (t) {
|
||
var e = this.getProjection();
|
||
if (!this.tileGrid || e && !Qe(e, t)) {
|
||
var i = a(t);
|
||
return i in this.tileGridForProjection || (this.tileGridForProjection[i] = qu(t)), this.tileGridForProjection[i]
|
||
}
|
||
return this.tileGrid
|
||
}, e.prototype.getTileCacheForProjection = function (t) {
|
||
var e = this.getProjection();
|
||
if (!e || Qe(e, t)) return this.tileCache;
|
||
var i = a(t);
|
||
return i in this.tileCacheForProjection || (this.tileCacheForProjection[i] = new fh(this.tileCache.highWaterMark)), this.tileCacheForProjection[i]
|
||
}, e.prototype.createTile_ = function (t, e, i, r, o, n) {
|
||
var s = [t, e, i], a = this.getTileCoordForTileUrlFunction(s, o),
|
||
l = a ? this.tileUrlFunction(a, r, o) : void 0,
|
||
h = new this.tileClass(s, void 0 !== l ? Ro.IDLE : Ro.EMPTY, void 0 !== l ? l : "", this.crossOrigin, this.tileLoadFunction, this.tileOptions);
|
||
return h.key = n, w(h, F.CHANGE, this.handleTileChange, this), h
|
||
}, e.prototype.getTile = function (t, e, i, r, o) {
|
||
var n = this.getProjection();
|
||
if (n && o && !Qe(n, o)) {
|
||
var s, a = this.getTileCacheForProjection(o), l = [t, e, i], h = hh(l);
|
||
a.containsKey(h) && (s = a.get(h));
|
||
var u = this.getKey();
|
||
if (s && s.key == u) return s;
|
||
var c = this.getTileGridForProjection(n), p = this.getTileGridForProjection(o),
|
||
d = this.getTileCoordForTileUrlFunction(l, o),
|
||
f = new yx(n, c, o, p, l, d, this.getTilePixelRatio(r), this.getGutter(), function (t, e, i, r) {
|
||
return this.getTileInternal(t, e, i, r, n)
|
||
}.bind(this), this.reprojectionErrorThreshold_, this.renderReprojectionEdges_);
|
||
return f.key = u, s ? (f.interimTile = s, f.refreshInterimChain(), a.replace(h, f)) : a.set(h, f), f
|
||
}
|
||
return this.getTileInternal(t, e, i, r, n || o)
|
||
}, e.prototype.getTileInternal = function (t, e, i, r, o) {
|
||
var n = null, s = lh(t, e, i), a = this.getKey();
|
||
if (this.tileCache.containsKey(s)) {
|
||
if ((n = this.tileCache.get(s)).key != a) {
|
||
var l = n;
|
||
n = this.createTile_(t, e, i, r, o, a), l.getState() == Ro.IDLE ? n.interimTile = l.interimTile : n.interimTile = l, n.refreshInterimChain(), this.tileCache.replace(s, n)
|
||
}
|
||
} else n = this.createTile_(t, e, i, r, o, a), this.tileCache.set(s, n);
|
||
return n
|
||
}, e.prototype.setRenderReprojectionEdges = function (t) {
|
||
if (this.renderReprojectionEdges_ != t) {
|
||
for (var e in this.renderReprojectionEdges_ = t, this.tileCacheForProjection) this.tileCacheForProjection[e].clear();
|
||
this.changed()
|
||
}
|
||
}, e.prototype.setTileGridForProjection = function (t, e) {
|
||
var i = We(t);
|
||
if (i) {
|
||
var r = a(i);
|
||
r in this.tileGridForProjection || (this.tileGridForProjection[r] = e)
|
||
}
|
||
}, e
|
||
}(Ex), Px = function (t) {
|
||
function e(e) {
|
||
var i = void 0 !== e.hidpi && e.hidpi;
|
||
t.call(this, {
|
||
cacheSize: e.cacheSize,
|
||
crossOrigin: "anonymous",
|
||
opaque: !0,
|
||
projection: We("EPSG:3857"),
|
||
reprojectionErrorThreshold: e.reprojectionErrorThreshold,
|
||
state: hs.LOADING,
|
||
tileLoadFunction: e.tileLoadFunction,
|
||
tilePixelRatio: i ? 2 : 1,
|
||
wrapX: void 0 === e.wrapX || e.wrapX,
|
||
transition: e.transition
|
||
}), this.hidpi_ = i, this.culture_ = void 0 !== e.culture ? e.culture : "en-us", this.maxZoom_ = void 0 !== e.maxZoom ? e.maxZoom : -1, this.apiKey_ = e.key, this.imagerySet_ = e.imagerySet, Cx("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/" + this.imagerySet_ + "?uriScheme=https&include=ImageryProviders&key=" + this.apiKey_ + "&c=" + this.culture_, this.handleImageryMetadataResponse.bind(this), void 0, "jsonp")
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getApiKey = function () {
|
||
return this.apiKey_
|
||
}, e.prototype.getImagerySet = function () {
|
||
return this.imagerySet_
|
||
}, e.prototype.handleImageryMetadataResponse = function (t) {
|
||
if (200 == t.statusCode && "OK" == t.statusDescription && "ValidCredentials" == t.authenticationResultCode && 1 == t.resourceSets.length && 1 == t.resourceSets[0].resources.length) {
|
||
var e = t.resourceSets[0].resources[0], i = -1 == this.maxZoom_ ? e.zoomMax : this.maxZoom_,
|
||
r = tc(this.getProjection()), o = this.hidpi_ ? 2 : 1,
|
||
n = e.imageWidth == e.imageHeight ? e.imageWidth / o : [e.imageWidth / o, e.imageHeight / o],
|
||
s = Ju({extent: r, minZoom: e.zoomMin, maxZoom: i, tileSize: n});
|
||
this.tileGrid = s;
|
||
var a = this.culture_, l = this.hidpi_;
|
||
if (this.tileUrlFunction = xx(e.imageUrlSubdomains.map(function (t) {
|
||
var i = [0, 0, 0], r = e.imageUrl.replace("{subdomain}", t).replace("{culture}", a);
|
||
return function (t, e, o) {
|
||
if (t) {
|
||
ah(t[0], t[1], -t[2] - 1, i);
|
||
var n = r;
|
||
return l && (n += "&dpi=d1&device=mobile"), n.replace("{quadkey}", ph(i))
|
||
}
|
||
}
|
||
})), e.imageryProviders) {
|
||
var h = ti(We("EPSG:4326"), this.getProjection());
|
||
this.setAttributions(function (t) {
|
||
var i = [], r = t.viewState,
|
||
o = this.getTileGrid().getTileCoordForCoordAndResolution(r.center, r.resolution)[0];
|
||
return e.imageryProviders.map(function (e) {
|
||
for (var r = !1, n = e.coverageAreas, s = 0, a = n.length; s < a; ++s) {
|
||
var l = n[s];
|
||
if (o >= l.zoomMin && o <= l.zoomMax) {
|
||
var u = l.bbox;
|
||
if (Bt(Xt([u[1], u[0], u[3], u[2]], h), t.extent)) {
|
||
r = !0;
|
||
break
|
||
}
|
||
}
|
||
}
|
||
r && i.push(e.attribution)
|
||
}), i.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html">Terms of Use</a>'), i
|
||
}.bind(this))
|
||
}
|
||
this.setState(hs.READY)
|
||
} else this.setState(hs.ERROR)
|
||
}, e
|
||
}(Rx), Lx = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = void 0 !== i.projection ? i.projection : "EPSG:3857",
|
||
o = void 0 !== i.tileGrid ? i.tileGrid : Ju({
|
||
extent: tc(r),
|
||
maxZoom: i.maxZoom,
|
||
minZoom: i.minZoom,
|
||
tileSize: i.tileSize
|
||
});
|
||
t.call(this, {
|
||
attributions: i.attributions,
|
||
cacheSize: i.cacheSize,
|
||
crossOrigin: i.crossOrigin,
|
||
opaque: i.opaque,
|
||
projection: r,
|
||
reprojectionErrorThreshold: i.reprojectionErrorThreshold,
|
||
tileGrid: o,
|
||
tileLoadFunction: i.tileLoadFunction,
|
||
tilePixelRatio: i.tilePixelRatio,
|
||
tileUrlFunction: i.tileUrlFunction,
|
||
url: i.url,
|
||
urls: i.urls,
|
||
wrapX: void 0 === i.wrapX || i.wrapX,
|
||
transition: i.transition,
|
||
attributionsCollapsible: i.attributionsCollapsible
|
||
})
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(Rx), Ix = function (t) {
|
||
function e(e) {
|
||
t.call(this, {
|
||
attributions: e.attributions,
|
||
cacheSize: e.cacheSize,
|
||
crossOrigin: e.crossOrigin,
|
||
maxZoom: void 0 !== e.maxZoom ? e.maxZoom : 18,
|
||
minZoom: e.minZoom,
|
||
projection: e.projection,
|
||
wrapX: e.wrapX
|
||
}), this.account_ = e.account, this.mapId_ = e.map || "", this.config_ = e.config || {}, this.templateCache_ = {}, this.initializeMap_()
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getConfig = function () {
|
||
return this.config_
|
||
}, e.prototype.updateConfig = function (t) {
|
||
p(this.config_, t), this.initializeMap_()
|
||
}, e.prototype.setConfig = function (t) {
|
||
this.config_ = t || {}, this.initializeMap_()
|
||
}, e.prototype.initializeMap_ = function () {
|
||
var t = JSON.stringify(this.config_);
|
||
if (this.templateCache_[t]) this.applyTemplate_(this.templateCache_[t]); else {
|
||
var e = "https://" + this.account_ + ".carto.com/api/v1/map";
|
||
this.mapId_ && (e += "/named/" + this.mapId_);
|
||
var i = new XMLHttpRequest;
|
||
i.addEventListener("load", this.handleInitResponse_.bind(this, t)), i.addEventListener("error", this.handleInitError_.bind(this)), i.open("POST", e), i.setRequestHeader("Content-type", "application/json"), i.send(JSON.stringify(this.config_))
|
||
}
|
||
}, e.prototype.handleInitResponse_ = function (t, e) {
|
||
var i = e.target;
|
||
if (!i.status || i.status >= 200 && i.status < 300) {
|
||
var r;
|
||
try {
|
||
r = JSON.parse(i.responseText)
|
||
} catch (t) {
|
||
return void this.setState(hs.ERROR)
|
||
}
|
||
this.applyTemplate_(r), this.templateCache_[t] = r, this.setState(hs.READY)
|
||
} else this.setState(hs.ERROR)
|
||
}, e.prototype.handleInitError_ = function (t) {
|
||
this.setState(hs.ERROR)
|
||
}, e.prototype.applyTemplate_ = function (t) {
|
||
var e = "https://" + t.cdn_url.https + "/" + this.account_ + "/api/v1/map/" + t.layergroupid + "/{z}/{x}/{y}.png";
|
||
this.setUrl(e)
|
||
}, e
|
||
}(Lx), Ox = function (t) {
|
||
function e(e) {
|
||
t.call(this, {
|
||
attributions: e.attributions,
|
||
wrapX: e.wrapX
|
||
}), this.resolution = void 0, this.distance = void 0 !== e.distance ? e.distance : 20, this.features = [], this.geometryFunction = e.geometryFunction || function (t) {
|
||
var e = t.getGeometry();
|
||
return W(e.getType() == Zt.POINT, 10), e
|
||
}, this.source = e.source, w(this.source, F.CHANGE, this.refresh, this)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getDistance = function () {
|
||
return this.distance
|
||
}, e.prototype.getSource = function () {
|
||
return this.source
|
||
}, e.prototype.loadFeatures = function (t, e, i) {
|
||
this.source.loadFeatures(t, e, i), e !== this.resolution && (this.clear(), this.resolution = e, this.cluster(), this.addFeatures(this.features))
|
||
}, e.prototype.setDistance = function (t) {
|
||
this.distance = t, this.refresh()
|
||
}, e.prototype.refresh = function () {
|
||
this.clear(), this.cluster(), this.addFeatures(this.features), t.prototype.refresh.call(this)
|
||
}, e.prototype.cluster = function () {
|
||
if (void 0 !== this.resolution) {
|
||
this.features.length = 0;
|
||
for (var t = [1 / 0, 1 / 0, -1 / 0, -1 / 0], e = this.distance * this.resolution, i = this.source.getFeatures(), r = {}, o = 0, n = i.length; o < n; o++) {
|
||
var s = i[o];
|
||
if (!(a(s) in r)) {
|
||
var l = this.geometryFunction(s);
|
||
if (l) {
|
||
_t(l.getCoordinates(), t), ht(t, e, t);
|
||
var h = this.source.getFeaturesInExtent(t);
|
||
h = h.filter(function (t) {
|
||
var e = a(t);
|
||
return !(e in r) && (r[e] = !0, !0)
|
||
}), this.features.push(this.createCluster(h))
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}, e.prototype.createCluster = function (t) {
|
||
for (var e = [0, 0], i = t.length - 1; i >= 0; --i) {
|
||
var r = this.geometryFunction(t[i]);
|
||
r ? Fr(e, r.getCoordinates()) : t.splice(i, 1)
|
||
}
|
||
Br(e, 1 / t.length);
|
||
var o = new X(new qi(e));
|
||
return o.set("features", t), o
|
||
}, e
|
||
}(b_), Mx = "imageloadstart", Ax = "imageloadend", kx = "imageloaderror", Fx = function (t) {
|
||
function e(e, i) {
|
||
t.call(this, e), this.image = i
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A);
|
||
|
||
function Nx(t, e) {
|
||
t.getImage().src = e
|
||
}
|
||
|
||
var Dx = function (t) {
|
||
function e(e) {
|
||
t.call(this, {
|
||
attributions: e.attributions,
|
||
projection: e.projection,
|
||
state: e.state
|
||
}), this.resolutions_ = void 0 !== e.resolutions ? e.resolutions : null, this.reprojectedImage_ = null, this.reprojectedRevision_ = 0
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getResolutions = function () {
|
||
return this.resolutions_
|
||
}, e.prototype.findNearestResolution = function (t) {
|
||
if (this.resolutions_) {
|
||
var e = J(this.resolutions_, t, 0);
|
||
t = this.resolutions_[e]
|
||
}
|
||
return t
|
||
}, e.prototype.getImage = function (t, e, i, r) {
|
||
var o = this.getProjection();
|
||
if (o && r && !Qe(o, r)) {
|
||
if (this.reprojectedImage_) {
|
||
if (this.reprojectedRevision_ == this.getRevision() && Qe(this.reprojectedImage_.getProjection(), r) && this.reprojectedImage_.getResolution() == e && bt(this.reprojectedImage_.getExtent(), t)) return this.reprojectedImage_;
|
||
this.reprojectedImage_.dispose(), this.reprojectedImage_ = null
|
||
}
|
||
return this.reprojectedImage_ = new mx(o, r, t, e, i, function (t, e, i) {
|
||
return this.getImageInternal(t, e, i, o)
|
||
}.bind(this)), this.reprojectedRevision_ = this.getRevision(), this.reprojectedImage_
|
||
}
|
||
return o && (r = o), this.getImageInternal(t, e, i, r)
|
||
}, e.prototype.getImageInternal = function (t, e, i, r) {
|
||
return n()
|
||
}, e.prototype.handleImageChange = function (t) {
|
||
var e = t.target;
|
||
switch (e.getState()) {
|
||
case So.LOADING:
|
||
this.loading = !0, this.dispatchEvent(new Fx(Mx, e));
|
||
break;
|
||
case So.LOADED:
|
||
this.loading = !1, this.dispatchEvent(new Fx(Ax, e));
|
||
break;
|
||
case So.ERROR:
|
||
this.loading = !1, this.dispatchEvent(new Fx(kx, e))
|
||
}
|
||
}, e
|
||
}(Yu);
|
||
|
||
function Gx(t, e) {
|
||
var i = [];
|
||
Object.keys(e).forEach(function (t) {
|
||
null !== e[t] && void 0 !== e[t] && i.push(t + "=" + encodeURIComponent(e[t]))
|
||
});
|
||
var r = i.join("&");
|
||
return (t = -1 === (t = t.replace(/[?&]$/, "")).indexOf("?") ? t + "?" : t + "&") + r
|
||
}
|
||
|
||
var jx = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {
|
||
attributions: i.attributions,
|
||
projection: i.projection,
|
||
resolutions: i.resolutions
|
||
}), this.crossOrigin_ = void 0 !== i.crossOrigin ? i.crossOrigin : null, this.hidpi_ = void 0 === i.hidpi || i.hidpi, this.url_ = i.url, this.imageLoadFunction_ = void 0 !== i.imageLoadFunction ? i.imageLoadFunction : Nx, this.params_ = i.params || {}, this.image_ = null, this.imageSize_ = [0, 0], this.renderedRevision_ = 0, this.ratio_ = void 0 !== i.ratio ? i.ratio : 1.5
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getParams = function () {
|
||
return this.params_
|
||
}, e.prototype.getImageInternal = function (t, e, i, r) {
|
||
if (void 0 === this.url_) return null;
|
||
e = this.findNearestResolution(e), i = this.hidpi_ ? i : 1;
|
||
var o = this.image_;
|
||
if (o && this.renderedRevision_ == this.getRevision() && o.getResolution() == e && o.getPixelRatio() == i && dt(o.getExtent(), t)) return o;
|
||
var n = {F: "image", FORMAT: "PNG32", TRANSPARENT: !0};
|
||
p(n, this.params_);
|
||
var s = ((t = t.slice())[0] + t[2]) / 2, a = (t[1] + t[3]) / 2;
|
||
if (1 != this.ratio_) {
|
||
var l = this.ratio_ * Ut(t) / 2, h = this.ratio_ * Nt(t) / 2;
|
||
t[0] = s - l, t[1] = a - h, t[2] = s + l, t[3] = a + h
|
||
}
|
||
var u = e / i, c = Math.ceil(Ut(t) / u), d = Math.ceil(Nt(t) / u);
|
||
t[0] = s - u * c / 2, t[2] = s + u * c / 2, t[1] = a - u * d / 2, t[3] = a + u * d / 2, this.imageSize_[0] = c, this.imageSize_[1] = d;
|
||
var f = this.getRequestUrl_(t, this.imageSize_, i, r, n);
|
||
return this.image_ = new Eo(t, e, i, f, this.crossOrigin_, this.imageLoadFunction_), this.renderedRevision_ = this.getRevision(), w(this.image_, F.CHANGE, this.handleImageChange, this), this.image_
|
||
}, e.prototype.getImageLoadFunction = function () {
|
||
return this.imageLoadFunction_
|
||
}, e.prototype.getRequestUrl_ = function (t, e, i, r, o) {
|
||
var n = r.getCode().split(":").pop();
|
||
o.SIZE = e[0] + "," + e[1], o.BBOX = t.join(","), o.BBOXSR = n, o.IMAGESR = n, o.DPI = Math.round(90 * i);
|
||
var s = this.url_,
|
||
a = s.replace(/MapServer\/?$/, "MapServer/export").replace(/ImageServer\/?$/, "ImageServer/exportImage");
|
||
return a == s && W(!1, 50), Gx(a, o)
|
||
}, e.prototype.getUrl = function () {
|
||
return this.url_
|
||
}, e.prototype.setImageLoadFunction = function (t) {
|
||
this.image_ = null, this.imageLoadFunction_ = t, this.changed()
|
||
}, e.prototype.setUrl = function (t) {
|
||
t != this.url_ && (this.url_ = t, this.image_ = null, this.changed())
|
||
}, e.prototype.updateParams = function (t) {
|
||
p(this.params_, t), this.image_ = null, this.changed()
|
||
}, e
|
||
}(Dx), zx = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {
|
||
attributions: i.attributions,
|
||
projection: i.projection,
|
||
resolutions: i.resolutions,
|
||
state: i.state
|
||
}), this.canvasFunction_ = i.canvasFunction, this.canvas_ = null, this.renderedRevision_ = 0, this.ratio_ = void 0 !== i.ratio ? i.ratio : 1.5
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getImageInternal = function (t, e, i, r) {
|
||
e = this.findNearestResolution(e);
|
||
var o = this.canvas_;
|
||
if (o && this.renderedRevision_ == this.getRevision() && o.getResolution() == e && o.getPixelRatio() == i && dt(o.getExtent(), t)) return o;
|
||
Wt(t = t.slice(), this.ratio_);
|
||
var n = [Ut(t) / e * i, Nt(t) / e * i], s = this.canvasFunction_.call(this, t, e, i, n, r);
|
||
return s && (o = new To(t, e, i, s)), this.canvas_ = o, this.renderedRevision_ = this.getRevision(), o
|
||
}, e
|
||
}(Dx);
|
||
var Ux = function (t) {
|
||
function e(e) {
|
||
t.call(this, {
|
||
projection: e.projection,
|
||
resolutions: e.resolutions
|
||
}), this.crossOrigin_ = void 0 !== e.crossOrigin ? e.crossOrigin : null, this.displayDpi_ = void 0 !== e.displayDpi ? e.displayDpi : 96, this.params_ = e.params || {}, this.url_ = e.url, this.imageLoadFunction_ = void 0 !== e.imageLoadFunction ? e.imageLoadFunction : Nx, this.hidpi_ = void 0 === e.hidpi || e.hidpi, this.metersPerUnit_ = void 0 !== e.metersPerUnit ? e.metersPerUnit : 1, this.ratio_ = void 0 !== e.ratio ? e.ratio : 1, this.useOverlay_ = void 0 !== e.useOverlay && e.useOverlay, this.image_ = null, this.renderedRevision_ = 0
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getParams = function () {
|
||
return this.params_
|
||
}, e.prototype.getImageInternal = function (t, e, i, r) {
|
||
e = this.findNearestResolution(e), i = this.hidpi_ ? i : 1;
|
||
var o = this.image_;
|
||
if (o && this.renderedRevision_ == this.getRevision() && o.getResolution() == e && o.getPixelRatio() == i && dt(o.getExtent(), t)) return o;
|
||
1 != this.ratio_ && Wt(t = t.slice(), this.ratio_);
|
||
var n = [Ut(t) / e * i, Nt(t) / e * i];
|
||
if (void 0 !== this.url_) {
|
||
var s = this.getUrl(this.url_, this.params_, t, n, r);
|
||
w(o = new Eo(t, e, i, s, this.crossOrigin_, this.imageLoadFunction_), F.CHANGE, this.handleImageChange, this)
|
||
} else o = null;
|
||
return this.image_ = o, this.renderedRevision_ = this.getRevision(), o
|
||
}, e.prototype.getImageLoadFunction = function () {
|
||
return this.imageLoadFunction_
|
||
}, e.prototype.updateParams = function (t) {
|
||
p(this.params_, t), this.changed()
|
||
}, e.prototype.getUrl = function (t, e, i, r, o) {
|
||
var n = function (t, e, i, r) {
|
||
var o = Ut(t), n = Nt(t), s = e[0], a = e[1], l = .0254 / r;
|
||
return a * o > s * n ? o * i / (s * l) : n * i / (a * l)
|
||
}(i, r, this.metersPerUnit_, this.displayDpi_), s = At(i), a = {
|
||
OPERATION: this.useOverlay_ ? "GETDYNAMICMAPOVERLAYIMAGE" : "GETMAPIMAGE",
|
||
VERSION: "2.0.0",
|
||
LOCALE: "en",
|
||
CLIENTAGENT: "ol/source/ImageMapGuide source",
|
||
CLIP: "1",
|
||
SETDISPLAYDPI: this.displayDpi_,
|
||
SETDISPLAYWIDTH: Math.round(r[0]),
|
||
SETDISPLAYHEIGHT: Math.round(r[1]),
|
||
SETVIEWSCALE: n,
|
||
SETVIEWCENTERX: s[0],
|
||
SETVIEWCENTERY: s[1]
|
||
};
|
||
return p(a, e), Gx(t, a)
|
||
}, e.prototype.setImageLoadFunction = function (t) {
|
||
this.image_ = null, this.imageLoadFunction_ = t, this.changed()
|
||
}, e
|
||
}(Dx), Bx = function (t) {
|
||
function e(e) {
|
||
var i = void 0 !== e.crossOrigin ? e.crossOrigin : null,
|
||
r = void 0 !== e.imageLoadFunction ? e.imageLoadFunction : Nx;
|
||
t.call(this, {
|
||
attributions: e.attributions,
|
||
projection: We(e.projection)
|
||
}), this.url_ = e.url, this.imageExtent_ = e.imageExtent, this.image_ = new Eo(this.imageExtent_, void 0, 1, this.url_, i, r), this.imageSize_ = e.imageSize ? e.imageSize : null, w(this.image_, F.CHANGE, this.handleImageChange, this)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getImageExtent = function () {
|
||
return this.imageExtent_
|
||
}, e.prototype.getImageInternal = function (t, e, i, r) {
|
||
return Bt(t, this.image_.getExtent()) ? this.image_ : null
|
||
}, e.prototype.getUrl = function () {
|
||
return this.url_
|
||
}, e.prototype.handleImageChange = function (e) {
|
||
if (this.image_.getState() == So.LOADED) {
|
||
var i, r, o = this.image_.getExtent(), n = this.image_.getImage();
|
||
this.imageSize_ ? (i = this.imageSize_[0], r = this.imageSize_[1]) : (i = n.width, r = n.height);
|
||
var s = Nt(o) / r, a = Math.ceil(Ut(o) / s);
|
||
if (a != i) {
|
||
var l = Ao(a, r), h = l.canvas;
|
||
l.drawImage(n, 0, 0, i, r, 0, 0, h.width, h.height), this.image_.setImage(h)
|
||
}
|
||
}
|
||
t.prototype.handleImageChange.call(this, e)
|
||
}, e
|
||
}(Dx), Vx = "1.3.0",
|
||
Yx = {CARMENTA_SERVER: "carmentaserver", GEOSERVER: "geoserver", MAPSERVER: "mapserver", QGIS: "qgis"},
|
||
Wx = [101, 101], Hx = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {
|
||
attributions: i.attributions,
|
||
projection: i.projection,
|
||
resolutions: i.resolutions
|
||
}), this.crossOrigin_ = void 0 !== i.crossOrigin ? i.crossOrigin : null, this.url_ = i.url, this.imageLoadFunction_ = void 0 !== i.imageLoadFunction ? i.imageLoadFunction : Nx, this.params_ = i.params || {}, this.v13_ = !0, this.updateV13_(), this.serverType_ = i.serverType, this.hidpi_ = void 0 === i.hidpi || i.hidpi, this.image_ = null, this.imageSize_ = [0, 0], this.renderedRevision_ = 0, this.ratio_ = void 0 !== i.ratio ? i.ratio : 1.5
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getGetFeatureInfoUrl = function (t, e, i, r) {
|
||
if (void 0 !== this.url_) {
|
||
var o = We(i), n = this.getProjection();
|
||
n && n !== o && (e = cx(n, o, t, e), t = ii(t, o, n));
|
||
var s = Ft(t, e, 0, Wx), a = {
|
||
SERVICE: "WMS",
|
||
VERSION: Vx,
|
||
REQUEST: "GetFeatureInfo",
|
||
FORMAT: "image/png",
|
||
TRANSPARENT: !0,
|
||
QUERY_LAYERS: this.params_.LAYERS
|
||
};
|
||
p(a, this.params_, r);
|
||
var l = Math.floor((t[0] - s[0]) / e), h = Math.floor((s[3] - t[1]) / e);
|
||
return a[this.v13_ ? "I" : "X"] = l, a[this.v13_ ? "J" : "Y"] = h, this.getRequestUrl_(s, Wx, 1, n || o, a)
|
||
}
|
||
}, e.prototype.getParams = function () {
|
||
return this.params_
|
||
}, e.prototype.getImageInternal = function (t, e, i, r) {
|
||
if (void 0 === this.url_) return null;
|
||
e = this.findNearestResolution(e), 1 == i || this.hidpi_ && void 0 !== this.serverType_ || (i = 1);
|
||
var o = e / i, n = At(t), s = Ft(n, o, 0, [Math.ceil(Ut(t) / o), Math.ceil(Nt(t) / o)]),
|
||
a = Ft(n, o, 0, [Math.ceil(this.ratio_ * Ut(t) / o), Math.ceil(this.ratio_ * Nt(t) / o)]),
|
||
l = this.image_;
|
||
if (l && this.renderedRevision_ == this.getRevision() && l.getResolution() == e && l.getPixelRatio() == i && dt(l.getExtent(), s)) return l;
|
||
var h = {SERVICE: "WMS", VERSION: Vx, REQUEST: "GetMap", FORMAT: "image/png", TRANSPARENT: !0};
|
||
p(h, this.params_), this.imageSize_[0] = Math.round(Ut(a) / o), this.imageSize_[1] = Math.round(Nt(a) / o);
|
||
var u = this.getRequestUrl_(a, this.imageSize_, i, r, h);
|
||
return this.image_ = new Eo(a, e, i, u, this.crossOrigin_, this.imageLoadFunction_), this.renderedRevision_ = this.getRevision(), w(this.image_, F.CHANGE, this.handleImageChange, this), this.image_
|
||
}, e.prototype.getImageLoadFunction = function () {
|
||
return this.imageLoadFunction_
|
||
}, e.prototype.getRequestUrl_ = function (t, e, i, r, o) {
|
||
if (W(void 0 !== this.url_, 9), o[this.v13_ ? "CRS" : "SRS"] = r.getCode(), "STYLES" in this.params_ || (o.STYLES = ""), 1 != i) switch (this.serverType_) {
|
||
case Yx.GEOSERVER:
|
||
var n = 90 * i + .5 | 0;
|
||
"FORMAT_OPTIONS" in o ? o.FORMAT_OPTIONS += ";dpi:" + n : o.FORMAT_OPTIONS = "dpi:" + n;
|
||
break;
|
||
case Yx.MAPSERVER:
|
||
o.MAP_RESOLUTION = 90 * i;
|
||
break;
|
||
case Yx.CARMENTA_SERVER:
|
||
case Yx.QGIS:
|
||
o.DPI = 90 * i;
|
||
break;
|
||
default:
|
||
W(!1, 8)
|
||
}
|
||
o.WIDTH = e[0], o.HEIGHT = e[1];
|
||
var s, a = r.getAxisOrientation();
|
||
return s = this.v13_ && "ne" == a.substr(0, 2) ? [t[1], t[0], t[3], t[2]] : t, o.BBOX = s.join(","), Gx(this.url_, o)
|
||
}, e.prototype.getUrl = function () {
|
||
return this.url_
|
||
}, e.prototype.setImageLoadFunction = function (t) {
|
||
this.image_ = null, this.imageLoadFunction_ = t, this.changed()
|
||
}, e.prototype.setUrl = function (t) {
|
||
t != this.url_ && (this.url_ = t, this.image_ = null, this.changed())
|
||
}, e.prototype.updateParams = function (t) {
|
||
p(this.params_, t), this.updateV13_(), this.image_ = null, this.changed()
|
||
}, e.prototype.updateV13_ = function () {
|
||
var t = this.params_.VERSION || Vx;
|
||
this.v13_ = kr(t, "1.3") >= 0
|
||
}, e
|
||
}(Dx), Xx = '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.',
|
||
qx = function (t) {
|
||
function e(e) {
|
||
var i, r = e || {};
|
||
i = void 0 !== r.attributions ? r.attributions : [Xx];
|
||
var o = void 0 !== r.crossOrigin ? r.crossOrigin : "anonymous",
|
||
n = void 0 !== r.url ? r.url : "https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";
|
||
t.call(this, {
|
||
attributions: i,
|
||
cacheSize: r.cacheSize,
|
||
crossOrigin: o,
|
||
opaque: void 0 === r.opaque || r.opaque,
|
||
maxZoom: void 0 !== r.maxZoom ? r.maxZoom : 19,
|
||
reprojectionErrorThreshold: r.reprojectionErrorThreshold,
|
||
tileLoadFunction: r.tileLoadFunction,
|
||
url: n,
|
||
wrapX: r.wrapX,
|
||
attributionsCollapsible: !1
|
||
})
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(Lx), Zx = i(10), Kx = "beforeoperations", Jx = "afteroperations", $x = {PIXEL: "pixel", IMAGE: "image"},
|
||
Qx = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, e), this.extent = i.extent, this.resolution = i.viewState.resolution / i.pixelRatio, this.data = r
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(A), tw = null;
|
||
|
||
function ew(t, e, i) {
|
||
if (!t.prepareFrame(e, i)) return null;
|
||
var r = e.size[0], o = e.size[1];
|
||
if (tw) {
|
||
var n = tw.canvas;
|
||
n.width !== r || n.height !== o ? tw = Ao(r, o) : tw.clearRect(0, 0, r, o)
|
||
} else tw = Ao(r, o);
|
||
return t.composeFrame(e, i, tw), tw.getImageData(0, 0, r, o)
|
||
}
|
||
|
||
function iw(t) {
|
||
var e = t, i = t, r = t, o = null;
|
||
return "function" == typeof e.getTile ? o = function (t) {
|
||
var e = new lx({source: t});
|
||
return new fl(e)
|
||
}(e) : "function" == typeof i.getImage ? o = function (t) {
|
||
var e = new nx({source: t});
|
||
return new hl(e)
|
||
}(i) : r.getType() === Vo.TILE ? o = new fl(r) : r.getType() != Vo.IMAGE && r.getType() != Vo.VECTOR || (o = new hl(r)), o
|
||
}
|
||
|
||
var rw = function (t) {
|
||
function e(e) {
|
||
t.call(this, {projection: null}), this.worker_ = null, this.operationType_ = void 0 !== e.operationType ? e.operationType : $x.PIXEL, this.threads_ = void 0 !== e.threads ? e.threads : 1, this.renderers_ = function (t) {
|
||
for (var e = t.length, i = new Array(e), r = 0; r < e; ++r) i[r] = iw(t[r]);
|
||
return i
|
||
}(e.sources);
|
||
for (var i = 0, r = this.renderers_.length; i < r; ++i) w(this.renderers_[i], F.CHANGE, this.changed, this);
|
||
this.tileQueue_ = new Un(function () {
|
||
return 1
|
||
}, this.changed.bind(this));
|
||
for (var o = this.renderers_.map(function (t) {
|
||
return t.getLayer().getLayerState()
|
||
}), n = {}, s = 0, l = o.length; s < l; ++s) n[a(o[s].layer)] = o[s];
|
||
this.requestedFrameState_, this.renderedImageCanvas_ = null, this.renderedRevision_, this.frameState_ = {
|
||
animate: !1,
|
||
coordinateToPixelTransform: [1, 0, 0, 1, 0, 0],
|
||
extent: null,
|
||
focus: null,
|
||
index: 0,
|
||
layerStates: n,
|
||
layerStatesArray: o,
|
||
pixelRatio: 1,
|
||
pixelToCoordinateTransform: [1, 0, 0, 1, 0, 0],
|
||
postRenderFunctions: [],
|
||
size: [0, 0],
|
||
skippedFeatureUids: {},
|
||
tileQueue: this.tileQueue_,
|
||
time: Date.now(),
|
||
usedTiles: {},
|
||
viewState: {rotation: 0},
|
||
viewHints: [],
|
||
wantedTiles: {}
|
||
}, void 0 !== e.operation && this.setOperation(e.operation, e.lib)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.setOperation = function (t, e) {
|
||
this.worker_ = new Zx.Processor({
|
||
operation: t,
|
||
imageOps: this.operationType_ === $x.IMAGE,
|
||
queue: 1,
|
||
lib: e,
|
||
threads: this.threads_
|
||
}), this.changed()
|
||
}, e.prototype.updateFrameState_ = function (t, e, i) {
|
||
var r = p({}, this.frameState_);
|
||
r.viewState = p({}, r.viewState);
|
||
var o = At(t);
|
||
r.extent = t.slice(), r.focus = o, r.size[0] = Math.round(Ut(t) / e), r.size[1] = Math.round(Nt(t) / e), r.time = Date.now(), r.animate = !1;
|
||
var n = r.viewState;
|
||
return n.center = o, n.projection = i, n.resolution = e, r
|
||
}, e.prototype.allSourcesReady_ = function () {
|
||
for (var t = !0, e = 0, i = this.renderers_.length; e < i; ++e) if (this.renderers_[e].getLayer().getSource().getState() !== hs.READY) {
|
||
t = !1;
|
||
break
|
||
}
|
||
return t
|
||
}, e.prototype.getImage = function (t, e, i, r) {
|
||
if (!this.allSourcesReady_()) return null;
|
||
var o = this.updateFrameState_(t, e, r);
|
||
if (this.requestedFrameState_ = o, this.renderedImageCanvas_) {
|
||
var n = this.renderedImageCanvas_.getResolution(), s = this.renderedImageCanvas_.getExtent();
|
||
e === n && bt(t, s) || (this.renderedImageCanvas_ = null)
|
||
}
|
||
return this.renderedImageCanvas_ && this.getRevision() === this.renderedRevision_ || this.processSources_(), o.tileQueue.loadMoreTiles(16, 16), o.animate && requestAnimationFrame(this.changed.bind(this)), this.renderedImageCanvas_
|
||
}, e.prototype.processSources_ = function () {
|
||
for (var t = this.requestedFrameState_, e = this.renderers_.length, i = new Array(e), r = 0; r < e; ++r) {
|
||
var o = ew(this.renderers_[r], t, t.layerStatesArray[r]);
|
||
if (!o) return;
|
||
i[r] = o
|
||
}
|
||
var n = {};
|
||
this.dispatchEvent(new Qx(Kx, t, n)), this.worker_.process(i, n, this.onWorkerComplete_.bind(this, t))
|
||
}, e.prototype.onWorkerComplete_ = function (t, e, i, r) {
|
||
if (!e && i) {
|
||
var o = t.extent, n = t.viewState.resolution;
|
||
if (n === this.requestedFrameState_.viewState.resolution && bt(o, this.requestedFrameState_.extent)) {
|
||
var s;
|
||
if (this.renderedImageCanvas_) s = this.renderedImageCanvas_.getImage().getContext("2d"); else s = Ao(Math.round(Ut(o) / n), Math.round(Nt(o) / n)), this.renderedImageCanvas_ = new To(o, n, 1, s.canvas);
|
||
s.putImageData(i, 0, 0), this.changed(), this.renderedRevision_ = this.getRevision(), this.dispatchEvent(new Qx(Jx, t, r))
|
||
}
|
||
}
|
||
}, e.prototype.getImageInternal = function () {
|
||
return null
|
||
}, e
|
||
}(Dx),
|
||
ow = ['Map tiles by <a href="https://stamen.com/">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.', Xx],
|
||
nw = {
|
||
terrain: {extension: "jpg", opaque: !0},
|
||
"terrain-background": {extension: "jpg", opaque: !0},
|
||
"terrain-labels": {extension: "png", opaque: !1},
|
||
"terrain-lines": {extension: "png", opaque: !1},
|
||
"toner-background": {extension: "png", opaque: !0},
|
||
toner: {extension: "png", opaque: !0},
|
||
"toner-hybrid": {extension: "png", opaque: !1},
|
||
"toner-labels": {extension: "png", opaque: !1},
|
||
"toner-lines": {extension: "png", opaque: !1},
|
||
"toner-lite": {extension: "png", opaque: !0},
|
||
watercolor: {extension: "jpg", opaque: !0}
|
||
}, sw = {
|
||
terrain: {minZoom: 4, maxZoom: 18},
|
||
toner: {minZoom: 0, maxZoom: 20},
|
||
watercolor: {minZoom: 1, maxZoom: 16}
|
||
}, aw = function (t) {
|
||
function e(e) {
|
||
var i = e.layer.indexOf("-"), r = -1 == i ? e.layer : e.layer.slice(0, i), o = sw[r], n = nw[e.layer],
|
||
s = void 0 !== e.url ? e.url : "https://stamen-tiles-{a-d}.a.ssl.fastly.net/" + e.layer + "/{z}/{x}/{y}." + n.extension;
|
||
t.call(this, {
|
||
attributions: ow,
|
||
cacheSize: e.cacheSize,
|
||
crossOrigin: "anonymous",
|
||
maxZoom: null != e.maxZoom ? e.maxZoom : o.maxZoom,
|
||
minZoom: null != e.minZoom ? e.minZoom : o.minZoom,
|
||
opaque: n.opaque,
|
||
reprojectionErrorThreshold: e.reprojectionErrorThreshold,
|
||
tileLoadFunction: e.tileLoadFunction,
|
||
url: s,
|
||
wrapX: e.wrapX
|
||
})
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(Lx);
|
||
|
||
function lw(t, e, i) {
|
||
var r = this.getTileGrid();
|
||
if (r || (r = this.getTileGridForProjection(i)), !(r.getResolutions().length <= t[0])) {
|
||
var o = r.getTileCoordExtent(t, this.tmpExtent_), n = gs(r.getTileSize(t[0]), this.tmpSize);
|
||
1 != e && (n = fs(n, e, this.tmpSize));
|
||
var s = {F: "image", FORMAT: "PNG32", TRANSPARENT: !0};
|
||
return p(s, this.params_), this.getRequestUrl_(t, n, o, e, i, s)
|
||
}
|
||
}
|
||
|
||
var hw = function (t) {
|
||
function e(e) {
|
||
var i = e || {};
|
||
t.call(this, {
|
||
attributions: i.attributions,
|
||
cacheSize: i.cacheSize,
|
||
crossOrigin: i.crossOrigin,
|
||
projection: i.projection,
|
||
reprojectionErrorThreshold: i.reprojectionErrorThreshold,
|
||
tileGrid: i.tileGrid,
|
||
tileLoadFunction: i.tileLoadFunction,
|
||
tileUrlFunction: lw,
|
||
url: i.url,
|
||
urls: i.urls,
|
||
wrapX: void 0 === i.wrapX || i.wrapX,
|
||
transition: i.transition
|
||
}), this.params_ = i.params || {}, this.tmpExtent_ = [1 / 0, 1 / 0, -1 / 0, -1 / 0], this.setKey(this.getKeyForParams_())
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getKeyForParams_ = function () {
|
||
var t = 0, e = [];
|
||
for (var i in this.params_) e[t++] = i + "-" + this.params_[i];
|
||
return e.join("/")
|
||
}, e.prototype.getParams = function () {
|
||
return this.params_
|
||
}, e.prototype.getRequestUrl_ = function (t, e, i, r, o, n) {
|
||
var s = this.urls;
|
||
if (s) {
|
||
var a, l = o.getCode().split(":").pop();
|
||
if (n.SIZE = e[0] + "," + e[1], n.BBOX = i.join(","), n.BBOXSR = l, n.IMAGESR = l, n.DPI = Math.round(n.DPI ? n.DPI * r : 90 * r), 1 == s.length) a = s[0]; else a = s[le(ch(t), s.length)];
|
||
return Gx(a.replace(/MapServer\/?$/, "MapServer/export").replace(/ImageServer\/?$/, "ImageServer/exportImage"), n)
|
||
}
|
||
}, e.prototype.getTilePixelRatio = function (t) {
|
||
return t
|
||
}, e.prototype.updateParams = function (t) {
|
||
p(this.params_, t), this.setKey(this.getKeyForParams_())
|
||
}, e
|
||
}(Rx), uw = function (t) {
|
||
function e(e, i, r) {
|
||
t.call(this, e, Ro.LOADED), this.tileSize_ = i, this.text_ = r, this.canvas_ = null
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getImage = function () {
|
||
if (this.canvas_) return this.canvas_;
|
||
var t = this.tileSize_, e = Ao(t[0], t[1]);
|
||
return e.strokeStyle = "black", e.strokeRect(.5, .5, t[0] + .5, t[1] + .5), e.fillStyle = "black", e.textAlign = "center", e.textBaseline = "middle", e.font = "24px sans-serif", e.fillText(this.text_, t[0] / 2, t[1] / 2), this.canvas_ = e.canvas, e.canvas
|
||
}, e.prototype.load = function () {
|
||
}, e
|
||
}(Mo), cw = function (t) {
|
||
function e(e) {
|
||
t.call(this, {
|
||
opaque: !1,
|
||
projection: e.projection,
|
||
tileGrid: e.tileGrid,
|
||
wrapX: void 0 === e.wrapX || e.wrapX
|
||
})
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getTile = function (t, e, i) {
|
||
var r = lh(t, e, i);
|
||
if (this.tileCache.containsKey(r)) return this.tileCache.get(r);
|
||
var o = gs(this.tileGrid.getTileSize(t)), n = [t, e, i], s = this.getTileCoordForTileUrlFunction(n),
|
||
a = s ? this.getTileCoordForTileUrlFunction(s).toString() : "", l = new uw(n, o, a);
|
||
return this.tileCache.set(r, l), l
|
||
}, e
|
||
}(rc), pw = function (t) {
|
||
function e(e) {
|
||
if (t.call(this, {
|
||
attributions: e.attributions,
|
||
cacheSize: e.cacheSize,
|
||
crossOrigin: e.crossOrigin,
|
||
projection: We("EPSG:3857"),
|
||
reprojectionErrorThreshold: e.reprojectionErrorThreshold,
|
||
state: hs.LOADING,
|
||
tileLoadFunction: e.tileLoadFunction,
|
||
wrapX: void 0 === e.wrapX || e.wrapX,
|
||
transition: e.transition
|
||
}), this.tileJSON_ = null, e.url) if (e.jsonp) Cx(e.url, this.handleTileJSONResponse.bind(this), this.handleTileJSONError.bind(this)); else {
|
||
var i = new XMLHttpRequest;
|
||
i.addEventListener("load", this.onXHRLoad_.bind(this)), i.addEventListener("error", this.onXHRError_.bind(this)), i.open("GET", e.url), i.send()
|
||
} else e.tileJSON ? this.handleTileJSONResponse(e.tileJSON) : W(!1, 51)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.onXHRLoad_ = function (t) {
|
||
var e = t.target;
|
||
if (!e.status || e.status >= 200 && e.status < 300) {
|
||
var i;
|
||
try {
|
||
i = JSON.parse(e.responseText)
|
||
} catch (t) {
|
||
return void this.handleTileJSONError()
|
||
}
|
||
this.handleTileJSONResponse(i)
|
||
} else this.handleTileJSONError()
|
||
}, e.prototype.onXHRError_ = function (t) {
|
||
this.handleTileJSONError()
|
||
}, e.prototype.getTileJSON = function () {
|
||
return this.tileJSON_
|
||
}, e.prototype.handleTileJSONResponse = function (t) {
|
||
var e, i = We("EPSG:4326"), r = this.getProjection();
|
||
if (void 0 !== t.bounds) {
|
||
var o = ti(i, r);
|
||
e = Xt(t.bounds, o)
|
||
}
|
||
var n = t.minzoom || 0, s = t.maxzoom || 22, a = Ju({extent: tc(r), maxZoom: s, minZoom: n});
|
||
if (this.tileGrid = a, this.tileUrlFunction = _x(t.tiles, a), void 0 !== t.attribution && !this.getAttributions()) {
|
||
var l = void 0 !== e ? e : i.getExtent();
|
||
this.setAttributions(function (e) {
|
||
return Bt(l, e.extent) ? [t.attribution] : null
|
||
})
|
||
}
|
||
this.tileJSON_ = t, this.setState(hs.READY)
|
||
}, e.prototype.handleTileJSONError = function () {
|
||
this.setState(hs.ERROR)
|
||
}, e
|
||
}(Rx);
|
||
|
||
function dw(t, e, i) {
|
||
var r = this.getTileGrid();
|
||
if (r || (r = this.getTileGridForProjection(i)), !(r.getResolutions().length <= t[0])) {
|
||
1 == e || this.hidpi_ && void 0 !== this.serverType_ || (e = 1);
|
||
var o = r.getResolution(t[0]), n = r.getTileCoordExtent(t, this.tmpExtent_),
|
||
s = gs(r.getTileSize(t[0]), this.tmpSize), a = this.gutter_;
|
||
0 !== a && (s = ps(s, a, this.tmpSize), n = ht(n, o * a, n)), 1 != e && (s = fs(s, e, this.tmpSize));
|
||
var l = {SERVICE: "WMS", VERSION: Vx, REQUEST: "GetMap", FORMAT: "image/png", TRANSPARENT: !0};
|
||
return p(l, this.params_), this.getRequestUrl_(t, s, n, e, i, l)
|
||
}
|
||
}
|
||
|
||
var fw = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = i.params || {}, o = !("TRANSPARENT" in r) || r.TRANSPARENT;
|
||
t.call(this, {
|
||
attributions: i.attributions,
|
||
cacheSize: i.cacheSize,
|
||
crossOrigin: i.crossOrigin,
|
||
opaque: !o,
|
||
projection: i.projection,
|
||
reprojectionErrorThreshold: i.reprojectionErrorThreshold,
|
||
tileClass: i.tileClass,
|
||
tileGrid: i.tileGrid,
|
||
tileLoadFunction: i.tileLoadFunction,
|
||
tileUrlFunction: dw,
|
||
url: i.url,
|
||
urls: i.urls,
|
||
wrapX: void 0 === i.wrapX || i.wrapX,
|
||
transition: i.transition
|
||
}), this.gutter_ = void 0 !== i.gutter ? i.gutter : 0, this.params_ = r, this.v13_ = !0, this.serverType_ = i.serverType, this.hidpi_ = void 0 === i.hidpi || i.hidpi, this.tmpExtent_ = [1 / 0, 1 / 0, -1 / 0, -1 / 0], this.updateV13_(), this.setKey(this.getKeyForParams_())
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getGetFeatureInfoUrl = function (t, e, i, r) {
|
||
var o = We(i), n = this.getProjection(), s = this.getTileGrid();
|
||
s || (s = this.getTileGridForProjection(o));
|
||
var a = s.getTileCoordForCoordAndResolution(t, e);
|
||
if (!(s.getResolutions().length <= a[0])) {
|
||
var l = s.getResolution(a[0]), h = s.getTileCoordExtent(a, this.tmpExtent_),
|
||
u = gs(s.getTileSize(a[0]), this.tmpSize), c = this.gutter_;
|
||
0 !== c && (u = ps(u, c, this.tmpSize), h = ht(h, l * c, h)), n && n !== o && (l = cx(n, o, t, l), h = ri(h, o, n), t = ii(t, o, n));
|
||
var d = {
|
||
SERVICE: "WMS",
|
||
VERSION: Vx,
|
||
REQUEST: "GetFeatureInfo",
|
||
FORMAT: "image/png",
|
||
TRANSPARENT: !0,
|
||
QUERY_LAYERS: this.params_.LAYERS
|
||
};
|
||
p(d, this.params_, r);
|
||
var f = Math.floor((t[0] - h[0]) / l), g = Math.floor((h[3] - t[1]) / l);
|
||
return d[this.v13_ ? "I" : "X"] = f, d[this.v13_ ? "J" : "Y"] = g, this.getRequestUrl_(a, u, h, 1, n || o, d)
|
||
}
|
||
}, e.prototype.getGutter = function () {
|
||
return this.gutter_
|
||
}, e.prototype.getParams = function () {
|
||
return this.params_
|
||
}, e.prototype.getRequestUrl_ = function (t, e, i, r, o, n) {
|
||
var s = this.urls;
|
||
if (s) {
|
||
if (n.WIDTH = e[0], n.HEIGHT = e[1], n[this.v13_ ? "CRS" : "SRS"] = o.getCode(), "STYLES" in this.params_ || (n.STYLES = ""), 1 != r) switch (this.serverType_) {
|
||
case Yx.GEOSERVER:
|
||
var a = 90 * r + .5 | 0;
|
||
"FORMAT_OPTIONS" in n ? n.FORMAT_OPTIONS += ";dpi:" + a : n.FORMAT_OPTIONS = "dpi:" + a;
|
||
break;
|
||
case Yx.MAPSERVER:
|
||
n.MAP_RESOLUTION = 90 * r;
|
||
break;
|
||
case Yx.CARMENTA_SERVER:
|
||
case Yx.QGIS:
|
||
n.DPI = 90 * r;
|
||
break;
|
||
default:
|
||
W(!1, 52)
|
||
}
|
||
var l, h, u = o.getAxisOrientation(), c = i;
|
||
if (this.v13_ && "ne" == u.substr(0, 2)) l = i[0], c[0] = i[1], c[1] = l, l = i[2], c[2] = i[3], c[3] = l;
|
||
if (n.BBOX = c.join(","), 1 == s.length) h = s[0]; else h = s[le(ch(t), s.length)];
|
||
return Gx(h, n)
|
||
}
|
||
}, e.prototype.getTilePixelRatio = function (t) {
|
||
return this.hidpi_ && void 0 !== this.serverType_ ? t : 1
|
||
}, e.prototype.getKeyForParams_ = function () {
|
||
var t = 0, e = [];
|
||
for (var i in this.params_) e[t++] = i + "-" + this.params_[i];
|
||
return e.join("/")
|
||
}, e.prototype.updateParams = function (t) {
|
||
p(this.params_, t), this.updateV13_(), this.setKey(this.getKeyForParams_())
|
||
}, e.prototype.updateV13_ = function () {
|
||
var t = this.params_.VERSION || Vx;
|
||
this.v13_ = kr(t, "1.3") >= 0
|
||
}, e
|
||
}(Rx), gw = function (t) {
|
||
function e(e, i, r, o, n, s) {
|
||
t.call(this, e, i), this.src_ = r, this.extent_ = o, this.preemptive_ = n, this.grid_ = null, this.keys_ = null, this.data_ = null, this.jsonp_ = s
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getImage = function () {
|
||
return null
|
||
}, e.prototype.getData = function (t) {
|
||
if (!this.grid_ || !this.keys_) return null;
|
||
var e = (t[0] - this.extent_[0]) / (this.extent_[2] - this.extent_[0]),
|
||
i = (t[1] - this.extent_[1]) / (this.extent_[3] - this.extent_[1]),
|
||
r = this.grid_[Math.floor((1 - i) * this.grid_.length)];
|
||
if ("string" != typeof r) return null;
|
||
var o = r.charCodeAt(Math.floor(e * r.length));
|
||
o >= 93 && o--, o >= 35 && o--;
|
||
var n = null;
|
||
if ((o -= 32) in this.keys_) {
|
||
var s = this.keys_[o];
|
||
n = this.data_ && s in this.data_ ? this.data_[s] : s
|
||
}
|
||
return n
|
||
}, e.prototype.forDataAtCoordinate = function (t, e, i, r) {
|
||
this.state == Ro.IDLE && !0 === r ? (b(this, F.CHANGE, function (r) {
|
||
e.call(i, this.getData(t))
|
||
}, this), this.loadInternal_()) : !0 === r ? setTimeout(function () {
|
||
e.call(i, this.getData(t))
|
||
}.bind(this), 0) : e.call(i, this.getData(t))
|
||
}, e.prototype.getKey = function () {
|
||
return this.src_
|
||
}, e.prototype.handleError_ = function () {
|
||
this.state = Ro.ERROR, this.changed()
|
||
}, e.prototype.handleLoad_ = function (t) {
|
||
this.grid_ = t.grid, this.keys_ = t.keys, this.data_ = t.data, this.state = Ro.EMPTY, this.changed()
|
||
}, e.prototype.loadInternal_ = function () {
|
||
if (this.state == Ro.IDLE) if (this.state = Ro.LOADING, this.jsonp_) Cx(this.src_, this.handleLoad_.bind(this), this.handleError_.bind(this)); else {
|
||
var t = new XMLHttpRequest;
|
||
t.addEventListener("load", this.onXHRLoad_.bind(this)), t.addEventListener("error", this.onXHRError_.bind(this)), t.open("GET", this.src_), t.send()
|
||
}
|
||
}, e.prototype.onXHRLoad_ = function (t) {
|
||
var e = t.target;
|
||
if (!e.status || e.status >= 200 && e.status < 300) {
|
||
var i;
|
||
try {
|
||
i = JSON.parse(e.responseText)
|
||
} catch (t) {
|
||
return void this.handleError_()
|
||
}
|
||
this.handleLoad_(i)
|
||
} else this.handleError_()
|
||
}, e.prototype.onXHRError_ = function (t) {
|
||
this.handleError_()
|
||
}, e.prototype.load = function () {
|
||
this.preemptive_ && this.loadInternal_()
|
||
}, e
|
||
}(Mo), mw = function (t) {
|
||
function e(e) {
|
||
if (t.call(this, {
|
||
projection: We("EPSG:3857"),
|
||
state: hs.LOADING
|
||
}), this.preemptive_ = void 0 === e.preemptive || e.preemptive, this.tileUrlFunction_ = wx, this.template_ = void 0, this.jsonp_ = e.jsonp || !1, e.url) if (this.jsonp_) Cx(e.url, this.handleTileJSONResponse.bind(this), this.handleTileJSONError.bind(this)); else {
|
||
var i = new XMLHttpRequest;
|
||
i.addEventListener("load", this.onXHRLoad_.bind(this)), i.addEventListener("error", this.onXHRError_.bind(this)), i.open("GET", e.url), i.send()
|
||
} else e.tileJSON ? this.handleTileJSONResponse(e.tileJSON) : W(!1, 51)
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.onXHRLoad_ = function (t) {
|
||
var e = t.target;
|
||
if (!e.status || e.status >= 200 && e.status < 300) {
|
||
var i;
|
||
try {
|
||
i = JSON.parse(e.responseText)
|
||
} catch (t) {
|
||
return void this.handleTileJSONError()
|
||
}
|
||
this.handleTileJSONResponse(i)
|
||
} else this.handleTileJSONError()
|
||
}, e.prototype.onXHRError_ = function (t) {
|
||
this.handleTileJSONError()
|
||
}, e.prototype.getTemplate = function () {
|
||
return this.template_
|
||
}, e.prototype.forDataAtCoordinateAndResolution = function (t, e, i, r) {
|
||
if (this.tileGrid) {
|
||
var o = this.tileGrid.getTileCoordForCoordAndResolution(t, e);
|
||
this.getTile(o[0], o[1], o[2], 1, this.getProjection()).forDataAtCoordinate(t, i, null, r)
|
||
} else !0 === r ? setTimeout(function () {
|
||
i(null)
|
||
}, 0) : i(null)
|
||
}, e.prototype.handleTileJSONError = function () {
|
||
this.setState(hs.ERROR)
|
||
}, e.prototype.handleTileJSONResponse = function (t) {
|
||
var e, i = We("EPSG:4326"), r = this.getProjection();
|
||
if (void 0 !== t.bounds) {
|
||
var o = ti(i, r);
|
||
e = Xt(t.bounds, o)
|
||
}
|
||
var n = t.minzoom || 0, s = t.maxzoom || 22, a = Ju({extent: tc(r), maxZoom: s, minZoom: n});
|
||
this.tileGrid = a, this.template_ = t.template;
|
||
var l = t.grids;
|
||
if (l) {
|
||
if (this.tileUrlFunction_ = _x(l, a), void 0 !== t.attribution) {
|
||
var h = void 0 !== e ? e : i.getExtent();
|
||
this.setAttributions(function (e) {
|
||
return Bt(h, e.extent) ? [t.attribution] : null
|
||
})
|
||
}
|
||
this.setState(hs.READY)
|
||
} else this.setState(hs.ERROR)
|
||
}, e.prototype.getTile = function (t, e, i, r, o) {
|
||
var n = lh(t, e, i);
|
||
if (this.tileCache.containsKey(n)) return this.tileCache.get(n);
|
||
var s = [t, e, i], a = this.getTileCoordForTileUrlFunction(s, o), l = this.tileUrlFunction_(a, r, o),
|
||
h = new gw(s, void 0 !== l ? Ro.IDLE : Ro.EMPTY, void 0 !== l ? l : "", this.tileGrid.getTileCoordExtent(s), this.preemptive_, this.jsonp_);
|
||
return this.tileCache.set(n, h), h
|
||
}, e.prototype.useTile = function (t, e, i) {
|
||
var r = lh(t, e, i);
|
||
this.tileCache.containsKey(r) && this.tileCache.get(r)
|
||
}, e
|
||
}(rc), yw = function (t) {
|
||
function e(e) {
|
||
var i = e.projection || "EPSG:3857", r = e.extent || tc(i), o = e.tileGrid || Ju({
|
||
extent: r,
|
||
maxZoom: e.maxZoom || 22,
|
||
minZoom: e.minZoom,
|
||
tileSize: e.tileSize || 512
|
||
});
|
||
t.call(this, {
|
||
attributions: e.attributions,
|
||
cacheSize: void 0 !== e.cacheSize ? e.cacheSize : 128,
|
||
opaque: !1,
|
||
projection: i,
|
||
state: e.state,
|
||
tileGrid: o,
|
||
tileLoadFunction: e.tileLoadFunction ? e.tileLoadFunction : _h,
|
||
tileUrlFunction: e.tileUrlFunction,
|
||
url: e.url,
|
||
urls: e.urls,
|
||
wrapX: void 0 === e.wrapX || e.wrapX,
|
||
transition: e.transition
|
||
}), this.format_ = e.format ? e.format : null, this.sourceTiles_ = {}, this.overlaps_ = null == e.overlaps || e.overlaps, this.tileClass = e.tileClass ? e.tileClass : wh, this.tileGrids_ = {}
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getOverlaps = function () {
|
||
return this.overlaps_
|
||
}, e.prototype.clear = function () {
|
||
this.tileCache.clear(), this.sourceTiles_ = {}
|
||
}, e.prototype.getTile = function (t, e, i, r, o) {
|
||
var n = lh(t, e, i);
|
||
if (this.tileCache.containsKey(n)) return this.tileCache.get(n);
|
||
var s = [t, e, i], a = this.getTileCoordForTileUrlFunction(s, o),
|
||
l = new vh(s, null !== a ? Ro.IDLE : Ro.EMPTY, this.getRevision(), this.format_, this.tileLoadFunction, a, this.tileUrlFunction, this.tileGrid, this.getTileGridForProjection(o), this.sourceTiles_, r, o, this.tileClass, this.handleTileChange.bind(this), s[0]);
|
||
return this.tileCache.set(n, l), l
|
||
}, e.prototype.getTileGridForProjection = function (t) {
|
||
var e = t.getCode(), i = this.tileGrids_[e];
|
||
if (!i) {
|
||
var r = this.tileGrid;
|
||
i = this.tileGrids_[e] = Qu(t, void 0, r ? r.getTileSize(r.getMinZoom()) : void 0)
|
||
}
|
||
return i
|
||
}, e.prototype.getTilePixelRatio = function (t) {
|
||
return t
|
||
}, e.prototype.getTilePixelSize = function (t, e, i) {
|
||
var r = gs(this.getTileGridForProjection(i).getTileSize(t), this.tmpSize);
|
||
return [Math.round(r[0] * e), Math.round(r[1] * e)]
|
||
}, e
|
||
}(Ex), vw = {KVP: "KVP", REST: "REST"}, _w = function (t) {
|
||
function e(e) {
|
||
t.call(this, {
|
||
extent: e.extent,
|
||
origin: e.origin,
|
||
origins: e.origins,
|
||
resolutions: e.resolutions,
|
||
tileSize: e.tileSize,
|
||
tileSizes: e.tileSizes,
|
||
sizes: e.sizes
|
||
}), this.matrixIds_ = e.matrixIds
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getMatrixId = function (t) {
|
||
return this.matrixIds_[t]
|
||
}, e.prototype.getMatrixIds = function () {
|
||
return this.matrixIds_
|
||
}, e
|
||
}(Xu), xw = _w;
|
||
|
||
function ww(t, e, i) {
|
||
var r = [], o = [], n = [], s = [], a = [], l = void 0 !== i ? i : [], h = t.SupportedCRS,
|
||
u = We(h.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/, "$1:$3")) || We(h), c = u.getMetersPerUnit(),
|
||
p = "ne" == u.getAxisOrientation().substr(0, 2);
|
||
return t.TileMatrix.sort(function (t, e) {
|
||
return e.ScaleDenominator - t.ScaleDenominator
|
||
}), t.TileMatrix.forEach(function (e) {
|
||
if (!(l.length > 0) || et(l, function (i) {
|
||
return e.Identifier == i.TileMatrix || -1 === e.Identifier.indexOf(":") && t.Identifier + ":" + e.Identifier === i.TileMatrix
|
||
})) {
|
||
o.push(e.Identifier);
|
||
var i = 28e-5 * e.ScaleDenominator / c, h = e.TileWidth, u = e.TileHeight;
|
||
p ? n.push([e.TopLeftCorner[1], e.TopLeftCorner[0]]) : n.push(e.TopLeftCorner), r.push(i), s.push(h == u ? h : [h, u]), a.push([e.MatrixWidth, -e.MatrixHeight])
|
||
}
|
||
}), new _w({extent: e, origins: n, resolutions: r, matrixIds: o, tileSizes: s, sizes: a})
|
||
}
|
||
|
||
var bw = function (t) {
|
||
function e(e) {
|
||
var i = void 0 !== e.requestEncoding ? e.requestEncoding : vw.KVP, r = e.tileGrid, o = e.urls;
|
||
void 0 === o && void 0 !== e.url && (o = bx(e.url)), t.call(this, {
|
||
attributions: e.attributions,
|
||
cacheSize: e.cacheSize,
|
||
crossOrigin: e.crossOrigin,
|
||
projection: e.projection,
|
||
reprojectionErrorThreshold: e.reprojectionErrorThreshold,
|
||
tileClass: e.tileClass,
|
||
tileGrid: r,
|
||
tileLoadFunction: e.tileLoadFunction,
|
||
tilePixelRatio: e.tilePixelRatio,
|
||
tileUrlFunction: wx,
|
||
urls: o,
|
||
wrapX: void 0 !== e.wrapX && e.wrapX,
|
||
transition: e.transition
|
||
}), this.version_ = void 0 !== e.version ? e.version : "1.0.0", this.format_ = void 0 !== e.format ? e.format : "image/jpeg", this.dimensions_ = void 0 !== e.dimensions ? e.dimensions : {}, this.layer_ = e.layer, this.matrixSet_ = e.matrixSet, this.style_ = e.style, this.requestEncoding_ = i, this.setKey(this.getKeyForDimensions_()), o && o.length > 0 && (this.tileUrlFunction = xx(o.map(Cw.bind(this))))
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.setUrls = function (t) {
|
||
this.urls = t;
|
||
var e = t.join("\n");
|
||
this.setTileUrlFunction(xx(t.map(Cw.bind(this))), e)
|
||
}, e.prototype.getDimensions = function () {
|
||
return this.dimensions_
|
||
}, e.prototype.getFormat = function () {
|
||
return this.format_
|
||
}, e.prototype.getLayer = function () {
|
||
return this.layer_
|
||
}, e.prototype.getMatrixSet = function () {
|
||
return this.matrixSet_
|
||
}, e.prototype.getRequestEncoding = function () {
|
||
return this.requestEncoding_
|
||
}, e.prototype.getStyle = function () {
|
||
return this.style_
|
||
}, e.prototype.getVersion = function () {
|
||
return this.version_
|
||
}, e.prototype.getKeyForDimensions_ = function () {
|
||
var t = 0, e = [];
|
||
for (var i in this.dimensions_) e[t++] = i + "-" + this.dimensions_[i];
|
||
return e.join("/")
|
||
}, e.prototype.updateDimensions = function (t) {
|
||
p(this.dimensions_, t), this.setKey(this.getKeyForDimensions_())
|
||
}, e
|
||
}(Rx);
|
||
|
||
function Cw(t) {
|
||
var e = this.requestEncoding_, i = {layer: this.layer_, style: this.style_, tilematrixset: this.matrixSet_};
|
||
e == vw.KVP && p(i, {
|
||
Service: "WMTS",
|
||
Request: "GetTile",
|
||
Version: this.version_,
|
||
Format: this.format_
|
||
}), t = e == vw.KVP ? Gx(t, i) : t.replace(/\{(\w+?)\}/g, function (t, e) {
|
||
return e.toLowerCase() in i ? i[e.toLowerCase()] : t
|
||
});
|
||
var r = this.tileGrid, o = this.dimensions_;
|
||
return function (i, n, s) {
|
||
if (i) {
|
||
var a = {TileMatrix: r.getMatrixId(i[0]), TileCol: i[1], TileRow: -i[2] - 1};
|
||
p(a, o);
|
||
var l = t;
|
||
return l = e == vw.KVP ? Gx(l, a) : l.replace(/\{(\w+?)\}/g, function (t, e) {
|
||
return a[e]
|
||
})
|
||
}
|
||
}
|
||
}
|
||
|
||
var Sw = {DEFAULT: "default", TRUNCATED: "truncated"}, Ew = function (t) {
|
||
function e(e, i, r, o, n, s, a) {
|
||
t.call(this, i, r, o, n, s, a), this.zoomifyImage_ = null, this.tileSize_ = gs(e.getTileSize(i[0]))
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getImage = function () {
|
||
if (this.zoomifyImage_) return this.zoomifyImage_;
|
||
var e = t.prototype.getImage.call(this);
|
||
if (this.state == Ro.LOADED) {
|
||
var i = this.tileSize_;
|
||
if (e.width == i[0] && e.height == i[1]) return this.zoomifyImage_ = e, e;
|
||
var r = Ao(i[0], i[1]);
|
||
return r.drawImage(e, 0, 0), this.zoomifyImage_ = r.canvas, r.canvas
|
||
}
|
||
return e
|
||
}, e
|
||
}(zo), Tw = function (t) {
|
||
function e(e) {
|
||
var i = e || {}, r = i.size, o = void 0 !== i.tierSizeCalculation ? i.tierSizeCalculation : Sw.DEFAULT,
|
||
n = r[0], s = r[1], a = i.extent || [0, -r[1], r[0], 0], l = [], h = i.tileSize || Vn, u = h;
|
||
switch (o) {
|
||
case Sw.DEFAULT:
|
||
for (; n > u || s > u;) l.push([Math.ceil(n / u), Math.ceil(s / u)]), u += u;
|
||
break;
|
||
case Sw.TRUNCATED:
|
||
for (var c = n, p = s; c > u || p > u;) l.push([Math.ceil(c / u), Math.ceil(p / u)]), c >>= 1, p >>= 1;
|
||
break;
|
||
default:
|
||
W(!1, 53)
|
||
}
|
||
l.push([1, 1]), l.reverse();
|
||
for (var d = [1], f = [0], g = 1, m = l.length; g < m; g++) d.push(1 << g), f.push(l[g - 1][0] * l[g - 1][1] + f[g - 1]);
|
||
d.reverse();
|
||
var y = new Xu({tileSize: h, extent: a, origin: jt(a), resolutions: d}), v = i.url;
|
||
v && -1 == v.indexOf("{TileGroup}") && -1 == v.indexOf("{tileIndex}") && (v += "{TileGroup}/{z}-{x}-{y}.jpg");
|
||
var _ = xx(bx(v).map(function (t) {
|
||
return function (e, i, r) {
|
||
if (e) {
|
||
var o = e[0], n = e[1], s = -e[2] - 1, a = n + s * l[o][0], h = y.getTileSize(o),
|
||
u = Array.isArray(h) ? h[0] : h,
|
||
c = {z: o, x: n, y: s, tileIndex: a, TileGroup: "TileGroup" + ((a + f[o]) / u | 0)};
|
||
return t.replace(/\{(\w+?)\}/g, function (t, e) {
|
||
return c[e]
|
||
})
|
||
}
|
||
}
|
||
})), x = Ew.bind(null, y);
|
||
t.call(this, {
|
||
attributions: i.attributions,
|
||
cacheSize: i.cacheSize,
|
||
crossOrigin: i.crossOrigin,
|
||
projection: i.projection,
|
||
reprojectionErrorThreshold: i.reprojectionErrorThreshold,
|
||
tileClass: x,
|
||
tileGrid: y,
|
||
tileUrlFunction: _,
|
||
transition: i.transition
|
||
})
|
||
}
|
||
|
||
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e
|
||
}(Rx);
|
||
var Rw = window.ol = {};
|
||
Rw.AssertionError = h, Rw.Collection = Y, Rw.Collection.CollectionEvent = V, Rw.CollectionEventType = u, Rw.Disposable = R, Rw.Feature = X, Rw.Feature.createStyleFunction = H, Rw.Geolocation = Mr, Rw.Graticule = bo, Rw.Image = Eo, Rw.ImageBase = Co, Rw.ImageCanvas = To, Rw.ImageState = So, Rw.ImageTile = zo, Rw.Kinetic = Bo, Rw.LayerType = Vo, Rw.Map = rh, Rw.MapBrowserEvent = Wo, Rw.MapBrowserEventHandler = Nn, Rw.MapBrowserEventType = Ho, Rw.MapBrowserPointerEvent = Xo, Rw.MapEvent = Yo, Rw.MapEventType = Dn, Rw.MapProperty = Gn, Rw.Object = U, Rw.Object.ObjectEvent = G, Rw.Object.getChangeEventType = z, Rw.ObjectEventType = c, Rw.Observable = D, Rw.Observable.unByKey = N, Rw.Overlay = sh, Rw.OverlayPositioning = oh, Rw.PluggableMap = ms, Rw.Tile = Mo, Rw.TileCache = fh, Rw.TileQueue = Un, Rw.TileRange = pl, Rw.TileRange.createOrUpdate = cl, Rw.TileState = Ro, Rw.VectorImageTile = vh, Rw.VectorImageTile.defaultLoadFunction = _h, Rw.VectorTile = wh, Rw.View = ss, Rw.View.createCenterConstraint = is, Rw.View.createResolutionConstraint = rs, Rw.View.createRotationConstraint = os, Rw.View.isNoopAnimation = ns, Rw.ViewHint = $n, Rw.ViewProperty = Qn, Rw.WebGLMap = pc, Rw.array = {}, Rw.array.binarySearch = q, Rw.array.equals = it, Rw.array.extend = Q, Rw.array.find = et, Rw.array.findIndex = ot, Rw.array.includes = K, Rw.array.isSorted = nt, Rw.array.linearFindNearest = J, Rw.array.numberSafeCompareFunction = Z, Rw.array.remove = tt, Rw.array.reverseSubArray = $, Rw.array.stableSort = rt, Rw.asserts = {}, Rw.asserts.assert = W, Rw.centerconstraint = {}, Rw.centerconstraint.createExtent = Yn, Rw.centerconstraint.none = Wn, Rw.color = {}, Rw.color.asArray = lo, Rw.color.asString = oo, Rw.color.fromString = ao, Rw.color.normalize = ho, Rw.color.toString = uo, Rw.colorlike = {}, Rw.colorlike.asColorLike = Wa, Rw.colorlike.isColorLike = void 0, Rw.control = {}, Rw.control.Attribution = Ps, Rw.control.Attribution.render = Rs, Rw.control.Control = ys, Rw.control.FullScreen = yc, Rw.control.MousePosition = xc, Rw.control.MousePosition.render = _c, Rw.control.OverviewMap = bc, Rw.control.OverviewMap.render = wc, Rw.control.Rotate = Is, Rw.control.Rotate.render = Ls, Rw.control.ScaleLine = Rc, Rw.control.ScaleLine.Units = Sc, Rw.control.ScaleLine.render = Tc, Rw.control.Zoom = Os, Rw.control.ZoomSlider = Ic, Rw.control.ZoomSlider.render = Lc, Rw.control.ZoomToExtent = Oc, Rw.control.util = {}, Rw.control.util.defaults = Ms, Rw.coordinate = {}, Rw.coordinate.add = Fr, Rw.coordinate.closestOnCircle = Nr, Rw.coordinate.closestOnSegment = Dr,Rw.coordinate.createStringXY = function (t) {
|
||
return function (e) {
|
||
return Hr(e, t)
|
||
}
|
||
},Rw.coordinate.degreesToStringHDMS = Gr,Rw.coordinate.distance = Yr,Rw.coordinate.equals = zr,Rw.coordinate.format = jr,Rw.coordinate.rotate = Ur,Rw.coordinate.scale = Br,Rw.coordinate.squaredDistance = Vr,Rw.coordinate.squaredDistanceToSegment = Wr,Rw.coordinate.toStringHDMS = function (t, e) {
|
||
return t ? Gr("NS", t[1], e) + " " + Gr("EW", t[0], e) : ""
|
||
},Rw.coordinate.toStringXY = Hr,Rw.css = {},Rw.css.CLASS_COLLAPSED = Cs,Rw.css.CLASS_CONTROL = bs,Rw.css.CLASS_HIDDEN = vs,Rw.css.CLASS_SELECTABLE = _s,Rw.css.CLASS_UNSELECTABLE = xs,Rw.css.CLASS_UNSUPPORTED = ws,Rw.css.getFontFamilies = Ss,Rw.dom = {},Rw.dom.createCanvasContext2D = Ao,Rw.dom.outerHeight = Fo,Rw.dom.outerWidth = ko,Rw.dom.removeChildren = Go,Rw.dom.removeNode = Do,Rw.dom.replaceNode = No,Rw.easing = {},Rw.easing.easeIn = Po,Rw.easing.easeOut = Lo,Rw.easing.inAndOut = Io,Rw.easing.linear = Oo,Rw.easing.upAndDown = function (t) {
|
||
return t < .5 ? Io(2 * t) : 1 - Io(2 * (t - .5))
|
||
},Rw.events = {},Rw.events.Event = A,Rw.events.Event.preventDefault = function (t) {
|
||
t.preventDefault()
|
||
},Rw.events.Event.stopPropagation = M,Rw.events.EventType = F,Rw.events.KeyCode = fa,Rw.events.Target = k,Rw.events.bindListener = m,Rw.events.condition = {},Rw.events.condition.altKeyOnly = Vs,Rw.events.condition.altShiftKeysOnly = Ys,Rw.events.condition.always = Hs,Rw.events.condition.click = function (t) {
|
||
return t.type == Ho.CLICK
|
||
},Rw.events.condition.doubleClick = function (t) {
|
||
return t.type == Ho.DBLCLICK
|
||
},Rw.events.condition.focus = Ws,Rw.events.condition.mouseActionButton = Xs,Rw.events.condition.mouseOnly = ta,Rw.events.condition.never = qs,Rw.events.condition.noModifierKeys = Js,Rw.events.condition.platformModifierKeyOnly = function (t) {
|
||
var e = t.originalEvent;
|
||
return !e.altKey && (Cr ? e.metaKey : e.ctrlKey) && !e.shiftKey
|
||
},Rw.events.condition.pointerMove = Zs,Rw.events.condition.primaryAction = ea,Rw.events.condition.shiftKeyOnly = $s,Rw.events.condition.singleClick = Ks,Rw.events.condition.targetNotEditable = Qs,Rw.events.findListener = y,Rw.events.getListeners = v,Rw.events.listen = w,Rw.events.listenOnce = b,Rw.events.unlisten = C,Rw.events.unlistenAll = E,Rw.events.unlistenByKey = S,Rw.extent = {},Rw.extent.Corner = st,Rw.extent.Relationship = at,Rw.extent.applyTransform = Xt,Rw.extent.boundingExtent = lt,Rw.extent.buffer = ht,Rw.extent.clone = ut,Rw.extent.closestSquaredDistanceXY = ct,Rw.extent.containsCoordinate = pt,Rw.extent.containsExtent = dt,Rw.extent.containsXY = ft,Rw.extent.coordinateRelationship = gt,Rw.extent.createEmpty = mt,Rw.extent.createOrUpdate = yt,Rw.extent.createOrUpdateEmpty = vt,Rw.extent.createOrUpdateFromCoordinate = _t,Rw.extent.createOrUpdateFromCoordinates = xt,Rw.extent.createOrUpdateFromFlatCoordinates = wt,Rw.extent.createOrUpdateFromRings = function (t, e) {
|
||
return Rt(vt(e), t)
|
||
},Rw.extent.equals = bt,Rw.extent.extend = Ct,Rw.extent.extendCoordinate = St,Rw.extent.extendCoordinates = Et,Rw.extent.extendFlatCoordinates = Tt,Rw.extent.extendRings = Rt,Rw.extent.extendXY = Pt,Rw.extent.forEachCorner = Lt,Rw.extent.getArea = It,Rw.extent.getBottomLeft = Ot,Rw.extent.getBottomRight = Mt,Rw.extent.getCenter = At,Rw.extent.getCorner = kt,Rw.extent.getEnlargedArea = function (t, e) {
|
||
var i = Math.min(t[0], e[0]), r = Math.min(t[1], e[1]);
|
||
return (Math.max(t[2], e[2]) - i) * (Math.max(t[3], e[3]) - r)
|
||
},Rw.extent.getForViewAndSize = Ft,Rw.extent.getHeight = Nt,Rw.extent.getIntersection = Dt,Rw.extent.getIntersectionArea = function (t, e) {
|
||
return It(Dt(t, e))
|
||
},Rw.extent.getMargin = function (t) {
|
||
return Ut(t) + Nt(t)
|
||
},Rw.extent.getSize = Gt,Rw.extent.getTopLeft = jt,Rw.extent.getTopRight = zt,Rw.extent.getWidth = Ut,Rw.extent.intersects = Bt,Rw.extent.intersectsSegment = Ht,Rw.extent.isEmpty = Vt,Rw.extent.returnOrUpdate = Yt,Rw.extent.scaleFromCenter = Wt,Rw.featureloader = {},Rw.featureloader.loadFeaturesXhr = mh,Rw.featureloader.xhr = yh,Rw.format = {},Rw.format.EsriJSON = Xc,Rw.format.Feature = Ac,Rw.format.Feature.transformWithOptions = kc,Rw.format.FormatType = gh,Rw.format.GML = Up,Rw.format.GML2 = Wp,Rw.format.GML3 = jp,Rw.format.GMLBase = wp,Rw.format.GMLBase.GMLNS = vp,Rw.format.GPX = Td,Rw.format.GeoJSON = Od,Rw.format.IGC = jd,Rw.format.JSONFeature = Nc,Rw.format.KML = em,Rw.format.KML.getDefaultFillStyle = function () {
|
||
return xf
|
||
},Rw.format.KML.getDefaultImageStyle = function () {
|
||
return bf
|
||
},Rw.format.KML.getDefaultStrokeStyle = function () {
|
||
return Sf
|
||
},Rw.format.KML.getDefaultStyle = function () {
|
||
return Tf
|
||
},Rw.format.KML.getDefaultStyleArray = function () {
|
||
return Rf
|
||
},Rw.format.KML.getDefaultTextStyle = function () {
|
||
return Ef
|
||
},Rw.format.KML.readFlatCoordinates = Of,Rw.format.MVT = cm,Rw.format.OSMXML = vm,Rw.format.OWS = jm,Rw.format.Polyline = Km,Rw.format.Polyline.decodeDeltas = Bm,Rw.format.Polyline.decodeFloats = Ym,Rw.format.Polyline.decodeSignedIntegers = Hm,Rw.format.Polyline.decodeUnsignedIntegers = qm,Rw.format.Polyline.encodeDeltas = Um,Rw.format.Polyline.encodeFloats = Vm,Rw.format.Polyline.encodeSignedIntegers = Wm,Rw.format.Polyline.encodeUnsignedInteger = Zm,Rw.format.Polyline.encodeUnsignedIntegers = Xm,Rw.format.TextFeature = Ad,Rw.format.TopoJSON = ry,Rw.format.WFS = tv,Rw.format.WFS.writeFilter = function (t) {
|
||
var e = Kc(Ny, "Filter");
|
||
return Xy(e, t, []), e
|
||
},Rw.format.WKT = xv,Rw.format.WMSCapabilities = Yv,Rw.format.WMSGetFeatureInfo = Wv,Rw.format.WMTSCapabilities = a_,Rw.format.XLink = {},Rw.format.XLink.readHref = xm,Rw.format.XML = bm,Rw.format.XMLFeature = yp,Rw.format.filter = {},Rw.format.filter.And = ay,Rw.format.filter.Bbox = ly,Rw.format.filter.Comparison = cy,Rw.format.filter.ComparisonBinary = dy,Rw.format.filter.Contains = uy,Rw.format.filter.During = py,Rw.format.filter.EqualTo = fy,Rw.format.filter.Filter = ny,Rw.format.filter.GreaterThan = gy,Rw.format.filter.GreaterThanOrEqualTo = my,Rw.format.filter.Intersects = yy,Rw.format.filter.IsBetween = vy,Rw.format.filter.IsLike = _y,Rw.format.filter.IsNull = xy,Rw.format.filter.LessThan = wy,Rw.format.filter.LessThanOrEqualTo = by,Rw.format.filter.LogicalNary = sy,Rw.format.filter.Not = Cy,Rw.format.filter.NotEqualTo = Sy,Rw.format.filter.Or = Ey,Rw.format.filter.Spatial = hy,Rw.format.filter.Within = Ty,Rw.format.filter.and = Ry,Rw.format.filter.bbox = Py,Rw.format.filter.between = function (t, e, i) {
|
||
return new vy(t, e, i)
|
||
},Rw.format.filter.contains = function (t, e, i) {
|
||
return new uy(t, e, i)
|
||
},Rw.format.filter.during = function (t, e, i) {
|
||
return new py(t, e, i)
|
||
},Rw.format.filter.equalTo = function (t, e, i) {
|
||
return new fy(t, e, i)
|
||
},Rw.format.filter.greaterThan = function (t, e) {
|
||
return new gy(t, e)
|
||
},Rw.format.filter.greaterThanOrEqualTo = function (t, e) {
|
||
return new my(t, e)
|
||
},Rw.format.filter.intersects = function (t, e, i) {
|
||
return new yy(t, e, i)
|
||
},Rw.format.filter.isNull = function (t) {
|
||
return new xy(t)
|
||
},Rw.format.filter.lessThan = function (t, e) {
|
||
return new wy(t, e)
|
||
},Rw.format.filter.lessThanOrEqualTo = function (t, e) {
|
||
return new by(t, e)
|
||
},Rw.format.filter.like = function (t, e, i, r, o, n) {
|
||
return new _y(t, e, i, r, o, n)
|
||
},Rw.format.filter.not = function (t) {
|
||
return new Cy(t)
|
||
},Rw.format.filter.notEqualTo = function (t, e, i) {
|
||
return new Sy(t, e, i)
|
||
},Rw.format.filter.or = function (t) {
|
||
var e = [null].concat(Array.prototype.slice.call(arguments));
|
||
return new (Function.prototype.bind.apply(Ey, e))
|
||
},Rw.format.filter.within = function (t, e, i) {
|
||
return new Ty(t, e, i)
|
||
},Rw.format.xsd = {},Rw.format.xsd.readBoolean = bp,Rw.format.xsd.readBooleanString = Cp,Rw.format.xsd.readDateTime = Sp,Rw.format.xsd.readDecimal = Ep,Rw.format.xsd.readDecimalString = Tp,Rw.format.xsd.readNonNegativeInteger = Rp,Rw.format.xsd.readNonNegativeIntegerString = Pp,Rw.format.xsd.readString = Lp,Rw.format.xsd.writeBooleanTextNode = Ip,Rw.format.xsd.writeCDATASection = Op,Rw.format.xsd.writeDateTimeTextNode = Mp,Rw.format.xsd.writeDecimalTextNode = Ap,Rw.format.xsd.writeNonNegativeIntegerTextNode = kp,Rw.format.xsd.writeStringTextNode = Fp,Rw.functions = {},Rw.functions.FALSE = L,Rw.functions.TRUE = P,Rw.functions.VOID = I,Rw.geom = {},Rw.geom.Circle = h_,Rw.geom.Geometry = _i,Rw.geom.GeometryCollection = Pd,Rw.geom.GeometryLayout = qt,Rw.geom.GeometryType = Zt,Rw.geom.LineString = Jr,Rw.geom.LinearRing = Xi,Rw.geom.MultiLineString = Dc,Rw.geom.MultiPoint = Gc,Rw.geom.MultiPolygon = zc,Rw.geom.Point = qi,Rw.geom.Polygon = fr,Rw.geom.Polygon.circular = gr,Rw.geom.Polygon.fromCircle = yr,Rw.geom.Polygon.fromExtent = mr,Rw.geom.Polygon.makeRegular = vr,Rw.geom.SimpleGeometry = bi,Rw.geom.SimpleGeometry.getStrideForLayout = xi,Rw.geom.SimpleGeometry.transformGeom2D = wi,Rw.geom.flat = {},Rw.geom.flat.area = {},Rw.geom.flat.area.linearRing = Ci,Rw.geom.flat.area.linearRings = Si,Rw.geom.flat.area.linearRingss = Ei,Rw.geom.flat.center = {},Rw.geom.flat.center.linearRingss = jc,Rw.geom.flat.closest = {},Rw.geom.flat.closest.arrayMaxSquaredDelta = Pi,Rw.geom.flat.closest.assignClosestArrayPoint = Oi,Rw.geom.flat.closest.assignClosestMultiArrayPoint = Mi,Rw.geom.flat.closest.assignClosestPoint = Ii,Rw.geom.flat.closest.maxSquaredDelta = Ri,Rw.geom.flat.closest.multiArrayMaxSquaredDelta = Li,Rw.geom.flat.contains = {},Rw.geom.flat.contains.linearRingContainsExtent = Zi,Rw.geom.flat.contains.linearRingContainsXY = Ki,Rw.geom.flat.contains.linearRingsContainsXY = Ji,Rw.geom.flat.contains.linearRingssContainsXY = $i,Rw.geom.flat.deflate = {},Rw.geom.flat.deflate.deflateCoordinate = Ai,Rw.geom.flat.deflate.deflateCoordinates = ki,Rw.geom.flat.deflate.deflateCoordinatesArray = Fi,Rw.geom.flat.deflate.deflateMultiCoordinatesArray = Ni,Rw.geom.flat.flip = {},Rw.geom.flat.flip.flipXY = zm,Rw.geom.flat.geodesic = {},Rw.geom.flat.geodesic.greatCircleArc = function (t, e, i, r, o, n) {
|
||
var s = We("EPSG:4326"), a = Math.cos(ae(e)), l = Math.sin(ae(e)), h = Math.cos(ae(r)), u = Math.sin(ae(r)),
|
||
c = Math.cos(ae(i - t)), p = Math.sin(ae(i - t)), d = l * u + a * h * c;
|
||
return $r(function (e) {
|
||
if (1 <= d) return [i, r];
|
||
var o = e * Math.acos(d), n = Math.cos(o), s = Math.sin(o), f = p * h, g = a * u - l * h * c,
|
||
m = Math.atan2(f, g), y = Math.asin(l * n + a * s * Math.cos(m));
|
||
return [se(ae(t) + Math.atan2(Math.sin(m) * s * a, n - l * Math.sin(y))), se(y)]
|
||
}, ei(s, o), n)
|
||
},Rw.geom.flat.geodesic.meridian = Qr,Rw.geom.flat.geodesic.parallel = to,Rw.geom.flat.inflate = {},Rw.geom.flat.inflate.inflateCoordinates = Di,Rw.geom.flat.inflate.inflateCoordinatesArray = Gi,Rw.geom.flat.inflate.inflateMultiCoordinatesArray = ji,Rw.geom.flat.interiorpoint = {},Rw.geom.flat.interiorpoint.getInteriorPointOfArray = Qi,Rw.geom.flat.interiorpoint.getInteriorPointsOfMultiArray = tr,Rw.geom.flat.interpolate = {},Rw.geom.flat.interpolate.interpolatePoint = Xr,Rw.geom.flat.interpolate.lineStringCoordinateAtM = qr,Rw.geom.flat.interpolate.lineStringsCoordinateAtM = Zr,Rw.geom.flat.intersectsextent = {},Rw.geom.flat.intersectsextent.intersectsLineString = ir,Rw.geom.flat.intersectsextent.intersectsLineStringArray = rr,Rw.geom.flat.intersectsextent.intersectsLinearRing = or,Rw.geom.flat.intersectsextent.intersectsLinearRingArray = nr,Rw.geom.flat.intersectsextent.intersectsLinearRingMultiArray = sr,Rw.geom.flat.length = {},Rw.geom.flat.length.lineStringLength = Kr,Rw.geom.flat.length.linearRingLength = function (t, e, i, r) {
|
||
var o = Kr(t, e, i, r), n = t[i - r] - t[e], s = t[i - r + 1] - t[e + 1];
|
||
return o += Math.sqrt(n * n + s * s)
|
||
},Rw.geom.flat.orient = {},Rw.geom.flat.orient.linearRingIsClockwise = lr,Rw.geom.flat.orient.linearRingIsOriented = hr,Rw.geom.flat.orient.linearRingsAreOriented = ur,Rw.geom.flat.orient.orientLinearRings = cr,Rw.geom.flat.orient.orientLinearRingsArray = pr,Rw.geom.flat.reverse = {},Rw.geom.flat.reverse.coordinates = ar,Rw.geom.flat.segments = {},Rw.geom.flat.segments.forEach = er,Rw.geom.flat.simplify = {},Rw.geom.flat.simplify.douglasPeucker = zi,Rw.geom.flat.simplify.douglasPeuckerArray = Ui,Rw.geom.flat.simplify.douglasPeuckerMultiArray = function (t, e, i, r, o, n, s, a) {
|
||
for (var l = 0, h = i.length; l < h; ++l) {
|
||
var u = i[l], c = [];
|
||
s = Ui(t, e, u, r, o, n, s, c), a.push(c), e = u[u.length - 1]
|
||
}
|
||
return s
|
||
},Rw.geom.flat.simplify.quantize = Yi,Rw.geom.flat.simplify.quantizeArray = Wi,Rw.geom.flat.simplify.quantizeMultiArray = Hi,Rw.geom.flat.simplify.radialDistance = Bi,Rw.geom.flat.simplify.simplifyLineString = function (t, e, i, r, o, n, s) {
|
||
var a = void 0 !== s ? s : [];
|
||
return n || (i = Bi(t, e, i, r, o, a, 0), t = a, e = 0, r = 2), a.length = zi(t, e, i, r, o, a, 0), a
|
||
},Rw.geom.flat.simplify.snap = Vi,Rw.geom.flat.straightchunk = {},Rw.geom.flat.straightchunk.matchingChunk = Fl,Rw.geom.flat.textpath = {},Rw.geom.flat.textpath.drawTextOnPath = xl,Rw.geom.flat.topology = {},Rw.geom.flat.topology.lineStringIsClosed = su,Rw.geom.flat.transform = {},Rw.geom.flat.transform.rotate = Jt,Rw.geom.flat.transform.scale = $t,Rw.geom.flat.transform.transform2D = Kt,Rw.geom.flat.transform.translate = Qt,Rw.has = {},Rw.has.CANVAS_LINE_DASH = Er,Rw.has.DEVICE_PIXEL_RATIO = Sr,Rw.has.FIREFOX = xr,Rw.has.GEOLOCATION = Tr,Rw.has.MAC = Cr,Rw.has.MSPOINTER = Lr,Rw.has.POINTER = Pr,Rw.has.SAFARI = wr,Rw.has.TOUCH = Rr,Rw.has.WEBKIT = br,Rw.interaction = {},Rw.interaction.DoubleClickZoom = Bs,Rw.interaction.DragAndDrop = f_,Rw.interaction.DragBox = ca,Rw.interaction.DragPan = oa,Rw.interaction.DragRotate = na,Rw.interaction.DragRotateAndZoom = g_,Rw.interaction.DragZoom = da,Rw.interaction.Draw = P_,Rw.interaction.Draw.createBox = R_,Rw.interaction.Draw.createRegularPolygon = function (t, e) {
|
||
return function (i, r) {
|
||
var o = i[0], n = i[1], s = Math.sqrt(Vr(o, n)), a = r || yr(new h_(o), t), l = e;
|
||
if (!e) {
|
||
var h = n[0] - o[0], u = n[1] - o[1];
|
||
l = Math.atan(u / h) - (h < 0 ? Math.PI : 0)
|
||
}
|
||
return vr(a, o, s, l), a
|
||
}
|
||
},Rw.interaction.Draw.handleEvent = void 0,Rw.interaction.Extent = k_,Rw.interaction.Interaction = zs,Rw.interaction.Interaction.pan = ks,Rw.interaction.Interaction.rotate = Fs,Rw.interaction.Interaction.rotateWithoutConstraints = Ns,Rw.interaction.Interaction.zoom = Ds,Rw.interaction.Interaction.zoomByDelta = Gs,Rw.interaction.Interaction.zoomWithoutConstraints = js,Rw.interaction.KeyboardPan = ma,Rw.interaction.KeyboardZoom = va,Rw.interaction.Modify = B_,Rw.interaction.Modify.ModifyEvent = G_,Rw.interaction.MouseWheelZoom = xa,Rw.interaction.MouseWheelZoom.Mode = _a,Rw.interaction.PinchRotate = wa,Rw.interaction.PinchZoom = ba,Rw.interaction.Pointer = ra,Rw.interaction.Pointer.centroid = ia,Rw.interaction.Pointer.handleEvent = void 0,Rw.interaction.Property = As,Rw.interaction.Select = X_,Rw.interaction.Snap = Z_,Rw.interaction.Snap.handleEvent = void 0,Rw.interaction.Translate = tx,Rw.interaction.Translate.TranslateEvent = Q_,Rw.interaction.defaults = Ca,Rw.layer = {},Rw.layer.Base = ls,Rw.layer.Group = cs,Rw.layer.Heatmap = rx,Rw.layer.Image = nx,Rw.layer.Layer = Ts,Rw.layer.Layer.visibleAtResolution = Es,Rw.layer.Property = as,Rw.layer.Tile = lx,Rw.layer.TileProperty = sx,Rw.layer.Vector = v_,Rw.layer.Vector.RenderType = void 0,Rw.layer.VectorRenderType = Ea,Rw.layer.VectorTile = ux,Rw.layer.VectorTile.RenderType = void 0,Rw.layer.VectorTileRenderType = $l,Rw.loadingstrategy = {},Rw.loadingstrategy.all = __,Rw.loadingstrategy.bbox = function (t, e) {
|
||
return [t]
|
||
},Rw.loadingstrategy.tile = function (t) {
|
||
return function (e, i) {
|
||
var r = t.getZForResolution(i), o = t.getTileRangeForExtentAndZ(e, r), n = [], s = [r, 0, 0];
|
||
for (s[1] = o.minX; s[1] <= o.maxX; ++s[1]) for (s[2] = o.minY; s[2] <= o.maxY; ++s[2]) n.push(t.getTileCoordExtent(s));
|
||
return n
|
||
}
|
||
},Rw.math = {},Rw.math.clamp = te,Rw.math.cosh = ee,Rw.math.lerp = he,Rw.math.modulo = le,Rw.math.roundUpToPowerOfTwo = ie,Rw.math.solveLinearSystem = ne,Rw.math.squaredDistance = oe,Rw.math.squaredSegmentDistance = re,Rw.math.toDegrees = se,Rw.math.toRadians = ae,Rw.net = {},Rw.net.jsonp = Cx,Rw.obj = {},Rw.obj.assign = p,Rw.obj.clear = d,Rw.obj.getValues = f,Rw.obj.isEmpty = g,Rw.pointer = {},Rw.pointer.EventSource = Ko,Rw.pointer.EventType = qo,Rw.pointer.MouseSource = sn,Rw.pointer.MouseSource.POINTER_ID = Jo,Rw.pointer.MouseSource.POINTER_TYPE = $o,Rw.pointer.MsSource = mn,Rw.pointer.NativeSource = En,Rw.pointer.PointerEvent = Pn,Rw.pointer.PointerEventHandler = Fn,Rw.pointer.TouchSource = An,Rw.proj = {},Rw.proj.Projection = xe,Rw.proj.Units = ve,Rw.proj.Units.METERS_PER_UNIT = ye,Rw.proj.addCommon = oi,Rw.proj.addCoordinateTransforms = Je,Rw.proj.addEquivalentProjections = Xe,Rw.proj.addEquivalentTransforms = qe,Rw.proj.addProjection = Ve,Rw.proj.addProjections = Ye,Rw.proj.clearAllProjections = function () {
|
||
ke(), Ge()
|
||
},Rw.proj.cloneTransform = Ue,Rw.proj.createProjection = Ze,Rw.proj.createTransformFromCoordinateTransform = Ke,Rw.proj.epsg3857 = {},Rw.proj.epsg3857.EXTENT = Ce,Rw.proj.epsg3857.HALF_SIZE = be,Rw.proj.epsg3857.PROJECTIONS = Te,Rw.proj.epsg3857.RADIUS = we,Rw.proj.epsg3857.WORLD_EXTENT = Se,Rw.proj.epsg3857.fromEPSG4326 = Re,Rw.proj.epsg3857.toEPSG4326 = Pe,Rw.proj.epsg4326 = {},Rw.proj.epsg4326.EXTENT = Le,Rw.proj.epsg4326.METERS_PER_UNIT = Ie,Rw.proj.epsg4326.PROJECTIONS = Me,Rw.proj.epsg4326.RADIUS = 6378137,Rw.proj.equivalent = Qe,Rw.proj.fromLonLat = $e,Rw.proj.get = We,Rw.proj.getPointResolution = He,Rw.proj.getTransform = ei,Rw.proj.getTransformFromProjections = ti,Rw.proj.identityTransform = Be,Rw.proj.proj4 = {},Rw.proj.proj4.register = function (t) {
|
||
var e, i, r = Object.keys(t.defs), o = r.length;
|
||
for (e = 0; e < o; ++e) {
|
||
var n = r[e];
|
||
if (!We(n)) {
|
||
var s = t.defs(n);
|
||
Ve(new xe({code: n, axisOrientation: s.axis, metersPerUnit: s.to_meter, units: s.units}))
|
||
}
|
||
}
|
||
for (e = 0; e < o; ++e) {
|
||
var a = r[e], l = We(a);
|
||
for (i = 0; i < o; ++i) {
|
||
var h = r[i], u = We(h);
|
||
if (!ze(a, h)) if (t.defs[a] === t.defs[h]) Xe([l, u]); else {
|
||
var c = t(a, h);
|
||
Je(l, u, c.forward, c.inverse)
|
||
}
|
||
}
|
||
}
|
||
},Rw.proj.projections = {},Rw.proj.projections.add = Ne,Rw.proj.projections.clear = ke,Rw.proj.projections.get = Fe,Rw.proj.toLonLat = function (t, e) {
|
||
var i = ii(t, void 0 !== e ? e : "EPSG:3857", "EPSG:4326"), r = i[0];
|
||
return (r < -180 || r > 180) && (i[0] = le(r + 180, 360) - 180), i
|
||
},Rw.proj.transform = ii,Rw.proj.transformExtent = ri,Rw.proj.transformWithProjections = function (t, e, i) {
|
||
return ti(e, i)(t)
|
||
},Rw.proj.transforms = {},Rw.proj.transforms.add = je,Rw.proj.transforms.clear = Ge,Rw.proj.transforms.get = ze,Rw.proj.transforms.remove = function (t, e) {
|
||
var i = t.getCode(), r = e.getCode(), o = De[i][r];
|
||
return delete De[i][r], g(De[i]) && delete De[i], o
|
||
},Rw.render = {},Rw.render.Box = sa,Rw.render.Event = Ta,Rw.render.EventType = eo,Rw.render.Feature = sm,Rw.render.ReplayGroup = vl,Rw.render.ReplayType = _l,Rw.render.VectorContext = Xa,Rw.render.canvas = {},Rw.render.canvas.ImageReplay = Ml,Rw.render.canvas.Immediate = qa,Rw.render.canvas.Instruction = Tl,Rw.render.canvas.Instruction.beginPathInstruction = Sl,Rw.render.canvas.Instruction.closePathInstruction = El,Rw.render.canvas.Instruction.fillInstruction = bl,Rw.render.canvas.Instruction.strokeInstruction = Cl,Rw.render.canvas.LineStringReplay = Al,Rw.render.canvas.PolygonReplay = kl,Rw.render.canvas.Replay = Ol,Rw.render.canvas.ReplayGroup = Vl,Rw.render.canvas.ReplayGroup.getCircleArray = Ul,Rw.render.canvas.ReplayGroup.replayDeclutter = Bl,Rw.render.canvas.TextReplay = Dl,Rw.render.canvas.TextReplay.measureTextWidths = Nl,Rw.render.canvas.checkFont = Na,Rw.render.canvas.checkedFonts = Aa,Rw.render.canvas.defaultFillStyle = Pa,Rw.render.canvas.defaultFont = "10px sans-serif",Rw.render.canvas.defaultLineCap = "round",Rw.render.canvas.defaultLineDash = La,Rw.render.canvas.defaultLineDashOffset = 0,Rw.render.canvas.defaultLineJoin = "round",Rw.render.canvas.defaultLineWidth = 1,Rw.render.canvas.defaultMiterLimit = 10,Rw.render.canvas.defaultPadding = Oa,Rw.render.canvas.defaultStrokeStyle = Ia,Rw.render.canvas.defaultTextAlign = "center",Rw.render.canvas.defaultTextBaseline = "middle",Rw.render.canvas.drawImage = Ya,Rw.render.canvas.labelCache = Ma,Rw.render.canvas.measureTextHeight = za,Rw.render.canvas.measureTextWidth = Ua,Rw.render.canvas.resetTransform = Va,Rw.render.canvas.rotateAtOffset = Ba,Rw.render.canvas.textHeights = Fa,Rw.render.replay = {},Rw.render.replay.ORDER = Rl,Rw.render.replay.TEXT_ALIGN = Pl,Rw.render.toContext = function (t, e) {
|
||
var i = t.canvas, r = e || {}, o = r.pixelRatio || Sr, n = r.size;
|
||
n && (i.width = n[0] * o, i.height = n[1] * o, i.style.width = n[0] + "px", i.style.height = n[1] + "px");
|
||
var s = [0, 0, i.width, i.height], a = di([1, 0, 0, 1, 0, 0], o, o);
|
||
return new qa(t, o, s, a, 0)
|
||
},Rw.render.webgl = {},Rw.render.webgl.CircleReplay = Zh,Rw.render.webgl.DEFAULT_FILLSTYLE = Uh,Rw.render.webgl.DEFAULT_FONT = "10px sans-serif",Rw.render.webgl.DEFAULT_LINECAP = "round",Rw.render.webgl.DEFAULT_LINEDASH = Bh,Rw.render.webgl.DEFAULT_LINEDASHOFFSET = 0,Rw.render.webgl.DEFAULT_LINEJOIN = "round",Rw.render.webgl.DEFAULT_LINEWIDTH = 1,Rw.render.webgl.DEFAULT_MITERLIMIT = 10,Rw.render.webgl.DEFAULT_STROKESTYLE = Vh,Rw.render.webgl.DEFAULT_TEXTALIGN = .5,Rw.render.webgl.DEFAULT_TEXTBASELINE = .5,Rw.render.webgl.EPSILON = Yh,Rw.render.webgl.ImageReplay = nu,Rw.render.webgl.Immediate = Fu,Rw.render.webgl.LineStringReplay = vu,Rw.render.webgl.PolygonReplay = Tu,Rw.render.webgl.Replay = zh,Rw.render.webgl.ReplayGroup = ku,Rw.render.webgl.TextReplay = Ou,Rw.render.webgl.TextureReplay = ou,Rw.render.webgl.circlereplay = {},Rw.render.webgl.circlereplay.defaultshader = {},Rw.render.webgl.circlereplay.defaultshader.Locations = Dh,Rw.render.webgl.circlereplay.defaultshader.fragment = Fh,Rw.render.webgl.circlereplay.defaultshader.vertex = Nh,Rw.render.webgl.linestringreplay = {},Rw.render.webgl.linestringreplay.defaultshader = {},Rw.render.webgl.linestringreplay.defaultshader.Locations = hu,Rw.render.webgl.linestringreplay.defaultshader.fragment = au,Rw.render.webgl.linestringreplay.defaultshader.vertex = lu,Rw.render.webgl.polygonreplay = {},Rw.render.webgl.polygonreplay.defaultshader = {},Rw.render.webgl.polygonreplay.defaultshader.Locations = wu,Rw.render.webgl.polygonreplay.defaultshader.fragment = _u,Rw.render.webgl.polygonreplay.defaultshader.vertex = xu,Rw.render.webgl.texturereplay = {},Rw.render.webgl.texturereplay.defaultshader = {},Rw.render.webgl.texturereplay.defaultshader.Locations = $h,Rw.render.webgl.texturereplay.defaultshader.fragment = Kh,Rw.render.webgl.texturereplay.defaultshader.vertex = Jh,Rw.render.webgl.triangleIsCounterClockwise = Wh,Rw.renderer = {},Rw.renderer.Layer = nl,Rw.renderer.Map = el,Rw.renderer.Map.sortByZIndex = tl,Rw.renderer.canvas = {},Rw.renderer.canvas.ImageLayer = hl,Rw.renderer.canvas.IntermediateCanvas = al,Rw.renderer.canvas.Layer = sl,Rw.renderer.canvas.Map = rl,Rw.renderer.canvas.Map.layerRendererConstructors = il,Rw.renderer.canvas.TileLayer = fl,Rw.renderer.canvas.VectorLayer = Jl,Rw.renderer.canvas.VectorTileLayer = ih,Rw.renderer.vector = {},Rw.renderer.vector.defaultOrder = Hl,Rw.renderer.vector.getSquaredTolerance = Xl,Rw.renderer.vector.getTolerance = ql,Rw.renderer.vector.renderFeature = Zl,Rw.renderer.webgl = {},Rw.renderer.webgl.ImageLayer = Uu,Rw.renderer.webgl.Layer = ju,Rw.renderer.webgl.Map = Bu,Rw.renderer.webgl.TileLayer = lc,Rw.renderer.webgl.VectorLayer = cc,Rw.renderer.webgl.defaultmapshader = {},Rw.renderer.webgl.defaultmapshader.Locations = Gu,Rw.renderer.webgl.defaultmapshader.fragment = Nu,Rw.renderer.webgl.defaultmapshader.vertex = Du,Rw.renderer.webgl.tilelayershader = {},Rw.renderer.webgl.tilelayershader.Locations = sc,Rw.renderer.webgl.tilelayershader.fragment = oc,Rw.renderer.webgl.tilelayershader.vertex = nc,Rw.reproj = {},Rw.reproj.Image = mx,Rw.reproj.Tile = yx,Rw.reproj.Triangulation = gx,Rw.reproj.calculateSourceResolution = cx,Rw.reproj.common = {},Rw.reproj.common.ENABLE_RASTER_REPROJECTION = !0,Rw.reproj.common.ERROR_THRESHOLD = Sa,Rw.reproj.render = dx,Rw.resolutionconstraint = {},Rw.resolutionconstraint.createSnapToPower = Xn,Rw.resolutionconstraint.createSnapToResolutions = Hn,Rw.rotationconstraint = {},Rw.rotationconstraint.createSnapToN = Kn,Rw.rotationconstraint.createSnapToZero = Jn,Rw.rotationconstraint.disable = qn,Rw.rotationconstraint.none = Zn,Rw.size = {},Rw.size.buffer = ps,Rw.size.hasArea = ds,Rw.size.scale = fs,Rw.size.toSize = gs,Rw.source = {},Rw.source.BingMaps = Px,Rw.source.CartoDB = Ix,Rw.source.Cluster = Ox,Rw.source.Image = Dx,Rw.source.Image.defaultImageLoadFunction = Nx,Rw.source.ImageArcGISRest = jx,Rw.source.ImageCanvas = zx,Rw.source.ImageMapGuide = Ux,Rw.source.ImageStatic = Bx,Rw.source.ImageWMS = Hx,Rw.source.OSM = qx,Rw.source.OSM.ATTRIBUTION = Xx,Rw.source.Raster = rw,Rw.source.Source = Yu,Rw.source.Stamen = aw,Rw.source.State = hs,Rw.source.Tile = rc,Rw.source.Tile.TileSourceEvent = ic,Rw.source.TileArcGISRest = hw,Rw.source.TileDebug = cw,Rw.source.TileEventType = Sx,Rw.source.TileImage = Rx,Rw.source.TileJSON = pw,Rw.source.TileWMS = fw,Rw.source.UTFGrid = mw,Rw.source.UTFGrid.CustomTile = gw,Rw.source.UrlTile = Ex,Rw.source.Vector = b_,Rw.source.Vector.VectorSourceEvent = w_,Rw.source.VectorEventType = x_,Rw.source.VectorTile = yw,Rw.source.WMSServerType = Yx,Rw.source.WMTS = bw,Rw.source.WMTS.optionsFromCapabilities = function (t, e) {
|
||
var i = et(t.Contents.Layer, function (t, i, r) {
|
||
return t.Identifier == e.layer
|
||
});
|
||
if (null === i) return null;
|
||
var r, o = t.Contents.TileMatrixSet;
|
||
(r = i.TileMatrixSetLink.length > 1 ? ot(i.TileMatrixSetLink, "projection" in e ? function (t, i, r) {
|
||
var n = et(o, function (e) {
|
||
return e.Identifier == t.TileMatrixSet
|
||
}).SupportedCRS, s = We(n.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/, "$1:$3")) || We(n),
|
||
a = We(e.projection);
|
||
return s && a ? Qe(s, a) : n == e.projection
|
||
} : function (t, i, r) {
|
||
return t.TileMatrixSet == e.matrixSet
|
||
}) : 0) < 0 && (r = 0);
|
||
var n = i.TileMatrixSetLink[r].TileMatrixSet, s = i.TileMatrixSetLink[r].TileMatrixSetLimits,
|
||
a = i.Format[0];
|
||
"format" in e && (a = e.format), (r = ot(i.Style, function (t, i, r) {
|
||
return "style" in e ? t.Title == e.style : t.isDefault
|
||
})) < 0 && (r = 0);
|
||
var l = i.Style[r].Identifier, h = {};
|
||
"Dimension" in i && i.Dimension.forEach(function (t, e, i) {
|
||
var r = t.Identifier, o = t.Default;
|
||
void 0 === o && (o = t.Value[0]), h[r] = o
|
||
});
|
||
var u, c = et(t.Contents.TileMatrixSet, function (t, e, i) {
|
||
return t.Identifier == n
|
||
}), p = c.SupportedCRS;
|
||
if (p && (u = We(p.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/, "$1:$3")) || We(p)), "projection" in e) {
|
||
var d = We(e.projection);
|
||
d && (u && !Qe(d, u) || (u = d))
|
||
}
|
||
var f, g, m = i.WGS84BoundingBox;
|
||
if (void 0 !== m) {
|
||
var y = We("EPSG:4326").getExtent();
|
||
g = m[0] == y[0] && m[2] == y[2], f = ri(m, "EPSG:4326", u);
|
||
var v = u.getExtent();
|
||
v && (dt(v, f) || (f = void 0))
|
||
}
|
||
var _ = ww(c, f, s), x = [], w = e.requestEncoding;
|
||
if (w = void 0 !== w ? w : "", "OperationsMetadata" in t && "GetTile" in t.OperationsMetadata) for (var b = t.OperationsMetadata.GetTile.DCP.HTTP.Get, C = 0, S = b.length; C < S; ++C) if (b[C].Constraint) {
|
||
var E = et(b[C].Constraint, function (t) {
|
||
return "GetEncoding" == t.name
|
||
}).AllowedValues.Value;
|
||
if ("" === w && (w = E[0]), w !== vw.KVP) break;
|
||
K(E, vw.KVP) && x.push(b[C].href)
|
||
} else b[C].href && (w = vw.KVP, x.push(b[C].href));
|
||
return 0 === x.length && (w = vw.REST, i.ResourceURL.forEach(function (t) {
|
||
"tile" === t.resourceType && (a = t.format, x.push(t.template))
|
||
})), {
|
||
urls: x,
|
||
layer: e.layer,
|
||
matrixSet: n,
|
||
format: a,
|
||
projection: u,
|
||
requestEncoding: w,
|
||
tileGrid: _,
|
||
style: l,
|
||
dimensions: h,
|
||
wrapX: g,
|
||
crossOrigin: e.crossOrigin
|
||
}
|
||
},Rw.source.WMTSRequestEncoding = vw,Rw.source.XYZ = Lx,Rw.source.Zoomify = Tw,Rw.source.Zoomify.CustomTile = Ew,Rw.source.common = {},Rw.source.common.DEFAULT_WMS_VERSION = Vx,Rw.sphere = {},Rw.sphere.DEFAULT_RADIUS = ue,Rw.sphere.getArea = fe,Rw.sphere.getDistance = ce,Rw.sphere.getLength = function t(e, i) {
|
||
var r = i || {}, o = r.radius || ue, n = r.projection || "EPSG:3857", s = e.getType();
|
||
s !== Zt.GEOMETRY_COLLECTION && (e = e.clone().transform(n, "EPSG:4326"));
|
||
var a, l, h, u, c, p, d = 0;
|
||
switch (s) {
|
||
case Zt.POINT:
|
||
case Zt.MULTI_POINT:
|
||
break;
|
||
case Zt.LINE_STRING:
|
||
case Zt.LINEAR_RING:
|
||
d = pe(a = e.getCoordinates(), o);
|
||
break;
|
||
case Zt.MULTI_LINE_STRING:
|
||
case Zt.POLYGON:
|
||
for (h = 0, u = (a = e.getCoordinates()).length; h < u; ++h) d += pe(a[h], o);
|
||
break;
|
||
case Zt.MULTI_POLYGON:
|
||
for (h = 0, u = (a = e.getCoordinates()).length; h < u; ++h) for (c = 0, p = (l = a[h]).length; c < p; ++c) d += pe(l[c], o);
|
||
break;
|
||
case Zt.GEOMETRY_COLLECTION:
|
||
var f = e.getGeometries();
|
||
for (h = 0, u = f.length; h < u; ++h) d += t(f[h], i);
|
||
break;
|
||
default:
|
||
throw new Error("Unsupported geometry type: " + s)
|
||
}
|
||
return d
|
||
},Rw.sphere.offset = ge,Rw.string = {},Rw.string.compareVersions = kr,Rw.string.padNumber = Ar,Rw.structs = {},Rw.structs.LRUCache = Ra,Rw.structs.LinkedList = Cu,Rw.structs.PriorityQueue = zn,Rw.structs.PriorityQueue.DROP = 1 / 0,Rw.structs.RBush = Eu,Rw.style = {},Rw.style.Atlas = Pu,Rw.style.AtlasManager = Iu,Rw.style.Circle = Zd,Rw.style.Fill = po,Rw.style.Icon = Xd,Rw.style.IconAnchorUnits = zd,Rw.style.IconImage = Vd,Rw.style.IconImage.get = Bd,Rw.style.IconImageCache = Ja,Rw.style.IconImageCache.shared = $a,Rw.style.IconOrigin = Yd,Rw.style.Image = Hd,Rw.style.RegularShape = qd,Rw.style.Stroke = go,Rw.style.Style = uf,Rw.style.Style.createDefaultStyle = Qd,Rw.style.Style.createEditingStyle = tf,Rw.style.Style.toFunction = Jd,Rw.style.Text = vo,Rw.style.TextPlacement = mo,Rw.tilecoord = {},Rw.tilecoord.createOrUpdate = ah,Rw.tilecoord.fromKey = uh,Rw.tilecoord.getKey = hh,Rw.tilecoord.getKeyZXY = lh,Rw.tilecoord.hash = ch,Rw.tilecoord.quadKey = ph,Rw.tilecoord.withinExtentAndZ = dh;
|
||
Rw.tilegrid = {}, Rw.tilegrid.TileGrid = Xu, Rw.tilegrid.WMTS = xw, Rw.tilegrid.WMTS.createFromCapabilitiesMatrixSet = ww, Rw.tilegrid.common = {}, Rw.tilegrid.common.DEFAULT_MAX_ZOOM = Bn, Rw.tilegrid.common.DEFAULT_TILE_SIZE = Vn, Rw.tilegrid.createForExtent = Ku, Rw.tilegrid.createForProjection = Qu, Rw.tilegrid.createXYZ = Ju, Rw.tilegrid.extentFromProjection = tc, Rw.tilegrid.getForProjection = qu, Rw.tilegrid.wrapX = Zu, Rw.tilegrid.resolutionsFromExtent = $u, Rw.tileurlfunction = {}, Rw.tileurlfunction.createFromTemplate = vx, Rw.tileurlfunction.createFromTemplates = _x, Rw.tileurlfunction.createFromTileUrlFunctions = xx, Rw.tileurlfunction.expandUrl = bx, Rw.tileurlfunction.nullTileUrlFunction = wx, Rw.transform = {}, Rw.transform.apply = ci, Rw.transform.compose = gi, Rw.transform.create = si, Rw.transform.determinant = yi, Rw.transform.invert = mi, Rw.transform.multiply = li, Rw.transform.reset = ai, Rw.transform.rotate = pi, Rw.transform.scale = di, Rw.transform.set = hi, Rw.transform.setFromArray = ui, Rw.transform.translate = fi, Rw.uri = {}, Rw.uri.appendParams = Gx, Rw.util = {}, Rw.util.VERSION = l, Rw.util.getUid = a, Rw.util.inherits = function (t, e) {
|
||
t.prototype = Object.create(e.prototype), t.prototype.constructor = t
|
||
}, Rw.vec = {}, Rw.vec.mat4 = {}, Rw.vec.mat4.create = Gh, Rw.vec.mat4.fromTransform = jh, Rw.webgl = {}, Rw.webgl.ARRAY_BUFFER = 34962, Rw.webgl.BLEND = 3042, Rw.webgl.Buffer = qh, Rw.webgl.CLAMP_TO_EDGE = 33071, Rw.webgl.COLOR_ATTACHMENT0 = 36064, Rw.webgl.COLOR_BUFFER_BIT = 16384, Rw.webgl.COMPILE_STATUS = 35713, Rw.webgl.CULL_FACE = 2884, Rw.webgl.Context = ru, Rw.webgl.Context.createEmptyTexture = eu, Rw.webgl.Context.createTexture = iu, Rw.webgl.ContextEventType = Qh, Rw.webgl.DEBUG = !0, Rw.webgl.DEPTH_TEST = 2929, Rw.webgl.DYNAMIC_DRAW = 35048, Rw.webgl.ELEMENT_ARRAY_BUFFER = 34963, Rw.webgl.FLOAT = 5126, Rw.webgl.FRAGMENT_SHADER = 35632, Rw.webgl.FRAMEBUFFER = 36160, Rw.webgl.Fragment = Ah, Rw.webgl.LINEAR = bh, Rw.webgl.LINK_STATUS = 35714, Rw.webgl.ONE = 1, Rw.webgl.ONE_MINUS_SRC_ALPHA = 771, Rw.webgl.RGBA = 6408, Rw.webgl.SCISSOR_TEST = 3089, Rw.webgl.SRC_ALPHA = 770, Rw.webgl.STATIC_DRAW = 35044, Rw.webgl.STENCIL_TEST = 2960, Rw.webgl.STREAM_DRAW = 35040, Rw.webgl.Shader = Mh, Rw.webgl.TEXTURE0 = 33984, Rw.webgl.TEXTURE_2D = Eh, Rw.webgl.TEXTURE_MAG_FILTER = 10240, Rw.webgl.TEXTURE_MIN_FILTER = 10241, Rw.webgl.TEXTURE_WRAP_S = Ch, Rw.webgl.TEXTURE_WRAP_T = Sh, Rw.webgl.TRIANGLES = 4, Rw.webgl.TRIANGLE_STRIP = 5, Rw.webgl.UNSIGNED_BYTE = 5121, Rw.webgl.UNSIGNED_INT = 5125, Rw.webgl.UNSIGNED_SHORT = 5123, Rw.webgl.VERTEX_SHADER = 35633, Rw.webgl.Vertex = kh, Rw.webgl.getContext = Rh, Rw.xml = {}, Rw.xml.DOCUMENT = qc, Rw.xml.OBJECT_PROPERTY_NODE_FACTORY = up, Rw.xml.XML_SCHEMA_INSTANCE_URI = Zc, Rw.xml.createElementNS = Kc, Rw.xml.getAllTextContent = Jc, Rw.xml.getAllTextContent_ = $c, Rw.xml.getAttributeNS = tp, Rw.xml.isDocument = Qc, Rw.xml.isNode = void 0, Rw.xml.makeArrayExtender = ip, Rw.xml.makeArrayPusher = rp,Rw.xml.makeArraySerializer = lp,Rw.xml.makeChildAppender = ap,Rw.xml.makeObjectPropertyPusher = np,Rw.xml.makeObjectPropertySetter = sp,Rw.xml.makeReplacer = op,Rw.xml.makeSequence = cp,Rw.xml.makeSimpleNodeFactory = hp,Rw.xml.makeStructureNS = pp,Rw.xml.parse = ep,Rw.xml.parseNode = dp,Rw.xml.pushParseAndPop = fp,Rw.xml.pushSerializeAndPop = mp,Rw.xml.serialize = gp;
|
||
const Pw = {};
|
||
|
||
function Lw(t, e, i) {
|
||
return t.on(e, i)
|
||
}
|
||
|
||
Pw.obj = function (t) {
|
||
return t
|
||
}, Pw.supportsImageRenderingPixelatedResult_ = void 0, Pw.imageRenderingValueResult_ = void 0, Pw.supportsImageRenderingPixelated = function () {
|
||
if (void 0 === Pw.supportsImageRenderingPixelatedResult_) {
|
||
const t = document.createElement("canvas");
|
||
t.setAttribute("style", "image-rendering: -moz-crisp-edges; image-rendering: pixelated;");
|
||
const e = t.style.imageRendering;
|
||
Pw.supportsImageRenderingPixelatedResult_ = !!e, Pw.supportsImageRenderingPixelatedResult_ && (Pw.imageRenderingValueResult_ = e)
|
||
}
|
||
return Pw.supportsImageRenderingPixelatedResult_
|
||
}, Pw.imageRenderingValue = function () {
|
||
return Pw.supportsImageRenderingPixelated(), Pw.imageRenderingValueResult_ || ""
|
||
}, Pw.getSourceProjection = function (t) {
|
||
return t.get("olcs.projection") || t.getProjection()
|
||
};
|
||
let Iw = 0;
|
||
|
||
function Ow(t) {
|
||
return t.olcs_uid || (t.olcs_uid = ++Iw)
|
||
}
|
||
|
||
function Mw(t) {
|
||
const e = Cesium.GroundPolylinePrimitive;
|
||
return e && e.isSupported(t)
|
||
}
|
||
|
||
var Aw = Pw;
|
||
|
||
class kw {
|
||
constructor(t, e, i) {
|
||
this.source_ = e, this.projection_ = null, this.fallbackProj_ = i || null, this.ready_ = !1, this.tilingScheme_ = null, this.rectangle_ = null, this.map_ = t;
|
||
const r = this.source_.get("olcs.proxy");
|
||
r && ("function" == typeof r ? this.proxy_ = {getURL: r} : "string" == typeof r && (this.proxy_ = new Cesium.DefaultProxy(r))), this.errorEvent_ = new Cesium.Event, this.emptyCanvas_ = document.createElement("canvas"), this.emptyCanvas_.width = 1, this.emptyCanvas_.height = 1, this.source_.on("change", t => {
|
||
this.handleSourceChanged_()
|
||
}), this.handleSourceChanged_()
|
||
}
|
||
|
||
handleSourceChanged_(t) {
|
||
if (!this.ready_ && "ready" == this.source_.getState()) {
|
||
if (this.projection_ = Aw.getSourceProjection(this.source_) || this.fallbackProj_, this.projection_ == We("EPSG:4326")) this.tilingScheme_ = new Cesium.GeographicTilingScheme; else {
|
||
if (this.projection_ != We("EPSG:3857")) return;
|
||
this.tilingScheme_ = new Cesium.WebMercatorTilingScheme
|
||
}
|
||
this.rectangle_ = this.tilingScheme_.rectangle, this.ready_ = !0
|
||
}
|
||
}
|
||
|
||
getTileCredits(t, e, i) {
|
||
const r = this.map_.getView().calculateExtent(this.map_.getSize()), o = this.map_.getView().getCenter(),
|
||
n = {
|
||
viewState: {
|
||
zoom: this.tilingScheme_ instanceof Cesium.GeographicTilingScheme ? i + 1 : i,
|
||
center: o
|
||
}, extent: r
|
||
}, s = this.source_.getAttributions();
|
||
if (!s) return [];
|
||
let a = s(n);
|
||
return Array.isArray(a) || (a = [a]), a.map(t => new Cesium.Credit(t, !0))
|
||
}
|
||
|
||
requestImage(t, e, i) {
|
||
const r = this.source_.getTileUrlFunction();
|
||
if (r && this.projection_) {
|
||
const o = this.tilingScheme_ instanceof Cesium.GeographicTilingScheme ? i + 1 : i, n = -e - 1;
|
||
let s = r.call(this.source_, [o, t, n], 1, this.projection_);
|
||
return this.proxy_ && (s = this.proxy_.getURL(s)), s ? Cesium.ImageryProvider.loadImage(this, s) : this.emptyCanvas_
|
||
}
|
||
return this.emptyCanvas_
|
||
}
|
||
}
|
||
|
||
Object.defineProperties(kw.prototype, {
|
||
ready: {
|
||
get: function () {
|
||
return this.ready_
|
||
}
|
||
}, rectangle: {
|
||
get: function () {
|
||
return this.rectangle_
|
||
}
|
||
}, tileWidth: {
|
||
get: function () {
|
||
const t = this.source_.getTileGrid();
|
||
return t ? Array.isArray(t.getTileSize(0)) ? t.getTileSize(0)[0] : t.getTileSize(0) : 256
|
||
}
|
||
}, tileHeight: {
|
||
get: function () {
|
||
const t = this.source_.getTileGrid();
|
||
return t ? Array.isArray(t.getTileSize(0)) ? t.getTileSize(0)[1] : t.getTileSize(0) : 256
|
||
}
|
||
}, maximumLevel: {
|
||
get: function () {
|
||
const t = this.source_.getTileGrid();
|
||
return t ? t.getMaxZoom() : 18
|
||
}
|
||
}, minimumLevel: {
|
||
get: function () {
|
||
return 0
|
||
}
|
||
}, tilingScheme: {
|
||
get: function () {
|
||
return this.tilingScheme_
|
||
}
|
||
}, tileDiscardPolicy: {
|
||
get: function () {
|
||
}
|
||
}, errorEvent: {
|
||
get: function () {
|
||
return this.errorEvent_
|
||
}
|
||
}, proxy: {
|
||
get: function () {
|
||
return this.proxy_
|
||
}
|
||
}, hasAlphaChannel: {
|
||
get: function () {
|
||
return !0
|
||
}
|
||
}, pickFeatures: {
|
||
get: function () {
|
||
}
|
||
}
|
||
});
|
||
var Fw = kw;
|
||
const Nw = {
|
||
computePixelSizeAtCoordinate: function (t, e) {
|
||
const i = t.camera, r = t.canvas, o = i.frustum,
|
||
n = Cesium.Cartesian3.magnitude(Cesium.Cartesian3.subtract(i.position, e, new Cesium.Cartesian3)),
|
||
s = new Cesium.Cartesian2;
|
||
return o.getPixelDimensions(r.clientWidth, r.clientHeight, n, s)
|
||
},
|
||
computeBoundingBoxAtTarget: function (t, e, i) {
|
||
const r = Nw.computePixelSizeAtCoordinate(t, e), o = Cesium.Transforms.eastNorthUpToFixedFrame(e),
|
||
n = Cesium.Matrix4.multiplyByPoint(o, new Cesium.Cartesian3(-r.x * i, -r.y * i, 0), new Cesium.Cartesian3),
|
||
s = Cesium.Matrix4.multiplyByPoint(o, new Cesium.Cartesian3(r.x * i, r.y * i, 0), new Cesium.Cartesian3);
|
||
return Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray([n, s])
|
||
},
|
||
applyHeightOffsetToGeometry: function (t, e) {
|
||
t.applyTransform((t, i, r) => {
|
||
if (console.assert(t === i), void 0 !== r && r >= 3) for (let t = 0; t < i.length; t += r) i[t + 2] = i[t + 2] + e;
|
||
return i
|
||
})
|
||
},
|
||
createMatrixAtCoordinates: function (t, e = 0, i = Cesium.Cartesian3.ZERO, r = new Cesium.Cartesian3(1, 1, 1)) {
|
||
const o = Nw.ol4326CoordinateToCesiumCartesian(t), n = Cesium.Transforms.eastNorthUpToFixedFrame(o),
|
||
s = Cesium.Quaternion.fromAxisAngle(Cesium.Cartesian3.UNIT_Z, -e),
|
||
a = Cesium.Matrix4.fromTranslationQuaternionRotationScale(i, s, r);
|
||
return Cesium.Matrix4.multiply(n, a, new Cesium.Matrix4)
|
||
},
|
||
rotateAroundAxis: function (t, e, i, r, o) {
|
||
const n = Cesium.Math.clamp, s = Cesium.defaultValue, a = o || {}, l = s(a.duration, 500),
|
||
h = s(a.easing, Oo), u = a.callback;
|
||
let c = 0;
|
||
const p = new Cesium.Matrix4, d = Date.now(), f = function () {
|
||
const o = Date.now(), s = h(n((o - d) / l, 0, 1));
|
||
console.assert(s >= c), t.transform.clone(p);
|
||
const a = (s - c) * e;
|
||
c = s, t.lookAtTransform(r), t.rotate(i, a), t.lookAtTransform(p), s < 1 ? window.requestAnimationFrame(f) : u && u()
|
||
};
|
||
window.requestAnimationFrame(f)
|
||
},
|
||
setHeadingUsingBottomCenter: function (t, e, i, r) {
|
||
const o = t.camera, n = Nw.computeAngleToZenith(t, i), s = o.right,
|
||
a = Cesium.Quaternion.fromAxisAngle(s, n), l = Cesium.Matrix3.fromQuaternion(a),
|
||
h = new Cesium.Cartesian3;
|
||
Cesium.Cartesian3.subtract(o.position, i, h);
|
||
const u = new Cesium.Cartesian3;
|
||
Cesium.Matrix3.multiplyByVector(l, h, u), Cesium.Cartesian3.add(u, i, u);
|
||
const c = Cesium.Matrix4.fromTranslation(u);
|
||
(0, Nw.rotateAroundAxis)(o, e, u, c, r)
|
||
},
|
||
pickOnTerrainOrEllipsoid: function (t, e) {
|
||
const i = t.camera.getPickRay(e);
|
||
return t.globe.pick(i, t) || t.camera.pickEllipsoid(e)
|
||
},
|
||
pickBottomPoint: function (t) {
|
||
const e = t.canvas, i = new Cesium.Cartesian2(e.clientWidth / 2, e.clientHeight);
|
||
return Nw.pickOnTerrainOrEllipsoid(t, i)
|
||
},
|
||
pickCenterPoint: function (t) {
|
||
const e = t.canvas, i = new Cesium.Cartesian2(e.clientWidth / 2, e.clientHeight / 2);
|
||
return Nw.pickOnTerrainOrEllipsoid(t, i)
|
||
},
|
||
computeSignedTiltAngleOnGlobe: function (t) {
|
||
const e = t.camera, i = new Cesium.Ray(e.position, e.direction);
|
||
let r = t.globe.pick(i, t);
|
||
if (!r) {
|
||
const t = Cesium.Ellipsoid.WGS84, e = Cesium.IntersectionTests.rayEllipsoid(i, t);
|
||
e && (r = Cesium.Ray.getPoint(i, e.start))
|
||
}
|
||
if (!r) return;
|
||
const o = new Cesium.Cartesian3;
|
||
Cesium.Ellipsoid.WGS84.geocentricSurfaceNormal(r, o);
|
||
const n = (0, Nw.signedAngleBetween)(e.direction, o, e.right) - Math.PI;
|
||
return Cesium.Math.convertLongitudeRange(n)
|
||
},
|
||
bottomFovRay: function (t) {
|
||
const e = t.camera, i = e.frustum.fovy / 2, r = e.direction,
|
||
o = Cesium.Quaternion.fromAxisAngle(e.right, i), n = Cesium.Matrix3.fromQuaternion(o),
|
||
s = new Cesium.Cartesian3;
|
||
return Cesium.Matrix3.multiplyByVector(n, r, s), new Cesium.Ray(e.position, s)
|
||
},
|
||
signedAngleBetween: function (t, e, i) {
|
||
const r = new Cesium.Cartesian3, o = new Cesium.Cartesian3, n = new Cesium.Cartesian3;
|
||
Cesium.Cartesian3.normalize(t, r), Cesium.Cartesian3.normalize(e, o), Cesium.Cartesian3.cross(r, o, n);
|
||
const s = Cesium.Cartesian3.dot(r, o), a = Cesium.Cartesian3.magnitude(n),
|
||
l = Cesium.Cartesian3.dot(i, n), h = Math.atan2(a, s);
|
||
return l >= 0 ? h : -h
|
||
},
|
||
computeAngleToZenith: function (t, e) {
|
||
const i = t.camera, r = i.frustum.fovy / 2, o = Nw.bottomFovRay(t),
|
||
n = Cesium.Cartesian3.clone(o.direction);
|
||
Cesium.Cartesian3.negate(n, n);
|
||
const s = new Cesium.Cartesian3;
|
||
Cesium.Ellipsoid.WGS84.geocentricSurfaceNormal(e, s);
|
||
const a = new Cesium.Cartesian3;
|
||
return Cesium.Cartesian3.negate(i.right, a), Nw.signedAngleBetween(s, n, a) + r
|
||
},
|
||
extentToRectangle: function (t, e) {
|
||
if (t && e) {
|
||
const i = ri(t, e, "EPSG:4326");
|
||
return Cesium.Rectangle.fromDegrees(i[0], i[1], i[2], i[3])
|
||
}
|
||
return null
|
||
},
|
||
tileLayerToImageryLayer: function (t, e, i) {
|
||
if (!(e instanceof lx || e instanceof nx)) return null;
|
||
let r = null, o = e.getSource();
|
||
if (o instanceof Hx && o.getUrl() && o.getImageLoadFunction() === Nx) {
|
||
const t = {
|
||
"olcs.proxy": o.get("olcs.proxy"),
|
||
"olcs.extent": o.get("olcs.extent"),
|
||
"olcs.projection": o.get("olcs.projection"),
|
||
"olcs.imagesource": o
|
||
};
|
||
(o = new fw({
|
||
url: o.getUrl(),
|
||
attributions: o.getAttributions(),
|
||
projection: o.getProjection(),
|
||
params: o.getParams()
|
||
})).setProperties(t)
|
||
}
|
||
if (o instanceof Rx) {
|
||
let e = Aw.getSourceProjection(o);
|
||
if (e || (e = i), !Nw.isCesiumProjection(e)) return null;
|
||
r = new Fw(t, o, i)
|
||
} else {
|
||
if (!(o instanceof Bx)) return null;
|
||
{
|
||
let t = Aw.getSourceProjection(o);
|
||
if (t || (t = i), !Nw.isCesiumProjection(t)) return null;
|
||
r = new Cesium.SingleTileImageryProvider({
|
||
url: o.getUrl(),
|
||
rectangle: new Cesium.Rectangle.fromDegrees(o.getImageExtent()[0], o.getImageExtent()[1], o.getImageExtent()[2], o.getImageExtent()[3])
|
||
})
|
||
}
|
||
}
|
||
const n = {}, s = e.get("olcs.extent") || e.getExtent();
|
||
return s && (n.rectangle = Nw.extentToRectangle(s, i)), new Cesium.ImageryLayer(r, n)
|
||
},
|
||
updateCesiumLayerProperties: function (t, e) {
|
||
let i = 1, r = !0;
|
||
[t.layer].concat(t.parents).forEach(t => {
|
||
const e = t.getOpacity();
|
||
void 0 !== e && (i *= e);
|
||
const o = t.getVisible();
|
||
void 0 !== o && (r &= o)
|
||
}), e.alpha = i, e.show = r
|
||
},
|
||
ol4326CoordinateToCesiumCartesian: function (t) {
|
||
const e = t;
|
||
return e.length > 2 ? Cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]) : Cesium.Cartesian3.fromDegrees(e[0], e[1])
|
||
},
|
||
ol4326CoordinateArrayToCsCartesians: function (t) {
|
||
console.assert(null !== t);
|
||
const e = Nw.ol4326CoordinateToCesiumCartesian, i = [];
|
||
for (let r = 0; r < t.length; ++r) i.push(e(t[r]));
|
||
return i
|
||
},
|
||
olGeometryCloneTo4326: function (t, e) {
|
||
console.assert(e);
|
||
const i = We("EPSG:4326"), r = We(e);
|
||
if (r !== i) {
|
||
const e = t.getProperties();
|
||
(t = t.clone()).transform(r, i), t.setProperties(e)
|
||
}
|
||
return t
|
||
},
|
||
convertColorToCesium: function (t) {
|
||
if (t = t || "black", Array.isArray(t)) return new Cesium.Color(Cesium.Color.byteToFloat(t[0]), Cesium.Color.byteToFloat(t[1]), Cesium.Color.byteToFloat(t[2]), t[3]);
|
||
if ("string" == typeof t) return Cesium.Color.fromCssColorString(t);
|
||
if (t instanceof CanvasPattern || t instanceof CanvasGradient) {
|
||
const e = document.createElement("canvas"), i = e.getContext("2d");
|
||
return e.width = e.height = 256, i.fillStyle = t, i.fillRect(0, 0, e.width, e.height), new Cesium.ImageMaterialProperty({image: e})
|
||
}
|
||
console.assert(!1, "impossible")
|
||
},
|
||
convertUrlToCesium: function (t) {
|
||
let e = "";
|
||
const i = /\{(\d|[a-z])-(\d|[a-z])\}/, r = i.exec(t);
|
||
if (r) {
|
||
t = t.replace(i, "{s}");
|
||
const o = r[1].charCodeAt(0), n = r[2].charCodeAt(0);
|
||
let s;
|
||
for (s = o; s <= n; ++s) e += String.fromCharCode(s)
|
||
}
|
||
return {url: t, subdomains: e}
|
||
},
|
||
resetToNorthZenith: function (t, e) {
|
||
return new Promise((i, r) => {
|
||
const o = e.camera, n = Nw.pickBottomPoint(e);
|
||
if (!n) return void r("Could not get bottom pivot");
|
||
const s = t.getView().getRotation();
|
||
if (void 0 === s) return void r("The view is not initialized");
|
||
const a = Nw.computeAngleToZenith(e, n);
|
||
Nw.setHeadingUsingBottomCenter(e, s, n);
|
||
const l = Cesium.Matrix4.fromTranslation(n), h = o.right, u = {
|
||
callback: () => {
|
||
const e = t.getView();
|
||
Nw.normalizeView(e), i()
|
||
}
|
||
};
|
||
Nw.rotateAroundAxis(o, -a, h, l, u)
|
||
})
|
||
},
|
||
rotateAroundBottomCenter: function (t, e) {
|
||
return new Promise((i, r) => {
|
||
const o = t.camera, n = Nw.pickBottomPoint(t);
|
||
if (!n) return void r("could not get bottom pivot");
|
||
const s = {callback: i}, a = Cesium.Matrix4.fromTranslation(n), l = o.right;
|
||
(0, Nw.rotateAroundAxis)(o, -e, l, a, s)
|
||
})
|
||
},
|
||
normalizeView: function (t, e = 0) {
|
||
const i = t.getResolution();
|
||
t.setRotation(e), t.setResolution(t.constrainResolution(i))
|
||
},
|
||
isCesiumProjection: function (t) {
|
||
const e = t === We("EPSG:3857"), i = t === We("EPSG:4326");
|
||
return e || i
|
||
}
|
||
};
|
||
var Dw = Nw;
|
||
var Gw = class {
|
||
constructor(t) {
|
||
this.ol3d = t, this.scene_ = t.getCesiumScene(), this.canvas_ = this.scene_.canvas, this._boundNotifyRepaintRequired = this.notifyRepaintRequired.bind(this), this.repaintEventNames_ = ["mousemove", "mousedown", "mouseup", "touchstart", "touchend", "touchmove", "pointerdown", "pointerup", "pointermove", "wheel"], this.enable()
|
||
}
|
||
|
||
enable() {
|
||
this.scene_.requestRenderMode = !0, this.scene_.maximumRenderTimeChange = 1e3;
|
||
for (const t of this.repaintEventNames_) this.canvas_.addEventListener(t, this._boundNotifyRepaintRequired, !1);
|
||
window.addEventListener("resize", this._boundNotifyRepaintRequired, !1), this.ol3d.getOlMap().getLayerGroup().on("change", this._boundNotifyRepaintRequired)
|
||
}
|
||
|
||
disable() {
|
||
for (const t of this.repaintEventNames_) this.canvas_.removeEventListener(t, this._boundNotifyRepaintRequired, !1);
|
||
window.removeEventListener("resize", this._boundNotifyRepaintRequired, !1), this.ol3d.getOlMap().getLayerGroup().un("change", this._boundNotifyRepaintRequired), this.scene_.requestRenderMode = !1
|
||
}
|
||
|
||
restartRenderLoop() {
|
||
this.notifyRepaintRequired()
|
||
}
|
||
|
||
notifyRepaintRequired() {
|
||
this.scene_.requestRender()
|
||
}
|
||
};
|
||
|
||
function jw(t) {
|
||
return 180 * t / Math.PI
|
||
}
|
||
|
||
function zw(t) {
|
||
return t * Math.PI / 180
|
||
}
|
||
|
||
class Uw {
|
||
constructor(t, e) {
|
||
this.scene_ = t, this.cam_ = t.camera, this.map_ = e, this.view_ = null, this.viewListenKey_ = null, this.toLonLat_ = Uw.identityProjection, this.fromLonLat_ = Uw.identityProjection, this.tilt_ = 0, this.distance_ = 0, this.lastCameraViewMatrix_ = null, this.viewUpdateInProgress_ = !1, this.map_.on("change:view", t => {
|
||
this.setView_(this.map_.getView())
|
||
}), this.setView_(this.map_.getView())
|
||
}
|
||
|
||
static identityProjection(t, e, i) {
|
||
const r = i || t.length;
|
||
if (e) for (let i = 0; i < r; ++i) e[i] = t[i];
|
||
return t
|
||
}
|
||
|
||
setView_(t) {
|
||
if (this.view_ && (N(this.viewListenKey_), this.viewListenKey_ = null), this.view_ = t, t) {
|
||
const e = ei(t.getProjection(), "EPSG:4326"), i = ei("EPSG:4326", t.getProjection());
|
||
console.assert(e && i), this.toLonLat_ = e, this.fromLonLat_ = i, this.viewListenKey_ = t.on("propertychange", t => this.handleViewEvent_(t)), this.readFromView()
|
||
} else this.toLonLat_ = Uw.identityProjection, this.fromLonLat_ = Uw.identityProjection
|
||
}
|
||
|
||
handleViewEvent_(t) {
|
||
this.viewUpdateInProgress_ || this.readFromView()
|
||
}
|
||
|
||
setHeading(t) {
|
||
this.view_ && this.view_.setRotation(t)
|
||
}
|
||
|
||
getHeading() {
|
||
if (!this.view_) return;
|
||
return this.view_.getRotation() || 0
|
||
}
|
||
|
||
setTilt(t) {
|
||
this.tilt_ = t, this.updateCamera_()
|
||
}
|
||
|
||
getTilt() {
|
||
return this.tilt_
|
||
}
|
||
|
||
setDistance(t) {
|
||
this.distance_ = t, this.updateCamera_(), this.updateView()
|
||
}
|
||
|
||
getDistance() {
|
||
return this.distance_
|
||
}
|
||
|
||
setCenter(t) {
|
||
this.view_ && this.view_.setCenter(t)
|
||
}
|
||
|
||
getCenter() {
|
||
if (this.view_) return this.view_.getCenter()
|
||
}
|
||
|
||
setPosition(t) {
|
||
if (!this.toLonLat_) return;
|
||
const e = this.toLonLat_(t);
|
||
console.assert(e);
|
||
const i = new Cesium.Cartographic(zw(e[0]), zw(e[1]), this.getAltitude());
|
||
this.cam_.setView({destination: Cesium.Ellipsoid.WGS84.cartographicToCartesian(i)}), this.updateView()
|
||
}
|
||
|
||
getPosition() {
|
||
if (!this.fromLonLat_) return;
|
||
const t = Cesium.Ellipsoid.WGS84.cartesianToCartographic(this.cam_.position),
|
||
e = this.fromLonLat_([jw(t.longitude), jw(t.latitude)]);
|
||
return console.assert(e), e
|
||
}
|
||
|
||
setAltitude(t) {
|
||
const e = Cesium.Ellipsoid.WGS84.cartesianToCartographic(this.cam_.position);
|
||
e.height = t, this.cam_.position = Cesium.Ellipsoid.WGS84.cartographicToCartesian(e), this.updateView()
|
||
}
|
||
|
||
getAltitude() {
|
||
return Cesium.Ellipsoid.WGS84.cartesianToCartographic(this.cam_.position).height
|
||
}
|
||
|
||
updateCamera_() {
|
||
if (!this.view_ || !this.toLonLat_) return;
|
||
const t = this.view_.getCenter();
|
||
if (!t) return;
|
||
const e = this.toLonLat_(t);
|
||
console.assert(e);
|
||
const i = new Cesium.Cartographic(zw(e[0]), zw(e[1]));
|
||
if (this.scene_.globe) {
|
||
const t = this.scene_.globe.getHeight(i);
|
||
i.height = t || 0
|
||
}
|
||
const r = Cesium.Ellipsoid.WGS84.cartographicToCartesian(i),
|
||
o = {pitch: this.tilt_ - Cesium.Math.PI_OVER_TWO, heading: -this.view_.getRotation(), roll: void 0};
|
||
this.cam_.setView({
|
||
destination: r,
|
||
orientation: o
|
||
}), this.cam_.moveBackward(this.distance_), this.checkCameraChange(!0)
|
||
}
|
||
|
||
readFromView() {
|
||
if (!this.view_ || !this.toLonLat_) return;
|
||
const t = this.view_.getCenter();
|
||
if (null == t) return;
|
||
const e = this.toLonLat_(t);
|
||
console.assert(e);
|
||
const i = this.view_.getResolution();
|
||
this.distance_ = this.calcDistanceForResolution(i || 0, zw(e[1])), this.updateCamera_()
|
||
}
|
||
|
||
updateView() {
|
||
if (!this.view_ || !this.fromLonLat_) return;
|
||
this.viewUpdateInProgress_ = !0;
|
||
const t = Cesium.Ellipsoid.WGS84, e = this.scene_, i = Dw.pickCenterPoint(e);
|
||
let r = i;
|
||
if (!r) {
|
||
const t = e.globe, i = this.cam_.positionCartographic.clone(), o = t.getHeight(i);
|
||
i.height = o || 0, r = Cesium.Ellipsoid.WGS84.cartographicToCartesian(i)
|
||
}
|
||
this.distance_ = Cesium.Cartesian3.distance(r, this.cam_.position);
|
||
const o = t.cartesianToCartographic(r);
|
||
if (this.view_.setCenter(this.fromLonLat_([jw(o.longitude), jw(o.latitude)])), this.view_.setResolution(this.calcResolutionForDistance(this.distance_, o ? o.latitude : 0)), i) {
|
||
const e = this.cam_.position, r = new Cesium.Cartesian3;
|
||
t.geocentricSurfaceNormal(i, r);
|
||
const o = new Cesium.Cartesian3;
|
||
Cesium.Cartesian3.subtract(e, i, o), Cesium.Cartesian3.normalize(o, o);
|
||
const n = this.cam_.up, s = this.cam_.right, a = new Cesium.Cartesian3(-i.y, i.x, 0),
|
||
l = Cesium.Cartesian3.angleBetween(s, a),
|
||
h = Cesium.Cartesian3.cross(i, n, new Cesium.Cartesian3).z;
|
||
this.view_.setRotation(h < 0 ? l : -l);
|
||
const u = Math.acos(Cesium.Cartesian3.dot(r, o));
|
||
this.tilt_ = isNaN(u) ? 0 : u
|
||
} else this.view_.setRotation(this.cam_.heading), this.tilt_ = -this.cam_.pitch + Math.PI / 2;
|
||
this.viewUpdateInProgress_ = !1
|
||
}
|
||
|
||
checkCameraChange(t) {
|
||
const e = this.lastCameraViewMatrix_, i = this.cam_.viewMatrix;
|
||
e && Cesium.Matrix4.equalsEpsilon(e, i, 1e-5) || (this.lastCameraViewMatrix_ = i.clone(), !0 !== t && this.updateView())
|
||
}
|
||
|
||
calcDistanceForResolution(t, e) {
|
||
const i = this.scene_.canvas, r = this.cam_.frustum.fovy;
|
||
console.assert(!isNaN(r));
|
||
const o = this.view_.getProjection().getMetersPerUnit();
|
||
return t * i.clientHeight * o * Math.cos(Math.abs(e)) / 2 / Math.tan(r / 2)
|
||
}
|
||
|
||
calcResolutionForDistance(t, e) {
|
||
const i = this.scene_.canvas, r = this.cam_.frustum.fovy,
|
||
o = this.view_.getProjection().getMetersPerUnit();
|
||
return 2 * t * Math.tan(r / 2) / o / Math.cos(Math.abs(e)) / i.clientHeight
|
||
}
|
||
}
|
||
|
||
var Bw = Uw;
|
||
var Vw = class {
|
||
constructor(t, e) {
|
||
this.map = t, this.view = t.getView(), this.scene = e, this.olLayers = t.getLayerGroup().getLayers(), this.mapLayerGroup = t.getLayerGroup(), this.layerMap = {}, this.olLayerListenKeys = {}, this.olGroupListenKeys_ = {}
|
||
}
|
||
|
||
synchronize() {
|
||
this.destroyAll(), this.addLayers_(this.mapLayerGroup)
|
||
}
|
||
|
||
orderLayers() {
|
||
}
|
||
|
||
addLayers_(t) {
|
||
const e = [{layer: t, parents: []}];
|
||
for (; e.length > 0;) {
|
||
const t = e.splice(0, 1)[0], i = t.layer, r = Ow(i).toString();
|
||
this.olLayerListenKeys[r] = [], console.assert(!this.layerMap[r]);
|
||
let o = null;
|
||
if (i instanceof cs) this.listenForGroupChanges_(i), i !== this.mapLayerGroup && (o = this.createSingleLayerCounterparts(t)), o || i.getLayers().forEach(r => {
|
||
if (r) {
|
||
const o = {layer: r, parents: i === this.mapLayerGroup ? [] : [t.layer].concat(t.parents)};
|
||
e.push(o)
|
||
}
|
||
}); else if (!(o = this.createSingleLayerCounterparts(t))) {
|
||
const e = r, i = t, o = t => {
|
||
const r = this.createSingleLayerCounterparts(i);
|
||
r && (i.layer.un("change", o), this.addCesiumObjects_(r, e, i.layer), this.orderLayers())
|
||
};
|
||
this.olLayerListenKeys[r].push(Lw(i.layer, "change", o))
|
||
}
|
||
o && this.addCesiumObjects_(o, r, i)
|
||
}
|
||
this.orderLayers()
|
||
}
|
||
|
||
addCesiumObjects_(t, e, i) {
|
||
this.layerMap[e] = t, this.olLayerListenKeys[e].push(Lw(i, "change:zIndex", () => this.orderLayers())), t.forEach(t => {
|
||
this.addCesiumObject(t)
|
||
})
|
||
}
|
||
|
||
removeAndDestroySingleLayer_(t) {
|
||
const e = Ow(t).toString(), i = this.layerMap[e];
|
||
return i && (i.forEach(t => {
|
||
this.removeSingleCesiumObject(t, !1), this.destroyCesiumObject(t)
|
||
}), this.olLayerListenKeys[e].forEach(N), delete this.olLayerListenKeys[e]), delete this.layerMap[e], !!i
|
||
}
|
||
|
||
unlistenSingleGroup_(t) {
|
||
if (t === this.mapLayerGroup) return;
|
||
const e = Ow(t).toString();
|
||
this.olGroupListenKeys_[e].forEach(t => {
|
||
N(t)
|
||
}), delete this.olGroupListenKeys_[e], delete this.layerMap[e]
|
||
}
|
||
|
||
removeLayer_(t) {
|
||
if (t) {
|
||
const e = [t];
|
||
for (; e.length > 0;) {
|
||
const t = e.splice(0, 1)[0], i = this.removeAndDestroySingleLayer_(t);
|
||
t instanceof cs && (this.unlistenSingleGroup_(t), i || t.getLayers().forEach(t => {
|
||
e.push(t)
|
||
}))
|
||
}
|
||
}
|
||
}
|
||
|
||
listenForGroupChanges_(t) {
|
||
const e = Ow(t).toString();
|
||
console.assert(void 0 === this.olGroupListenKeys_[e]);
|
||
const i = [];
|
||
this.olGroupListenKeys_[e] = i;
|
||
let r = [];
|
||
const o = function () {
|
||
const e = t.getLayers();
|
||
e && (r = [e.on("add", t => {
|
||
this.addLayers_(t.element)
|
||
}), e.on("remove", t => {
|
||
this.removeLayer_(t.element)
|
||
})], i.push(...r))
|
||
}.bind(this);
|
||
o(), i.push(t.on("change:layers", t => {
|
||
r.forEach(t => {
|
||
const e = i.indexOf(t);
|
||
e >= 0 && i.splice(e, 1), N(t)
|
||
}), o()
|
||
}))
|
||
}
|
||
|
||
destroyAll() {
|
||
let t;
|
||
for (t in this.removeAllCesiumObjects(!0), this.olGroupListenKeys_) this.olGroupListenKeys_[t].forEach(N);
|
||
for (t in this.olLayerListenKeys) this.olLayerListenKeys[t].forEach(N);
|
||
this.olGroupListenKeys_ = {}, this.olLayerListenKeys = {}, this.layerMap = {}
|
||
}
|
||
|
||
addCesiumObject(t) {
|
||
}
|
||
|
||
destroyCesiumObject(t) {
|
||
}
|
||
|
||
removeSingleCesiumObject(t, e) {
|
||
}
|
||
|
||
removeAllCesiumObjects(t) {
|
||
}
|
||
|
||
createSingleLayerCounterparts(t) {
|
||
}
|
||
};
|
||
var Yw = class extends Vw {
|
||
constructor(t, e) {
|
||
super(t, e), this.cesiumLayers_ = e.imageryLayers, this.ourLayers_ = new Cesium.ImageryLayerCollection
|
||
}
|
||
|
||
addCesiumObject(t) {
|
||
this.cesiumLayers_.add(t), this.ourLayers_.add(t)
|
||
}
|
||
|
||
destroyCesiumObject(t) {
|
||
t.destroy()
|
||
}
|
||
|
||
removeSingleCesiumObject(t, e) {
|
||
this.cesiumLayers_.remove(t, e), this.ourLayers_.remove(t, !1)
|
||
}
|
||
|
||
removeAllCesiumObjects(t) {
|
||
for (let e = 0; e < this.ourLayers_.length; ++e) this.cesiumLayers_.remove(this.ourLayers_.get(e), t);
|
||
this.ourLayers_.removeAll(!1)
|
||
}
|
||
|
||
convertLayerToCesiumImageries(t, e) {
|
||
const i = Dw.tileLayerToImageryLayer(this.map, t, e);
|
||
return i ? [i] : null
|
||
}
|
||
|
||
createSingleLayerCounterparts(t) {
|
||
const e = t.layer, i = Ow(e).toString(), r = this.view.getProjection();
|
||
console.assert(r);
|
||
const o = this.convertLayerToCesiumImageries(e, r);
|
||
if (o) {
|
||
const r = [];
|
||
[t.layer].concat(t.parents).forEach(e => {
|
||
r.push(e.on(["change:opacity", "change:visible"], () => {
|
||
console.assert(o);
|
||
for (let e = 0; e < o.length; ++e) Dw.updateCesiumLayerProperties(t, o[e])
|
||
}))
|
||
});
|
||
for (let e = 0; e < o.length; ++e) Dw.updateCesiumLayerProperties(t, o[e]);
|
||
r.push(e.on("change:extent", t => {
|
||
for (let t = 0; t < o.length; ++t) this.cesiumLayers_.remove(o[t], !0), this.ourLayers_.remove(o[t], !1);
|
||
delete this.layerMap[Ow(e)], this.synchronize()
|
||
})), r.push(e.on("change", t => {
|
||
for (let t = 0; t < o.length; ++t) {
|
||
const e = this.cesiumLayers_.indexOf(o[t]);
|
||
e >= 0 && (this.cesiumLayers_.remove(o[t], !1), this.cesiumLayers_.add(o[t], e))
|
||
}
|
||
})), this.olLayerListenKeys[i].push(...r)
|
||
}
|
||
return Array.isArray(o) ? o : null
|
||
}
|
||
|
||
orderLayers() {
|
||
const t = [], e = {}, i = [this.mapLayerGroup];
|
||
for (; i.length > 0;) {
|
||
const r = i.splice(0, 1)[0];
|
||
if (t.push(r), e[Ow(r)] = r.getZIndex(), r instanceof cs) {
|
||
const t = r.getLayers();
|
||
t && i.unshift(...t.getArray())
|
||
}
|
||
}
|
||
!function (t, e) {
|
||
const i = t.length, r = Array(t.length);
|
||
for (let e = 0; e < i; e++) r[e] = {index: e, value: t[e]};
|
||
r.sort((t, i) => e(t.value, i.value) || t.index - i.index);
|
||
for (let e = 0; e < t.length; e++) t[e] = r[e].value
|
||
}(t, (t, i) => e[Ow(t)] - e[Ow(i)]), t.forEach(t => {
|
||
const e = Ow(t).toString(), i = this.layerMap[e];
|
||
i && i.forEach(t => {
|
||
this.raiseToTop(t)
|
||
})
|
||
})
|
||
}
|
||
|
||
raiseToTop(t) {
|
||
this.cesiumLayers_.raiseToTop(t)
|
||
}
|
||
};
|
||
var Ww = class {
|
||
constructor(t, e) {
|
||
const i = new Cesium.BillboardCollection({scene: e}), r = new Cesium.PrimitiveCollection;
|
||
this.olListenKeys = [], this.rootCollection_ = new Cesium.PrimitiveCollection, this.context = {
|
||
projection: t,
|
||
billboards: i,
|
||
featureToCesiumMap: {},
|
||
primitives: r
|
||
}, this.rootCollection_.add(i), this.rootCollection_.add(r)
|
||
}
|
||
|
||
destroy() {
|
||
this.olListenKeys.forEach(N), this.olListenKeys.length = 0
|
||
}
|
||
|
||
getRootPrimitive() {
|
||
return this.rootCollection_
|
||
}
|
||
};
|
||
var Hw = class {
|
||
constructor(t) {
|
||
this.scene = t, this.boundOnRemoveOrClearFeatureListener_ = this.onRemoveOrClearFeature_.bind(this), this.defaultBillboardEyeOffset_ = new Cesium.Cartesian3(0, 0, 10)
|
||
}
|
||
|
||
onRemoveOrClearFeature_(t) {
|
||
const e = t.target;
|
||
console.assert(e instanceof b_);
|
||
const i = Aw.obj(e).olcs_cancellers;
|
||
if (i) {
|
||
const r = t.feature;
|
||
if (r) {
|
||
const t = Ow(r), e = i[t];
|
||
e && (e(), delete i[t])
|
||
} else {
|
||
for (const t in i) i.hasOwnProperty(t) && i[t]();
|
||
Aw.obj(e).olcs_cancellers = {}
|
||
}
|
||
}
|
||
}
|
||
|
||
setReferenceForPicking(t, e, i) {
|
||
i.olLayer = t, i.olFeature = e
|
||
}
|
||
|
||
createColoredPrimitive(t, e, i, r, o, n) {
|
||
const s = {flat: !0, renderState: {depthTest: {enabled: !0}}};
|
||
void 0 !== n && (s.renderState || (s.renderState = {}), s.renderState.lineWidth = n);
|
||
const a = function (t, e) {
|
||
const i = new Cesium.GeometryInstance({geometry: t});
|
||
return !e || e instanceof Cesium.ImageMaterialProperty || (i.attributes = {color: Cesium.ColorGeometryInstanceAttribute.fromColor(e)}), i
|
||
}(r, o);
|
||
let l;
|
||
if (this.getHeightReference(t, e, i) === Cesium.HeightReference.CLAMP_TO_GROUND) {
|
||
const t = a.geometry.constructor;
|
||
if (t && !t.createShadowVolume) return null;
|
||
l = new Cesium.GroundPrimitive({geometryInstances: a})
|
||
} else l = new Cesium.Primitive({geometryInstances: a});
|
||
if (o instanceof Cesium.ImageMaterialProperty) {
|
||
const t = o.image.getValue().toDataURL();
|
||
l.appearance = new Cesium.MaterialAppearance({
|
||
flat: !0,
|
||
renderState: {depthTest: {enabled: !0}},
|
||
material: new Cesium.Material({fabric: {type: "Image", uniforms: {image: t}}})
|
||
})
|
||
} else l.appearance = new Cesium.PerInstanceColorAppearance(s);
|
||
return this.setReferenceForPicking(t, e, l), l
|
||
}
|
||
|
||
extractColorFromOlStyle(t, e) {
|
||
const i = t.getFill() ? t.getFill().getColor() : null,
|
||
r = t.getStroke() ? t.getStroke().getColor() : null;
|
||
let o = "black";
|
||
return r && e ? o = r : i && (o = i), Dw.convertColorToCesium(o)
|
||
}
|
||
|
||
extractLineWidthFromOlStyle(t) {
|
||
const e = t.getStroke() ? t.getStroke().getWidth() : void 0;
|
||
return void 0 !== e ? e : 1
|
||
}
|
||
|
||
wrapFillAndOutlineGeometries(t, e, i, r, o, n) {
|
||
const s = this.extractColorFromOlStyle(n, !1), a = this.extractColorFromOlStyle(n, !0),
|
||
l = new Cesium.PrimitiveCollection;
|
||
if (n.getFill()) {
|
||
const o = this.createColoredPrimitive(t, e, i, r, s);
|
||
console.assert(!!o), l.add(o)
|
||
}
|
||
if (n.getStroke() && o) {
|
||
const r = this.extractLineWidthFromOlStyle(n), s = this.createColoredPrimitive(t, e, i, o, a, r);
|
||
s && l.add(s)
|
||
}
|
||
return l
|
||
}
|
||
|
||
addTextStyle(t, e, i, r, o) {
|
||
let n;
|
||
if (o instanceof Cesium.PrimitiveCollection ? n = o : (n = new Cesium.PrimitiveCollection).add(o), !r.getText()) return n;
|
||
const s = r.getText(), a = this.olGeometry4326TextPartToCesium(t, e, i, s);
|
||
return a && n.add(a), n
|
||
}
|
||
|
||
csAddBillboard(t, e, i, r, o, n) {
|
||
e.eyeOffset || (e.eyeOffset = this.defaultBillboardEyeOffset_);
|
||
const s = t.add(e);
|
||
return this.setReferenceForPicking(i, r, s), s
|
||
}
|
||
|
||
olCircleGeometryToCesium(t, e, i, r, o) {
|
||
i = Dw.olGeometryCloneTo4326(i, r), console.assert("Circle" == i.getType());
|
||
let n = i.getCenter();
|
||
const s = 3 == n.length ? n[2] : 0;
|
||
let a = n.slice();
|
||
a[0] += i.getRadius(), n = Dw.ol4326CoordinateToCesiumCartesian(n), a = Dw.ol4326CoordinateToCesiumCartesian(a);
|
||
const l = Cesium.Cartesian3.distance(n, a),
|
||
h = new Cesium.CircleGeometry({center: n, radius: l, height: s});
|
||
let u, c;
|
||
if (this.getHeightReference(t, e, i) === Cesium.HeightReference.CLAMP_TO_GROUND) {
|
||
const r = this.extractLineWidthFromOlStyle(o);
|
||
if (r) {
|
||
const n = gr(i.getCenter(), l),
|
||
s = Dw.ol4326CoordinateArrayToCsCartesians(n.getLinearRing(0).getCoordinates());
|
||
if (Mw(this.scene)) (u = new Cesium.GroundPolylinePrimitive({
|
||
geometryInstances: new Cesium.GeometryInstance({
|
||
geometry: new Cesium.GroundPolylineGeometry({
|
||
positions: s,
|
||
width: r
|
||
})
|
||
}),
|
||
appearance: new Cesium.PolylineMaterialAppearance({material: this.olStyleToCesium(e, o, !0)}),
|
||
classificationType: Cesium.ClassificationType.TERRAIN
|
||
})).readyPromise.then(() => {
|
||
this.setReferenceForPicking(t, e, u._primitive)
|
||
}); else {
|
||
const i = this.extractColorFromOlStyle(o, !0);
|
||
u = this.createStackedGroundCorridors(t, e, r, i, s)
|
||
}
|
||
}
|
||
} else c = new Cesium.CircleOutlineGeometry({center: n, radius: l, extrudedHeight: s, height: s});
|
||
const p = this.wrapFillAndOutlineGeometries(t, e, i, h, c, o);
|
||
return u && p.add(u), this.addTextStyle(t, e, i, o, p)
|
||
}
|
||
|
||
createStackedGroundCorridors(t, e, i, r, o) {
|
||
Array.isArray(o[0]) || (o = [o]), i = Math.max(3, i);
|
||
const n = [];
|
||
let s = 0;
|
||
for (const t of [1e3, 4e3, 16e3, 64e3, 254e3, 1e6, 1e7]) {
|
||
const e = {width: i *= 2.14, vertexFormat: Cesium.VertexFormat.POSITION_ONLY};
|
||
for (const i of o) e.positions = i, n.push(new Cesium.GeometryInstance({
|
||
geometry: new Cesium.CorridorGeometry(e),
|
||
attributes: {
|
||
color: Cesium.ColorGeometryInstanceAttribute.fromColor(r),
|
||
distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(s, t - 1)
|
||
}
|
||
}));
|
||
s = t
|
||
}
|
||
return new Cesium.GroundPrimitive({geometryInstances: n})
|
||
}
|
||
|
||
olLineStringGeometryToCesium(t, e, i, r, o) {
|
||
i = Dw.olGeometryCloneTo4326(i, r), console.assert("LineString" == i.getType());
|
||
const n = Dw.ol4326CoordinateArrayToCsCartesians(i.getCoordinates()),
|
||
s = this.extractLineWidthFromOlStyle(o);
|
||
let a;
|
||
const l = this.getHeightReference(t, e, i);
|
||
if (l !== Cesium.HeightReference.CLAMP_TO_GROUND || Mw(this.scene)) {
|
||
const i = new Cesium.PolylineMaterialAppearance({material: this.olStyleToCesium(e, o, !0)}),
|
||
r = {positions: n, width: s}, h = {appearance: i};
|
||
if (l === Cesium.HeightReference.CLAMP_TO_GROUND) {
|
||
const i = new Cesium.GroundPolylineGeometry(r);
|
||
h.geometryInstances = new Cesium.GeometryInstance({geometry: i}), (a = new Cesium.GroundPolylinePrimitive(h)).readyPromise.then(() => {
|
||
this.setReferenceForPicking(t, e, a._primitive)
|
||
})
|
||
} else {
|
||
r.vertexFormat = i.vertexFormat;
|
||
const t = new Cesium.PolylineGeometry(r);
|
||
h.geometryInstances = new Cesium.GeometryInstance({geometry: t}), a = new Cesium.Primitive(h)
|
||
}
|
||
} else {
|
||
const i = this.extractColorFromOlStyle(o, !0);
|
||
a = this.createStackedGroundCorridors(t, e, s, i, n)
|
||
}
|
||
return this.setReferenceForPicking(t, e, a), this.addTextStyle(t, e, i, o, a)
|
||
}
|
||
|
||
olPolygonGeometryToCesium(t, e, i, r, o) {
|
||
i = Dw.olGeometryCloneTo4326(i, r), console.assert("Polygon" == i.getType());
|
||
const n = this.getHeightReference(t, e, i);
|
||
let s, a, l;
|
||
if (5 == i.getCoordinates()[0].length && "rectangle" === e.getGeometry().get("olcs.polygon_kind")) {
|
||
const t = i.getCoordinates()[0], e = lt(t),
|
||
r = Cesium.Rectangle.fromDegrees(e[0], e[1], e[2], e[3]);
|
||
let o = 0;
|
||
if (3 == t[0].length) for (let e = 0; e < t.length; e++) o = Math.max(o, t[e][2]);
|
||
s = new Cesium.RectangleGeometry({
|
||
ellipsoid: Cesium.Ellipsoid.WGS84,
|
||
rectangle: r,
|
||
height: o
|
||
}), a = new Cesium.RectangleOutlineGeometry({
|
||
ellipsoid: Cesium.Ellipsoid.WGS84,
|
||
rectangle: r,
|
||
height: o
|
||
})
|
||
} else {
|
||
const r = i.getLinearRings(), h = {}, u = h;
|
||
console.assert(r.length > 0);
|
||
for (let t = 0; t < r.length; ++t) {
|
||
const e = r[t].getCoordinates(), i = Dw.ol4326CoordinateArrayToCsCartesians(e);
|
||
console.assert(i && i.length > 0), 0 == t ? h.positions = i : (h.holes || (h.holes = []), h.holes.push({positions: i}))
|
||
}
|
||
if (s = new Cesium.PolygonGeometry({
|
||
polygonHierarchy: u,
|
||
perPositionHeight: !0
|
||
}), n === Cesium.HeightReference.CLAMP_TO_GROUND) {
|
||
const i = this.extractLineWidthFromOlStyle(o);
|
||
if (i > 0) {
|
||
const r = [h.positions];
|
||
if (h.holes) for (let t = 0; t < h.holes.length; ++t) r.push(h.holes[t].positions);
|
||
if (Mw(this.scene)) {
|
||
const n = new Cesium.PolylineMaterialAppearance({material: this.olStyleToCesium(e, o, !0)}),
|
||
s = [];
|
||
for (const t of r) {
|
||
const e = new Cesium.GroundPolylineGeometry({positions: t, width: i});
|
||
s.push(new Cesium.GeometryInstance({geometry: e}))
|
||
}
|
||
const a = {appearance: n, geometryInstances: s};
|
||
(l = new Cesium.GroundPolylinePrimitive(a)).readyPromise.then(() => {
|
||
this.setReferenceForPicking(t, e, l._primitive)
|
||
})
|
||
} else {
|
||
const n = this.extractColorFromOlStyle(o, !0);
|
||
l = this.createStackedGroundCorridors(t, e, i, n, r)
|
||
}
|
||
}
|
||
} else a = new Cesium.PolygonOutlineGeometry({polygonHierarchy: h, perPositionHeight: !0})
|
||
}
|
||
const h = this.wrapFillAndOutlineGeometries(t, e, i, s, a, o);
|
||
return l && h.add(l), this.addTextStyle(t, e, i, o, h)
|
||
}
|
||
|
||
getHeightReference(t, e, i) {
|
||
let r = i.get("altitudeMode");
|
||
void 0 === r && (r = e.get("altitudeMode")), void 0 === r && (r = t.get("altitudeMode"));
|
||
let o = Cesium.HeightReference.NONE;
|
||
return "clampToGround" === r ? o = Cesium.HeightReference.CLAMP_TO_GROUND : "relativeToGround" === r && (o = Cesium.HeightReference.RELATIVE_TO_GROUND), o
|
||
}
|
||
|
||
createBillboardFromImage(t, e, i, r, o, n, s, a) {
|
||
n instanceof Xd && n.load();
|
||
const l = n.getImage(1), h = function () {
|
||
if (!l) return;
|
||
if (!(l instanceof HTMLCanvasElement || l instanceof Image || l instanceof HTMLImageElement)) return;
|
||
const r = i.getCoordinates(), h = Dw.ol4326CoordinateToCesiumCartesian(r);
|
||
let u;
|
||
const c = n.getOpacity();
|
||
void 0 !== c && (u = new Cesium.Color(1, 1, 1, c));
|
||
const p = this.getHeightReference(t, e, i),
|
||
d = {image: l, color: u, scale: n.getScale(), heightReference: p, position: h};
|
||
if (n instanceof Xd) {
|
||
const t = n.getAnchor();
|
||
t && (d.pixelOffset = new Cesium.Cartesian2(l.width / 2 - t[0], l.height / 2 - t[1]))
|
||
}
|
||
const f = this.csAddBillboard(s, d, t, e, i, o);
|
||
a && a(f)
|
||
}.bind(this);
|
||
if (l instanceof Image && !function (t) {
|
||
return "" != t.src && 0 != t.naturalHeight && 0 != t.naturalWidth && t.complete
|
||
}(l)) {
|
||
let i = !1;
|
||
const r = t.getSource(), o = function () {
|
||
i = !0
|
||
};
|
||
r.on(["removefeature", "clear"], this.boundOnRemoveOrClearFeatureListener_);
|
||
let n = Aw.obj(r).olcs_cancellers;
|
||
n || (n = Aw.obj(r).olcs_cancellers = {});
|
||
const a = Ow(e);
|
||
n[a] && n[a](), n[a] = o;
|
||
const u = function () {
|
||
l.removeEventListener("load", u), s.isDestroyed() || i || h()
|
||
};
|
||
l.addEventListener("load", u)
|
||
} else h()
|
||
}
|
||
|
||
olPointGeometryToCesium(t, e, i, r, o, n, s) {
|
||
console.assert("Point" == i.getType()), i = Dw.olGeometryCloneTo4326(i, r);
|
||
let a = null;
|
||
const l = o.getImage();
|
||
if (l) {
|
||
const h = i.get("olcs_model") || e.get("olcs_model");
|
||
if (h) {
|
||
const t = h(), e = Object.assign({}, {scene: this.scene}, t.cesiumOptions),
|
||
i = Cesium.Model.fromGltf(e);
|
||
(a = new Cesium.PrimitiveCollection).add(i), t.debugModelMatrix && a.add(new Cesium.DebugModelMatrixPrimitive({modelMatrix: t.debugModelMatrix}))
|
||
} else this.createBillboardFromImage(t, e, i, r, o, l, n, s)
|
||
}
|
||
return o.getText() ? this.addTextStyle(t, e, i, o, a || new Cesium.Primitive) : a
|
||
}
|
||
|
||
olMultiGeometryToCesium(t, e, i, r, o, n, s) {
|
||
const a = function (i, n) {
|
||
const s = new Cesium.PrimitiveCollection;
|
||
return i.forEach(i => {
|
||
s.add(n(t, e, i, r, o))
|
||
}), s
|
||
};
|
||
let l;
|
||
switch (i.getType()) {
|
||
case"MultiPoint":
|
||
if (l = (i = i).getPoints(), o.getText()) {
|
||
const i = new Cesium.PrimitiveCollection;
|
||
return l.forEach(a => {
|
||
console.assert(a);
|
||
const l = this.olPointGeometryToCesium(t, e, a, r, o, n, s);
|
||
l && i.add(l)
|
||
}), i
|
||
}
|
||
return l.forEach(i => {
|
||
console.assert(i), this.olPointGeometryToCesium(t, e, i, r, o, n, s)
|
||
}), null;
|
||
case"MultiLineString":
|
||
return a(l = (i = i).getLineStrings(), this.olLineStringGeometryToCesium.bind(this));
|
||
case"MultiPolygon":
|
||
return a(l = (i = i).getPolygons(), this.olPolygonGeometryToCesium.bind(this));
|
||
default:
|
||
console.assert(!1, `Unhandled multi geometry type${i.getType()}`)
|
||
}
|
||
}
|
||
|
||
olGeometry4326TextPartToCesium(t, e, i, r) {
|
||
const o = r.getText();
|
||
if (!o) return null;
|
||
const n = new Cesium.LabelCollection({scene: this.scene}), s = At(i.getExtent());
|
||
if (i instanceof bi) {
|
||
const t = i.getFirstCoordinate();
|
||
s[2] = 3 == t.length ? t[2] : 0
|
||
}
|
||
const a = {};
|
||
a.position = Dw.ol4326CoordinateToCesiumCartesian(s), a.text = o, a.heightReference = this.getHeightReference(t, e, i);
|
||
const l = r.getOffsetX(), h = r.getOffsetY();
|
||
if (0 != l && 0 != h) {
|
||
const t = new Cesium.Cartesian2(l, h);
|
||
a.pixelOffset = t
|
||
}
|
||
a.font = r.getFont() || "10px sans-serif";
|
||
let u, c = void 0;
|
||
switch (r.getFill() && (a.fillColor = this.extractColorFromOlStyle(r, !1), c = Cesium.LabelStyle.FILL), r.getStroke() && (a.outlineWidth = this.extractLineWidthFromOlStyle(r), a.outlineColor = this.extractColorFromOlStyle(r, !0), c = Cesium.LabelStyle.OUTLINE), r.getFill() && r.getStroke() && (c = Cesium.LabelStyle.FILL_AND_OUTLINE), a.style = c, r.getTextAlign()) {
|
||
case"left":
|
||
u = Cesium.HorizontalOrigin.LEFT;
|
||
break;
|
||
case"right":
|
||
u = Cesium.HorizontalOrigin.RIGHT;
|
||
break;
|
||
case"center":
|
||
default:
|
||
u = Cesium.HorizontalOrigin.CENTER
|
||
}
|
||
if (a.horizontalOrigin = u, r.getTextBaseline()) {
|
||
let t;
|
||
switch (r.getTextBaseline()) {
|
||
case"top":
|
||
t = Cesium.VerticalOrigin.TOP;
|
||
break;
|
||
case"middle":
|
||
t = Cesium.VerticalOrigin.CENTER;
|
||
break;
|
||
case"bottom":
|
||
t = Cesium.VerticalOrigin.BOTTOM;
|
||
break;
|
||
case"alphabetic":
|
||
t = Cesium.VerticalOrigin.TOP;
|
||
break;
|
||
case"hanging":
|
||
t = Cesium.VerticalOrigin.BOTTOM;
|
||
break;
|
||
default:
|
||
console.assert(!1, `unhandled baseline ${r.getTextBaseline()}`)
|
||
}
|
||
a.verticalOrigin = t
|
||
}
|
||
const p = n.add(a);
|
||
return this.setReferenceForPicking(t, e, p), n
|
||
}
|
||
|
||
olStyleToCesium(t, e, i) {
|
||
const r = e.getFill(), o = e.getStroke();
|
||
if (i && !o || !i && !r) return null;
|
||
let n = i ? o.getColor() : r.getColor();
|
||
return n = Dw.convertColorToCesium(n), i && o.getLineDash() ? Cesium.Material.fromType("Stripe", {
|
||
horizontal: !1,
|
||
repeat: 500,
|
||
evenColor: n,
|
||
oddColor: new Cesium.Color(0, 0, 0, 0)
|
||
}) : Cesium.Material.fromType("Color", {color: n})
|
||
}
|
||
|
||
computePlainStyle(t, e, i, r) {
|
||
const o = e.getStyleFunction();
|
||
let n = null;
|
||
return o && (n = o(e, r)), !n && i && (n = i(e, r)), n ? Array.isArray(n) ? n : [n] : null
|
||
}
|
||
|
||
getGeometryFromFeature(t, e, i) {
|
||
if (i) return i;
|
||
const r = t.get("olcs.3d_geometry");
|
||
if (r && r instanceof _i) return r;
|
||
if (e) {
|
||
const i = e.getGeometryFunction()(t);
|
||
if (i instanceof _i) return i
|
||
}
|
||
return t.getGeometry()
|
||
}
|
||
|
||
olFeatureToCesium(t, e, i, r, o) {
|
||
let n = this.getGeometryFromFeature(e, i, o);
|
||
if (!n) return null;
|
||
const s = r.projection, a = function (t) {
|
||
const i = r.featureToCesiumMap[Ow(e)];
|
||
i instanceof Array ? i.push(t) : r.featureToCesiumMap[Ow(e)] = [t]
|
||
};
|
||
switch (n.getType()) {
|
||
case"GeometryCollection":
|
||
const o = new Cesium.PrimitiveCollection;
|
||
return n.getGeometries().forEach(n => {
|
||
if (n) {
|
||
const s = this.olFeatureToCesium(t, e, i, r, n);
|
||
s && o.add(s)
|
||
}
|
||
}), o;
|
||
case"Point":
|
||
n = n;
|
||
const l = r.billboards, h = this.olPointGeometryToCesium(t, e, n, s, i, l, a);
|
||
return h || null;
|
||
case"Circle":
|
||
return n = n, this.olCircleGeometryToCesium(t, e, n, s, i);
|
||
case"LineString":
|
||
return n = n, this.olLineStringGeometryToCesium(t, e, n, s, i);
|
||
case"Polygon":
|
||
return n = n, this.olPolygonGeometryToCesium(t, e, n, s, i);
|
||
case"MultiPoint":
|
||
case"MultiLineString":
|
||
case"MultiPolygon":
|
||
const u = this.olMultiGeometryToCesium(t, e, n, s, i, r.billboards, a);
|
||
return u || null;
|
||
case"LinearRing":
|
||
throw new Error("LinearRing should only be part of polygon.");
|
||
default:
|
||
throw new Error(`Ol geom type not handled : ${n.getType()}`)
|
||
}
|
||
}
|
||
|
||
olVectorLayerToCesium(t, e, i) {
|
||
const r = e.getProjection(), o = e.getResolution();
|
||
if (void 0 === o || !r) throw console.assert(!1, "View not ready"), new Error("View not ready");
|
||
let n = t.getSource();
|
||
n instanceof Ox && (n = n.getSource()), console.assert(n instanceof b_);
|
||
const s = n.getFeatures(), a = new Ww(r, this.scene), l = a.context;
|
||
for (let e = 0; e < s.length; ++e) {
|
||
const r = s[e];
|
||
if (!r) continue;
|
||
const n = t.getStyleFunction(), h = this.computePlainStyle(t, r, n, o);
|
||
if (!h || !h.length) continue;
|
||
let u = null;
|
||
for (let e = 0; e < h.length; e++) {
|
||
const i = this.olFeatureToCesium(t, r, h[e], l);
|
||
if (i) if (u) {
|
||
if (i) {
|
||
let t, e = 0;
|
||
for (; t = i.get(e);) u.add(t), e++
|
||
}
|
||
} else u = i
|
||
}
|
||
u && (i[Ow(r)] = u, a.getRootPrimitive().add(u))
|
||
}
|
||
return a
|
||
}
|
||
|
||
convert(t, e, i, r) {
|
||
const o = e.getProjection(), n = e.getResolution();
|
||
if (null == n || !o) return null;
|
||
const s = t.getStyleFunction(), a = this.computePlainStyle(t, i, s, n);
|
||
if (!a.length) return null;
|
||
r.projection = o;
|
||
let l = null;
|
||
for (let e = 0; e < a.length; e++) {
|
||
const o = this.olFeatureToCesium(t, i, a[e], r);
|
||
if (l) {
|
||
if (o) {
|
||
let t, e = 0;
|
||
for (; t = o.get(e);) l.add(t), e++
|
||
}
|
||
} else l = o
|
||
}
|
||
return l
|
||
}
|
||
};
|
||
var Xw = class extends Vw {
|
||
constructor(t, e, i) {
|
||
super(t, e), this.converter = i || new Hw(e), this.csAllPrimitives_ = new Cesium.PrimitiveCollection, e.primitives.add(this.csAllPrimitives_), this.csAllPrimitives_.destroyPrimitives = !1
|
||
}
|
||
|
||
addCesiumObject(t) {
|
||
console.assert(t), t.getRootPrimitive().counterpart = t, this.csAllPrimitives_.add(t.getRootPrimitive())
|
||
}
|
||
|
||
destroyCesiumObject(t) {
|
||
t.getRootPrimitive().destroy()
|
||
}
|
||
|
||
removeSingleCesiumObject(t, e) {
|
||
t.destroy(), this.csAllPrimitives_.destroyPrimitives = e, this.csAllPrimitives_.remove(t.getRootPrimitive()), this.csAllPrimitives_.destroyPrimitives = !1
|
||
}
|
||
|
||
removeAllCesiumObjects(t) {
|
||
if (this.csAllPrimitives_.destroyPrimitives = t, t) for (let t = 0; t < this.csAllPrimitives_.length; ++t) this.csAllPrimitives_.get(t).counterpart.destroy();
|
||
this.csAllPrimitives_.removeAll(), this.csAllPrimitives_.destroyPrimitives = !1
|
||
}
|
||
|
||
updateLayerVisibility(t, e) {
|
||
let i = !0;
|
||
[t.layer].concat(t.parents).forEach(t => {
|
||
const e = t.getVisible();
|
||
void 0 !== e ? i &= e : i = !1
|
||
}), e.show = i
|
||
}
|
||
|
||
createSingleLayerCounterparts(t) {
|
||
const e = t.layer;
|
||
if (!(e instanceof v_)) return null;
|
||
console.assert(e instanceof Ts);
|
||
let i = e.getSource();
|
||
if (i instanceof Ox && (i = i.getSource()), !i) return null;
|
||
console.assert(i instanceof b_), console.assert(this.view);
|
||
const r = this.view, o = {}, n = this.converter.olVectorLayerToCesium(e, r, o),
|
||
s = n.getRootPrimitive(), a = n.olListenKeys;
|
||
[t.layer].concat(t.parents).forEach(e => {
|
||
a.push(Lw(e, "change:visible", () => {
|
||
this.updateLayerVisibility(t, s)
|
||
}))
|
||
}), this.updateLayerVisibility(t, s);
|
||
const l = function (t) {
|
||
console.assert(e instanceof v_ || e instanceof nx);
|
||
const i = n.context, a = this.converter.convert(e, r, t, i);
|
||
a && (o[Ow(t)] = a, s.add(a))
|
||
}.bind(this), h = function (t) {
|
||
const e = Ow(t), i = n.context, r = i.featureToCesiumMap[e];
|
||
r && (delete i.featureToCesiumMap[e], r.forEach(t => {
|
||
t instanceof Cesium.Billboard && i.billboards.remove(t)
|
||
}));
|
||
const a = o[e];
|
||
delete o[e], a && s.remove(a)
|
||
}.bind(this);
|
||
return a.push(Lw(i, "addfeature", t => {
|
||
console.assert(t.feature), l(t.feature)
|
||
})), a.push(Lw(i, "removefeature", t => {
|
||
console.assert(t.feature), h(t.feature)
|
||
})), a.push(Lw(i, "changefeature", t => {
|
||
const e = t.feature;
|
||
console.assert(e), h(e), l(e)
|
||
})), n ? [n] : null
|
||
}
|
||
};
|
||
var qw = class extends sh {
|
||
constructor(t) {
|
||
const e = t.parent;
|
||
super(e.getOptions()), this.scenePostRenderListenerRemover_ = null, this.scene_ = t.scene, this.synchronizer_ = t.synchronizer, this.parent_ = e, this.positionWGS84_ = void 0, this.observer_ = new MutationObserver(this.handleElementChanged.bind(this)), this.attributeObserver_ = [], this.listenerKeys_ = [];
|
||
const i = t => this.setPropertyFromEvent_(t);
|
||
this.listenerKeys_.push(this.parent_.on("change:position", i)), this.listenerKeys_.push(this.parent_.on("change:element", i)), this.listenerKeys_.push(this.parent_.on("change:offset", i)), this.listenerKeys_.push(this.parent_.on("change:position", i)), this.listenerKeys_.push(this.parent_.on("change:positioning", i)), this.setProperties(this.parent_.getProperties()), this.handleMapChanged(), this.handleElementChanged()
|
||
}
|
||
|
||
observeTarget_(t) {
|
||
if (this.observer_) {
|
||
this.observer_.disconnect(), this.observer_.observe(t, {
|
||
attributes: !1,
|
||
childList: !0,
|
||
characterData: !0,
|
||
subtree: !0
|
||
}), this.attributeObserver_.forEach(t => {
|
||
t.disconnect()
|
||
}), this.attributeObserver_.length = 0;
|
||
for (let e = 0; e < t.childNodes.length; e++) {
|
||
const i = t.childNodes[e];
|
||
if (1 === i.nodeType) {
|
||
const t = new MutationObserver(this.handleElementChanged.bind(this));
|
||
t.observe(i, {attributes: !0, subtree: !0}), this.attributeObserver_.push(t)
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
setPropertyFromEvent_(t) {
|
||
t.target && t.key && this.set(t.key, t.target.get(t.key))
|
||
}
|
||
|
||
getScene() {
|
||
return this.scene_
|
||
}
|
||
|
||
handleMapChanged() {
|
||
var t;
|
||
this.scenePostRenderListenerRemover_ && (this.scenePostRenderListenerRemover_(), (t = this.element) && t.parentNode && t.parentNode.removeChild(t)), this.scenePostRenderListenerRemover_ = null;
|
||
const e = this.getScene();
|
||
if (e) {
|
||
this.scenePostRenderListenerRemover_ = e.postRender.addEventListener(this.updatePixelPosition.bind(this)), this.updatePixelPosition();
|
||
const t = this.stopEvent ? this.synchronizer_.getOverlayContainerStopEvent() : this.synchronizer_.getOverlayContainer();
|
||
this.insertFirst ? t.insertBefore(this.element, t.childNodes[0] || null) : t.appendChild(this.element)
|
||
}
|
||
}
|
||
|
||
handlePositionChanged() {
|
||
const t = this.getPosition();
|
||
if (t) {
|
||
const e = this.parent_.getMap().getView().getProjection();
|
||
this.positionWGS84_ = ii(t, e, "EPSG:4326")
|
||
} else this.positionWGS84_ = void 0;
|
||
this.updatePixelPosition()
|
||
}
|
||
|
||
handleElementChanged() {
|
||
function t(e, i) {
|
||
const r = e.cloneNode();
|
||
i && i.appendChild(r), e.nodeType != Node.TEXT_NODE && r.addEventListener("click", t => {
|
||
e.dispatchEvent(new MouseEvent("click", t)), t.stopPropagation()
|
||
});
|
||
const o = e.childNodes;
|
||
for (let e = 0; e < o.length; e++) o[e] && t(o[e], r);
|
||
return r
|
||
}
|
||
|
||
!function (t) {
|
||
for (; t.lastChild;) t.removeChild(t.lastChild)
|
||
}(this.element);
|
||
const e = this.getElement();
|
||
if (e && e.parentNode && e.parentNode.childNodes) for (const i of e.parentNode.childNodes) {
|
||
const e = t(i, null);
|
||
this.element.appendChild(e)
|
||
}
|
||
e.parentNode && this.observeTarget_(e.parentNode)
|
||
}
|
||
|
||
updatePixelPosition() {
|
||
const t = this.positionWGS84_;
|
||
if (!this.scene_ || !t) return void this.setVisible(!1);
|
||
let e = 0;
|
||
if (2 === t.length) {
|
||
const i = this.scene_.globe.getHeight(Cesium.Cartographic.fromDegrees(t[0], t[1]));
|
||
i && this.scene_.globe.tilesLoaded && (t[2] = i), i && (e = i)
|
||
} else e = t[2];
|
||
const i = Cesium.Cartesian3.fromDegrees(t[0], t[1], e), r = this.scene_.camera,
|
||
o = new Cesium.BoundingSphere(new Cesium.Cartesian3, 6356752);
|
||
if (!new Cesium.Occluder(o, r.position).isPointVisible(i)) return void this.setVisible(!1);
|
||
if (1 !== r.frustum.computeCullingVolume(r.position, r.direction, r.up).computeVisibility(new Cesium.BoundingSphere(i))) return void this.setVisible(!1);
|
||
this.setVisible(!0);
|
||
const n = this.scene_.cartesianToCanvasCoordinates(i), s = [n.x, n.y],
|
||
a = [this.scene_.canvas.width, this.scene_.canvas.height];
|
||
this.updateRenderedPosition(s, a)
|
||
}
|
||
|
||
destroy() {
|
||
this.scenePostRenderListenerRemover_ && this.scenePostRenderListenerRemover_(), this.observer_ && this.observer_.disconnect(), N(this.listenerKeys_), this.listenerKeys_.splice(0), this.element.removeNode ? this.element.removeNode(!0) : this.element.remove(), this.element = null
|
||
}
|
||
};
|
||
var Zw = class {
|
||
constructor(t, e) {
|
||
this.map = t, this.overlays_ = this.map.getOverlays(), this.scene = e, this.overlayContainerStopEvent_ = document.createElement("DIV"), this.overlayContainerStopEvent_.className = "ol-overlaycontainer-stopevent", ["click", "dblclick", "mousedown", "touchstart", "MSPointerDown", "pointerdown", "mousewheel", "wheel"].forEach(t => {
|
||
this.overlayContainerStopEvent_.addEventListener(t, t => t.stopPropagation())
|
||
}), this.scene.canvas.parentElement.appendChild(this.overlayContainerStopEvent_), this.overlayContainer_ = document.createElement("DIV"), this.overlayContainer_.className = "ol-overlaycontainer", this.scene.canvas.parentElement.appendChild(this.overlayContainer_), this.overlayMap_ = {}
|
||
}
|
||
|
||
getOverlayContainerStopEvent() {
|
||
return this.overlayContainerStopEvent_
|
||
}
|
||
|
||
getOverlayContainer() {
|
||
return this.overlayContainer_
|
||
}
|
||
|
||
synchronize() {
|
||
this.destroyAll(), this.addOverlays(), this.overlays_.on("add", this.addOverlayFromEvent_.bind(this)), this.overlays_.on("remove", this.removeOverlayFromEvent_.bind(this))
|
||
}
|
||
|
||
addOverlayFromEvent_(t) {
|
||
const e = t.element;
|
||
this.addOverlay(e)
|
||
}
|
||
|
||
addOverlays() {
|
||
this.overlays_.forEach(t => {
|
||
this.addOverlay()
|
||
})
|
||
}
|
||
|
||
addOverlay(t) {
|
||
if (!t) return;
|
||
const e = new qw({scene: this.scene, synchronizer: this, parent: t}), i = Ow(t).toString();
|
||
this.overlayMap_[i] = e
|
||
}
|
||
|
||
removeOverlayFromEvent_(t) {
|
||
const e = t.element;
|
||
this.removeOverlay(e)
|
||
}
|
||
|
||
removeOverlay(t) {
|
||
const e = Ow(t).toString(), i = this.overlayMap_[e];
|
||
i && (i.destroy(), delete this.overlayMap_[e])
|
||
}
|
||
|
||
destroyAll() {
|
||
Object.keys(this.overlayMap_).forEach(t => {
|
||
this.overlayMap_[t].destroy(), delete this.overlayMap_[t]
|
||
})
|
||
}
|
||
};
|
||
|
||
class Kw {
|
||
constructor(t) {
|
||
this.autoRenderLoop_ = null, this.map_ = t.map, this.time_ = t.time || function () {
|
||
return Cesium.JulianDate.now()
|
||
}, this.to4326Transform_ = ei(this.map_.getView().getProjection(), "EPSG:4326"), this.resolutionScale_ = 1, this.canvasClientWidth_ = 0, this.canvasClientHeight_ = 0, this.resolutionScaleChanged_ = !0;
|
||
const e = "position:absolute;top:0;left:0;width:100%;height:100%;";
|
||
this.container_ = document.createElement("DIV");
|
||
const i = document.createAttribute("style");
|
||
i.value = `${e}visibility:hidden;`, this.container_.setAttributeNode(i);
|
||
let r = t.target || null;
|
||
if (r) "string" == typeof r && (r = document.getElementById(r)), r.appendChild(this.container_); else {
|
||
const t = this.map_.getViewport().querySelector(".ol-overlaycontainer");
|
||
t && t.parentNode && t.parentNode.insertBefore(this.container_, t)
|
||
}
|
||
if (this.isOverMap_ = !r, this.isOverMap_ && t.stopOpenLayersEventsPropagation) {
|
||
const t = ["click", "dblclick", "mousedown", "touchstart", "MSPointerDown", "pointerdown", "mousewheel", "wheel"];
|
||
for (let e = 0, i = t.length; e < i; ++e) this.container_.addEventListener(t[e], t => t.stopPropagation())
|
||
}
|
||
this.canvas_ = document.createElement("CANVAS");
|
||
const o = document.createAttribute("style");
|
||
o.value = e, this.canvas_.setAttributeNode(o), Aw.supportsImageRenderingPixelated() && (this.canvas_.style.imageRendering = Aw.imageRenderingValue()), this.canvas_.oncontextmenu = function () {
|
||
return !1
|
||
}, this.canvas_.onselectstart = function () {
|
||
return !1
|
||
}, this.container_.appendChild(this.canvas_), this.enabled_ = !1, this.pausedInteractions_ = [], this.hiddenRootGroup_ = null;
|
||
const n = void 0 !== t.sceneOptions ? t.sceneOptions : {};
|
||
n.canvas = this.canvas_, n.scene3DOnly = !0, this.scene_ = new Cesium.Scene(n);
|
||
const s = this.scene_.screenSpaceCameraController;
|
||
s.tiltEventTypes.push({
|
||
eventType: Cesium.CameraEventType.LEFT_DRAG,
|
||
modifier: Cesium.KeyboardEventModifier.SHIFT
|
||
}), s.tiltEventTypes.push({
|
||
eventType: Cesium.CameraEventType.LEFT_DRAG,
|
||
modifier: Cesium.KeyboardEventModifier.ALT
|
||
}), s.enableLook = !1, this.scene_.camera.constrainedAxis = Cesium.Cartesian3.UNIT_Z, this.camera_ = new Bw(this.scene_, this.map_), this.globe_ = new Cesium.Globe(Cesium.Ellipsoid.WGS84), this.globe_.baseColor = Cesium.Color.WHITE, this.scene_.globe = this.globe_, this.scene_.skyAtmosphere = new Cesium.SkyAtmosphere;
|
||
const a = new Cesium.SingleTileImageryProvider({
|
||
url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
|
||
rectangle: Cesium.Rectangle.fromDegrees(0, 0, 1, 1)
|
||
});
|
||
this.globe_.imageryLayers.addImageryProvider(a, 0), this.dataSourceCollection_ = new Cesium.DataSourceCollection, this.dataSourceDisplay_ = new Cesium.DataSourceDisplay({
|
||
scene: this.scene_,
|
||
dataSourceCollection: this.dataSourceCollection_
|
||
});
|
||
const l = t.createSynchronizers ? t.createSynchronizers(this.map_, this.scene_, this.dataSourceCollection_) : [new Yw(this.map_, this.scene_), new Xw(this.map_, this.scene_), new Zw(this.map_, this.scene_)];
|
||
this.handleResize_();
|
||
for (let t = l.length - 1; t >= 0; --t) l[t].synchronize();
|
||
this.lastFrameTime_ = 0, this.renderId_ = void 0, this.targetFrameRate_ = Number.POSITIVE_INFINITY, this.blockCesiumRendering_ = !1, this.warmingUp_ = !1, this.trackedFeature_ = null, this.trackedEntity_ = null, this.entityView_ = null, this.needTrackedEntityUpdate_ = !1, this.boundingSphereScratch_ = new Cesium.BoundingSphere, (new Cesium.EventHelper).add(this.scene_.postRender, Kw.prototype.updateTrackedEntity_, this), Cesium.Camera.enableSuspendTerrainAdjustment = !1
|
||
}
|
||
|
||
render_() {
|
||
void 0 !== this.renderId_ && (cancelAnimationFrame(this.renderId_), this.renderId_ = void 0), !this.enabled_ && !this.warmingUp_ || this.blockCesiumRendering_ || (this.renderId_ = requestAnimationFrame(this.onAnimationFrame_.bind(this)))
|
||
}
|
||
|
||
onAnimationFrame_(t) {
|
||
this.renderId_ = void 0;
|
||
const e = 1e3 / this.targetFrameRate_;
|
||
if (t - this.lastFrameTime_ < e) return void this.render_();
|
||
this.lastFrameTime_ = t;
|
||
const i = this.time_();
|
||
if (this.scene_.initializeFrame(), this.handleResize_(), this.dataSourceDisplay_.update(i), this.entityView_) {
|
||
const t = this.trackedEntity_;
|
||
this.dataSourceDisplay_.getBoundingSphere(t, !1, this.boundingSphereScratch_) === Cesium.BoundingSphereState.DONE && (this.boundingSphereScratch_.radius = 1, this.entityView_.update(i, this.boundingSphereScratch_))
|
||
}
|
||
this.scene_.render(i), this.camera_.checkCameraChange(), this.render_()
|
||
}
|
||
|
||
updateTrackedEntity_() {
|
||
if (!this.needTrackedEntityUpdate_) return;
|
||
const t = this.trackedEntity_, e = this.scene_,
|
||
i = this.dataSourceDisplay_.getBoundingSphere(t, !1, this.boundingSphereScratch_);
|
||
if (i === Cesium.BoundingSphereState.PENDING) return;
|
||
e.screenSpaceCameraController.enableTilt = !1;
|
||
const r = i !== Cesium.BoundingSphereState.FAILED ? this.boundingSphereScratch_ : void 0;
|
||
r && (r.radius = 1), this.entityView_ = new Cesium.EntityView(t, e, e.mapProjection.ellipsoid), this.entityView_.update(this.time_(), r), this.needTrackedEntityUpdate_ = !1
|
||
}
|
||
|
||
handleResize_() {
|
||
let t = this.canvas_.clientWidth, e = this.canvas_.clientHeight;
|
||
if (0 === t | 0 === e) return;
|
||
if (t === this.canvasClientWidth_ && e === this.canvasClientHeight_ && !this.resolutionScaleChanged_) return;
|
||
let i = this.resolutionScale_;
|
||
Aw.supportsImageRenderingPixelated() || (i *= window.devicePixelRatio || 1), this.resolutionScaleChanged_ = !1, this.canvasClientWidth_ = t, this.canvasClientHeight_ = e, t *= i, e *= i, this.canvas_.width = t, this.canvas_.height = e, this.scene_.camera.frustum.aspectRatio = t / e
|
||
}
|
||
|
||
getCamera() {
|
||
return this.camera_
|
||
}
|
||
|
||
getOlMap() {
|
||
return this.map_
|
||
}
|
||
|
||
getOlView() {
|
||
const t = this.map_.getView();
|
||
return console.assert(t), t
|
||
}
|
||
|
||
getCesiumScene() {
|
||
return this.scene_
|
||
}
|
||
|
||
getDataSources() {
|
||
return this.dataSourceCollection_
|
||
}
|
||
|
||
getDataSourceDisplay() {
|
||
return this.dataSourceDisplay_
|
||
}
|
||
|
||
getEnabled() {
|
||
return this.enabled_
|
||
}
|
||
|
||
setEnabled(t) {
|
||
if (this.enabled_ === t) return;
|
||
let e;
|
||
if (this.enabled_ = t, this.container_.style.visibility = this.enabled_ ? "visible" : "hidden", this.enabled_) {
|
||
if (this.throwOnUnitializedMap_(), this.isOverMap_) {
|
||
(e = this.map_.getInteractions()).forEach((t, e, i) => {
|
||
this.pausedInteractions_.push(t)
|
||
}), e.clear();
|
||
const t = this.map_.getLayerGroup();
|
||
t.getVisible() && (this.hiddenRootGroup_ = t, this.hiddenRootGroup_.setVisible(!1)), this.map_.getOverlayContainer().classList.add("olcs-hideoverlay"), this.map_.getOverlayContainerStopEvent().classList.add("olcs-hideoverlay")
|
||
}
|
||
this.camera_.readFromView(), this.render_()
|
||
} else this.isOverMap_ && (e = this.map_.getInteractions(), this.pausedInteractions_.forEach(t => {
|
||
e.push(t)
|
||
}), this.pausedInteractions_.length = 0, this.map_.getOverlayContainer().classList.remove("olcs-hideoverlay"), this.map_.getOverlayContainerStopEvent().classList.remove("olcs-hideoverlay"), this.hiddenRootGroup_ && (this.hiddenRootGroup_.setVisible(!0), this.hiddenRootGroup_ = null)), this.camera_.updateView()
|
||
}
|
||
|
||
warmUp(t, e) {
|
||
if (this.enabled_) return;
|
||
this.throwOnUnitializedMap_(), this.camera_.readFromView();
|
||
const i = this.globe_.ellipsoid, r = this.scene_.camera, o = i.cartesianToCartographic(r.position);
|
||
o.height < t && (o.height = t, r.position = i.cartographicToCartesian(o)), this.warmingUp_ = !0, this.render_(), setTimeout(() => {
|
||
this.warmingUp_ = !1
|
||
}, e)
|
||
}
|
||
|
||
setBlockCesiumRendering(t) {
|
||
this.blockCesiumRendering_ !== t && (this.blockCesiumRendering_ = t, this.render_())
|
||
}
|
||
|
||
enableAutoRenderLoop() {
|
||
this.autoRenderLoop_ || (this.autoRenderLoop_ = new Gw(this))
|
||
}
|
||
|
||
getAutoRenderLoop() {
|
||
return this.autoRenderLoop_
|
||
}
|
||
|
||
setResolutionScale(t) {
|
||
(t = Math.max(0, t)) !== this.resolutionScale_ && (this.resolutionScale_ = Math.max(0, t), this.resolutionScaleChanged_ = !0, this.autoRenderLoop_ && this.autoRenderLoop_.restartRenderLoop())
|
||
}
|
||
|
||
setTargetFrameRate(t) {
|
||
this.targetFrameRate_ !== t && (this.targetFrameRate_ = t, this.render_())
|
||
}
|
||
|
||
throwOnUnitializedMap_() {
|
||
const t = this.map_.getView(), e = t.getCenter();
|
||
if (!t.isDef() || isNaN(e[0]) || isNaN(e[1])) throw new Error(`The OpenLayers map is not properly initialized: ${e} / ${t.getResolution()}`)
|
||
}
|
||
}
|
||
|
||
Object.defineProperties(Kw.prototype, {
|
||
trackedFeature: {
|
||
get: function () {
|
||
return this.trackedFeature_
|
||
}, set: function (t) {
|
||
if (this.trackedFeature_ !== t) {
|
||
const e = this.scene_;
|
||
if (!t || !t.getGeometry()) return this.needTrackedEntityUpdate_ = !1, e.screenSpaceCameraController.enableTilt = !0, this.trackedEntity_ && this.dataSourceDisplay_.defaultDataSource.entities.remove(this.trackedEntity_), this.trackedEntity_ = null, this.trackedFeature_ = null, this.entityView_ = null, void e.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
|
||
this.trackedFeature_ = t, this.needTrackedEntityUpdate_ = !0;
|
||
const i = this.to4326Transform_, r = function () {
|
||
const e = t.getGeometry();
|
||
console.assert(e instanceof qi);
|
||
const r = e.getCoordinates(), o = i(r, void 0, r.length);
|
||
return Dw.ol4326CoordinateToCesiumCartesian(o)
|
||
}, o = {
|
||
position: new Cesium.CallbackProperty((t, e) => r(), !1),
|
||
point: {pixelSize: 1, color: Cesium.Color.TRANSPARENT}
|
||
};
|
||
this.trackedEntity_ = this.dataSourceDisplay_.defaultDataSource.entities.add(o)
|
||
}
|
||
}
|
||
}
|
||
});
|
||
var Jw = Kw;
|
||
var $w = class {
|
||
constructor(t) {
|
||
this.promise, this.url_ = t
|
||
}
|
||
|
||
load() {
|
||
return this.promise || (this.promise = new Promise((t, e) => {
|
||
const i = document.createElement("script");
|
||
i.onload = (() => t()), i.onerror = (() => e()), document.head.appendChild(i), i.src = this.url_
|
||
})), this.promise
|
||
}
|
||
};
|
||
var Qw = class extends D {
|
||
constructor(t, {map: e, cameraExtentInRadians: i} = {}) {
|
||
super(), this.cesiumUrl_ = t, this.map = e, this.cameraExtentInRadians = i || null, this.boundingSphere_, this.blockLimiter_ = !1, this.promise_, this.ol3d, this.cesiumInitialTilt_ = zw(50), this.fogDensity = 1e-4, this.fogSSEFactor = 25, this.minimumZoomDistance = 2, this.maximumZoomDistance = 1e7, this.limitCameraToBoundingSphereRatio = (t => t > 3e3 ? 9 : 3)
|
||
}
|
||
|
||
load() {
|
||
if (!this.promise_) {
|
||
const t = new $w(this.cesiumUrl_);
|
||
this.promise_ = t.load().then(() => this.onCesiumLoaded())
|
||
}
|
||
return this.promise_
|
||
}
|
||
|
||
onCesiumLoaded() {
|
||
if (this.cameraExtentInRadians) {
|
||
const t = new Cesium.Rectangle(...this.cameraExtentInRadians);
|
||
Cesium.Camera.DEFAULT_VIEW_RECTANGLE = t, this.boundingSphere_ = Cesium.BoundingSphere.fromRectangle3D(t, Cesium.Ellipsoid.WGS84, 300)
|
||
}
|
||
this.ol3d = this.instantiateOLCesium();
|
||
const t = this.ol3d.getCesiumScene();
|
||
return this.configureForUsability(t), this.configureForPerformance(t), this.dispatchEvent("load"), this.ol3d
|
||
}
|
||
|
||
instantiateOLCesium() {
|
||
console.assert(this.map);
|
||
const t = new Jw({map: this.map}), e = t.getCesiumScene(), i = Cesium.createWorldTerrain();
|
||
return e.terrainProvider = i, t
|
||
}
|
||
|
||
configureForPerformance(t) {
|
||
const e = t.fog;
|
||
e.enabled = !0, e.density = this.fogDensity, e.screenSpaceErrorFactor = this.fogSSEFactor
|
||
}
|
||
|
||
configureForUsability(t) {
|
||
const e = t.screenSpaceCameraController;
|
||
e.minimumZoomDistance = this.minimumZoomDistance, e.maximumZoomDistance = this.maximumZoomDistance, t.globe.depthTestAgainstTerrain = !0, t.globe.baseColor = Cesium.Color.WHITE, t.backgroundColor = Cesium.Color.WHITE, this.boundingSphere_ && t.postRender.addEventListener(this.limitCameraToBoundingSphere.bind(this), t), this.ol3d.enableAutoRenderLoop()
|
||
}
|
||
|
||
limitCameraToBoundingSphere() {
|
||
if (this.boundingSphere_ && !this.blockLimiter_) {
|
||
const t = this.ol3d.getCesiumScene().camera, e = t.position,
|
||
i = Cesium.Cartographic.fromCartesian(e), r = this.limitCameraToBoundingSphereRatio(i.height);
|
||
if (Cesium.Cartesian3.distance(this.boundingSphere_.center, e) > this.boundingSphere_.radius * r) {
|
||
if (!0 === t.flying) return;
|
||
{
|
||
this.blockLimiter_ = !0;
|
||
const e = () => this.blockLimiter_ = !1;
|
||
t.flyToBoundingSphere(this.boundingSphere_, {complete: e, cancel: e})
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
toggle3d() {
|
||
return this.load().then(t => {
|
||
const e = t.getEnabled(), i = t.getCesiumScene();
|
||
return e ? (console.assert(this.map), Dw.resetToNorthZenith(this.map, i).then(() => {
|
||
t.setEnabled(!1), this.dispatchEvent("toggle")
|
||
})) : (t.setEnabled(!0), this.dispatchEvent("toggle"), Dw.rotateAroundBottomCenter(i, this.cesiumInitialTilt_))
|
||
})
|
||
}
|
||
|
||
set3dWithView(t, e, i, r, o) {
|
||
return this.load().then(n => {
|
||
const s = n.getEnabled(), a = n.getCesiumScene().camera, l = Cesium.Cartesian3.fromDegrees(t, e, i),
|
||
h = {heading: Cesium.Math.toRadians(r), pitch: Cesium.Math.toRadians(o), roll: 0};
|
||
s || (n.setEnabled(!0), this.dispatchEvent("toggle")), a.setView({destination: l, orientation: h})
|
||
})
|
||
}
|
||
|
||
is3dEnabled() {
|
||
return !!this.ol3d && this.ol3d.getEnabled()
|
||
}
|
||
|
||
getHeading() {
|
||
return this.map && this.map.getView().getRotation() || 0
|
||
}
|
||
|
||
getTiltOnGlobe() {
|
||
const t = this.ol3d.getCesiumScene();
|
||
return -Dw.computeSignedTiltAngleOnGlobe(t)
|
||
}
|
||
|
||
setHeading(t) {
|
||
const e = this.ol3d.getCesiumScene(), i = Dw.pickBottomPoint(e);
|
||
i && Dw.setHeadingUsingBottomCenter(e, t, i)
|
||
}
|
||
|
||
getOl3d() {
|
||
return this.ol3d
|
||
}
|
||
|
||
getOlView() {
|
||
const t = this.map.getView();
|
||
return console.assert(t), t
|
||
}
|
||
|
||
getCesiumViewMatrix() {
|
||
return this.ol3d.getCesiumScene().camera.viewMatrix
|
||
}
|
||
|
||
getCesiumScene() {
|
||
return this.ol3d.getCesiumScene()
|
||
}
|
||
|
||
flyToRectangle(t, e = 0) {
|
||
const i = this.getCesiumScene().camera, r = i.getRectangleCameraCoordinates(t),
|
||
o = Cesium.Cartesian3.magnitude(r) + e;
|
||
return Cesium.Cartesian3.normalize(r, r), Cesium.Cartesian3.multiplyByScalar(r, o, r), new Promise((t, e) => {
|
||
this.cameraExtentInRadians ? i.flyTo({
|
||
destination: r,
|
||
complete: () => t(),
|
||
cancel: () => e(),
|
||
endTransform: Cesium.Matrix4.IDENTITY
|
||
}) : e()
|
||
})
|
||
}
|
||
|
||
getCameraExtentRectangle() {
|
||
if (this.cameraExtentInRadians) return new Cesium.Rectangle(...this.cameraExtentInRadians)
|
||
}
|
||
}, tb = window.olcs = {};
|
||
tb.OLCesium = Jw, tb.AbstractSynchronizer = Vw, tb.RasterSynchronizer = Yw, tb.VectorSynchronizer = Xw, tb.core = Dw, tb.core.OLImageryProvider = Fw, tb.core.VectorLayerCounterpart = Ww, tb.contrib = {}, tb.contrib.LazyLoader = $w, tb.contrib.Manager = Qw;
|
||
var eb = i(4), ib = i.n(eb), rb = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"];
|
||
|
||
function ob(t, e) {
|
||
const i = {};
|
||
for (const e in t) "ref" !== e && (i[e] = t[e]);
|
||
return rb.forEach(t => {
|
||
t in e && (i[t] = e[t])
|
||
}), i
|
||
}
|
||
|
||
var nb = function (t) {
|
||
t = t.slice();
|
||
const e = Object.create(null);
|
||
for (let i = 0; i < t.length; i++) e[t[i].id] = t[i];
|
||
for (let i = 0; i < t.length; i++) "ref" in t[i] && (t[i] = ob(t[i], e[t[i].ref]));
|
||
return t
|
||
};
|
||
var sb = i(11), ab = i(2);
|
||
|
||
function lb(t) {
|
||
return t * Math.PI / 180
|
||
}
|
||
|
||
const hb = function () {
|
||
const t = [];
|
||
for (let e = 78271.51696402048; t.length <= 24; e /= 2) t.push(e);
|
||
return t
|
||
}();
|
||
const ub = Array(256).join(" ");
|
||
|
||
function cb(t, e) {
|
||
if (e >= .05) {
|
||
let i = "";
|
||
const r = t.split("\n"), o = ub.slice(0, Math.round(e / .1));
|
||
for (let t = 0, e = r.length; t < e; ++t) t > 0 && (i += "\n"), i += r[t].split("").join(o);
|
||
return i
|
||
}
|
||
return t
|
||
}
|
||
|
||
const pb = document.createElement("CANVAS").getContext("2d");
|
||
|
||
function db(t, e) {
|
||
return pb.measureText(t).width + (t.length - 1) * e
|
||
}
|
||
|
||
let fb = {};
|
||
|
||
function gb(t, e, i, r) {
|
||
const o = i + "," + e + "," + t + "," + r;
|
||
let n = fb[o];
|
||
if (!n) {
|
||
const s = t.split(" ");
|
||
if (s.length > 1) {
|
||
pb.font = e;
|
||
const t = pb.measureText("M").width * i;
|
||
let o = "";
|
||
const a = [];
|
||
for (let e = 0, i = s.length; e < i; ++e) {
|
||
const i = s[e], n = o + (o ? " " : "") + i;
|
||
db(n, r) <= t ? o = n : (o && a.push(o), o = i)
|
||
}
|
||
o && a.push(o);
|
||
for (let e = 0, i = a.length; e < i; ++e) {
|
||
const o = a[e];
|
||
if (db(o, r) < .35 * t) {
|
||
const t = e > 0 ? db(a[e - 1], r) : 1 / 0, n = e < i - 1 ? db(a[e + 1], r) : 1 / 0;
|
||
a.splice(e, 1), t < n ? (a[e - 1] += " " + o, e -= 1) : a[e] = o + " " + a[e], i -= 1
|
||
}
|
||
}
|
||
for (let e = 0, i = a.length - 1; e < i; ++e) {
|
||
const o = a[e], n = a[e + 1];
|
||
if (db(o, r) > .7 * t && db(n, r) < .6 * t) {
|
||
const s = o.split(" "), l = s.pop();
|
||
db(l, r) < .2 * t && (a[e] = s.join(" "), a[e + 1] = l + " " + n), i -= 1
|
||
}
|
||
}
|
||
n = a.join("\n")
|
||
} else n = t;
|
||
n = cb(n, r), fb[o] = n
|
||
}
|
||
return n
|
||
}
|
||
|
||
Ma && w(Ma, F.CLEAR, function () {
|
||
fb = {}
|
||
});
|
||
const mb = ab.function.isFunction, yb = ab.function.convertFunction, vb = ab.expression.isExpression,
|
||
_b = ab.expression.createPropertyExpression,
|
||
xb = {Point: 1, MultiPoint: 1, LineString: 2, MultiLineString: 2, Polygon: 3, MultiPolygon: 3},
|
||
wb = function (t, e) {
|
||
const i = _b(t, e);
|
||
if ("error" === i.result) throw new Error(i.value.map(t => `${t.key}: ${t.message}`).join(", "));
|
||
return i.value
|
||
}, bb = {}, Cb = {zoom: 0}, Sb = {};
|
||
|
||
function Eb(t, e, i, r, o) {
|
||
const n = t.id;
|
||
Sb[n] || (Sb[n] = {});
|
||
const s = Sb[n];
|
||
if (!s[i]) {
|
||
let r = (t[e] || bb)[i];
|
||
const o = sb[`${e}_${t.type}`][i];
|
||
void 0 === r && (r = o.default);
|
||
let n = vb(r);
|
||
if (!n && mb(r) && (r = yb(r, o), n = !0), n) {
|
||
const t = wb(r, o);
|
||
s[i] = t.evaluate.bind(t)
|
||
} else "color" == o.type && (r = ab.Color.parse(r)), s[i] = function () {
|
||
return r
|
||
}
|
||
}
|
||
return Cb.zoom = r, s[i](Cb, o)
|
||
}
|
||
|
||
const Tb = {};
|
||
|
||
function Rb(t, e, i, r) {
|
||
return t in Tb || (Tb[t] = Object(ab.featureFilter)(e)), Cb.zoom = r, Tb[t](Cb, i)
|
||
}
|
||
|
||
function Pb(t, e) {
|
||
if (t) {
|
||
if (0 === t.a || 0 === e) return;
|
||
const i = t.a;
|
||
return e = void 0 === e ? 1 : e, "rgba(" + Math.round(255 * t.r / i) + "," + Math.round(255 * t.g / i) + "," + Math.round(255 * t.b / i) + "," + i * e + ")"
|
||
}
|
||
return t
|
||
}
|
||
|
||
const Lb = /^([^]*)\{(.*)\}([^]*)$/;
|
||
|
||
function Ib(t, e) {
|
||
let i;
|
||
do {
|
||
if (i = t.match(Lb)) {
|
||
const r = e[i[2]] || "";
|
||
t = i[1] + r + i[3]
|
||
}
|
||
} while (i);
|
||
return t
|
||
}
|
||
|
||
var Ob = function (t, e, i, r = hb, o, n, s) {
|
||
if ("string" == typeof e && (e = JSON.parse(e)), 8 != e.version) throw new Error("glStyle version 8 required.");
|
||
let a, l;
|
||
if (n) {
|
||
const e = new Image;
|
||
e.crossOrigin = "anonymous", e.onload = function () {
|
||
a = e, l = [e.width, e.height], t.changed(), e.onload = null
|
||
}, e.src = n
|
||
}
|
||
const h = nb(e.layers), u = {}, c = [];
|
||
let p;
|
||
for (let t = 0, r = h.length; t < r; ++t) {
|
||
const r = h[t], o = r.id;
|
||
if ("string" == typeof i && r.source == i || -1 !== i.indexOf(o)) {
|
||
const i = r["source-layer"];
|
||
if (!p) {
|
||
p = r.source;
|
||
const t = e.sources[p];
|
||
if (!t) throw new Error(`Source "${p}" is not defined`);
|
||
const i = t.type;
|
||
if ("vector" !== i && "geojson" !== i) throw new Error(`Source "${p}" is not of type "vector" or "geojson", but "${i}"`)
|
||
}
|
||
let n = u[i];
|
||
n || (n = u[i] = []), n.push({layer: r, index: t}), c.push(o)
|
||
}
|
||
delete Sb[o], delete Tb[o]
|
||
}
|
||
const d = new go, f = new po, g = {}, m = {}, y = [], v = function (t, e) {
|
||
const i = t.getProperties(), n = u[i.layer];
|
||
if (!n) return;
|
||
let h = r.indexOf(e);
|
||
-1 == h && (h = function (t, e) {
|
||
let i = 0;
|
||
const r = e.length;
|
||
for (; i < r; ++i) if (e[i] < t && i + 1 < r) {
|
||
const r = e[i] / e[i + 1];
|
||
return i + Math.log(e[i] / t) / Math.log(r)
|
||
}
|
||
return r - 1
|
||
}(e, r));
|
||
const c = xb[t.getGeometry().getType()], p = {properties: i, type: c};
|
||
let v = -1;
|
||
for (let r = 0, u = n.length; r < u; ++r) {
|
||
const u = n[r], _ = u.layer, x = _.id, w = _.layout || bb, b = _.paint || bb;
|
||
if ("none" === w.visibility || "minzoom" in _ && h < _.minzoom || "maxzoom" in _ && h >= _.maxzoom) continue;
|
||
const C = _.filter;
|
||
if (!C || Rb(x, C, p, h)) {
|
||
let r, n, x, C, S, E;
|
||
const T = u.index;
|
||
if (3 == c && "fill" == _.type) if (n = Eb(_, "paint", "fill-opacity", h, p), "fill-pattern" in b) {
|
||
const t = Eb(_, "paint", "fill-pattern", h, p);
|
||
if (t) {
|
||
const e = Ib(t, i);
|
||
if (a && o && o[e]) {
|
||
(E = y[++v]) && E.getFill() && !E.getStroke() && !E.getText() || (E = y[v] = new uf({fill: new po})), x = E.getFill(), E.setZIndex(T);
|
||
const t = e + "." + n;
|
||
let i = m[t];
|
||
if (!i) {
|
||
const r = o[e], s = document.createElement("canvas");
|
||
s.width = r.width, s.height = r.height;
|
||
const l = s.getContext("2d");
|
||
l.globalAlpha = n, l.drawImage(a, r.x, r.y, r.width, r.height, 0, 0, r.width, r.height), i = l.createPattern(s, "repeat"), m[t] = i
|
||
}
|
||
x.setColor(i)
|
||
}
|
||
}
|
||
} else (r = Pb(Eb(_, "paint", "fill-color", h, p), n)) && ("fill-outline-color" in b && (S = Pb(Eb(_, "paint", "fill-outline-color", h, p), n)), S || (S = r), (E = y[++v]) && E.getFill() && E.getStroke() && !E.getText() || (E = y[v] = new uf({
|
||
fill: new po,
|
||
stroke: new go
|
||
})), (x = E.getFill()).setColor(r), (C = E.getStroke()).setColor(S), C.setWidth(1), E.setZIndex(T));
|
||
if (1 != c && "line" == _.type) {
|
||
r = !("line-pattern" in b) && "line-color" in b ? Pb(Eb(_, "paint", "line-color", h, p), Eb(_, "paint", "line-opacity", h, p)) : void 0;
|
||
const t = Eb(_, "paint", "line-width", h, p);
|
||
r && t > 0 && ((E = y[++v]) && E.getStroke() && !E.getFill() && !E.getText() || (E = y[v] = new uf({stroke: new go})), (C = E.getStroke()).setLineCap(Eb(_, "layout", "line-cap", h, p)), C.setLineJoin(Eb(_, "layout", "line-join", h, p)), C.setMiterLimit(Eb(_, "layout", "line-miter-limit", h, p)), C.setColor(r), C.setWidth(t), C.setLineDash(b["line-dasharray"] ? Eb(_, "paint", "line-dasharray", h, p).map(function (e) {
|
||
return e * t
|
||
}) : null), E.setZIndex(T))
|
||
}
|
||
let R, P, L, I, O = !1, M = null, A = 0;
|
||
if ((1 == c || 2 == c) && "icon-image" in w) {
|
||
const n = Eb(_, "layout", "icon-image", h, p);
|
||
if (n) {
|
||
R = Ib(n, i);
|
||
let s = void 0;
|
||
if (a && o && o[R]) {
|
||
const i = Eb(_, "layout", "icon-rotation-alignment", h, p);
|
||
if (2 == c) {
|
||
const r = t.getGeometry();
|
||
if (r.getFlatMidpoint) {
|
||
const t = r.getExtent();
|
||
if (Math.sqrt(Math.max(Math.pow((t[2] - t[0]) / e, 2), Math.pow((t[3] - t[1]) / e, 2))) > 150) {
|
||
const t = r.getFlatMidpoint();
|
||
if (s = new qi(t), "line" === Eb(_, "layout", "symbol-placement", h, p) && "map" === i) {
|
||
const e = r.getStride(), i = r.getFlatCoordinates();
|
||
for (let r = 0, o = i.length - e; r < o; r += e) {
|
||
const o = i[r], n = i[r + 1], s = i[r + e], a = i[r + e + 1],
|
||
l = Math.min(o, s), h = Math.min(n, a), u = Math.max(o, s),
|
||
c = Math.max(n, a);
|
||
if (t[0] >= l && t[0] <= u && t[1] >= h && t[1] <= c) {
|
||
A = Math.atan2(n - a, s - o);
|
||
break
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
if (2 !== c || s) {
|
||
(E = y[++v]) && E.getImage() && !E.getFill() && !E.getStroke() || (E = y[v] = new uf), E.setGeometry(s);
|
||
const t = Eb(_, "layout", "icon-size", h, p),
|
||
e = void 0 !== b["icon-color"] ? Eb(_, "paint", "icon-color", h, p) : null;
|
||
let n = R + "." + t;
|
||
if (null !== e && (n += "." + e), !(P = g[n])) {
|
||
const s = o[R];
|
||
if (null !== e) {
|
||
r = Pb(e, 1);
|
||
const i = document.createElement("canvas");
|
||
i.width = s.width, i.height = s.height;
|
||
const o = i.getContext("2d");
|
||
o.drawImage(a, s.x, s.y, s.width, s.height, 0, 0, s.width, s.height);
|
||
const l = o.getImageData(0, 0, i.width, i.height);
|
||
for (let t = 0, e = l.data.length; t < e; t += 4) l.data[t] = r[0], l.data[t + 1] = r[1], l.data[t + 2] = r[2];
|
||
o.putImageData(l, 0, 0), P = g[n] = new Xd({
|
||
img: i,
|
||
imgSize: [i.width, i.height],
|
||
scale: t / s.pixelRatio
|
||
})
|
||
} else P = g[n] = new Xd({
|
||
img: a,
|
||
imgSize: l,
|
||
size: [s.width, s.height],
|
||
offset: [s.x, s.y],
|
||
rotateWithView: "map" === i,
|
||
scale: t / s.pixelRatio
|
||
})
|
||
}
|
||
P.setRotation(A + lb(Eb(_, "layout", "icon-rotate", h, p))), P.setOpacity(Eb(_, "paint", "icon-opacity", h, p)), E.setImage(P), M = E.getText(), E.setText(void 0), E.setZIndex(99999 - T), O = !0, L = !1
|
||
} else L = !0
|
||
}
|
||
}
|
||
}
|
||
if (1 == c && "circle-radius" in b) {
|
||
(E = y[++v]) && E.getImage() && !E.getFill() && !E.getStroke() || (E = y[v] = new uf);
|
||
const t = Eb(_, "paint", "circle-radius", h, p),
|
||
e = Pb(Eb(_, "paint", "circle-stroke-color", h, p), Eb(_, "paint", "circle-stroke-opacity", h, p)),
|
||
i = Pb(Eb(_, "paint", "circle-color", h, p), Eb(_, "paint", "circle-opacity", h, p)),
|
||
r = Eb(_, "paint", "circle-stroke-width", h, p), o = t + "." + e + "." + i + "." + r;
|
||
(P = g[o]) || (P = g[o] = new Zd({
|
||
radius: t,
|
||
stroke: e && r > 0 ? new go({width: r, color: e}) : void 0,
|
||
fill: i ? new po({color: i}) : void 0
|
||
})), E.setImage(P), M = E.getText(), E.setText(void 0), E.setGeometry(void 0), E.setZIndex(99999 - T), O = !0
|
||
}
|
||
if ("text-field" in w) {
|
||
I = Ib(Eb(_, "layout", "text-field", h, p).toString(), i), n = Eb(_, "paint", "text-opacity", h, p)
|
||
}
|
||
if (I && n && !L) {
|
||
O || ((E = y[++v]) && E.getText() && !E.getFill() && !E.getStroke() || (E = y[v] = new uf), E.setImage(void 0), E.setGeometry(void 0)), E.getText() || E.setText(M || new vo({padding: [2, 2, 2, 2]})), M = E.getText();
|
||
const t = Eb(_, "layout", "text-size", h, p), e = Eb(_, "layout", "text-font", h, p),
|
||
i = Eb(_, "layout", "text-line-height", h, p), r = ib()(s ? s(e) : e, t, i),
|
||
o = w["text-transform"];
|
||
"uppercase" == o ? I = I.toUpperCase() : "lowercase" == o && (I = I.toLowerCase());
|
||
const a = Eb(_, "layout", "text-max-width", h, p),
|
||
l = Eb(_, "layout", "text-letter-spacing", h, p),
|
||
u = 2 == c ? cb(I, l) : gb(I, r, a, l);
|
||
M.setText(u), M.setFont(r), M.setRotation(lb(Eb(_, "layout", "text-rotate", h, p)));
|
||
const g = Eb(_, "layout", "text-anchor", h, p),
|
||
m = O || 1 == c ? "point" : Eb(_, "layout", "symbol-placement", h, p);
|
||
M.setPlacement(m);
|
||
let x = Eb(_, "paint", "text-halo-width", h, p);
|
||
const b = Eb(_, "layout", "text-offset", h, p), C = Eb(_, "paint", "text-translate", h, p);
|
||
let S = 0, R = 0;
|
||
if ("point" == m) {
|
||
let t = "center";
|
||
-1 !== g.indexOf("left") ? (t = "left", R = x) : -1 !== g.indexOf("right") && (t = "right", R = -x), M.setTextAlign(t)
|
||
} else M.setMaxAngle(lb(Eb(_, "layout", "text-max-angle", h, p))), M.setTextAlign();
|
||
let P = "middle";
|
||
0 == g.indexOf("bottom") ? (P = "bottom", S = -x - .5 * (i - 1) * t) : 0 == g.indexOf("top") && (P = "top", S = x + .5 * (i - 1) * t), M.setTextBaseline(P), M.setOffsetX(b[0] * t + R + C[0]), M.setOffsetY(b[1] * t + S + C[1]), f.setColor(Pb(Eb(_, "paint", "text-color", h, p), n)), M.setFill(f);
|
||
const L = Pb(Eb(_, "paint", "text-halo-color", h, p), n);
|
||
if (L) {
|
||
d.setColor(L), x *= 2;
|
||
const e = .5 * t;
|
||
d.setWidth(x <= e ? x : e), M.setStroke(d)
|
||
} else M.setStroke(void 0);
|
||
const A = Eb(_, "layout", "text-padding", h, p), k = M.getPadding();
|
||
A !== k[0] && (k[0] = k[1] = k[2] = k[3] = A), E.setZIndex(99999 - T)
|
||
}
|
||
}
|
||
}
|
||
return v > -1 ? (y.length = v + 1, y) : void 0
|
||
};
|
||
return t.setStyle(v), t.set("mapbox-source", p), t.set("mapbox-layers", c), v
|
||
}, Mb = i(12);
|
||
const Ab = /font-family: ?([^;]*);/, kb = /("|')/g;
|
||
let Fb;
|
||
|
||
function Nb(t) {
|
||
if (!Fb) {
|
||
Fb = {};
|
||
const t = document.styleSheets;
|
||
for (let e = 0, i = t.length; e < i; ++e) {
|
||
const i = t[e];
|
||
try {
|
||
const t = i.rules || i.cssRules;
|
||
if (t) for (let e = 0, i = t.length; e < i; ++e) {
|
||
const i = t[e];
|
||
if (5 == i.type) {
|
||
const t = i.cssText.match(Ab);
|
||
Fb[t[1].replace(kb, "")] = !0
|
||
}
|
||
}
|
||
} catch (t) {
|
||
}
|
||
}
|
||
}
|
||
return t in Fb
|
||
}
|
||
|
||
const Db = {}, Gb = i.n(Mb).a.getNames();
|
||
|
||
function jb(t) {
|
||
const e = t.toString();
|
||
if (e in Db) return t;
|
||
const i = t.map(function (t) {
|
||
const e = ib()(t, 1).split(" ");
|
||
return [e.slice(3, 5).join(" ").replace(/"/g, ""), e[1] + e[0]]
|
||
});
|
||
for (let t = 0, e = i.length; t < e; ++t) {
|
||
const e = i[t], r = e[0];
|
||
if (!Nb(r) && -1 !== Gb.indexOf(r)) {
|
||
const t = "https://fonts.googleapis.com/css?family=" + r.replace(/ /g, "+") + ":" + e[1];
|
||
if (!document.querySelector('link[href="' + t + '"]')) {
|
||
const e = document.createElement("link");
|
||
e.href = t, e.rel = "stylesheet", document.head.appendChild(e)
|
||
}
|
||
}
|
||
}
|
||
return Db[e] = !0, t
|
||
}
|
||
|
||
const zb = /^(.*)(\?.*)$/;
|
||
|
||
function Ub(t, e) {
|
||
return e && t.startsWith(".") && (t = e + t), t
|
||
}
|
||
|
||
function Bb(t, e, i) {
|
||
const r = (t = Ub(t, e)).match(zb);
|
||
return r ? r[1] + i + (r.length > 2 ? r[2] : "") : t + i
|
||
}
|
||
|
||
function Vb(t, e, i, r, o) {
|
||
return new Promise(function (n, s) {
|
||
if ("object" != typeof e && (e = JSON.parse(e)), 8 != e.version) return s(new Error("glStyle version 8 required."));
|
||
if (!(t instanceof v_ || t instanceof ux)) return s(new Error("Can only apply to VectorLayer or VectorTileLayer"));
|
||
let a, l, h, u;
|
||
|
||
function c() {
|
||
u || e.sprite && !l ? u ? (t.setStyle(u), n()) : s(new Error("Something went wrong trying to apply style.")) : (u = Ob(t, e, i, o, l, h, jb), t.getStyle() ? n() : s(new Error(`Nothing to show for source [${i}]`)))
|
||
}
|
||
|
||
if (e.sprite) {
|
||
const t = .5 == (a = window.devicePixelRatio >= 1.5 ? .5 : 1) ? "@2x" : "";
|
||
let i = Bb(e.sprite, r, t + ".json");
|
||
fetch(i, {credentials: "same-origin"}).then(function (o) {
|
||
return o.ok || "" === t ? o : (i = Bb(e.sprite, r, ".json"), fetch(i, {credentials: "same-origin"}))
|
||
}).then(function (t) {
|
||
if (t.ok) return t.json();
|
||
s(new Error(`Problem fetching sprite from ${i}: ${t.statusText}`))
|
||
}).then(function (i) {
|
||
if (void 0 === i || 0 === Object.keys(i).length) return s(new Error("No sprites found."));
|
||
l = i, h = Bb(e.sprite, r, t + ".png"), c()
|
||
}).catch(function (t) {
|
||
s(new Error(`Sprites cannot be loaded: ${i}: ${t.message}`))
|
||
})
|
||
} else c()
|
||
})
|
||
}
|
||
|
||
const Yb = {};
|
||
|
||
function Wb(t, e) {
|
||
const i = {type: e.type};
|
||
|
||
function r() {
|
||
const r = t.getTargetElement();
|
||
if (!r) return;
|
||
const o = e.layout || {}, n = e.paint || {};
|
||
i.paint = n, i.id = "olms-bg-" + n["background-opacity"] + n["background-color"];
|
||
const s = t.getView().getZoom();
|
||
if (void 0 !== n["background-color"]) {
|
||
const t = Eb(i, "paint", "background-color", s, Yb);
|
||
r.style.backgroundColor = ab.Color.parse(t).toString()
|
||
}
|
||
void 0 !== n["background-opacity"] && (r.style.opacity = Eb(i, "paint", "background-opacity", s, Yb)), "none" == o.visibility && (r.style.backgroundColor = "", r.style.opacity = "")
|
||
}
|
||
|
||
t.getTargetElement() && r(), t.on(["change:resolution", "change:target"], r)
|
||
}
|
||
|
||
function Hb(t, e) {
|
||
let i;
|
||
return t.some(function (t) {
|
||
if (t.id == e) return i = t.source, !0
|
||
}), i
|
||
}
|
||
|
||
function Xb(t) {
|
||
const e = t.bounds;
|
||
if (e) {
|
||
const t = $e([e[0], e[1]]), i = $e([e[2], e[3]]);
|
||
return [t[0], t[1], i[0], i[1]]
|
||
}
|
||
}
|
||
|
||
function qb(t, e, i) {
|
||
if (t = Object.assign({}, t), i && 0 == i.indexOf("mapbox://")) {
|
||
const r = i.replace("mapbox://", "");
|
||
t.tiles = ["a", "b", "c", "d"].map(function (i) {
|
||
return "https://" + i + ".tiles.mapbox.com/v4/" + r + "/{z}/{x}/{y}." + ("vector" == t.type ? "vector.pbf" : "png") + e
|
||
})
|
||
}
|
||
const r = new ux({declutter: !0, visible: !1}),
|
||
o = new pw({url: t.tiles ? void 0 : i, tileJSON: t.tiles ? t : void 0}),
|
||
n = o.on("change", function () {
|
||
const e = o.getState();
|
||
if ("ready" === e) {
|
||
const e = o.getTileJSON(), i = Array.isArray(e.tiles) ? e.tiles : [e.tiles];
|
||
if (t.url) for (let e = 0, r = i.length; e < r; ++e) {
|
||
const r = i[e];
|
||
0 != r.indexOf("http") && (i[e] = t.url + r)
|
||
}
|
||
const s = o.getTileGrid(), a = Xb(e), l = e.minzoom || 0, h = e.maxzoom || 22, u = new yw({
|
||
attributions: o.getAttributions(),
|
||
format: new cm,
|
||
tileGrid: new Xu({
|
||
origin: s.getOrigin(),
|
||
extent: a || s.getExtent(),
|
||
minZoom: l,
|
||
resolutions: hb.slice(0, h + 1),
|
||
tileSize: 512
|
||
}),
|
||
urls: i
|
||
});
|
||
N(n), r.setSource(u)
|
||
} else "error" === e && (N(n), r.setSource(void 0))
|
||
});
|
||
return t.tiles && o.changed(), r
|
||
}
|
||
|
||
function Zb(t, e) {
|
||
const i = new lx, r = new pw({
|
||
transition: 0,
|
||
url: t.tiles ? void 0 : e,
|
||
tileJSON: t.tiles ? t : void 0,
|
||
crossOrigin: "anonymous"
|
||
}), o = r.on("change", function () {
|
||
const e = r.getState();
|
||
if ("ready" === e) {
|
||
N(o);
|
||
const e = r.getTileJSON(), n = Xb(e), s = r.getTileGrid(), a = t.tileSize || e.tileSize || 512,
|
||
l = e.minzoom || 0, h = e.maxzoom || 22;
|
||
r.tileGrid = new Xu({
|
||
origin: s.getOrigin(),
|
||
extent: n || s.getExtent(),
|
||
minZoom: l,
|
||
resolutions: Ju({maxZoom: h, tileSize: a}).getResolutions(),
|
||
tileSize: a
|
||
}), i.setSource(r)
|
||
} else "error" === e && (N(o), i.setSource(void 0))
|
||
});
|
||
return r.setTileLoadFunction(function (t, e) {
|
||
if (-1 != e.indexOf("{bbox-epsg-3857}")) {
|
||
const i = r.getTileGrid().getTileCoordExtent(t.getTileCoord());
|
||
e = e.replace("{bbox-epsg-3857}", i.toString())
|
||
}
|
||
t.getImage().src = e
|
||
}), i
|
||
}
|
||
|
||
const Kb = new Od;
|
||
|
||
function Jb(t, e) {
|
||
const i = t.data;
|
||
let r, o;
|
||
return "string" == typeof i ? o = Ub(i, e) : r = Kb.readFeatures(i, {featureProjection: "EPSG:3857"}), new v_({
|
||
source: new b_({
|
||
attributions: t.attribution,
|
||
features: r,
|
||
format: Kb,
|
||
url: o
|
||
}), visible: !1
|
||
})
|
||
}
|
||
|
||
function $b(t, e, i) {
|
||
const r = Eb(t, "paint", "raster-opacity", i.getZoom(), Yb);
|
||
e.setOpacity(r)
|
||
}
|
||
|
||
function Qb(t, e, i, r, o, n) {
|
||
const s = [];
|
||
let a = e.getView();
|
||
a.isDef() || a.getRotation() || a.getResolutions() || (a = new ss({resolutions: hb}), e.setView(a)), "center" in t && !a.getCenter() && a.setCenter($e(t.center)), "zoom" in t && void 0 === a.getZoom() && a.setResolution(hb[0] / Math.pow(2, t.zoom)), a.getCenter() && void 0 !== a.getZoom() || a.fit(a.getProjection().getExtent(), {
|
||
nearest: !0,
|
||
size: e.getSize()
|
||
}), t.sprite && (0 == t.sprite.indexOf("mapbox://") ? t.sprite = i + "/sprite" + n : 0 != t.sprite.indexOf("http") && (t.sprite = (r ? r + o : "") + t.sprite + n));
|
||
const l = t.layers;
|
||
let h, u, c, p, d, f, g = [];
|
||
for (let i = 0, r = l.length; i < r; ++i) {
|
||
const r = (h = l[i]).type;
|
||
"heatmap" == r || "fill-extrusion" == r || "hillshade" == r || ("background" == r ? Wb(e, h) : ((p = h.source || Hb(l, h.ref)) != c && (g.length && (s.push(eC(d, g, t, o, e)), g = []), (f = (u = t.sources[p]).url) && o && f.startsWith(".") && (f = o + f), "vector" == u.type ? d = qb(u, n, f) : "raster" == u.type ? ((d = Zb(u, f)).setVisible(!h.layout || "none" !== h.layout.visibility), a.on("change:resolution", $b.bind(this, h, d, a)), $b(h, d, a)) : "geojson" == u.type && (d = Jb(u, o)), c = p, d && d.set("mapbox-source", c)), g.push(h.id)))
|
||
}
|
||
return s.push(eC(d, g, t, o, e)), e.set("mapbox-style", t), Promise.all(s)
|
||
}
|
||
|
||
function tC(t, e) {
|
||
let i, r, o, n, s;
|
||
if (i = r = o = n = "", t instanceof rh || (t = new rh({target: t})), "string" == typeof e) {
|
||
const a = e.match(zb);
|
||
a && (r = a[1], i = a.length > 2 ? a[2] : ""), s = new Promise(function (s, a) {
|
||
fetch(e, {credentials: "same-origin"}).then(function (t) {
|
||
return t.json()
|
||
}).then(function (l) {
|
||
const h = document.createElement("A");
|
||
h.href = e;
|
||
const u = h.href;
|
||
n = h.pathname.split("/").slice(0, -1).join("/") + "/", o = u.substr(0, u.indexOf(n)), Qb(l, t, r, o, n, i).then(function () {
|
||
s(t)
|
||
}).catch(a)
|
||
}).catch(function (t) {
|
||
a(new Error(`Could not load ${e}: ${t.message}`))
|
||
})
|
||
})
|
||
} else s = new Promise(function (i, r) {
|
||
Qb(e, t).then(function () {
|
||
i(t)
|
||
}).catch(r)
|
||
});
|
||
return s
|
||
}
|
||
|
||
function eC(t, e, i, r, o) {
|
||
let n = 24, s = 0;
|
||
const a = i.layers;
|
||
for (let t = 0, i = a.length; t < i; ++t) {
|
||
const i = a[t];
|
||
-1 !== e.indexOf(i.id) && (n = Math.min("minzoom" in i ? i.minzoom : 0, n), s = Math.max("maxzoom" in i ? i.maxzoom : 24, s))
|
||
}
|
||
return new Promise(function (a, l) {
|
||
const h = function () {
|
||
const o = t.getSource();
|
||
if (o && "error" !== o.getState()) {
|
||
if ("function" == typeof o.getTileGrid) {
|
||
const e = o.getTileGrid();
|
||
if (e) {
|
||
const i = e.getMinZoom();
|
||
(n > 0 || i > 0) && t.setMaxResolution(Math.min(hb[n], e.getResolution(i)) + 1e-9), s < 24 && t.setMinResolution(hb[s] + 1e-9)
|
||
}
|
||
}
|
||
o instanceof b_ || o instanceof yw ? Vb(t, i, e, r).then(function () {
|
||
t.setVisible(!0), a()
|
||
}, function (t) {
|
||
l(t)
|
||
}) : a()
|
||
} else l(new Error("Error accessing data for source " + t.get("mapbox-source")))
|
||
};
|
||
t.set("mapbox-layers", e), -1 === o.getLayers().getArray().indexOf(t) && o.addLayer(t, !0), t.getSource() ? h() : t.once("change:source", h)
|
||
})
|
||
}
|
||
|
||
tC.apply = function (t, e) {
|
||
return t instanceof rh || (t = new rh({target: t})), setTimeout(function () {
|
||
tC(t, e)
|
||
}, 0), t
|
||
}, tC.applyBackground = function (t, e) {
|
||
e.layers.some(function (e) {
|
||
if ("background" == e.type) return Wb(t, e), !0
|
||
})
|
||
}, tC.applyStyle = Vb, tC.stylefunction = Ob;
|
||
var iC = tC;
|
||
window.olms = iC;
|
||
var rC = class {
|
||
constructor(t, e) {
|
||
W(void 0 !== t, "经度坐标不能为空"), W(void 0 !== e, "纬度坐标不能为空"), this.coordinate_ = [parseFloat(t), parseFloat(e)]
|
||
}
|
||
|
||
getCoordinate() {
|
||
return this.coordinate_
|
||
}
|
||
|
||
toStringXY() {
|
||
var t = this.coordinate_;
|
||
return t[0] + "," + t[1]
|
||
}
|
||
|
||
distanceTo(t) {
|
||
return ce(this.getCoordinate(), t.getCoordinate())
|
||
}
|
||
};
|
||
var oC = class extends X {
|
||
constructor(t) {
|
||
super(t), this.layer_ = null, this.set("isAddToMap", !1)
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t;
|
||
var e = t.getVectorLayers(), i = this;
|
||
e.getLayers().forEach(function (t, e, r) {
|
||
if ("vector_default" === t.get("name")) {
|
||
var o = t;
|
||
o.getSource().addFeature(i), i.layer_ = o
|
||
}
|
||
}), this.set("isAddToMap", !0)
|
||
}
|
||
|
||
onRemove(t) {
|
||
if (this.get("isAddToMap")) {
|
||
this.popup_ && (this.map_.removeOverlay(this.popup_), this.popup_ = null), this.map_ = null;
|
||
var e = t.getVectorLayers(), i = this;
|
||
e.getLayers().forEach(function (t, e, r) {
|
||
"vector_default" === t.get("name") && t.getSource().removeFeature(i)
|
||
}), this.set("isAddToMap", !1)
|
||
}
|
||
}
|
||
|
||
getMBR() {
|
||
var t = this.getGeometry().getExtent();
|
||
return new Ez.MBR(t[0], t[1], t[2], t[3])
|
||
}
|
||
|
||
readGeoJSON(t) {
|
||
return (new ol.format.GeoJSON).readFeature(t)
|
||
}
|
||
|
||
toGeoJSON() {
|
||
var t = new ol.format.GeoJSON;
|
||
return JSON.parse(t.writeFeature(this))
|
||
}
|
||
|
||
getFillStyle_() {
|
||
return this.getStyle().getFill()
|
||
}
|
||
|
||
getStrokeStyle_() {
|
||
return this.getStyle().getStroke()
|
||
}
|
||
|
||
getFillColor() {
|
||
var t = this.getFillStyle_(), e = ol.color.asArray(t.getColor());
|
||
return ol.color.asString(e)
|
||
}
|
||
|
||
getFillOpacity() {
|
||
var t = this.getFillStyle_(), e = ol.color.asArray(t.getColor());
|
||
return parseFloat(e[3])
|
||
}
|
||
|
||
setFillColor(t) {
|
||
var e = this.getStyle(), i = this.getFillStyle_(), r = ol.color.asArray(i.getColor())[3],
|
||
o = ol.color.asArray(t);
|
||
o[3] = r, i.setColor(o), this.setStyle(e)
|
||
}
|
||
|
||
setFillOpacity(t) {
|
||
W(t >= 0 && t <= 1, "设置的透明度必须在[0,1]范围内");
|
||
var e = this.getStyle(), i = this.getFillStyle_(), r = ol.color.asArray(i.getColor());
|
||
r[3] = t, i.setColor(r), this.setStyle(e)
|
||
}
|
||
|
||
getStrokeColor() {
|
||
var t = this.getStrokeStyle_(), e = ol.color.asArray(t.getColor());
|
||
return ol.color.asString(e)
|
||
}
|
||
|
||
getStrokeWidth() {
|
||
return this.getStrokeStyle_().getWidth()
|
||
}
|
||
|
||
getStrokeOpacity() {
|
||
var t = this.getStrokeStyle_(), e = ol.color.asArray(t.getColor());
|
||
return parseFloat(e[3])
|
||
}
|
||
|
||
setStrokeColor(t) {
|
||
var e = this.getStyle(), i = this.getStrokeStyle_(), r = ol.color.asArray(i.getColor())[3],
|
||
o = ol.color.asArray(t);
|
||
o[3] = r, i.setColor(o), this.setStyle(e)
|
||
}
|
||
|
||
setStrokeWidth(t) {
|
||
var e = this.getStyle();
|
||
this.getStrokeStyle_().setWidth(t), this.setStyle(e)
|
||
}
|
||
|
||
setStrokeOpacity(t) {
|
||
W(t >= 0 && t <= 1, "设置的透明度必须在[0,1]范围内");
|
||
var e = this.getStyle(), i = this.getStrokeStyle_(), r = ol.color.asArray(i.getColor());
|
||
r[3] = t, i.setColor(r), this.setStyle(e)
|
||
}
|
||
|
||
show() {
|
||
if (!this.get("isAddToMap")) {
|
||
var t = this.map_.getVectorLayers(), e = this;
|
||
t.getLayers().forEach(function (t, i, r) {
|
||
"vector_default" === t.get("name") && t.getSource().addFeature(e)
|
||
}), this.set("isAddToMap", !0)
|
||
}
|
||
}
|
||
|
||
hide() {
|
||
if (this.get("isAddToMap")) {
|
||
var t = this.map_.getVectorLayers(), e = this;
|
||
t.getLayers().forEach(function (t, i, r) {
|
||
"vector_default" === t.get("name") && t.getSource().removeFeature(e)
|
||
}), this.set("isAddToMap", !1)
|
||
}
|
||
}
|
||
|
||
addTitle(t) {
|
||
t || W(!1, "EzTitle对象不能为空"), this.title_ = t, this.isTitleOnMap = !1, this.isTitleInited = !1
|
||
}
|
||
|
||
showTitle() {
|
||
this.map_ && this.title_ && (this.map_, this.isTitleInited || this.handleTitleInit_(), this.title_.show(), this.isTitleOnMap = !0)
|
||
}
|
||
|
||
handleTitleInit_() {
|
||
var t, e = this.getGeometry().getType();
|
||
t = e === ol.geom.GeometryType.CIRCLE ? this.getCenter() : e === ol.geom.GeometryType.POINT ? this.getCenter() : e === ol.geom.GeometryType.LINE_STRING ? this.getCenter() : e === ol.geom.GeometryType.POLYGON ? this.getCenter() : this.getPoint(), this.title_.setPosition(t), this.map_.addOverlay(this.title_), this.isTitleInited = !0
|
||
}
|
||
|
||
hideTitle() {
|
||
this.title_.hide(), this.isTitleOnMap = !1, this.title_.hide()
|
||
}
|
||
|
||
openInfoWindow(t, e, i) {
|
||
var r;
|
||
e instanceof Ez.Coordinate ? r = e.getCoordinate() : Array.isArray(e) ? r = e : W(!1, "请传入坐标数组或者EzCoord对象"), this.popup_ && (this.map_.removeOverlay(this.popup_), this.popup_ = null), this.popup_ = new Ez.Popup(i), this.map_.addOverlay(this.popup_), this.popup_.show(t, r)
|
||
}
|
||
|
||
closeInfoWindow() {
|
||
this.popup_ && (this.map_.removeOverlay(this.popup_), this.popup_ = null)
|
||
}
|
||
|
||
getBounds() {
|
||
var t = this.getGeometry().getExtent();
|
||
return new Ez.MBR(t[0], t[1], t[2], t[3])
|
||
}
|
||
|
||
flash(t) {
|
||
var e = t || {}, i = e.duration ? e.duration : 3e3, r = e.times ? e.times : 3;
|
||
if (this.hide(), this.getFillOpacity(), this.getStrokeOpacity(), this.map_) {
|
||
var o, n = (new Date).getTime(), s = new Date(n), a = this;
|
||
o = map.on("postcompose", function (t) {
|
||
var e = t.vectorContext, l = t.frameState, h = (l.time - n) / (i / r * 1.25),
|
||
u = new ol.style.Style({fill: new ol.style.Fill({color: "rgba(76,140,88," + h + ")"})});
|
||
if (e.drawFeature(a.clone(), u), h >= .8 && (n = l.time, h = 0), l.time - s > i) return ol.Observable.unByKey(o), map.render(), void a.show();
|
||
map.render()
|
||
}), map.render()
|
||
}
|
||
}
|
||
|
||
hexToRgb_(t) {
|
||
var e = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
||
return e ? [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)] : null
|
||
}
|
||
};
|
||
var nC = class extends Xd {
|
||
constructor(t) {
|
||
var e = t || {};
|
||
super(e), this.iconOpts = e
|
||
}
|
||
|
||
getOptions() {
|
||
return this.iconOpts
|
||
}
|
||
};
|
||
var sC = class {
|
||
constructor(t, e, i, r) {
|
||
this.minX = t, this.minY = e, this.maxX = i, this.maxY = r, this.value_ = [t, e, i, r]
|
||
}
|
||
|
||
centerPoint(t) {
|
||
var e = At(this.value_);
|
||
return t ? new rC(e[0], e[1]) : e
|
||
}
|
||
|
||
containsBounds(t) {
|
||
return dt(this.value_, t.value_)
|
||
}
|
||
|
||
containsPoint(t) {
|
||
var e;
|
||
return e = t instanceof rC ? t.getCoordinate() : t, pt(this.value_, e)
|
||
}
|
||
|
||
getExtent() {
|
||
return this.value_
|
||
}
|
||
|
||
toBBoxString() {
|
||
return this.minX + "," + this.minY + "," + this.maxX + "," + this.maxY
|
||
}
|
||
}, aC = {
|
||
MAP_CLICK: "click",
|
||
MAP_DBLCLICK: "dblclick",
|
||
MAP_MOUSEDOWN: "pointerdown",
|
||
MAP_MOUSEMOVE: "pointermove",
|
||
MAP_MOUSEUP: "pointerup",
|
||
MAP_MOUSEOVER: "pointerover",
|
||
MAP_MOUSEOUT: "pointerout",
|
||
MAP_PANEND: "moveend",
|
||
MAP_PAN: "pointerdrag",
|
||
MAP_ZOOMCHANGE: "change:resolution",
|
||
POPUP_OPEN: "popup:open",
|
||
POPUP_CLOSE: "popup:close"
|
||
};
|
||
var lC = class extends lx {
|
||
constructor(t, e) {
|
||
var i = e || {}, r = {}, o = i.customOpts ? i.customOpts : null;
|
||
for (var n in i) "customOpts" !== i[n] && (r[n] = i[n]);
|
||
super(r), this.key_ = i.key, this.set("ezname", t), this.set("isAddToMap", !1), o && this.set("customOpts", o)
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t, t.getTileLayers().getLayers().push(this), this.set("isAddToMap", !0)
|
||
}
|
||
|
||
onRemove(t) {
|
||
this.get("isAddToMap") && (this.map_ = null, t.getTileLayers().getLayers().remove(this), this.set("isAddToMap", !1))
|
||
}
|
||
|
||
getResolutions() {
|
||
return this.getSource().getTileGrid().getResolutions()
|
||
}
|
||
};
|
||
var hC = class extends Rx {
|
||
constructor(t) {
|
||
for (var e = t.projection || "EPSG:4326", i = new Array(30), r = 0; r <= 30; ++r) i[r] = Math.pow(2, 1 - r);
|
||
var o = {};
|
||
o.tileGrid = new ol.tilegrid.TileGrid({
|
||
origin: [0, 0],
|
||
resolutions: t.resolutions || i,
|
||
tileSize: 256
|
||
}), o.projection = e, o.tileUrlFunction = function (e, i, r) {
|
||
var o = e[0], n = e[1], s = e[2];
|
||
return t.url.replace("{z}", o.toString()).replace("{y}", s.toString()).replace("{x}", n.toString())
|
||
}, W(t.url && "" != t.url, "瓦片URL模板不能为空"), super(o), this.urlTemplate_ = t.url
|
||
}
|
||
|
||
urlCallbackFunction_(t, e, i) {
|
||
var r = t[0], o = t[1], n = t[2];
|
||
return this.urlTemplate_.replace("{z}", r.toString()).replace("{y}", n.toString()).replace("{x}", o.toString())
|
||
}
|
||
};
|
||
var uC = class extends lC {
|
||
constructor(t, e, i) {
|
||
for (var r = i || {}, o = new Array(30), n = 0; n <= 30; ++n) o[n] = Math.pow(2, 1 - n);
|
||
// var s = e + "/EzMap?Service=getImage&Type=RGB&ZoomOffset=0&Col={x}&Row={y}&Zoom={z}&V=0.3&key=" + r.key,
|
||
var s = e;
|
||
a = new hC({
|
||
url: s,
|
||
crossOrigin: r.crossOrigin,
|
||
wrapX: !r.wrapX || r.wrapX,
|
||
cacheSize: r.cacheSize ? r.cacheSize : 2048,
|
||
resolutions: o
|
||
});
|
||
super(t, Object.assign({}, r, {source: a})), this.url_ = e
|
||
}
|
||
|
||
getUrl() {
|
||
return this.url_
|
||
}
|
||
|
||
getResolutions(t, e) {
|
||
for (var i = new Array(30), r = 0; r <= 30; ++r) i[r] = Math.pow(2, 1 - r);
|
||
return i.slice(t, e + 1)
|
||
}
|
||
};
|
||
var cC = class extends lC {
|
||
constructor(t, e, i) {
|
||
for (var r = i || {}, o = new Array(30), n = 9; n >= 0; --n) o[n] = Math.pow(2, 9 - n) / 256 * 114699;
|
||
for (n = 10; n <= 30; ++n) o[n] = 1 / Math.pow(2, n - 9) / 256 * 114699;
|
||
// var s = e + "/EzMap?Service=getImage&Type=RGB&ZoomOffset=0&Col={x}&Row={y}&Zoom={z}&V=0.3&key=" + r.key,
|
||
var s = e ;
|
||
a = new hC({
|
||
url: s,
|
||
crossOrigin: r.crossOrigin,
|
||
resolutions: o,
|
||
wrapX: !r.wrapX || r.wrapX,
|
||
projection: "EPSG:3857"
|
||
});
|
||
super(t, Object.assign({}, r, {source: a})), this.url_ = e
|
||
}
|
||
|
||
getUrl() {
|
||
return this.url_
|
||
}
|
||
};
|
||
var pC = class extends lC {
|
||
constructor(t, e, i) {
|
||
for (var r = i || {}, o = new Array(30), n = new Array(30), s = 0; s < 30; ++s) o[s] = 360 / (256 * Math.pow(2, s)), n[s] = s;
|
||
var a = new ol.tilegrid.WMTS({
|
||
origin: r.origin || [-180, 90],
|
||
resolutions: r.resolutions || o,
|
||
matrixIds: r.matrixIds || n
|
||
});
|
||
r.token && (e = e + "&token=" + r.token);
|
||
var l = new ol.source.WMTS({
|
||
url: e,
|
||
crossOrigin: r.crossOrigin,
|
||
wrapX: null == r.wrapX || r.wrapX,
|
||
projection: r.projection || "EPSG:4326",
|
||
layer: r.layer,
|
||
requestEncoding: r.requestEncoding || "KVP",
|
||
tileGrid: a,
|
||
matrixSet: r.matrixSet,
|
||
format: r.format,
|
||
maxZoom: r.maxZoom,
|
||
minZoom: r.minZoom,
|
||
tileSize: r.tileSize,
|
||
attributions: r.attributions,
|
||
style: r.style
|
||
});
|
||
super(t, Object.assign({}, r, {source: l})), this.url_ = e
|
||
}
|
||
|
||
getUrl() {
|
||
return this.url_
|
||
}
|
||
};
|
||
var dC = class extends lC {
|
||
constructor(t, e, i) {
|
||
var r = i || {}, o = e + "&x={x}&y={y}&z={z}", n = new ol.source.XYZ({
|
||
url: o,
|
||
crossOrigin: r.crossOrigin,
|
||
wrapX: !r.wrapX || r.wrapX,
|
||
cacheSize: r.cacheSize ? r.cacheSize : 2048,
|
||
tileLoadFunction: r.tileLoadFunction ? r.tileLoadFunction : void 0,
|
||
projection: "EPSG:3857"
|
||
});
|
||
super(t, Object.assign({}, r, {source: n})), this.url_ = e
|
||
}
|
||
|
||
getUrl() {
|
||
return this.url_
|
||
}
|
||
};
|
||
var fC = class extends lC {
|
||
constructor(t, e, i) {
|
||
var r = i || {},
|
||
// o = e + "/EzMap?Service=getImage&Type=RGB&ZoomOffset=0&Col={x}&Row={y}&Zoom={z}&V=0.3&key=" + r.key;
|
||
o = e
|
||
r.token && (o = o + "&token=" + r.token);
|
||
var n = new Lx({
|
||
url: o,
|
||
crossOrigin: r.crossOrigin,
|
||
wrapX: null == r.wrapX || r.wrapX,
|
||
cacheSize: r.cacheSize ? r.cacheSize : 2048,
|
||
tileLoadFunction: r.tileLoadFunction ? r.tileLoadFunction : void 0,
|
||
projection: "EPSG:4326"
|
||
});
|
||
super(t, Object.assign({}, r, {source: n})), this.url_ = e
|
||
}
|
||
|
||
getUrl() {
|
||
return this.url_
|
||
}
|
||
};
|
||
var gC = class extends k {
|
||
constructor(t, e) {
|
||
var i = function (t, r, o, n) {
|
||
var s;
|
||
if ("EzMap2010" === t) s = new uC(r, o, n); else if ("EzMap2010Local" === t) s = new cC(r, o, n); else if ("wmts_sl" === t) if (s = new Ez.VectorLayer.WMTS_SL(r, o, n), "openlayers" == n.styleType) {
|
||
var a = new Ez.Json2Style(e, n.styleUrl);
|
||
s.setJson2Style(a)
|
||
} else "mapbox" == n.styleType && (a = new Ez.Json2StyleMapbox(s, n.styleUrl, n.styleSource)); else if ("wmts" === t) s = new pC(r, o, n); else if ("gd" === t) s = new dC(r, o, n); else if ("group" === t) c = Object.assign({}, n.subLayer[1], {projection: n.projection}, {key: n.key}), l = i(n.subType, r, o, n), p = i(n.subType, r, n.subLayer[0], c), (s = new Ez.Layer.Group({layers: [l, p]})).set("ezname", r), s.set("imageSRC", n.imageSRC); else if ("groups" === t) {
|
||
for (var l, h = [l = i(n.subType, r, o, n)], u = 0; u < n.groups.length; u++) {
|
||
var c = Object.assign({}, n.groups[u], {projection: n.projection}, {key: n.key}),
|
||
p = i(n.groups[u].subType, r, n.groups[u].url, c);
|
||
h.push(p)
|
||
}
|
||
(s = new Ez.Layer.Group({layers: h})).set("ezname", r), s.set("imageSRC", n.imageSRC)
|
||
} else s = new fC(r, o, n);
|
||
return s
|
||
}, r = null != t ? t : {};
|
||
super(), this.map_ = e, this.opts_ = r;
|
||
var o = r.MapSrcURL;
|
||
this.layersInfoArray_ = [], this.layers_ = [];
|
||
for (var n = o.length - 1; n >= 0; n--) {
|
||
var s = o[n][0], a = o[n][1], l = o[n][2], h = {};
|
||
for (var u in l) "crs" === u ? h.projection = this.crs2Projection(l[u]) : h[u] = l[u];
|
||
h.key || (h.key = r.AuthorKey ? r.AuthorKey : "");
|
||
var c = i(h.type, s, a, h);
|
||
0 === n && e.addLayer(c), this.layers_.push(c);
|
||
var p = {};
|
||
p.title = c.get("ezname"), p.layer = c, p.imageSRC = c.get("imageSRC"), this.layersInfoArray_.push(p)
|
||
}
|
||
}
|
||
|
||
initialize() {
|
||
}
|
||
|
||
getGlobalOptions() {
|
||
return this.opts_
|
||
}
|
||
|
||
crs2Projection(t) {
|
||
return "EPSG:" + (null != t ? t : "4326")
|
||
}
|
||
|
||
getLayers() {
|
||
return this.layers_
|
||
}
|
||
|
||
getLayersInfo() {
|
||
return this.layersInfoArray_
|
||
}
|
||
};
|
||
var mC = class extends sh {
|
||
constructor(t, e, i, r, o, n) {
|
||
var s, a = document.createElement("div");
|
||
a.id = t, a.innerHTML = i, e instanceof rC ? s = e.getCoordinate() : Array.isArray(e) ? s = e : W(!1, "请传入坐标数组或者EzCoord对象"), super({
|
||
stopEvent: n = null == n || n,
|
||
element: a,
|
||
offset: null != r ? r : [0, 0],
|
||
positioning: null != o ? o : "top-left",
|
||
position: s
|
||
}), this.htmlelementoverlayFlag = !0
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t
|
||
}
|
||
|
||
onRemove(t) {
|
||
this.map_ = null
|
||
}
|
||
|
||
show() {
|
||
this.getElement().style.display = "block"
|
||
}
|
||
|
||
hide() {
|
||
this.getElement().style.display = "none"
|
||
}
|
||
|
||
setPos(t) {
|
||
var e;
|
||
t instanceof rC ? e = t.getCoordinate() : goog.isArray(t) ? e = t : W(!1, "请传入坐标数组或者EzCoord对象"), this.setPosition(e)
|
||
}
|
||
|
||
getPos(t) {
|
||
var e = this.getPosition();
|
||
return null != t && t ? e : new rC(e[0], e[1])
|
||
}
|
||
|
||
openInfoWindow(t, e, i) {
|
||
var r;
|
||
e instanceof rC ? r = e.getCoordinate() : Array.isArray(e) ? r = e : W(!1, "请传入坐标数组或者EzCoord对象"), this.popup_ || (t instanceof Ez.Popup ? this.popup_ = t : this.popup_ = new Ez.Popup(i), this.map_.addOverlay(this.popup_)), this.popup_.show(r, t)
|
||
}
|
||
|
||
closeInfoWindow() {
|
||
this.popup_ && (this.map_.removeOverlay(this.popup_), this.popup_ = null)
|
||
}
|
||
};
|
||
var yC = class {
|
||
constructor() {
|
||
this.flag = !1
|
||
}
|
||
|
||
init(t) {
|
||
if (!this.flag) {
|
||
var e = new XMLHttpRequest;
|
||
e.open("GET", serviceUrl + "/BasicsServlet", !1), e.onload = function (i) {
|
||
e.status >= 200 && e.status < 300 && (200 == JSON.parse(e.response).code ? (this.flag = !0, console.log("地图客户端已启动!"), t && t()) : console.log("请检查许可证书!"))
|
||
}.bind(this), e.send()
|
||
}
|
||
}
|
||
};
|
||
var vC = class {
|
||
constructor() {
|
||
}
|
||
|
||
static isDef(t) {
|
||
return void 0 !== t
|
||
}
|
||
|
||
static isNull(t) {
|
||
return null === t
|
||
}
|
||
|
||
static isString(t) {
|
||
return "string" == typeof t
|
||
}
|
||
|
||
static isNumber(t) {
|
||
return "number" == typeof t
|
||
}
|
||
|
||
static isDefAndNotNull(t) {
|
||
return null != t
|
||
}
|
||
};
|
||
|
||
class _C extends A {
|
||
constructor(t) {
|
||
super(t)
|
||
}
|
||
}
|
||
|
||
class xC extends oC {
|
||
constructor(t, e, i, r) {
|
||
var o;
|
||
o = vC.isDef(e) ? new uf({image: e}) : new uf({
|
||
image: new Xd({
|
||
src: "../images/marker-icon.png",
|
||
anchor: [.5, 1],
|
||
anchorXUnits: ol.style.IconAnchorUnits.FRACTION,
|
||
anchorYUnits: ol.style.IconAnchorUnits.FRACTION,
|
||
size: [25, 41],
|
||
opacity: 1
|
||
})
|
||
}), super({geometry: new qi(t.getCoordinate())}), this.coordinatesOfEz_ = t, this.coordinatesOfOl_ = t.getCoordinate(), this.map_ = null, this.title_ = null != i ? i : null, this.isTitleOnMap = !1, this.isTitleInited = !1, this.anchorImg_ = this.set("coordinate", this.coordinatesOfOl_), this.set("markerStyle", o), this.setStyle(o), this.markerFlag = !0;
|
||
var n = r || {};
|
||
n.draggable && this.set("draggable", n.draggable)
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t;
|
||
var e = t.getMarkerLayers(), i = this;
|
||
e.getLayers().forEach(function (t, e, r) {
|
||
"marker_default" === t.get("name") && t.getSource().addFeature(i)
|
||
}), this.set("isAddToMap", !0)
|
||
}
|
||
|
||
onRemove(t) {
|
||
if (this.get("isAddToMap")) {
|
||
this.title_ && this.isTitleOnMap && this.hideTitle(), this.map_ = null;
|
||
var e = t.getMarkerLayers(), i = this;
|
||
e.getLayers().forEach(function (t, e, r) {
|
||
"marker_default" === t.get("name") && t.getSource().removeFeature(i)
|
||
}), this.set("isAddToMap", !1)
|
||
}
|
||
}
|
||
|
||
show() {
|
||
this.setOpacity(this.opac_ ? this.opac_ : this.getOpacity()), delete this.opac_, this.isTitleOnMap && (this.title_.isShow || this.title_.show())
|
||
}
|
||
|
||
hide() {
|
||
this.opac_ = this.getOpacity(), this.setOpacity(0), this.isTitleOnMap && this.title_.hide()
|
||
}
|
||
|
||
getPoint() {
|
||
var t = this.getGeometry().getCoordinates();
|
||
return new rC(t[0], t[1])
|
||
}
|
||
|
||
setPoint(t) {
|
||
this.coordinatesOfEz_ = t;
|
||
var e = t.getCoordinate();
|
||
return this.coordinatesOfOl_ = e, this.getGeometry().setCoordinates(e), this.set("coordinate", e), this
|
||
}
|
||
|
||
setOpacity(t) {
|
||
var e = this.getStyle();
|
||
e.getImage().setOpacity(t), this.setStyle(e)
|
||
}
|
||
|
||
getOpacity() {
|
||
return this.getStyle().getImage().getOpacity()
|
||
}
|
||
|
||
getRotate() {
|
||
return this.getStyle().getImage().getRotation()
|
||
}
|
||
|
||
openInfoWindow(t, e) {
|
||
var i = this.getGeometry().getCoordinates(), r = e || {}, o = {};
|
||
for (var n in r) o[n] = r[n];
|
||
var s = this.getStyle().getImage().getSize();
|
||
s = s || [25, 41];
|
||
var a = this.getStyle().getImage().getScale();
|
||
a = a || 1, o.offsetX = 0, o.offsetY = -(s[1] * a + 5), this.popup_ && (this.map_.removeOverlay(this.popup_), this.popup_ = null), this.popup_ = new Ez.Popup(o), this.map_.addOverlay(this.popup_), this.popup_.show(t, i)
|
||
}
|
||
|
||
closeInfoWindow() {
|
||
this.popup_ && (this.map_.removeoverlay(this.popup_), this.popup_ = null)
|
||
}
|
||
|
||
handleChange_() {
|
||
var t = this.getGeometry().getCoordinates();
|
||
this.title_.setPosition(t)
|
||
}
|
||
|
||
handleOnLoad_() {
|
||
this.handleChange_(), this.map_.addOverlay(this.title_)
|
||
}
|
||
|
||
handleTitleInit_() {
|
||
var t = this.getPoint();
|
||
this.title_.setPosition(t), this.map_.addOverlay(this.title_), this.isTitleInited = !0
|
||
}
|
||
|
||
getImage() {
|
||
return this.getStyle().getImage().getImage()
|
||
}
|
||
|
||
getIcon() {
|
||
return this.getStyle().getImage()
|
||
}
|
||
|
||
setIcon(t, e) {
|
||
this.getStyle();
|
||
var i = new ol.style.Style({image: t});
|
||
this.setStyle(i), e || this.changed()
|
||
}
|
||
|
||
flash(t) {
|
||
var e = t || {}, i = e.duration ? e.duration : 3e3, r = e.times ? e.times : 3;
|
||
this.hide();
|
||
var o = this.getIcon();
|
||
if (this.map_) {
|
||
var n, s = (new Date).getTime(), a = (new Date(s), this);
|
||
n = map.on("postcompose", function (t) {
|
||
var e = t.vectorContext, l = (t.frameState.time - s) / parseFloat(i / r),
|
||
h = new ol.style.Style({image: o}), u = l % 1;
|
||
if (u < .3 || u > .6 ? o.setOpacity(1) : o.setOpacity(0), e.drawFeature(a.clone(), h), l > r) return ol.Observable.unByKey(n), map.render(), void a.show();
|
||
map.render()
|
||
}), map.render()
|
||
}
|
||
}
|
||
}
|
||
|
||
class wC extends ol.events.Event {
|
||
constructor(t) {
|
||
super(t)
|
||
}
|
||
}
|
||
|
||
class bC extends ol.Overlay {
|
||
constructor(t) {
|
||
var e = t || {}, i = null != e.customStyle ? e.customStyle : "ez-popup", r = e.offsetY || 0,
|
||
o = e.offsetX || 0, n = i, s = document.createElement("div");
|
||
s.className = i;
|
||
var a = null;
|
||
if (super({
|
||
element: s,
|
||
autoPan: !1,
|
||
stopEvent: !!e.stopEvent && e.stopEvent,
|
||
insertFirst: !e.hasOwnProperty("insertFirst") || e.insertFirst,
|
||
positioning: "bottom-center",
|
||
offset: [o, r]
|
||
}), n) {
|
||
var l = document.createElement("span");
|
||
l.className = "ez-popup-closer", s.appendChild(l);
|
||
var h = this;
|
||
l.addEventListener("click", function (t) {
|
||
t.stopPropagation(), h.close(), this.blur()
|
||
});
|
||
var u = document.createElement("div");
|
||
u.className = "ez-popup-content", s.appendChild(u), a = u
|
||
} else a = s;
|
||
this.container = s, this.appendContent = a, this.isDefaultStyle = n, this.panMapIfOutOfView = e.panMapIfOutOfView, void 0 === this.panMapIfOutOfView && (this.panMapIfOutOfView = !0), (this.fn_ = e.fn ? e.fn : null) && this.appendContent.addEventListener("click", this.delegate_.bind(this))
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t
|
||
}
|
||
|
||
onRemove(t) {
|
||
this.map_ = null
|
||
}
|
||
|
||
delegate_(t) {
|
||
if (this.fn_) return this.fn_(t), !1
|
||
}
|
||
|
||
close() {
|
||
this.map_.dispatchEvent(new Ez.PopupTargetMoveEvent("popup:close")), this.dispatchEvent(new wC("CLOSE")), this.map_.removeOverlay(this), this.map_ && this.map_.popup_ && (this.map_.popup_ = null)
|
||
}
|
||
|
||
show(t, e) {
|
||
return this.appendContent.innerHTML = t, e instanceof rC ? this.setPosition(e.getCoordinate()) : this.setPosition(e), this.container.style.display = "block", this.getMap().dispatchEvent(new Ez.PopupTargetMoveEvent("popup:open")), this.updatePixelPosition(), this.panMapIfOutOfView && this.map_.frameState_ && this.panIntoView_(e), this
|
||
}
|
||
|
||
setContent(t) {
|
||
this.appendContent.innerHTML = t
|
||
}
|
||
|
||
panIntoView_() {
|
||
var t = this.getMap();
|
||
if (void 0 !== t && t.getTargetElement()) {
|
||
var e = this.getRect(t.getTargetElement(), t.getSize()), i = this.getElement();
|
||
ol.asserts.assert(i, "element should be defined");
|
||
var r = this.getRect(i, [ol.dom.outerWidth(i), ol.dom.outerHeight(i)]), o = this.autoPanMargin_;
|
||
if (!ol.extent.containsExtent(e, r)) {
|
||
var n = r[0] - e[0], s = e[2] - r[2], a = r[1] - e[1], l = e[3] - r[3], h = [0, 0];
|
||
if (n < 0 ? h[0] = n - o : s < 0 && (h[0] = Math.abs(s) + o), a < 0 ? h[1] = a - o : l < 0 && (h[1] = Math.abs(l) + o), 0 !== h[0] || 0 !== h[1]) {
|
||
var u = t.getView().getCenter();
|
||
ol.asserts.assert(void 0 !== u, "center should be defined");
|
||
var c = t.getPixelFromCoordinate(u), p = [c[0] + h[0], c[1] + h[1]];
|
||
t.getView().animate({center: t.getCoordinateFromPixel(p), duration: 250})
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
isTouchDevice_() {
|
||
try {
|
||
return document.createEvent("TouchEvent"), !0
|
||
} catch (t) {
|
||
return !1
|
||
}
|
||
}
|
||
|
||
enableTouchScroll_(t) {
|
||
if (bC.isTouchDevice_()) {
|
||
var e = 0;
|
||
t.addEventListener("touchstart", function (t) {
|
||
e = this.scrollTop + t.touches[0].pageY
|
||
}, !1), t.addEventListener("touchmove", function (t) {
|
||
this.scrollTop = e - t.touches[0].pageY
|
||
}, !1)
|
||
}
|
||
}
|
||
|
||
hide() {
|
||
return this.container.style.display = "none", this
|
||
}
|
||
}
|
||
|
||
var CC = class extends ol.Feature {
|
||
constructor(t, e) {
|
||
super({geometry: new ol.geom.Point([0, 0])}), ol.asserts.assert(null != t, "Title对象构造时name参数不能为空"), this.title_ = t;
|
||
var i = null != e ? e : {}, r = this.defaultStyle_ = {
|
||
font: null != i.font ? i.font : "微软雅黑,宋体",
|
||
fontSize: null != i.fontSize ? parseInt(i.fontSize) : 12,
|
||
fontColor: null != i.fontColor ? i.fontColor : "#000000",
|
||
fillColor: null != i.fillColor ? i.fillColor : "#FFFFFF",
|
||
strokeColor: null != i.strokeColor ? i.strokeColor : "#000000",
|
||
isStroke: null != i.isStroke && i.isStroke,
|
||
strokeWidth: null != i.strokeWidth ? parseInt(i.strokeWidth) : 1,
|
||
strokeStyle: null != i.strokeStyle ? i.strokeStyle : void 0,
|
||
textAlign: null != i.textAlign ? i.textAlign : "center",
|
||
textBaseline: null != i.textBaseline ? i.textBaseline : "middle",
|
||
paddingV: null != i.paddingV ? parseInt(i.paddingV) : 1,
|
||
lineHeight: null != i.lineHeight ? parseInt(i.lineHeight) : 1,
|
||
paddingH: null != i.paddingH ? parseInt(i.paddingH) : 2,
|
||
positioning: null != i.positioning ? i.positioning : "top-left",
|
||
anchor: null != i.anchor ? i.anchor : [.5, 1],
|
||
offset: null != i.offset ? i.offset : [0, 0],
|
||
gap: null != i.gap ? i.gap : 2
|
||
};
|
||
this.map_ = null, this.position_ = [0, 0], this.positioning_ = r.positioning, this.offset_ = r.offset, this.isShow = !0, this.setStyle(this.styleFunction.bind(this)), i.draggable && this.set("draggable", i.draggable)
|
||
}
|
||
|
||
formatFont(t, e) {
|
||
return t + "px " + e
|
||
}
|
||
|
||
styleFunction(t, e) {
|
||
if (!this.isShow) return null;
|
||
var i, r = this.getDefaultStyle_(), o = this.calcWidthOfTitle(this.getTitle()), n = this.offset_[0],
|
||
s = this.offset_[1], a = o + Number(r.paddingH) + Math.abs(n),
|
||
l = Math.ceil(parseFloat(r.fontSize) * parseFloat(r.lineHeight)) + Math.abs(s),
|
||
h = document.createElement("canvas"), u = ol.render.toContext(h.getContext("2d"), {size: [a, l]}),
|
||
c = new ol.style.Fill({color: r.fillColor});
|
||
i = r.isStroke ? new ol.style.Stroke({
|
||
color: r.strokeColor,
|
||
width: r.strokeWidth,
|
||
lineDash: r.strokeStyle
|
||
}) : new ol.style.Stroke({
|
||
color: r.fillColor,
|
||
width: 1,
|
||
lineDash: void 0
|
||
}), u.setFillStrokeStyle(c, i), u.setTextStyle(null);
|
||
var p = n > 0 ? n : 0, d = s > 0 ? s : 0, f = o + Number(r.paddingH) + p,
|
||
g = Math.ceil(parseFloat(r.fontSize) * parseFloat(r.lineHeight));
|
||
return u.drawPolygon(new ol.geom.Polygon([[[p, d], [f, d], [f, g], [p, g], [p, d]]])), u.setTextStyle(new ol.style.Text({
|
||
text: this.getTitle().trim(),
|
||
font: this.formatFont(r.fontSize, r.font),
|
||
textAlign: "center",
|
||
textBaseline: "middle",
|
||
fill: new ol.style.Fill({color: r.fontColor})
|
||
})), u.drawPoint(new ol.geom.Point([p + Math.ceil((o + Number(r.paddingH)) / 2), d + Math.ceil(g / 2)])), new ol.style.Style({
|
||
image: new ol.style.Icon({
|
||
img: h,
|
||
imgSize: [h.width, h.height],
|
||
anchor: r.anchor
|
||
})
|
||
})
|
||
}
|
||
|
||
getDefaultStyle_() {
|
||
return this.defaultStyle_
|
||
}
|
||
|
||
calcWidthOfTitle(t) {
|
||
var e = t.trim(), i = this.getDefaultStyle_(), r = document.createElement("canvas").getContext("2d");
|
||
return r.font = this.formatFont(i.fontSize, i.font), r.measureText(e).width
|
||
}
|
||
|
||
getTitle() {
|
||
return this.title_
|
||
}
|
||
|
||
show() {
|
||
this.isShow = !0, this.map_.getMarkerLayers().getLayers().forEach(function (t, e, i) {
|
||
"marker_default" === t.get("name") && t.getSource().refresh()
|
||
})
|
||
}
|
||
|
||
hide() {
|
||
this.isShow = !1, this.map_.getMarkerLayers().getLayers().forEach(function (t, e, i) {
|
||
"marker_default" === t.get("name") && t.getSource().refresh()
|
||
})
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t;
|
||
var e = t.getMarkerLayers(), i = this;
|
||
e.getLayers().forEach(function (t, e, r) {
|
||
"marker_default" === t.get("name") && t.getSource().addFeature(i)
|
||
})
|
||
}
|
||
|
||
onRemove(t) {
|
||
this.map_ = null;
|
||
var e = t.getMarkerLayers(), i = this;
|
||
e.getLayers().forEach(function (t, e, r) {
|
||
"marker_default" === t.get("name") && t.getSource().removeFeature(i)
|
||
})
|
||
}
|
||
|
||
setPosition(t) {
|
||
this.position_ = t instanceof rC ? t.getCoordinate() : t, this.getGeometry().setCoordinates(this.position_)
|
||
}
|
||
|
||
setOffset(t) {
|
||
this.offset_ = t, this.changed()
|
||
}
|
||
};
|
||
var SC = class extends ol.Object {
|
||
constructor(t, e, i) {
|
||
super(), this.type = t, this.map_ = e, this.fn_ = i, this.callbackData = null, this.sketch = null, this.sketchStyle = new ol.style.Style({
|
||
fill: new ol.style.Fill({color: "rgba(67, 78, 255, 0.3)"}),
|
||
stroke: new ol.style.Stroke({color: "rgba(67, 78, 255, 0.8)", width: 2})
|
||
}), this.helpTooltipElement = null, this.helpTooltip = null, this.measureTooltipElement = null, this.measureTooltip = null, this.continuePolygonMsg = "点击右键结束测量", this.continueLineMsg = "点击右键结束测量", this.vectorLayer = null, this.draw = null, this.listener = null, this.wgs84radius = 6378137, this.closeBtn = null, this.init()
|
||
}
|
||
|
||
init() {
|
||
var t, e = this.map_;
|
||
if (e.getMarkerLayers().getLayers().forEach(function (e, i, r) {
|
||
"marker_default" === e.get("name") && (t = e)
|
||
}), !t) throw new Error("不能获取到默认的marker图层");
|
||
this.vectorLayer = t, this.draw = this.createInteraction(this.type), e.addInteraction(this.draw), this.createHelpTooltip(), this.createMeasureTooltip(), this.draw.once("drawstart", this.onStartDraw.bind(this), this), this.draw.once("drawend", this.onEndDraw.bind(this), this), e.on("pointermove", this.handlePointerMove.bind(this), this), e.getViewport().addEventListener("mouseout", function (t) {
|
||
this.addClass(this.helpTooltipElement, "hidden")
|
||
}.bind(this))
|
||
}
|
||
|
||
de_init() {
|
||
var t = this.map_;
|
||
t.removeInteraction(this.draw), t.removeOverlay(this.helpTooltip, !0), t.removeOverlay(this.measureTooltip, !0), this.draw.un("drawstart", this.onStartDraw.bind(this), this), this.draw.un("drawend", this.onEndDraw.bind(this), this), t.un("pointermove", this.handlePointerMove, this), t.getViewport().removeEventListener("mouseout", function (t) {
|
||
this.addClass(this.helpTooltipElement, "hidden")
|
||
}.bind(this))
|
||
}
|
||
|
||
disposeAll() {
|
||
var t = this.vectorLayer.getSource();
|
||
this.waitSketch && (t.removeFeature(this.waitSketch), this.waitSketch = null);
|
||
var e = this.map_;
|
||
e.removeOverlay(this.measureTooltip, !0), e.removeOverlay(this.HelpTooltip, !0), e.removeOverlay(this.closeBtn, !0)
|
||
}
|
||
|
||
handlePointerMove(t) {
|
||
if (!t.dragging) {
|
||
var e = "点击开始绘制与测量";
|
||
if (this.sketch) {
|
||
var i = this.sketch.getGeometry();
|
||
i instanceof ol.geom.Polygon ? e = this.continuePolygonMsg : i instanceof ol.geom.LineString && (e = this.continueLineMsg)
|
||
}
|
||
this.helpTooltipElement.innerHTML = e, this.helpTooltip.setPosition(t.coordinate), this.addClass(this.helpTooltipElement, "hidden")
|
||
}
|
||
}
|
||
|
||
createInteraction(t) {
|
||
return new ol.interaction.Draw2({
|
||
source: this.vectorLayer.getSource(),
|
||
type: t,
|
||
style: new ol.style.Style({
|
||
fill: new ol.style.Fill({color: "rgba(67, 78, 255, 0.3)"}),
|
||
stroke: new ol.style.Stroke({color: "rgba(67, 78, 255, 0.8)", width: 2})
|
||
}),
|
||
tip: !1
|
||
})
|
||
}
|
||
|
||
onStartDraw(t) {
|
||
var e = this.sketch = t.feature, i = t.coordinate;
|
||
this.listener = e.getGeometry().on("change", function (t) {
|
||
var e, r = t.target;
|
||
r instanceof ol.geom.Polygon ? (e = this.formatArea(r), i = r.getInteriorPoint().getCoordinates()) : r instanceof ol.geom.LineString && (e = this.formatLength(r), i = r.getLastCoordinate()), this.measureTooltipElement.innerHTML = e, this.measureTooltip.setPosition(i)
|
||
}.bind(this))
|
||
}
|
||
|
||
onEndDraw(t) {
|
||
this.measureTooltipElement.className = "tooltip tooltip-static", this.measureTooltip.setOffset([0, -7]), this.sketch.setStyle(this.sketchStyle), this.measureTooltipElement = null, this.fn_(this.callbackData), this.createCloseBtn();
|
||
var e = t.feature;
|
||
this.vectorLayer.getSource().addFeature(e), this.waitSketch = this.sketch, this.sketch = null, this.deleteHandleOfMeasure()
|
||
}
|
||
|
||
createCloseBtn() {
|
||
var t = document.createElement("div");
|
||
t.className = "close", this.closeBtn = new ol.Overlay({
|
||
element: t,
|
||
offset: [0, 5],
|
||
positioning: "top-center"
|
||
}), this.map_.addOverlay(this.closeBtn, !0);
|
||
var e, i = this.sketch.getGeometry();
|
||
i instanceof ol.geom.LineString ? e = i.getLastCoordinate() : i instanceof ol.geom.Polygon && (e = i.getInteriorPoint().getCoordinates()), this.closeBtn.setPosition(e), t.addEventListener("click", function () {
|
||
this.disposeAll()
|
||
}.bind(this))
|
||
}
|
||
|
||
deleteHandleOfMeasure() {
|
||
var t = this.map_;
|
||
t.removeOverlay(this.helpTooltip, !0), N(this.listener), t.removeInteraction(this.draw), this.draw = null, t.un("pointermove", this.handlePointerMove, this), t.getViewport().removeEventListener("mouseout", function (t) {
|
||
Ez.utility.Measure.addClass(this.helpTooltipElement, "hidden")
|
||
}.bind(this))
|
||
}
|
||
|
||
createMeasureTooltip() {
|
||
this.measureTooltipElement && this.measureTooltipElement.parentNode.removeChild(this.measureTooltipElement), this.measureTooltipElement = document.createElement("div"), this.measureTooltipElement.className = "tooltip tooltip-measure", this.measureTooltip = new ol.Overlay({
|
||
element: this.measureTooltipElement,
|
||
offset: [0, -15],
|
||
positioning: "bottom-center"
|
||
}), this.map_.addOverlay(this.measureTooltip, !0)
|
||
}
|
||
|
||
createHelpTooltip() {
|
||
this.helpTooltipElement && this.helpTooltipElement.parentNode.removeChild(this.helpTooltipElement), this.helpTooltipElement = document.createElement("div"), this.helpTooltipElement.className = "tooltip hidden", this.helpTooltip = new ol.Overlay({
|
||
element: this.helpTooltipElement,
|
||
offset: [15, 0],
|
||
positioning: "center-left"
|
||
}), this.map_.addOverlay(this.helpTooltip, !0)
|
||
}
|
||
|
||
formatArea(t) {
|
||
var e, i, r = this.map_.getView().getProjection();
|
||
return t.clone().transform(r, "EPSG:4326").getLinearRing(0).getCoordinates(), e = Math.abs(fe(t, {radius: this.wgs84radius})), i = Math.round(1e4 * e) + " km<sup>2</sup>", this.callbackData = {
|
||
value: e,
|
||
pretty: i
|
||
}, i
|
||
}
|
||
|
||
formatLength(t) {
|
||
var e, i = t.getCoordinates();
|
||
e = 0;
|
||
for (var r, o = this.map_.getView().getProjection(), n = 0, s = i.length - 1; n < s; ++n) e += ce(ol.proj.transform(i[n], o, "EPSG:4326"), ol.proj.transform(i[n + 1], o, "EPSG:4326"), this.wgs84radius);
|
||
return r = e > 100 ? Math.round(e / 1e3 * 100) / 100 + " km" : Math.round(100 * e) / 100 + " m", this.callbackData = {
|
||
value: e,
|
||
pretty: r
|
||
}, r
|
||
}
|
||
|
||
addClass(t, e) {
|
||
var i = " " + e.trim();
|
||
t.className += i
|
||
}
|
||
|
||
removeClass(t, e) {
|
||
for (var i = t.className.split(" "), r = 0; r < i.length; r++) if (i[r] === e) {
|
||
i[r] = "";
|
||
break
|
||
}
|
||
var o = i.join(" ");
|
||
t.className = o
|
||
}
|
||
};
|
||
var EC = {
|
||
mapCenter: !0,
|
||
mapInitLevel: !0,
|
||
constrainRotation: !0,
|
||
enableRotation: !0,
|
||
extent: !0,
|
||
minResolution: !0,
|
||
maxResolution: !0,
|
||
mapMinLevel: !0,
|
||
mapMaxLevel: !0,
|
||
projection: !0,
|
||
resolution: !0,
|
||
resolutions: !0,
|
||
rotation: !0,
|
||
zoomFactor: !0
|
||
};
|
||
|
||
class TC extends ol.Map {
|
||
constructor(t, e) {
|
||
var i = {}, r = {};
|
||
for (var o in e) o in EC ? "mapCenter" === o ? e[o] instanceof rC ? i.center = [e[o].x, e[o].y] : i.center = e[o] : "mapInitLevel" === o ? i.zoom = e[o] : "mapMinLevel" === o ? i.minZoom = e[o] : "mapMaxLevel" === o ? i.maxZoom = e[o] : i[o] = e[o] : r[o] = e[o];
|
||
var n = window.ezMap;
|
||
null != n && (null != e && null != e.indoor && e.indoor || (i.minZoom = n.MapMinLevel, i.maxZoom = n.MapMaxLevel, i.zoom = n.MapInitLevel, i.center = n.CenterPoint, i.extent = n.MapFullExtent, i.projection = "EPSG:" + n.MapSrcURL[0][2].crs, "EzMap2010" !== n.MapSrcURL[0][2].type && "EzMap2010Local" !== n.MapSrcURL[0][2].type || (i.resolutions = EzMap2010.getResolutions(n.MapMinLevel, n.MapMaxLevel))));
|
||
var s = new ol.View(i), a = null != t ? t : void 0, l = new ol.layer.Group({layers: []});
|
||
l.set("title", "baseLayers");
|
||
var h = new ol.layer.Group({layers: []});
|
||
h.set("title", "markerLayers");
|
||
var u = new ol.layer.Vector({source: new ol.source.Vector({wrapX: !1}), projection: s.getProjection()});
|
||
u.set("name", "marker_default"), h.getLayers().push(u);
|
||
var c = new ol.layer.Group({layers: []});
|
||
c.set("title", "vectorLayers");
|
||
var p = new ol.layer.Vector({source: new ol.source.Vector({wrapX: !1}), projection: s.getProjection()});
|
||
p.set("name", "vector_default"), c.getLayers().push(p);
|
||
var d = new ol.layer.Group({layers: []});
|
||
d.set("title", "customLayers");
|
||
var f = new ol.layer.Group({layers: []});
|
||
f.set("title", "tileOverlayLayers");
|
||
var g = [l, f, c, d, h];
|
||
null == r.logo && (r.logo = !1), r.layers = g, r.target = a, r.view = s, r.controls = ol.control.util.defaults({
|
||
attribution: !1,
|
||
rotate: !1,
|
||
zoom: !1
|
||
}), null != n && (null != e && null != e.indoor && e.indoor || (r.loadTilesWhileAnimating = null != n.loadTilesWhileAnimating && n.loadTilesWhileAnimating)), super(r), this.defaultMarkerLayer_ = u, this.defaultVectorLayer_ = p, this.tileLayerOverlayGroup_ = f, this.customLayerGroup_ = d, this.vectorLayerGroup_ = c, this.tileLayerGroup_ = l, this.markerLayerGroup_ = h, this.viewOfEz_ = s, this.elementOfEz_ = a, this.maxZoom_ = i.maxZoom, this.minZoom_ = i.minZoom;
|
||
var m = e || {};
|
||
if (null != m.appkeys) for (var y = m.appkeys, v = 0; v < y.length; v++) {
|
||
var _ = y[v];
|
||
_ && (n.MapSrcURL[v][2].appkey = _)
|
||
}
|
||
null != n && (this.global_ = new Ez.Global(n, this))
|
||
}
|
||
|
||
getTileLayers() {
|
||
return this.tileLayerGroup_
|
||
}
|
||
|
||
getTileLayerOverlayLayers() {
|
||
return this.tileLayerOverlayGroup_
|
||
}
|
||
|
||
getMarkerLayers() {
|
||
return this.markerLayerGroup_
|
||
}
|
||
|
||
getVectorLayers() {
|
||
return this.vectorLayerGroup_
|
||
}
|
||
|
||
getCustomLayers() {
|
||
return this.customLayerGroup_
|
||
}
|
||
|
||
getDegree(t, e) {
|
||
var i = t.getCoordinate();
|
||
return 1 * e / ce(i, [parseFloat(i[0]) + 1, i[1]], 6378137)
|
||
}
|
||
|
||
pixeldistance2KMdistance(t) {
|
||
return t * this.viewOfEz_.getResolution()
|
||
}
|
||
|
||
addLayer(t, e) {
|
||
e ? super.addLayer(t) : t.onAdd(this)
|
||
}
|
||
|
||
addlayer(t, e) {
|
||
e ? super.addLayer(t) : t.onAdd(this)
|
||
}
|
||
|
||
removeLayer(t, e) {
|
||
e ? super.removeLayer(t) : t.onRemove(this)
|
||
}
|
||
|
||
removelayer(t, e) {
|
||
e ? super.removeLayer(t) : t.onRemove(this)
|
||
}
|
||
|
||
addOverlay(t, e) {
|
||
e ? super.addOverlay(t) : (t.onAdd(this), t instanceof bC ? super.addOverlay(t) : t instanceof mC && super.addOverlay(t))
|
||
}
|
||
|
||
addoverlay(t, e) {
|
||
e ? super.addOverlay(t) : (t.onAdd(this), t instanceof bC ? super.addOverlay(t) : t instanceof mC && super.addOverlay(t))
|
||
}
|
||
|
||
removeOverlay(t, e) {
|
||
e ? super.removeOverlay(t) : (t.onRemove(this), t instanceof bC ? super.removeOverlay(t) : t instanceof mC && super.removeOverlay(t))
|
||
}
|
||
|
||
removeoverlay(t, e) {
|
||
e ? super.removeOverlay(t) : (t.onRemove(this), t instanceof bC ? super.removeOverlay(t) : t instanceof mC && super.removeOverlay(t))
|
||
}
|
||
|
||
getCenter() {
|
||
var t = this.viewOfEz_.getCenter();
|
||
return new rC(t[0], t[1])
|
||
}
|
||
|
||
zoomIn() {
|
||
this.viewOfEz_.getResolution() <= this.viewOfEz_.minResolution_ || this.doZoom(this.viewOfEz_.getZoom() + 1)
|
||
}
|
||
|
||
zoomOut() {
|
||
this.viewOfEz_.getResolution() >= this.viewOfEz_.maxResolution_ || this.doZoom(this.viewOfEz_.getZoom() - 1)
|
||
}
|
||
|
||
getZoom() {
|
||
return this.viewOfEz_.getZoom()
|
||
}
|
||
|
||
doZoom(t) {
|
||
this.viewOfEz_.animate({zoom: t, duration: 250})
|
||
}
|
||
|
||
showStandMapControl(t) {
|
||
if (!this.zoomslider_) {
|
||
var e = this.global_.getGlobalOptions(), i = vC.isDef(e) ? e : {};
|
||
t = vC.isDef(t) ? t : {};
|
||
var r = vC.isDef(i.MapMaxLevel) ? i.MapMaxLevel : vC.isDef(t.maxZoom) ? t.maxZoom : 18,
|
||
o = vC.isDef(i.MapMinLevel) ? i.MapMinLevel : vC.isDef(t.minZoom) ? t.minZoom : 0,
|
||
n = vC.isDef(i.isTitleArea) ? i.isTitleArea : !!vC.isDef(t.isTitleArea) && t.isTitleArea,
|
||
s = vC.isDef(i.flag2level) ? i.flag2level : vC.isDef(t.flag2level) ? t.flag2level : void 0;
|
||
this.zoomslider_ = new Ez.controls.ZoomSlider({
|
||
maxZoom: r,
|
||
minZoom: o,
|
||
isTitleArea: n,
|
||
flag2level: s
|
||
}), this.addControl(this.zoomslider_)
|
||
}
|
||
}
|
||
|
||
showMapControl(t) {
|
||
if (!this.navi_ && !this.zoomslider_) {
|
||
var e = this.global_.getGlobalOptions(), i = null != e ? e : {};
|
||
t = null != t ? t : {};
|
||
var r = null != i.MapMaxLevel ? i.MapMaxLevel : null != t.maxZoom ? t.maxZoom : 18,
|
||
o = null != i.MapMinLevel ? i.MapMinLevel : null != t.minZoom ? t.minZoom : 0,
|
||
n = null != i.isTitleArea ? i.isTitleArea : null != t.isTitleArea && t.isTitleArea,
|
||
s = null != i.flag2level ? i.flag2level : null != t.flag2level ? t.flag2level : void 0;
|
||
this.zoomslider_ = new Ez.controls.ZoomSlider({
|
||
maxZoom: r,
|
||
minZoom: o,
|
||
isTitleArea: n,
|
||
flag2level: s
|
||
}), this.addControl(this.zoomslider_), this.navi_ = new Ez.controls.NavBar, this.addControl(this.navi_)
|
||
}
|
||
}
|
||
|
||
hideMapControl() {
|
||
this.navi_ && (this.removeControl(this.navi_), this.navi_ = null), this.zoomslider_ && (this.removeControl(this.zoomslider_), this.zoomslider_ = null)
|
||
}
|
||
|
||
showSimpleZoomControl() {
|
||
this.simplezoom_ || (this.simplezoom_ = new Ez.controls.SimpleZoom, this.addControl(this.simplezoom_))
|
||
}
|
||
|
||
hideSimpleZoomControl() {
|
||
this.simplezoom_ && (this.removeControl(this.simplezoom_), delete this.simplezoom_)
|
||
}
|
||
|
||
initLayersControl() {
|
||
var t = this.getConfig().getLayersInfo(), e = new Ez.controls.SimpleLayers(t);
|
||
this.layersControl_ = e, this.addControl(e), e.changed(), document.getElementById("ez_simple_layers").style.display = "none"
|
||
}
|
||
|
||
showLayersControl(t) {
|
||
var e, i, r = this.getConfig().getLayersInfo(), o = "default";
|
||
switch (t && (r = (e = t(r, o)).layerInfo, o = e.type), o) {
|
||
case"default":
|
||
i = new Ez.controls.Layers(r);
|
||
break;
|
||
case"simple":
|
||
i = new Ez.controls.SimpleLayers(r)
|
||
}
|
||
this.addControl(i), this.layersControl_ = i, "default" === o ? i.refesh() : i.changed()
|
||
}
|
||
|
||
hideLayersControl() {
|
||
this.removeControl(this.layersControl_), delete this.layersControl_
|
||
}
|
||
|
||
getConfig() {
|
||
return this.global_
|
||
}
|
||
|
||
addMapEventListener(t, e, i) {
|
||
return aC.MAP_ZOOMCHANGE === t ? this.viewOfEz_.on(t, e, i) : this.on(t, e, i)
|
||
}
|
||
|
||
addMapEventListenerOnce(t, e, i) {
|
||
return aC.MAP_ZOOMCHANGE === t ? this.viewOfEz_.once(t, e, i) : this.once(t, e, i)
|
||
}
|
||
|
||
removeMapEventListener(t) {
|
||
this.unByKey(t)
|
||
}
|
||
|
||
centerAtLatlng(t, e) {
|
||
var i;
|
||
t instanceof rC && (i = t.getCoordinate()), vC.isDef(e) && ("number" != typeof t && "string" != typeof t || (i = [parseFloat(t), parseFloat(e)])), i || ol.asserts.assert(!1, "参数类型不正确或者输入格式有误"), this.viewOfEz_.setCenter(i)
|
||
}
|
||
|
||
showScaleControl() {
|
||
this.scale_ || (this.scale_ = new Ez.controls.ScaleLine, this.addControl(this.scale_))
|
||
}
|
||
|
||
hideScaleControl() {
|
||
this.removeControl(this.scale_), delete this.scale_
|
||
}
|
||
|
||
showOverviewControl() {
|
||
this.overview_ || (this.overview_ = new Ez.controls.Overview, this.addControl(this.overview_))
|
||
}
|
||
|
||
hideOverviewControl() {
|
||
this.removeControl(this.overview_), delete this.overview_
|
||
}
|
||
|
||
centerAndZoom(t, e) {
|
||
ol.asserts.assert(null != t, "缩放级别不能为undefined"), ol.asserts.assert(t instanceof rC, "point 参数必须为EzCoord类型");
|
||
var i = t.getCoordinate();
|
||
ol.asserts.assert(null != e, "缩放级别不能为undefined"), ol.asserts.assert("number" == typeof e, "缩放级别必须为数值类型"), this.viewOfEz_.setCenter(i), this.viewOfEz_.setZoom(e)
|
||
}
|
||
|
||
centerAtMBR(t) {
|
||
if (t instanceof EzMBR) var e = t.value_; else {
|
||
ol.asserts.assert(Array.isArray(t), "目标包络框类型错误");
|
||
e = t
|
||
}
|
||
var i = this.getSize();
|
||
this.viewOfEz_.fit(e, i)
|
||
}
|
||
|
||
zoomTo(t) {
|
||
ol.asserts.assert(null != t, "缩放级别不能为undefined"), ol.asserts.assert("number" == typeof t, "缩放级别必须为数值类型"), this.viewOfEz_.setZoom(t)
|
||
}
|
||
|
||
measureLine(t, e) {
|
||
var i = [];
|
||
if (t instanceof Array) i = t; else for (var r = (t = t.replace(/,$/, "")).split(","), o = 0; o < r.length / 2; o++) {
|
||
var n = [r[2 * o], r[2 * o + 1]];
|
||
i[o] = n
|
||
}
|
||
for (var s = 0, a = (new ol.Sphere(6378137), this.getView().getProjection()), l = (o = 0, i.length - 1); o < l; ++o) {
|
||
s += ce(ol.proj.transform(i[o], a, "EPSG:4326"), ol.proj.transform(i[o + 1], a, "EPSG:4326"), 6378137)
|
||
}
|
||
return e ? Math.round(100 * s) / 100 : s > 100 ? Math.round(s / 1e3 * 100) / 100 + " km" : Math.round(100 * s) / 100 + " m"
|
||
}
|
||
|
||
changeDragMode(t, e, i, r, o) {
|
||
var n;
|
||
switch (t) {
|
||
case"drawPoint":
|
||
this.drawType_("Point"), n = Ez.g.Point;
|
||
break;
|
||
case"drawPolyline":
|
||
this.drawType_("LineString"), n = Ez.g.Polyline;
|
||
break;
|
||
case"drawPolygon":
|
||
this.drawType_("Polygon"), n = Ez.g.Polygon;
|
||
break;
|
||
case"drawCircle":
|
||
this.drawType_("Circle"), n = Ez.g.Circle;
|
||
break;
|
||
case"drawRect":
|
||
this.drawType_("Rect"), n = Ez.g.Rectangle;
|
||
break;
|
||
case"measureLine":
|
||
return void (null == this.draw_ ? this.draw_ = new SC("LineString", this, e) : this.draw_ instanceof ol.interaction.Draw2 ? (this.removeInteraction(this.draw_), this.draw_ = new SC("LineString", this, e)) : (this.draw_.draw && this.draw_.de_init(), this.draw_ = new SC("LineString", this, e)));
|
||
case"measureArea":
|
||
return void (null == this.draw_ ? this.draw_ = new SC("Polygon", this, e) : this.draw_ instanceof ol.interaction.Draw2 ? (this.removeInteraction(this.draw_), this.draw_ = new SC("Polygon", this, e)) : (this.draw_.draw && this.draw_.de_init(), this.draw_ = new SC("Polygon", this, e)));
|
||
case"editGeometry":
|
||
if ("on" === r) {
|
||
if (!i) return;
|
||
this.draw_ = new ol.interaction.Modify({features: new ol.Collection([i])}), this.addInteraction(this.draw_);
|
||
break
|
||
}
|
||
var s = i.getGeometry().getCoordinates().map(function (t) {
|
||
return t.join(",")
|
||
});
|
||
i.coordString = s.join(","), e(i), this.removeInteraction(this.draw_), this.draw_ = void 0;
|
||
break;
|
||
case"editCircle":
|
||
if ("on" === r) {
|
||
if (!i) return;
|
||
this.draw_ = new ol.interaction.EditCircle(i, e, o), this.addInteraction(this.draw_);
|
||
break
|
||
}
|
||
this.draw_.disposeAll(e), this.removeInteraction(this.draw_), this.draw_ = void 0
|
||
}
|
||
var a = this;
|
||
null != e && "editGeometry" !== t && "editCircle" !== t && this.draw_.on("drawend", function (t) {
|
||
var i = t.feature.getGeometry();
|
||
if ("Circle" === i.getType()) {
|
||
var r = i.getCenter(), o = i.getRadius(), s = r;
|
||
o *= ce(s, [s[0] + 1, s[1]]);
|
||
var l = new n(new rC(r[0], r[1]), o)
|
||
} else if ("Point" === i.getType()) r = i.getCoordinates(), l = new n(new rC(r[0], r[1])); else r = i.getCoordinates(), l = new n(r);
|
||
e(l), a.removeInteraction(a.draw_), a.draw_ = void 0
|
||
})
|
||
}
|
||
|
||
clearDragMode() {
|
||
this.draw_ && (this.draw_ instanceof ol.interaction.Draw2 ? (this.removeInteraction(this.draw_), delete this.draw_) : this.draw_.draw && (this.draw_.de_init(), delete this.draw_))
|
||
}
|
||
|
||
drawType_(t) {
|
||
var e = {};
|
||
"Rect" === t ? (e.type = "LineString", e.source = this.defaultVectorLayer_.getSource(), e.maxPoints = 2, e.geometryFunction = function (t, e) {
|
||
var i = t[0], r = t[1];
|
||
return e || (e = new ol.geom.Polygon([[i, [i[0], r[1]], r, [r[0], i[1]], i]])), e.setCoordinates([[i, [i[0], r[1]], r, [r[0], i[1]], i]]), e
|
||
}) : (e.type = t, e.source = this.defaultVectorLayer_.getSource()), null == this.draw_ ? (this.draw_ = new ol.interaction.Draw2(e), this.addInteraction(this.draw_)) : this.draw_ instanceof ol.interaction.Draw2 ? (this.removeInteraction(this.draw_), this.draw_ = new ol.interaction.Draw2(e), this.addInteraction(this.draw_)) : (this.draw_.draw && this.draw_.de_init(), this.draw_ = new ol.interaction.Draw2(e), this.addInteraction(this.draw_))
|
||
}
|
||
|
||
animationTo(t, e, i) {
|
||
var r = this.viewOfEz_, o = vC.isDef(i) && vC.isDef(i.duration) ? i.duration : 2e3;
|
||
r.getCenter();
|
||
if ("fly" === e) {
|
||
var n = r.getZoom();
|
||
r.animate({center: t.getCoordinate(), duration: o}), r.animate({
|
||
zoom: n - 1,
|
||
duration: o / 2
|
||
}, {zoom: n, duration: o / 2})
|
||
} else if ("spiral" === e) {
|
||
var s = r.getCenter();
|
||
r.animate({
|
||
center: [s[0] + (t.getCoordinate()[0] - s[0]) / 2, s[1] + (t.getCoordinate()[1] - s[1]) / 2],
|
||
rotation: Math.PI,
|
||
easing: Po
|
||
}, {center: t.getCoordinate(), rotation: 2 * Math.PI, easing: Lo})
|
||
} else r.animate({center: t.getCoordinate(), duration: o})
|
||
}
|
||
|
||
zoomAnimationTo(t, e) {
|
||
var i = vC.isDef(e) ? e : {};
|
||
this.viewOfEz_.animate({
|
||
zoom: t,
|
||
duration: null != i.duration ? i.duration : 2e3,
|
||
easing: null != i.easing ? i.easing : ol.easing.inAndOut
|
||
})
|
||
}
|
||
|
||
openInfoWindow(t, e, i) {
|
||
var r;
|
||
e instanceof rC ? r = e.getCoordinate() : Array.isArray(e) ? r = e : ol.asserts.assert(!1, "参数类型不正确或者输入格式有误"), this.popup_ && (this.removeOverlay(this.popup_), this.popup_ = null), this.popup_ = new bC(i), this.popup_.on("CLOSE", this.assignPopup2null_.bind(this)), this.addOverlay(this.popup_), this.popup_.show(t, r)
|
||
}
|
||
|
||
assignPopup2null_() {
|
||
this.popup_ = null
|
||
}
|
||
|
||
closeInfoWindow() {
|
||
this.popup_ && this.popup_.close()
|
||
}
|
||
|
||
getBoundsLatLng() {
|
||
var t = this.viewOfEz_.calculateExtent(this.getSize());
|
||
return new EzMBR(t[0], t[1], t[2], t[3])
|
||
}
|
||
|
||
clear() {
|
||
var t = this.getLayers(), e = this;
|
||
t.forEach(function (t, i, r) {
|
||
"baseLayers" !== t.get("title") && (t instanceof ol.layer.Group ? t.getLayers().forEach(function (t) {
|
||
t instanceof Ez.TileLayer.SingleHotSpot ? t.onRemove ? e.removeLayer(t) : e.removeLayer(t, !0) : t.getSource().clear()
|
||
}) : t.getSource().clear())
|
||
});
|
||
var i = this.getOverlays();
|
||
0 !== i.getLength() && i.clear()
|
||
}
|
||
|
||
draggable() {
|
||
this.dragfeatureinteraction = new ol.interaction.DragFeature, this.addInteraction(this.dragfeatureinteraction)
|
||
}
|
||
|
||
disdraggable() {
|
||
this.removeInteraction(this.dragfeatureinteraction), delete this.dragfeatureinteraction
|
||
}
|
||
|
||
enabledblZoom() {
|
||
this.dblzoominteraction && !this.dblzoominteraction.isOnMap && this.dblzoominteraction.interaction && (this.addInteraction(this.dblzoominteraction.interaction), this.dblzoominteraction.isOnMap = !0)
|
||
}
|
||
|
||
disabledblZoom() {
|
||
if (!this.dblzoominteraction) {
|
||
var t = this.getInteractions();
|
||
this.dblzoominteraction = {interaction: null, isOnMap: null};
|
||
var e = this;
|
||
t.forEach(function (t) {
|
||
t instanceof ol.interaction.DoubleClickZoom && (e.dblzoominteraction.interaction = t)
|
||
})
|
||
}
|
||
this.removeInteraction(this.dblzoominteraction.interaction), this.dblzoominteraction.isOnMap = !1
|
||
}
|
||
|
||
getAllFeaturesFromMap() {
|
||
var t = [], e = [];
|
||
t = t.concat(this.getOverlays().getArray()), this.getMarkerLayers().getLayers().getArray().forEach(function (e) {
|
||
t = t.concat(e.getSource().getFeatures())
|
||
}), this.getVectorLayers().getLayers().getArray().forEach(function (e) {
|
||
t = t.concat(e.getSource().getFeatures())
|
||
});
|
||
var i = this.getTileLayers().getLayers().getArray();
|
||
return e = e.concat(i), {features: t, tile: e}
|
||
}
|
||
|
||
addLayerToContainer(t, e) {
|
||
e.getLayers().push(t)
|
||
}
|
||
|
||
removeFromContainer(t, e) {
|
||
e.getLayers().remove(t)
|
||
}
|
||
|
||
addScaleLineControl(t) {
|
||
this.scaleline_ = new Ez.controls.ScaleLine(t), map.addControl(this.scaleline_)
|
||
}
|
||
|
||
removeScaleLineControl() {
|
||
this.scaleline_ && (map.removeControl(this.scaleline_), delete this.scaleline_)
|
||
}
|
||
|
||
addOverviewControl(t) {
|
||
this.overview_ = new Ez.controls.Overview(t), map.addControl(this.overview_)
|
||
}
|
||
|
||
removeOverviewControl() {
|
||
this.overview_ && (map.removeControl(this.overview_), delete this.overview_)
|
||
}
|
||
|
||
calculateTileCount(t, e, i) {
|
||
for (var r = i || !0, o = t.getExtent(), n = new Array(22), s = 0; s <= 22; ++s) n[s] = 1.40625 / Math.pow(2, s);
|
||
var a = new ol.tilegrid.TileGrid({
|
||
resolutions: n,
|
||
origin: r ? [-180, 90] : [0, 0]
|
||
}).getTileRangeForExtentAndZ(o, e);
|
||
return (a.maxX - a.minX + 1) * (a.maxY - a.minY + 1)
|
||
}
|
||
|
||
getMaxZoom() {
|
||
return this.maxZoom_
|
||
}
|
||
|
||
getMinZoom() {
|
||
return this.minZoom_
|
||
}
|
||
|
||
getVersion() {
|
||
return "EzServerClient 8.0.0"
|
||
}
|
||
}
|
||
|
||
var RC = class {
|
||
constructor(t, e) {
|
||
this.map = t, this.loadJS(e, function () {
|
||
this.styleMap = Ez_style_styleJson
|
||
}.bind(this))
|
||
}
|
||
|
||
getStyles(t) {
|
||
var e = t.get("layer");
|
||
if (null == this.styleMap || null == e) return this.getDefaultStyles();
|
||
var i = this.styleMap[e];
|
||
if (i || (i = this.styleMap[e.toUpperCase()]), i) {
|
||
for (var r = [], o = this.map.getZoom(), n = 0, s = i.length; n < s; n++) {
|
||
var a = i[n];
|
||
if (!(a.minZoom > o || a.maxZoom < o)) {
|
||
var l = !1;
|
||
if ("" == a.ruleName) l = !0; else {
|
||
var h = t.get(a.ruleName);
|
||
h || (h = t.get(a.ruleName.toLowerCase())), h || (h = t.get(a.ruleName.toUpperCase())), a.ruleValue.split(",").forEach(function (t, e) {
|
||
t == h && (l = !0)
|
||
})
|
||
}
|
||
if (0 != l) {
|
||
var u = {}, c = a.zIndex;
|
||
c && (u.zIndex = c);
|
||
var p = a.fill;
|
||
p && (u.fill = new ol.style.Fill(this.getFillJson(p)));
|
||
var d = a.stroke;
|
||
d && (u.stroke = new ol.style.Stroke(this.getStrokeJson(d)));
|
||
var f = a.text;
|
||
f && (u.text = new ol.style.Text(this.getLabelJson(f, t)));
|
||
var g = a.image;
|
||
g && ("Circle" == g.type && (u.image = new ol.style.Circle(this.getCircleJson(g))), "Icon" == g.type && (u.image = new ol.style.Icon(this.getIconJson(g))), "RegularShape" == g.type && (u.image = new ol.style.RegularShape(this.getRegularShapeJson(g)))), r.push(new ol.style.Style(u))
|
||
}
|
||
}
|
||
}
|
||
return r
|
||
}
|
||
return this.getDefaultStyles()
|
||
}
|
||
|
||
getLabelStyles(t) {
|
||
var e = t.get("layer");
|
||
if (null == this.styleMap || null == e) return [];
|
||
var i = this.styleMap[e];
|
||
if (i || (i = this.styleMap[e.toUpperCase()]), i) {
|
||
for (var r = [], o = this.map.getZoom(), n = 0, s = i.length; n < s; n++) {
|
||
var a = i[n];
|
||
if (!(a.minZoom > o || a.maxZoom < o)) {
|
||
var l = !1;
|
||
if ("" == a.ruleName) l = !0; else {
|
||
var h = t.get(a.ruleName);
|
||
h || (h = t.get(a.ruleName.toLowerCase())), h || (h = t.get(a.ruleName.toUpperCase())), a.ruleValue.split(",").forEach(function (t, e) {
|
||
t == h && (l = !0)
|
||
})
|
||
}
|
||
if (0 != l) {
|
||
a.zIndex;
|
||
var u = a.text;
|
||
if (u) {
|
||
var c = new ol.style.Style({text: new ol.style.Text(this.getLabelJson(u, t))});
|
||
r.push(c)
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return r
|
||
}
|
||
return []
|
||
}
|
||
|
||
getDefaultStyles() {
|
||
var t = new ol.style.Fill({color: "rgba(255,255,255,0.4)"}),
|
||
e = new ol.style.Stroke({color: "#3399CC", width: 1.25});
|
||
return [new ol.style.Style({
|
||
image: new ol.style.Circle({fill: t, stroke: e, radius: 5}),
|
||
fill: t,
|
||
stroke: e
|
||
})]
|
||
}
|
||
|
||
getFillJson(t) {
|
||
var e = {};
|
||
return t.color && (e.color = t.color), e
|
||
}
|
||
|
||
getStrokeJson(t) {
|
||
var e = {};
|
||
return t.color && (e.color = t.color), t.lineCap && (e.lineCap = t.lineCap), t.lineJoin && (e.lineJoin = t.lineJoin), t.lineDash && (e.lineDash = t.lineDash), t.miterLimit && (e.miterLimit = t.miterLimit), t.width && (e.width = t.width), e
|
||
}
|
||
|
||
getLabelJson(t, e) {
|
||
var i = {};
|
||
|
||
function r(t) {
|
||
return t * (Math.PI / 180)
|
||
}
|
||
|
||
if (t.font && (i.font = t.font), t.font && (i.font = t.font), t.offsetX && (i.offsetX = t.offsetX), t.offsetY && (i.offsetY = t.offsetY), t.scale && (i.scale = t.scale), t.rotateWithView && (i.rotateWithView = t.rotateWithView), t.placement && (i.placement = t.placement), e && e.flatCoordinates_ && "LineString" == e.type_ && (null == i.placement || null != i.placement && "line" != i.placement)) {
|
||
for (var o = e.flatCoordinates_, n = [], s = 0; s < o.length; s++) s % 2 == 0 && n.push([o[s], o[s + 1]]);
|
||
var a = map.getCoordinateFromPixel(n[0]), l = map.getCoordinateFromPixel(n[n.length - 1]);
|
||
i.rotation = -function (t, e, i) {
|
||
var o = t[0] > e[0] ? Math.PI : 0;
|
||
return function (t) {
|
||
return r((450 - t) % 360)
|
||
}(i) + o
|
||
}(a, l, function (t, e, i, o) {
|
||
t = r(t), e = r(e), i = r(i);
|
||
var n = (o = r(o)) - e,
|
||
s = Math.log(Math.tan(i / 2 + Math.PI / 4) / Math.tan(t / 2 + Math.PI / 4));
|
||
return Math.abs(n) > Math.PI && (n = n > 0 ? -(2 * Math.PI - n) : 2 * Math.PI + n), (Math.atan2(n, s) * (180 / Math.PI) + 360) % 360
|
||
}(a[1], a[0], l[1], l[0]))
|
||
} else t.rotation && (i.rotation = t.rotation);
|
||
return t.text && e && (e.get(t.text) || e.get(t.text.toLowerCase()) || e.get(t.text.toUpperCase())) && (i.text = e.get(t.text), i.text || (i.text = e.get(t.text.toLowerCase())), i.text || (i.text = e.get(t.text.toUpperCase()))), t.textAlign && (i.textAlign = t.textAlign), t.textBaseline && (i.textBaseline = t.textBaseline), t.fill && (i.fill = new ol.style.Fill(this.getFillJson(t.fill))), t.stroke && (i.stroke = new ol.style.Stroke(this.getStrokeJson(t.stroke))), t.backgroundFill && (i.backgroundFill = new ol.style.Fill(this.getFillJson(t.backgroundFill))), t.backgroundStroke && (i.backgroundStroke = new ol.style.Stroke(this.getStrokeJson(t.backgroundStroke))), i
|
||
}
|
||
|
||
getCircleJson(t) {
|
||
var e = {};
|
||
return t.fill && (e.fill = new ol.style.Fill(this.getFillJson(t.fill))), t.radius && (e.radius = t.radius), t.snapToPixel && (e.snapToPixel = t.snapToPixel), t.stroke && (e.stroke = new ol.style.Stroke(this.getStrokeJson(t.stroke))), t.atlasManager && (e.atlasManager = t.atlasManager), e
|
||
}
|
||
|
||
getIconJson(t) {
|
||
var e = {};
|
||
return t.anchor && (e.anchor = t.anchor), t.anchorOrigin && (e.anchorOrigin = t.anchorOrigin), t.anchorXUnits && (e.anchorXUnits = t.anchorXUnits), t.anchorYUnits && (e.anchorYUnits = t.anchorYUnits), t.crossOrigin && (e.crossOrigin = t.crossOrigin), t.img && (e.img = t.img), t.offset && (e.offset = t.offset), t.offsetOrigin && (e.offsetOrigin = t.offsetOrigin), t.opacity && (e.opacity = t.opacity), t.scale && (e.scale = t.scale), t.snapToPixel && (e.snapToPixel = t.snapToPixel), t.rotateWithView && (e.rotateWithView = t.rotateWithView), t.rotation && (e.rotation = t.rotation), t.size && (e.size = t.size), t.src && (e.src = t.src), e
|
||
}
|
||
|
||
getRegularShapeJson(t) {
|
||
var e = {};
|
||
return t.fill && (e.fill = new ol.style.Fill(this.getFillJson(t.fill))), t.points && (e.points = t.points), t.radius && (e.radius = t.radius), t.radius1 && (e.radius1 = t.radius1), t.radius2 && (e.radius2 = t.radius2), t.angle && (e.angle = t.angle), t.snapToPixel && (e.snapToPixel = t.snapToPixel), t.stroke && (e.stroke = new ol.style.Stroke(this.getStrokeJson(t.stroke))), t.rotation && (e.rotation = t.rotation), t.rotateWithView && (e.rotateWithView = t.rotateWithView), t.atlasManager && (e.atlasManager = t.atlasManager), e
|
||
}
|
||
|
||
changeSkill(t) {
|
||
if ("" != t) this.loadJS(t, function () {
|
||
this.styleMap = Ez_style_styleJson;
|
||
var t = map.tileLayerGroup_.values_.layers.array_;
|
||
for (var e in t) t[e] instanceof Ez.VectorLayer.WMTS_SL && (t[e].setJson2Style(this), t[e].setStyle(function (t) {
|
||
return this.getStyles(t)
|
||
}.bind(this)), t[e].changeSkill(!0))
|
||
}.bind(this)); else {
|
||
this.styleMap = [];
|
||
var e = map.tileLayerGroup_.values_.layers.array_;
|
||
for (var i in e) e[i] instanceof Ez.VectorLayer.WMTS_SL && (e[i].setJson2Style(this), e[i].setStyle(), e[i].changeSkill(!1))
|
||
}
|
||
}
|
||
|
||
loadJS(t, e) {
|
||
var i = document.createElement("script"), r = e || function () {
|
||
};
|
||
i.type = "text/javascript", i.readyState ? i.onreadystatechange = function () {
|
||
"loaded" != i.readyState && "complete" != i.readyState || (i.onreadystatechange = null, r())
|
||
} : i.onload = function () {
|
||
r()
|
||
}, i.src = t, document.getElementsByTagName("head")[0].appendChild(i)
|
||
}
|
||
};
|
||
var PC = class {
|
||
constructor(t, e, i) {
|
||
this.layer = t, this.sourceName = i, this.loadJSON(e)
|
||
}
|
||
|
||
loadJSON(t) {
|
||
var e = this, i = new XMLHttpRequest;
|
||
i.open("get", t), i.send(null), i.onload = function () {
|
||
if (200 == i.status) {
|
||
var t = JSON.parse(i.responseText);
|
||
console.log(t), olms.applyStyle(e.layer, t, e.sourceName, null, e.layer.getSource().getTileGrid().getResolutions())
|
||
}
|
||
}
|
||
}
|
||
|
||
changeSkill(t) {
|
||
this.loadJSON(t)
|
||
}
|
||
};
|
||
var LC = class extends ux {
|
||
constructor(t, e) {
|
||
var i = e || {}, r = {}, o = i.customOpts ? i.customOpts : null;
|
||
for (var n in i) "customOpts" !== i[n] && (r[n] = i[n]);
|
||
super(r), this.key_ = i.key, this.set("ezname", t), this.set("isAddToMap", !1), o && this.set("customOpts", o)
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t, t.getTileLayers().getLayers().push(this), this.set("isAddToMap", !0)
|
||
}
|
||
|
||
onRemove(t) {
|
||
this.get("isAddToMap") && (this.map_ = null, t.getTileLayers().getLayers().remove(this), this.set("isAddToMap", !1))
|
||
}
|
||
|
||
getResolutions() {
|
||
return this.getSource().getTileGrid().getResolutions()
|
||
}
|
||
};
|
||
var IC = class extends LC {
|
||
constructor(t, e, i) {
|
||
for (var r = i || {}, o = new Array(30), n = new Array(30), s = 0; s < 30; ++s) o[s] = 360 / (256 * Math.pow(2, s + 1)), n[s] = s;
|
||
var a = new ol.tilegrid.WMTS({
|
||
origin: r.origin || [-180, 90],
|
||
resolutions: r.resolutions || o,
|
||
matrixIds: r.matrixIds || n
|
||
}), l = e;
|
||
if (-1 === e.indexOf("?")) {
|
||
var h = {
|
||
REQUEST: r.request || "GetTile",
|
||
SERVICE: r.service || "WMTS",
|
||
VERSION: r.version || "1.0.0",
|
||
LAYER: r.layer,
|
||
TILEMATRIX: r.tilematrix || r.projection + ":{z}",
|
||
TILEMATRIXSET: r.tilematrixset || r.projection,
|
||
FORMAT: r.format || "application/x-protobuf;type=mapbox-vector",
|
||
TILECOL: "{x}",
|
||
TILEROW: "{y}"
|
||
};
|
||
for (var u in l = e + "?", h) l = l + u + "=" + h[u] + "&";
|
||
l = l.slice(0, -1)
|
||
}
|
||
var c = new ol.source.VectorTile({
|
||
url: l,
|
||
format: new ol.format.MVT({}),
|
||
projection: r.projection,
|
||
wrapX: !vC.isDef(r.wrapX) || r.wrapX,
|
||
tileGrid: a
|
||
});
|
||
r.declutter = !0, super(t, Object.assign({}, r, {source: c})), this.tileGrid = a, this.url_ = l
|
||
}
|
||
|
||
getTileExtent(t) {
|
||
var e = t[0], i = t[1], r = t[2], o = this.tileGrid.getOrigin(e),
|
||
n = this.tileGrid.getTileSize(e) * this.tileGrid.getResolution(e);
|
||
return [o[0] + n * i, o[1] + n * (r + 1)]
|
||
}
|
||
|
||
changeSkill(t) {
|
||
for (var e in this.labelLayerArray) this.labelLayerArray[e].getSource().clear(), map.removeLayer(this.labelLayerArray[e]);
|
||
if (this.labelLayerArray = [], t) {
|
||
var i = this.getSource();
|
||
i.tileCache.expireCache({}), i.tileCache.clear()
|
||
}
|
||
}
|
||
|
||
setJson2Style(t) {
|
||
this.json2Style = t, this.setStyle(function (e) {
|
||
return t.getStyles(e)
|
||
})
|
||
}
|
||
|
||
getUrl() {
|
||
return this.url_
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t, t.getView().on("change:resolution", function (e) {
|
||
var i = t.getZoom() - 1;
|
||
for (var r in this.labelLayerArray) this.labelLayerArray[r].get("name") == "labelLayer_" + i ? this.labelLayerArray[r].setVisible(!0) : this.labelLayerArray[r].setVisible(!1)
|
||
}.bind(this)), t.getTileLayers().getLayers().push(this), this.set("isAddToMap", !0)
|
||
}
|
||
};
|
||
var OC = class extends lC {
|
||
constructor(t, e, i) {
|
||
var r = i || {}, o = new ol.source.XYZ({
|
||
url: e,
|
||
crossOrigin: r.crossOrigin,
|
||
projection: r.projection,
|
||
tileGrid: r.tileGrid,
|
||
maxZoom: r.maxZoom,
|
||
minZoom: r.minZoom,
|
||
tileSize: r.tileSize,
|
||
wrapX: !r.wrapX || r.wrapX,
|
||
attributions: r.attributions
|
||
});
|
||
super(t, Object.assign({}, r, {source: o})), this.url_ = e
|
||
}
|
||
|
||
getUrl() {
|
||
return this.url_
|
||
}
|
||
};
|
||
|
||
class MC extends ol.layer.Tile {
|
||
constructor(t) {
|
||
var e, i = {}, r = {};
|
||
for (var o in t) "icon" === o ? e = t[o] : i[o] = t[o];
|
||
super({source: new ol.source.EzHotspot(i)}), this.set("layerType", "hotspotLayer"), this.markerOpacity_ = vC.isDef(r.opacity) ? r.opacity : 1, r.opacity = 0, this.popupAnchor_ = vC.isDef(t.popupAnchor) ? t.popupAnchor : [0, 0], this.marker_ = new Ez.Marker(new Ez.Coordinate(0, 0), e)
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t, t.addOverlay(this.marker_), t.getLayers().insertAt(1, this)
|
||
}
|
||
|
||
onRemove(t) {
|
||
this.map_ = null;
|
||
t.removeLayer(this, !0), t.removeOverlay(this.marker_)
|
||
}
|
||
|
||
onMouseMove_(t) {
|
||
var e, i, r, o = t.coordinate, n = t.frameState, s = n.viewState.resolution, a = 8 * s,
|
||
l = n.viewState.projection, h = t.map.getView().getZoom();
|
||
t.map.getLayers().forEach(function (t) {
|
||
t instanceof MC && (e = t, i = t.getSource(), r = i.getTileGridForProjection(l))
|
||
});
|
||
var u = n.extent, c = ol.extent.getTopLeft(u);
|
||
ol.extent.createOrUpdate(c[0], c[1], o[0], o[1], u);
|
||
var p = r.getTileRangeForExtentAndResolution(u, s), d = p.maxX + ":" + (-p.maxY - 1),
|
||
f = i.getMarkerData();
|
||
if (h in f && d in f[h]) for (var g = f[h][d], m = g.length, y = 0; y < m; y++) {
|
||
var v = new Ez.Coordinate(parseFloat(g[y].X), parseFloat(g[y].Y)),
|
||
_ = new Ez.MBR(v.coordinate_[0] - a, v.coordinate_[1] - a, v.coordinate_[0] + a, v.coordinate_[1] + a),
|
||
x = {ID: g[y].ID, LABEL: g[y].LABEL, X: g[y].X, Y: g[y].Y};
|
||
if (_.containsPoint(o)) {
|
||
t.map.getViewport().style.cursor = "pointer", e.marker_.setPoint(v), e.marker_.set("hotspotdata", x), e.marker_.setOpacity(e.markerOpacity_);
|
||
break
|
||
}
|
||
t.map.getViewport().style.cursor = "", e.marker_.setOpacity(0)
|
||
}
|
||
}
|
||
|
||
onClick_(t) {
|
||
if (t) {
|
||
var e = "LABLE : " + t.get("data").LABEL;
|
||
t.popupOpenFlag_ ? t.closeInfoWindowHtml() : t.openInfoWindowHtml(e, {positioning: "bottom-left"})
|
||
}
|
||
}
|
||
}
|
||
|
||
var AC = MC;
|
||
var kC = class extends ol.layer.Group {
|
||
constructor(t) {
|
||
super(t), this.currentId = null, this.duration = t.duration ? t.duration : 500
|
||
}
|
||
|
||
addSingleLayer(t) {
|
||
this.getLayers().push(t)
|
||
}
|
||
|
||
deleteSingleLayer(t) {
|
||
var e = this.getLayers();
|
||
e.forEach(function (i) {
|
||
t !== i || e.remove(i)
|
||
})
|
||
}
|
||
|
||
handleTileData_() {
|
||
var t = this.getLayers();
|
||
t.forEach(function (t) {
|
||
t.getSource().clear(), t.updateSopurceState && t.updateSopurceState(!0, !1)
|
||
}), window.clearTimeout(this.currentId), this.currentId = window.setTimeout(function () {
|
||
t.forEach(function (t) {
|
||
t.updateSopurceState && t.updateSopurceState(!1, !0), t.getSource().changed()
|
||
})
|
||
}.bind(this), this.duration)
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t, t.getView().on("change:resolution", this.handleTileData_.bind(this)), t.getCustomLayers().getLayers().push(this), this.set("isAddToMap", !0)
|
||
}
|
||
|
||
onRemove(t) {
|
||
if (this.get("isAddToMap")) {
|
||
this.map_ = null, t.getView().off("change:resolution", this.handleTileData_.bind(this));
|
||
var e = t.getCustomLayers().getLayers(), i = this;
|
||
e.forEach(function (t) {
|
||
i === t && e.remove(t)
|
||
}), this.set("isAddToMap", !1)
|
||
}
|
||
}
|
||
};
|
||
var FC = class extends ol.layer.Vector {
|
||
constructor(t) {
|
||
var e = t || {}, i = new ol.source.SingleHotSpot(e);
|
||
super({source: i}), this.singleSource = i, this.set("isAddToMap", !1), this.currentId = null, this.clusterStyleCache_ = {}, this.duration = t.duration ? t.duration : 500
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t, t.getView().on("change:resolution", this.handleTileData_.bind(this)), t.getCustomLayers().getLayers().push(this), this.set("isAddToMap", !0)
|
||
}
|
||
|
||
onRemove(t) {
|
||
if (this.get("isAddToMap")) {
|
||
this.map_ = null, t.getView().off("change:resolution", this.handleTileData_.bind(this));
|
||
var e = t.getCustomLayers().getLayers(), i = this;
|
||
e.forEach(function (t) {
|
||
i === t && e.remove(t)
|
||
}), this.set("isAddToMap", !1)
|
||
}
|
||
}
|
||
|
||
updateSourceState(t, e) {
|
||
var i = this.getSource();
|
||
i.setLoadingState(t), i.setLoadendState(e)
|
||
}
|
||
|
||
handleTileData_(t) {
|
||
var e = this.getSource();
|
||
e.clear(!0), this.updateSourceState(!0, !1), window.clearTimeout(this.currentId), this.currentId = window.setTimeout(function () {
|
||
this.updateSourceState(!1, !0), e.changed()
|
||
}.bind(this), this.duration)
|
||
}
|
||
};
|
||
|
||
class NC extends ol.events.Event {
|
||
constructor(t, e) {
|
||
super(t), this.time = e
|
||
}
|
||
}
|
||
|
||
class DC extends ol.Object {
|
||
constructor(t, e) {
|
||
super(), this.feature_ = t, this.transitions_ = e, this.map_ = null, this.now_ = null, this.status_ = "STOP", this.transition_ = null, this.animationTimer_ = 0
|
||
}
|
||
|
||
setRefreshController(t) {
|
||
this.map_ = t
|
||
}
|
||
|
||
play() {
|
||
if ("PLAY" !== this.status_) {
|
||
var t = this.feature_, e = this.map_;
|
||
if ("PAUSE" === this.status_) {
|
||
var i = this.transitions_[0], r = t.getPoint(),
|
||
o = i.getDuration() - ((new Date).getTime() - this.now_ - this.animationTimer_);
|
||
this.transitions_[0].setDuration(o), this.transitions_[0].setStartState(r)
|
||
}
|
||
this.status_ = "PLAY";
|
||
var n = this.now_ = (new Date).getTime(), s = this.generateTransition(t, n);
|
||
this.on("animation:end", function () {
|
||
e.un("postcompose", s)
|
||
}), this.on("animation:control:pause", function () {
|
||
e.un("postcompose", s)
|
||
}), e.on("postcompose", s), this.dispatchEvent(new NC("animation:start", (new Date).getTime())), e.render()
|
||
}
|
||
}
|
||
|
||
pause() {
|
||
this.status_ = "PAUSE", this.dispatchEvent(new NC("animation:control:pause"))
|
||
}
|
||
}
|
||
|
||
var GC = {
|
||
linear: jC, radius: function () {
|
||
}
|
||
};
|
||
|
||
function jC(t, e, i, r) {
|
||
var o = (r - e) / (i - t), n = (i * e - t * r) / (i - t);
|
||
return Math.abs(o) === 1 / 0 ? 1 / 0 : function (t) {
|
||
return o * t + n
|
||
}
|
||
}
|
||
|
||
var zC = class extends DC {
|
||
constructor(t, e) {
|
||
super(t, e)
|
||
}
|
||
|
||
generateTransition(t, e) {
|
||
var i, r = this.transitions_;
|
||
r.forEach(function (t, e) {
|
||
0 === e && (i = t.getDuration()), i < t.getDuration() && (i = t.getDuration())
|
||
});
|
||
var o = r.map(function (i) {
|
||
return i.generateTransition(t, e)
|
||
}), n = 0, s = this;
|
||
return function (t) {
|
||
var r = t.frameState.time - e;
|
||
o.forEach(function (e, o, a) {
|
||
e(t) && n++, n === a.length && r >= i && (s.status_ = !1, s.dispatchEvent(new Ez.animation.ComposeEvent("animation:end")))
|
||
})
|
||
}
|
||
}
|
||
};
|
||
var UC = class extends ol.Object {
|
||
constructor(t, e, i, r, o) {
|
||
super();
|
||
var n = o || {};
|
||
this.duration_ = t || 0, this.atttibute_ = e || null, this.stateOfStart_ = i || null, this.stateOfEnd_ = r || null;
|
||
var s = n.interoptype ? n.interoptype : "linear";
|
||
this.interopFn_ = n.interopfn ? n.interopfn : GC[s], this.fps_ = n.fps ? n.fps : 60
|
||
}
|
||
|
||
generateInteropfn() {
|
||
var t = this.interopFn_, e = this.stateOfStart_.getCoordinate(), i = this.stateOfEnd_.getCoordinate();
|
||
return t(e[0], e[1], i[0], i[1])
|
||
}
|
||
|
||
getDuration() {
|
||
return this.duration_
|
||
}
|
||
|
||
setDuration(t) {
|
||
t && (this.duration_ = t)
|
||
}
|
||
|
||
getFPS() {
|
||
return this.fps_
|
||
}
|
||
|
||
setStartState(t) {
|
||
t && (this.stateOfStart_ = t)
|
||
}
|
||
};
|
||
var BC = class extends DC {
|
||
constructor(t, e) {
|
||
super(t, e)
|
||
}
|
||
|
||
calcSumDur(t, e, i) {
|
||
return i < 0 ? t : e[i].getDuration() + this.calcSumDur(t, e, i - 1)
|
||
}
|
||
|
||
generateTransition(t, e) {
|
||
var i = this.transitions_, r = this, o = i.map(function (i, o, n) {
|
||
var s = r.calcSumDur(e, n, o - 1);
|
||
return i.generateTransition(t, s)
|
||
});
|
||
return function (t) {
|
||
if (o[0](t)) {
|
||
o.splice(0, 1);
|
||
var e = i.splice(0, 1);
|
||
r.animationTimer_ += e[0].getDuration(), t.target.render()
|
||
}
|
||
0 === o.length && (this.status_ = "STOP", r.dispatchEvent(new NC("animation:end", t.frameState.time)))
|
||
}
|
||
}
|
||
};
|
||
var VC = class extends UC {
|
||
constructor(t, e, i, r, o) {
|
||
var n = o || {}, s = n.type ? n.type : "linear";
|
||
super(t, e, i, r, Object.assign({}, n, {type: s}))
|
||
}
|
||
|
||
generateTransition(t, e) {
|
||
var i = e,
|
||
r = (this.stateOfStart_.getCoordinate()[0], this.stateOfEnd_.getCoordinate()[0], this.getDuration()),
|
||
o = this.getFPS(), n = this.generateInteropfn(),
|
||
s = this.generateLine(this.stateOfStart_.getCoordinate(), this.stateOfEnd_.getCoordinate(), r, this.getFPS(), n);
|
||
return function (e) {
|
||
var r = e.frameState, n = e.target, a = r.time - i, l = Math.round(a / (1e3 / o));
|
||
if (l >= 1) {
|
||
if (l >= s.length) return !0;
|
||
t.getGeometry().setCoordinates(s[l]), n.render()
|
||
}
|
||
}
|
||
}
|
||
|
||
generateLine(t, e, i, r, o) {
|
||
var n, s = i / (1e3 / r);
|
||
n = o === 1 / 0 ? (e[1] - t[1]) / (s > 0 ? s : 0) : (e[0] - t[0]) / (s > 0 ? s : 0);
|
||
var a, l, h = [];
|
||
h.push(t);
|
||
for (var u = 1; u < s + 1; u++) o === 1 / 0 ? (a = t[0], l = t[1] + n * u) : l = o(a = t[0] + n * u), h.push([a, l]);
|
||
return h.push(e), h
|
||
}
|
||
};
|
||
var YC = class extends UC {
|
||
constructor(t, e, i, r, o, n) {
|
||
var s = n || {}, a = s.type ? s.type : "radius";
|
||
super(t, e, i, r, Object.assign({}, s, {type: a})), this.isRight_ = !vC.isDef(o) || o
|
||
}
|
||
|
||
generateTransition(t, e) {
|
||
var i = e, r = this.stateOfStart_, o = this.stateOfEnd_, n = this.getDuration(), s = this.getFPS(),
|
||
a = this.generateRad(r, o, n, s);
|
||
return function (e) {
|
||
var r = e.frameState, o = (e.target, r.time - i), n = Math.round(o / (1e3 / s));
|
||
if (n >= 1) {
|
||
if (n >= a.length) return !0;
|
||
var l = t.getStyle();
|
||
l.getImage().setRotation(a[n]), t.setStyle(l)
|
||
}
|
||
}
|
||
}
|
||
|
||
generateRad(t, e, i, r) {
|
||
var o = i / (1e3 / r);
|
||
if (this.isRight_) {
|
||
var n = this.radianClockwise_(t, e);
|
||
t = n.start, e = n.end
|
||
} else {
|
||
var s = this.radianUnClockwise_(t, e);
|
||
t = s.start, e = s.end
|
||
}
|
||
var a = (e - t) / (o > 0 ? o : 0), l = [];
|
||
l.push(t);
|
||
for (var h = 1; h < o + 1; h++) {
|
||
var u;
|
||
u = t + a * h, l.push(u)
|
||
}
|
||
return l.push(e), l
|
||
}
|
||
|
||
radianClockwise_(t, e) {
|
||
return e - t >= 0 ? {start: t, end: e} : {start: t, end: 2 * Math.PI + e}
|
||
}
|
||
|
||
radianUnClockwise_(t, e) {
|
||
return e - t >= 0 ? {start: t, end: -2 * Math.PI + e} : {start: t, end: e}
|
||
}
|
||
};
|
||
var WC = class extends ol.control.Control {
|
||
constructor(t) {
|
||
t.className += " ol-unselectable ol-control", super({element: t})
|
||
}
|
||
};
|
||
|
||
class HC extends ol.control.Control {
|
||
constructor(t) {
|
||
var e = {}, i = document.createElement("div"), r = document.createElement("div");
|
||
i.className = "ez-layers ol-unselectable ol-control", r.className = "ez-layers-showLayers";
|
||
for (var o = {}, n = 0; n < t.length; n++) {
|
||
var s = t[n], a = HC.generateLayerFrame(s);
|
||
e[s.title] = a, e[s.title + "_layer"] = s.layer, o[s.title] = s.layer
|
||
}
|
||
super({element: i}), i.addEventListener("mouseover", this.onMouseOver_.bind(this), !1), i.addEventListener("mouseout", this.onMouseOut_.bind(this), !1), i.addEventListener("click", this.onClick_.bind(this), !1), this.baseLayers_ = e, this.eleContainer = i, this.showContainer = r, this.layers_ = o
|
||
}
|
||
|
||
static generateLayerFrame(t) {
|
||
ol.asserts.assert(vC.isDef(t.title), "图层缺少title信息"), ol.asserts.assert(vC.isDef(t.layer), "图层缺少layer对象"), ol.asserts.assert(vC.isDef(t.imageSRC), "图层缺少image图标");
|
||
var e = document.createElement("div");
|
||
e.className = "ez-layers-div ez-layers-hidden", e.id = "ezLayer", e.addEventListener("mouseover", function (t) {
|
||
this.children[1].style.backgroundColor = "#989CFC"
|
||
}, !1), e.addEventListener("mouseout", function (t) {
|
||
this.children[1].style.backgroundColor = ""
|
||
}, !1);
|
||
var i = document.createElement("img");
|
||
i.src = t.imageSRC;
|
||
var r = document.createElement("div");
|
||
return r.innerHTML = t.title, r.className = "ez-layers-title", e.appendChild(i), e.appendChild(r), e
|
||
}
|
||
|
||
refesh() {
|
||
var t = this.getMap().getTileLayers().getLayers(), e = /_layer/, i = t.item(t.getLength() - 1);
|
||
for (var r in this.baseLayers_) r !== i.get("ezname") ? e.test(r) || this.showContainer.appendChild(this.baseLayers_[r]) : (this.eleContainer.appendChild(this.baseLayers_[r]), this.topElement_ = this.baseLayers_[r], this.removeCss(this.topElement_, "ez-layers-hidden"));
|
||
this.eleContainer.appendChild(this.showContainer)
|
||
}
|
||
|
||
onMouseOver_(t) {
|
||
t.stopPropagation(), this.expand()
|
||
}
|
||
|
||
onMouseOut_(t) {
|
||
t.stopPropagation(), this.collapse()
|
||
}
|
||
|
||
onClick_(t) {
|
||
t.stopPropagation();
|
||
var e, i = t.target;
|
||
for (e = i.lastChild ? i.lastChild.textContent : i.nextSibling.lastChild.textContent, this.swapTo(e), this.eleContainer.removeChild(this.showContainer); this.showContainer.hasChildNodes();) this.showContainer.removeChild(this.showContainer.lastChild);
|
||
this.refesh()
|
||
}
|
||
|
||
expand() {
|
||
for (var t = this.showContainer.childNodes, e = 0; e < t.length; e++) this.removeCss(t[e], "ez-layers-hidden")
|
||
}
|
||
|
||
collapse() {
|
||
for (var t = this.showContainer.childNodes, e = 0; e < t.length; e++) this.addCss(t[e], "ez-layers-hidden")
|
||
}
|
||
|
||
removeCss(t, e) {
|
||
for (var i = this.getClass(t), r = e, o = [], n = 0; n < i.length; n++) -1 == r.indexOf(i[n]) && o.push(i[n]);
|
||
t.className = o.join(" ")
|
||
}
|
||
|
||
addCss(t, e) {
|
||
var i = this.getClass(t), r = e;
|
||
-1 == i.indexOf(r) && i.push(r), t.className = i.join(" ")
|
||
}
|
||
|
||
getClass(t) {
|
||
var e = t.className;
|
||
return e && "function" == typeof e.split ? e.split(" ") : []
|
||
}
|
||
|
||
swapTo(t) {
|
||
var e = this.getMap();
|
||
if (vC.isDef(t)) {
|
||
var i = this.getCurrentTileLayer();
|
||
if (t !== i.get("ezname")) {
|
||
var r, o = this.layers_[t], n = e.getView().getProjection();
|
||
o instanceof Ez.Layer.Group ? (r = o.getLayers().getArray()[0].getSource().getProjection(), o.getLayers().getArray()[0].getResolutions()) : (o.getResolutions(), r = o.getSource().getProjection());
|
||
var s = e.getView().getCenter();
|
||
e.getView().getZoom(), e.getView().getState(), ol.proj.transform(s, n, r);
|
||
e.removeLayer(i), e.addLayer(o)
|
||
}
|
||
}
|
||
}
|
||
|
||
getCurrentTileLayer() {
|
||
var t = this.map_.tileLayerGroup_.getLayers();
|
||
return t.item(t.getLength() - 1)
|
||
}
|
||
}
|
||
|
||
var XC = HC;
|
||
var qC = class extends ol.control.Control {
|
||
constructor(t) {
|
||
var e = document.createElement("div");
|
||
e.className = "ez-navigation ol-unselectable ol-control";
|
||
var i = document.createElement("div");
|
||
i.className = "ez-navigation-top ez-navigation-pan", i.setAttribute("data-orientation", "NORTH"), e.appendChild(i);
|
||
var r = document.createElement("div");
|
||
r.className = "ez-navigation-left ez-navigation-pan", r.setAttribute("data-orientation", "WEST"), e.appendChild(r);
|
||
var o = document.createElement("div");
|
||
o.className = "ez-navigation-bottom ez-navigation-pan", o.setAttribute("data-orientation", "SOUTH"), e.appendChild(o);
|
||
var n = document.createElement("div");
|
||
n.className = "ez-navigation-right ez-navigation-pan", n.setAttribute("data-orientation", "EAST"), e.appendChild(n), super({element: e}), ol.events.listen(i, ol.events.EventType.CLICK, this.handleClick_, this), ol.events.listen(r, ol.events.EventType.CLICK, this.handleClick_, this), ol.events.listen(o, ol.events.EventType.CLICK, this.handleClick_, this), ol.events.listen(n, ol.events.EventType.CLICK, this.handleClick_, this)
|
||
}
|
||
|
||
handleClick_(t) {
|
||
var e = t.target.getAttribute("data-orientation"), i = this.getMap().viewOfEz_, r = i.getState(),
|
||
o = 128 * r.resolution, n = 0, s = 0;
|
||
"SOUTH" === e ? s = -o : "WEST" === e ? n = -o : "EAST" === e ? n = o : s = o;
|
||
var a = [n, s];
|
||
ol.coordinate.rotate(a, r.rotation), ol.interaction.Interaction.pan(i, a, 100), t.preventDefault()
|
||
}
|
||
};
|
||
var ZC = class extends ol.control.OverviewMap {
|
||
constructor(t) {
|
||
var e = t || {}, i = e.className ? e.className : "ol-overviewmap ez-custom-overview",
|
||
r = e.collapseLabel ? e.collapseLabel : "»", o = e.label ? e.label : "«",
|
||
n = !e.collapsed || e.collapsed, s = e.projection ? e.projection : "EPSG:4326";
|
||
super({className: i, collapseLabel: r, label: o, view: new ol.View({projection: s}), collapsed: n})
|
||
}
|
||
};
|
||
var KC = class extends ol.control.ScaleLine {
|
||
constructor(t) {
|
||
var e = t || {};
|
||
super({
|
||
className: e.className ? e.className : "ez-scale-line",
|
||
minWidth: e.minWidth ? e.minWidth : 64,
|
||
units: e.units ? e.units : "metric"
|
||
})
|
||
}
|
||
};
|
||
var JC = class extends ol.control.Control {
|
||
constructor(t) {
|
||
var e = document.createElement("div");
|
||
e.className = "ez-simple-layers ol-unselectable ol-control", e.id = "ez_simple_layers", super({element: e});
|
||
for (var i = {}, r = t.length - 1; r >= 0; r--) {
|
||
var o;
|
||
o = 0 === r ? this.createLayerCard(t[r]) : this.createLayerCard(t[r], !0), e.appendChild(o), i[t[r].title] = t[r].layer
|
||
}
|
||
e.addEventListener("mouseover", this.onMouseOver.bind(this)), e.addEventListener("mouseout", this.onMouseOut.bind(this)), this.element = e, this.layers_ = i
|
||
}
|
||
|
||
createLayerCard(t, e) {
|
||
var i = t.title, r = (t.layer, t.imageSRC), o = document.createElement("div");
|
||
o.className = e ? "ez-simple-card hide" : "ez-simple-card";
|
||
var n = document.createElement("img");
|
||
n.src = r;
|
||
var s = document.createElement("span");
|
||
return s.innerHTML = i, o.addEventListener("mouseover", this.oncardmouseover.bind(o, this)), o.addEventListener("mouseout", this.oncardmouseout.bind(o, this)), o.addEventListener("click", this.oncardclick.bind(o, this)), o.appendChild(n), o.appendChild(s), o
|
||
}
|
||
|
||
onMouseOver(t) {
|
||
var e = this.element, i = e.children;
|
||
this.addClass(e, "ez-simple-layers--onfocus");
|
||
for (var r = 0; r < i.length - 1; r++) this.removeClass(i[r], "hide")
|
||
}
|
||
|
||
onMouseOut(t) {
|
||
var e = this.element, i = e.children;
|
||
this.removeClass(e, "ez-simple-layers--onfocus");
|
||
for (var r = 0; r < i.length - 1; r++) this.addClass(i[r], "hide")
|
||
}
|
||
|
||
oncardmouseover(t) {
|
||
var e = this.children[1];
|
||
t.addClass(this, "ez-simple-card--onfocus"), t.addClass(e, "ez-simple-card-title--onfocus")
|
||
}
|
||
|
||
oncardmouseout(t) {
|
||
var e = this.children[1];
|
||
t.removeClass(this, "ez-simple-card--onfocus"), t.removeClass(e, "ez-simple-card-title--onfocus")
|
||
}
|
||
|
||
oncardclick(t) {
|
||
var e = this.children[1].textContent;
|
||
t.swapTo(e)
|
||
}
|
||
|
||
addClass(t, e) {
|
||
this.removeClass(t, e), t.className += " " + e
|
||
}
|
||
|
||
removeClass(t, e) {
|
||
for (var i = t.className.split(" "), r = 0; r < i.length; r++) if (i[r] === e) {
|
||
i.splice(r, 1);
|
||
break
|
||
}
|
||
t.className = i.join(" ")
|
||
}
|
||
|
||
swapTo(t) {
|
||
var e = this.getMap();
|
||
if (vC.isDef(t)) {
|
||
var i = this.getCurrentTileLayer();
|
||
if (t !== i.get("ezname")) {
|
||
var r, o = this.layers_[t], n = e.getView().getProjection();
|
||
if (o instanceof Ez.Layer.Group) r = o.getLayers().getArray()[0].getSource().getProjection(), o.getLayers().getArray()[0].getResolutions(); else {
|
||
if ("function" == typeof o) return void (o() && e.removeLayer(i));
|
||
o.getResolutions(), r = o.getSource().getProjection()
|
||
}
|
||
var s = e.getView().getCenter();
|
||
e.getView().getZoom(), e.getView().getState(), ol.proj.transform(s, n, r), e.removeLayer(i), e.addLayer(o)
|
||
}
|
||
}
|
||
}
|
||
|
||
getCurrentTileLayer() {
|
||
var t = this.map_.tileLayerGroup_.getLayers();
|
||
return t.item(t.getLength() - 1)
|
||
}
|
||
};
|
||
|
||
class $C extends ol.control.Control {
|
||
constructor() {
|
||
var t = $C.createDom("div", "ez-simple-zoom ol-unselectable ol-control"),
|
||
e = $C.createDom("div", "ez-simple-btn");
|
||
e.title = "放大一级";
|
||
var i = $C.createDom("div", "ez-simple-zoomview ez-simple-zoomin");
|
||
e.appendChild(i);
|
||
var r = $C.createDom("div", "ez-simple-btn");
|
||
r.title = "当前级别";
|
||
var o = $C.createDom("div", "ez-simple-zoomview ez-simple-status");
|
||
r.appendChild(o);
|
||
var n = $C.createDom("div", "ez-simple-btn");
|
||
n.title = "缩小一级";
|
||
var s = $C.createDom("div", "ez-simple-zoomview ez-simple-zoomout");
|
||
n.appendChild(s), t.appendChild(e), t.appendChild(r), t.appendChild(n), super({element: t}), e.addEventListener("click", this.handleZoomIn.bind(this)), n.addEventListener("click", this.handleZoomOut.bind(this)), this.view = o, window.setTimeout(this.initView.bind(this), 300)
|
||
}
|
||
|
||
initView() {
|
||
var t = this.getMap(), e = t.getZoom();
|
||
this.view.innerHTML = e, t.getView().on("change:resolution", function (e) {
|
||
this.view.innerHTML = t.getZoom()
|
||
}.bind(this))
|
||
}
|
||
|
||
static createDom(t, e) {
|
||
var i = document.createElement(t);
|
||
return i.className = e, i
|
||
}
|
||
|
||
handleZoomIn() {
|
||
this.getMap().zoomIn()
|
||
}
|
||
|
||
handleZoomOut() {
|
||
this.getMap().zoomOut()
|
||
}
|
||
}
|
||
|
||
var QC = $C;
|
||
|
||
class tS extends ol.control.Control {
|
||
constructor(t) {
|
||
var e = vC.isDef(t) ? t : {}, i = vC.isDef(e.maxZoom) ? e.maxZoom : 18,
|
||
r = vC.isDef(e.minZoom) ? e.minZoom : 2, o = !!vC.isDef(e.isTitleArea) && e.isTitleArea,
|
||
n = document.createElement("div");
|
||
n.className = "ez-zoomslider ol-unselectable ol-control";
|
||
var s = document.createElement("div");
|
||
s.className = "ez-zoomslider-zoomin ez-zoomslider-btn", s.title = "放大一级";
|
||
var a = document.createElement("div");
|
||
a.className = "ez-zoomslider-zoomcontent", a.title = "放置到此级别";
|
||
var l = document.createElement("div");
|
||
l.className = "ez-zoomslider-zoomout ez-zoomslider-btn", l.title = "缩小一级";
|
||
var h = null;
|
||
o && (h = tS.initFlagArea(e.flag2level, i, r), a.appendChild(h));
|
||
var u = 10 * (i - r - 1) + 15 + 14;
|
||
a.style.height = u + "px", o && (h.style.height = u + "px");
|
||
var c = document.createElement("div");
|
||
c.className = "ez-zoomslider-zoomcontent-top", a.appendChild(c);
|
||
var p = document.createElement("div");
|
||
p.className = "ez-zoomslider-zoomcontent-bottom", a.appendChild(p);
|
||
var d = document.createElement("div");
|
||
d.className = "ez-zoomslider-zoomcontent-body", a.appendChild(d), d.style.height = 10 * (i - r - 1) + "px";
|
||
var f = document.createElement("div");
|
||
f.className = "ez-zoomslider-zoomcontentrender", a.appendChild(f);
|
||
var g = document.createElement("div");
|
||
if (g.className = "ez-zoomslider-thumb", g.title = "拖拽", a.appendChild(g), n.appendChild(s), n.appendChild(a), n.appendChild(l), super({
|
||
element: n,
|
||
render: function (t) {
|
||
if (!vC.isNull(t.frameState)) {
|
||
ol.asserts.assert(vC.isDefAndNotNull(t.frameState.viewState), "viewState should be defined");
|
||
var e = t.frameState.viewState.resolution;
|
||
if (e !== this.currentResolution_) {
|
||
this.currentResolution_ = e, this.setThumbPosition_(e);
|
||
var i = this.thumbElement.style.top, r = this.dragger_.limits.height - parseInt(i) + 4;
|
||
r < 0 && (r = 0), this.zoomcontentrender_.style.height = r + "px"
|
||
}
|
||
}
|
||
}
|
||
}), o) {
|
||
a.addEventListener("mouseover", this.handleTagContainerMouseover_.bind(this), !1), a.addEventListener("mouseout", this.handleTagContainerMouseout_.bind(this), !1);
|
||
for (var m = h.children, y = 0; y < m.length; y++) m[y].addEventListener("click", this.locationZoom_.bind(this), !1)
|
||
}
|
||
this.tagContainer = h, this.eleContainer = n, this.zoomcontentrender_ = f, this.thumbElement = g, this.dragger_ = new ol.pointer.PointerEventHandler(a), this.dragger_.limits = {
|
||
left: 2,
|
||
top: 5,
|
||
width: 0,
|
||
height: u - 18 - 4
|
||
}, ol.events.listen(this.dragger_, ol.pointer.EventType.POINTERDOWN, this.handleDraggerStart_, this), ol.events.listen(this.dragger_, ol.pointer.EventType.POINTERMOVE, this.handleDraggerDrag_, this), ol.events.listen(this.dragger_, ol.pointer.EventType.POINTERUP, this.handleDraggerEnd_, this), ol.events.listen(d, ol.events.EventType.CLICK, this.handleContainerClick_, this), ol.events.listen(f, ol.events.EventType.CLICK, this.handleContainerrenderClick_, this), ol.events.listen(c, ol.events.EventType.CLICK, this.handleTopClick_, this), ol.events.listen(p, ol.events.EventType.CLICK, this.handleBottomClick_, this), ol.events.listen(this.thumbElement, ol.events.EventType.CLICK, ol.events.Event.stopPropagation), ol.events.listen(s, "click", this.zoomin_, this), ol.events.listen(l, "click", this.zoomout_, this), this.dragging_, this.dragListenerKeys_, this.currentResolution_ = void 0
|
||
}
|
||
|
||
render(t) {
|
||
if (!vC.isNull(t.frameState)) {
|
||
ol.asserts.assert(vC.isDefAndNotNull(t.frameState.viewState), "viewState should be defined");
|
||
var e = t.frameState.viewState.resolution;
|
||
if (e !== this.currentResolution_) {
|
||
this.currentResolution_ = e, this.setThumbPosition_(e);
|
||
var i = this.thumbElement.style.top, r = this.dragger_.limits.height - parseInt(i) + 4;
|
||
r < 0 && (r = 0), this.zoomcontentrender_.style.height = r + "px"
|
||
}
|
||
}
|
||
}
|
||
|
||
static initFlagArea(t, e, i) {
|
||
var r = vC.isDef(t) ? t : {},
|
||
o = [vC.isDef(r.country) ? r.country : 2, vC.isDef(r.province) ? r.province : 7, vC.isDef(r.city) ? r.city : 11, vC.isDef(r.street) ? r.street : 17],
|
||
n = document.createElement("div");
|
||
n.className = "ez-zoomslider-tagArea ez-zoomslider-tagArea-hidden";
|
||
for (var s = 0; s < o.length; s++) if (o[s] <= e && o[s] >= i) if (0 === s) {
|
||
var a = document.createElement("div");
|
||
a.className = "ez-zoomslider-tag ez-zoomslider-tag-country", a.id = "country", a.setAttribute("data-zoom", o[s]), a.style.top = 10 * (e - o[s] - 1) + 15 + 5 - 10 + "px", n.appendChild(a)
|
||
} else if (1 === s) {
|
||
var l = document.createElement("div");
|
||
l.className = "ez-zoomslider-tag ez-zoomslider-tag-province", l.style.top = 10 * (e - o[s] - 1) + 15 + 5 - 10 + "px", l.id = "province", l.setAttribute("data-zoom", o[s]), n.appendChild(l)
|
||
} else if (2 === s) {
|
||
var h = document.createElement("div");
|
||
h.className = "ez-zoomslider-tag ez-zoomslider-tag-city", h.style.top = 10 * (e - o[s] - 1) + 15 + 5 - 10 + "px", h.id = "city", h.setAttribute("data-zoom", o[s]), n.appendChild(h)
|
||
} else if (3 === s) {
|
||
var u = document.createElement("div");
|
||
u.className = "ez-zoomslider-tag ez-zoomslider-tag-street", u.style.top = 10 * (e - o[s] - 1) + 15 + 5 - 10 + "px", u.id = "street", u.setAttribute("data-zoom", o[s]), n.appendChild(u)
|
||
}
|
||
return n
|
||
}
|
||
|
||
handleTagContainerMouseover_(t) {
|
||
this.tagContainer.className = "ez-zoomslider-tagArea"
|
||
}
|
||
|
||
handleTagContainerMouseout_(t) {
|
||
this.tagContainer.className = "ez-zoomslider-tagArea ez-zoomslider-tagArea-hidden"
|
||
}
|
||
|
||
setThumbPosition_(t) {
|
||
var e = this.getPositionForResolution_(t), i = this.dragger_, r = this.thumbElement,
|
||
o = i.limits.top + i.limits.height * e;
|
||
this.setPosition(r, i.limits.left, o)
|
||
}
|
||
|
||
setPosition(t, e, i) {
|
||
var r, o;
|
||
r = e, o = i, t.style.left = r + "px", t.style.top = o + "px"
|
||
}
|
||
|
||
handleDraggerStart_(t) {
|
||
if (!this.dragging_ && t.originalEvent.target === this.thumbElement && (this.getMap().getView().setHint(ol.ViewHint.INTERACTING, 1), this.previousX_ = t.clientX, this.previousY_ = t.clientY, this.dragging_ = !0, !this.dragListenerKeys_)) {
|
||
var e = this.handleDraggerDrag_, i = this.handleDraggerEnd_;
|
||
this.dragListenerKeys_ = [ol.events.listen(document, ol.events.EventType.MOUSEMOVE, e, this), ol.events.listen(document, ol.events.EventType.MOUSEUP, i, this)]
|
||
}
|
||
}
|
||
|
||
handleDraggerDrag_(t) {
|
||
if (this.dragging_) {
|
||
var e = this.thumbElement, i = t.clientX - this.previousX_ + parseInt(e.style.left, 10),
|
||
r = t.clientY - this.previousY_ + parseInt(e.style.top, 10),
|
||
o = parseInt(this.dragger_.limits.height) - parseInt(e.style.top) + 4;
|
||
this.zoomcontentrender_.style.height = o + "px";
|
||
var n = this.getRelativePosition_(i, r);
|
||
this.currentResolution_ = this.getResolutionForPosition_(n), this.getMap().getView().setResolution(this.currentResolution_), this.setThumbPosition_(this.currentResolution_), this.previousX_ = t.clientX, this.previousY_ = t.clientY
|
||
}
|
||
}
|
||
|
||
handleDraggerEnd_(t) {
|
||
if (this.dragging_) {
|
||
var e = this.getMap().getView();
|
||
e.setHint(ol.ViewHint.INTERACTING, -1), ol.asserts.assert(this.currentResolution_, "this.currentResolution_ should be defined");
|
||
var i = e.constrainResolution(this.currentResolution_);
|
||
e.setResolution(i), this.dragging_ = !1, this.previousX_ = void 0, this.previousY_ = void 0, this.dragListenerKeys_.forEach(ol.events.unlistenByKey), this.dragListenerKeys_ = null
|
||
}
|
||
}
|
||
|
||
locationZoom_(t) {
|
||
var e = this.getMap().getView(), i = parseInt(t.target.getAttribute("data-zoom"));
|
||
e.setZoom(i)
|
||
}
|
||
|
||
handleContainerClick_(t) {
|
||
var e = this.getMap().getView(), i = e.getResolution();
|
||
ol.asserts.assert(vC.isDef(i), "currentResolution should be defined");
|
||
var r = this.getRelativePosition_(t.offsetX - 9, t.offsetY - 4.5 + 11),
|
||
o = this.getResolutionForPosition_(r);
|
||
e.setResolution(e.constrainResolution(o)), this.thumbElement.title = e.getZoom()
|
||
}
|
||
|
||
handleContainerrenderClick_(t) {
|
||
var e = this.getMap().getView(), i = this.thumbElement, r = e.getResolution();
|
||
ol.asserts.assert(vC.isDef(r), "currentResolution should be defined");
|
||
var o = this.getRelativePosition_(t.offsetX - 9, t.offsetY + parseFloat(i.style.top)),
|
||
n = this.getResolutionForPosition_(o);
|
||
e.setResolution(e.constrainResolution(n)), i.title = e.getZoom()
|
||
}
|
||
|
||
handleTopClick_(t) {
|
||
var e = this.getMap().getView(), i = e.getResolution();
|
||
ol.asserts.assert(vC.isDef(i), "currentResolution should be defined");
|
||
var r = this.getRelativePosition_(0, 5), o = this.getResolutionForPosition_(r);
|
||
e.setResolution(e.constrainResolution(o)), this.thumbElement.title = e.getZoom()
|
||
}
|
||
|
||
handleBottomClick_(t) {
|
||
var e = this.getMap().getView(), i = e.getResolution();
|
||
ol.asserts.assert(vC.isDef(i), "currentResolution should be defined");
|
||
var r = this.getRelativePosition_(0, 151), o = this.getResolutionForPosition_(r);
|
||
e.setResolution(e.constrainResolution(o)), this.thumbElement.title = e.getZoom()
|
||
}
|
||
|
||
zoomin_() {
|
||
var t = this.getMap().getView(), e = t.getZoom();
|
||
t.setZoom(e + 1)
|
||
}
|
||
|
||
zoomout_() {
|
||
var t = this.getMap().getView(), e = t.getZoom();
|
||
t.setZoom(e - 1)
|
||
}
|
||
|
||
getRelativePosition_(t, e) {
|
||
var i, r = this.dragger_.limits;
|
||
return i = 1 === this.direction_ ? (t - r.left) / r.width : (e - r.top) / r.height, ol.math.clamp(i, 0, 1)
|
||
}
|
||
|
||
getResolutionForPosition_(t) {
|
||
return this.getMap().getView().getResolutionForValueFunction()(1 - t)
|
||
}
|
||
|
||
getPositionForResolution_(t) {
|
||
return 1 - this.getMap().getView().getValueForResolutionFunction()(t)
|
||
}
|
||
}
|
||
|
||
var eS = tS;
|
||
var iS = class extends oC {
|
||
constructor(t, e, i, r) {
|
||
var o, n, s = "";
|
||
vC.isString(t) ? (n = t.split(","), s = t) : t instanceof rC ? (n = t.getCoordinate(), s = t.toStringXY()) : ol.asserts.assert(!1, "坐标点必须是EzCoord对象"), e = parseFloat(e);
|
||
var a = i || {};
|
||
if (!a.isMeter) {
|
||
var l = n;
|
||
e = 1 * e / ce(l, [l[0] + 1, l[1]], 6378137)
|
||
}
|
||
if (vC.isNumber(e) || ol.asserts.assert(!1, "圆形半径必须为数值型"), super({geometry: new ol.geom.Circle(n, e)}), vC.isDef(i)) {
|
||
var h = vC.isDef(a.fillColor) ? a.fillColor : "#FFFFFF", u = super.hexToRgb_(h);
|
||
u[3] = vC.isDef(a.fillOpacity) ? a.fillOpacity : .5;
|
||
var c = ol.color.asArray(vC.isDef(a.strokeColor) ? a.strokeColor : "#FFCC33");
|
||
c[3] = vC.isDef(a.strokeOpacity) ? a.strokeOpacity : 1;
|
||
var p = vC.isDef(a.strokeLineDash) ? a.strokeLineDash : void 0;
|
||
o = new ol.style.Style({
|
||
fill: new ol.style.Fill({color: u}),
|
||
stroke: new ol.style.Stroke({
|
||
color: c,
|
||
width: vC.isDef(a.strokeWidth) ? parseInt(a.strokeWidth) : 2,
|
||
lineDash: p
|
||
})
|
||
})
|
||
} else o = new ol.style.Style({
|
||
fill: new ol.style.Fill({color: [255, 255, 255, .5]}),
|
||
stroke: new ol.style.Stroke({color: [255, 204, 51, 1], width: 2})
|
||
});
|
||
this.coordString = s, this.circleFlag = !0, this.setStyle(o);
|
||
var d = r || {};
|
||
d.draggable && this.set("draggable", d.draggable)
|
||
}
|
||
|
||
getCenter() {
|
||
var t = this.getGeometry().getCenter();
|
||
return new rC(t[0], t[1])
|
||
}
|
||
|
||
setCenter(t) {
|
||
this.getGeometry().setCenter(t.getCoordinate())
|
||
}
|
||
|
||
getRadius() {
|
||
var t = this.getGeometry().getCenter(), e = ce(t, [t[0] + 1, t[1]], 6378137);
|
||
return this.getGeometry().getRadius() * e
|
||
}
|
||
|
||
setRadius(t) {
|
||
var e = this.getGeometry().getCenter(), i = ce(e, [e[0] + 1, e[1]], 6378137);
|
||
this.getGeometry().setRadius(t / i)
|
||
}
|
||
|
||
isPointInCircle(t) {
|
||
var e = this.getGeometry().getCenter(), i = this.getGeometry().getRadius(), r = t.getCoordinate();
|
||
return !((e[0] - r[0]) * (e[0] - r[0]) + (e[1] - r[1]) * (e[1] - r[1]) > i * i)
|
||
}
|
||
};
|
||
var rS = class extends oC {
|
||
constructor(t, e, i) {
|
||
var r, o, n = "";
|
||
if (vC.isString(t) ? (o = t.split(","), n = t) : t instanceof rC ? (o = t.getCoordinate(), n = t.toStringXY()) : ol.asserts.assert(!1, "坐标点必须是EzCoord对象"), super({
|
||
geometry: new ol.geom.Point(o),
|
||
otherOptions: i
|
||
}), vC.isDef(e)) {
|
||
var s = vC.isDef(e.fillColor) ? e.fillColor : "#FFFFFF", a = super.hexToRgb_(s);
|
||
a[3] = vC.isDef(e.fillOpacity) ? e.fillOpacity : 1;
|
||
var l = ol.color.asArray(vC.isDef(e.strokeColor) ? e.strokeColor : "#FFCC33");
|
||
l[3] = vC.isDef(e.strokeOpacity) ? e.strokeOpacity : 1, r = new ol.style.Style({
|
||
image: new ol.style.Circle({
|
||
radius: vC.isDef(e.radius) ? e.radius : 7,
|
||
fill: new ol.style.Fill({color: a}),
|
||
stroke: new ol.style.Stroke({
|
||
color: l,
|
||
width: vC.isDef(e.strokeWidth) ? parseInt(e.strokeWidth) : 2
|
||
})
|
||
})
|
||
})
|
||
} else r = new ol.style.Style({
|
||
image: new ol.style.Circle({
|
||
radius: 5,
|
||
fill: new ol.style.Fill({color: [255, 255, 255, 1]}),
|
||
stroke: new ol.style.Stroke({color: [255, 204, 51, 1], width: 2})
|
||
})
|
||
});
|
||
this.coordString = n, this.setStyle(r);
|
||
var h = i || {};
|
||
h.draggable && this.set("draggable", h.draggable)
|
||
}
|
||
|
||
getCenter() {
|
||
var t = this.getGeometry().getCoordinates();
|
||
return new rC(t[0], t[1])
|
||
}
|
||
|
||
setCenter(t) {
|
||
if (!t) throw new Error("坐标对象不能为空!");
|
||
var e = t.getCoordinate();
|
||
this.getGeometry().setCoordinates(e)
|
||
}
|
||
|
||
getFillColor() {
|
||
var t = this.getStyle().getImage().getFill(), e = ol.color.asArray(t.getColor());
|
||
return ol.color.asString(e)
|
||
}
|
||
|
||
getFillOpacity() {
|
||
var t = this.getStyle().getImage().getFill(), e = ol.color.asArray(t.getColor());
|
||
return parseFloat(e[3])
|
||
}
|
||
|
||
getRadius() {
|
||
return this.getStyle().getImage().getRadius()
|
||
}
|
||
|
||
setRadius(t) {
|
||
if (!t) throw new Error("像素半径不能为空!");
|
||
var e = this.getStyle().getImage(), i = e.getFill(), r = e.getStroke(), o = new ol.style.Style({
|
||
image: new ol.style.Circle({
|
||
radius: t,
|
||
fill: new ol.style.Fill({color: i.getColor()}),
|
||
stroke: new ol.style.Stroke({color: r.getColor(), width: r.getWidth()})
|
||
})
|
||
});
|
||
this.setStyle(o)
|
||
}
|
||
|
||
setFillColor(t) {
|
||
var e = this.getStyle(), i = e.getImage().getFill(), r = ol.color.asArray(i.getColor())[3],
|
||
o = ol.color.asArray(t);
|
||
o[3] = r, i.setColor(o), this.setStyle(e)
|
||
}
|
||
|
||
setFillOpacity(t) {
|
||
ol.asserts.assert(t >= 0 && t <= 1, "设置的透明度必须在[0,1]范围内");
|
||
var e = this.getStyle(), i = e.getImage().getFill(), r = ol.color.asArray(i.getColor());
|
||
r[3] = t, i.setColor(r), this.setStyle(e)
|
||
}
|
||
|
||
getStrokeColor() {
|
||
var t = this.getStyle().getImage().getStroke(), e = ol.color.asArray(t.getColor());
|
||
return ol.color.asString(e)
|
||
}
|
||
|
||
getStrokeWidth() {
|
||
return this.getStyle().getImage().getStroke().getWidth()
|
||
}
|
||
|
||
getStrokeOpacity() {
|
||
var t = this.getStyle().getImage().getStroke(), e = ol.color.asArray(t.getColor());
|
||
return parseFloat(e[3])
|
||
}
|
||
|
||
setStrokeColor(t) {
|
||
var e = this.getStyle(), i = e.getImage().getStroke(), r = ol.color.asArray(i.getColor())[3],
|
||
o = ol.color.asArray(t);
|
||
o[3] = r, i.setColor(o), this.setStyle(e)
|
||
}
|
||
|
||
setStrokeWidth(t) {
|
||
var e = this.getStyle();
|
||
e.getImage().getStroke().setWidth(t), this.setStyle(e)
|
||
}
|
||
|
||
setStrokeOpacity(t) {
|
||
ol.asserts.assert(t >= 0 && t <= 1, "设置的透明度必须在[0,1]范围内");
|
||
var e = this.getStyle(), i = e.getImage().getStroke(), r = ol.color.asArray(i.getColor());
|
||
r[3] = t, i.setColor(r), this.setStyle(e)
|
||
}
|
||
};
|
||
|
||
class oS extends oC {
|
||
constructor(t, e, i) {
|
||
var r, o, n = "";
|
||
if (vC.isString(t)) {
|
||
var s = t.split(";");
|
||
o = [];
|
||
for (var a = 0; a < s.length; a++) {
|
||
for (var l = s[a].split(","), h = [], u = 0; u < l.length - 1; u++) h.push([parseFloat(l[u]), parseFloat(l[u + 1])]), u++;
|
||
o.push(h)
|
||
}
|
||
n = t
|
||
} else if (Array.isArray(t)) {
|
||
o = [];
|
||
for (a = 0; a < t.length; a++) {
|
||
for (h = [], u = 0; u < t[a].length; u++) t[a][u] instanceof rC ? (n += t[a][u].toStringXY(), h.push(t[a][u].getCoordinate())) : (n += t[a][u][0] + "," + t[a][u][1], h.push(t[a][u])), u !== t[a].length - 1 && (n += ",");
|
||
o.push(h), a !== t.length - 1 && (n += ";")
|
||
}
|
||
} else ol.asserts.assert(!1, "坐标格式不对");
|
||
var c = e || {};
|
||
if (super({geometry: new ol.geom.Polygon(o)}), vC.isDef(e)) {
|
||
var p = vC.isDef(c.fillColor) ? c.fillColor : "#FFFFFF", d = super.hexToRgb_(p);
|
||
d[3] = vC.isDef(c.fillOpacity) ? c.fillOpacity : .5;
|
||
var f = ol.color.asArray(vC.isDef(c.strokeColor) ? c.strokeColor : "#FFCC33");
|
||
f[3] = vC.isDef(c.strokeOpacity) ? c.strokeOpacity : 1;
|
||
var g = vC.isDef(c.strokeLineDash) ? c.strokeLineDash : void 0;
|
||
r = new ol.style.Style({
|
||
fill: new ol.style.Fill({color: d}),
|
||
stroke: new ol.style.Stroke({
|
||
color: f,
|
||
width: vC.isDef(c.strokeWidth) ? parseInt(c.strokeWidth) : 2,
|
||
lineDash: g
|
||
})
|
||
})
|
||
} else r = new ol.style.Style({
|
||
fill: new ol.style.Fill({color: [255, 255, 255, .5]}),
|
||
stroke: new ol.style.Stroke({color: [255, 204, 51, 1], width: 2})
|
||
});
|
||
this.coordString = n, this.polygonFlag = !0, this.setStyle(r);
|
||
var m = i || {};
|
||
m.draggable && this.set("draggable", m.draggable)
|
||
}
|
||
|
||
readGeoJSON(t, e) {
|
||
var i = super.readGeoJSON(t).getGeometry().getCoordinates();
|
||
return new oS(i, e)
|
||
}
|
||
|
||
getCenter() {
|
||
var t = this.getGeometry().getInteriorPoint().getCoordinates();
|
||
return new rC(t[0], t[1])
|
||
}
|
||
|
||
getPoints() {
|
||
var t = this.getGeometry().getCoordinates();
|
||
return t.map(function (t) {
|
||
t.pop()
|
||
}), t
|
||
}
|
||
|
||
getArea() {
|
||
for (var t = [], e = this.coordString.split(","), i = 0; i < e.length / 2; i++) {
|
||
var r = [e[2 * i], e[2 * i + 1]];
|
||
t[i] = r
|
||
}
|
||
var o = new ol.geom.Polygon([t]), n = Math.abs(fe(o, {radius: 6378137}));
|
||
return Math.round(1e4 * n) + " km<sup>2</sup>"
|
||
}
|
||
}
|
||
|
||
var nS = oS;
|
||
var sS = class extends oC {
|
||
constructor(t, e, i) {
|
||
var r, o, n = "";
|
||
if (vC.isString(t)) {
|
||
var s = t.split(",");
|
||
r = [];
|
||
for (var a = 0; a < s.length - 1; a++) r.push([parseFloat(s[a]), parseFloat(s[a + 1])]), a++;
|
||
n = t
|
||
} else if (Array.isArray(t)) {
|
||
r = [];
|
||
for (var l = 0; l < t.length; l++) t[l] instanceof rC ? (n += t[l].toStringXY(), r.push(t[l].getCoordinate())) : (n += t[l][0] + "," + t[l][1], r.push(t[l])), l !== t.length - 1 && (n += ",")
|
||
} else ol.asserts.assert(!1, "坐标格式不对");
|
||
var h = e || {};
|
||
if (super({geometry: new ol.geom.LineString(r)}), vC.isDef(e)) {
|
||
var u = vC.isDef(h.strokeColor) ? h.strokeColor : "#FFCC33", c = super.hexToRgb_(u);
|
||
c[3] = vC.isDef(h.strokeOpacity) ? h.strokeOpacity : 1;
|
||
var p = vC.isDef(h.strokeLineDash) ? h.strokeLineDash : void 0;
|
||
o = new ol.style.Style({
|
||
stroke: new ol.style.Stroke({
|
||
color: c,
|
||
width: vC.isDef(h.strokeWidth) ? parseInt(h.strokeWidth) : 2,
|
||
lineDash: p
|
||
})
|
||
})
|
||
} else o = new ol.style.Style({stroke: new ol.style.Stroke({color: [255, 204, 51, 1], width: 2})});
|
||
this.coordString = n, this.polylineFlag = !0, this.setStyle(o);
|
||
var d = i || {};
|
||
d.draggable && this.set("draggable", d.draggable), this.onHandleChange = this.onHandleChange.bind(this)
|
||
}
|
||
|
||
onHandleChange(t) {
|
||
var e = this.getGeometry().getLastCoordinate(), i = this.pointFeature_.getGeometry(),
|
||
r = i.getCoordinates();
|
||
e[0] !== r[0] && e[1] !== r[1] && i.setCoordinates(e)
|
||
}
|
||
|
||
onRemove(t) {
|
||
this.map_ = null;
|
||
var e = t.getVectorLayers(), i = this;
|
||
e.getLayers().forEach(function (t, e, r) {
|
||
if ("vector_default" === t.get("name")) {
|
||
var o = t;
|
||
i.pointFeature_ && (o.getSource().removeFeature(i.pointFeature_), i.un("change", i.onHandleChange), delete i.pointFeature_), o.getSource().removeFeature(i)
|
||
}
|
||
})
|
||
}
|
||
|
||
show() {
|
||
if (!this.get("isAddToMap")) {
|
||
var t = this.map_.getVectorLayers(), e = this;
|
||
t.getLayers().forEach(function (t, i, r) {
|
||
if ("vector_default" === t.get("name")) {
|
||
var o = t;
|
||
e.pointFeature_ && o.getSource().addFeature(e.pointFeature_), o.getSource().addFeature(e)
|
||
}
|
||
}), this.set("isAddToMap", !0)
|
||
}
|
||
}
|
||
|
||
hide() {
|
||
if (this.get("isAddToMap")) {
|
||
var t = this.map_.getVectorLayers(), e = this;
|
||
t.getLayers().forEach(function (t, i, r) {
|
||
if ("vector_default" === t.get("name")) {
|
||
var o = t;
|
||
e.pointFeature_ && o.getSource().removeFeature(e.pointFeature_), o.getSource().removeFeature(e)
|
||
}
|
||
}), this.set("isAddToMap", !1)
|
||
}
|
||
}
|
||
|
||
getFirstPoint() {
|
||
var t = this.getPoints();
|
||
return new rC(t[0][0], t[0][1])
|
||
}
|
||
|
||
getCenter() {
|
||
var t = this.getGeometry().getCoordinates(), e = t.length, i = e % 2;
|
||
if (1 === i) {
|
||
var r = t[Math.floor(e / 2)];
|
||
return new rC(r[0], r[1])
|
||
}
|
||
if (0 === i) {
|
||
var o = t[e / 2 - 1], n = t[e / 2];
|
||
return r = [(o[0] + n[0]) / 2, (o[1] + n[1]) / 2], new rC(r[0], r[1])
|
||
}
|
||
ol.asserts.assert(!1, "线段的长度存在异常值")
|
||
}
|
||
|
||
getFillColor() {
|
||
}
|
||
|
||
getFillOpacity() {
|
||
}
|
||
|
||
setFillColor(t) {
|
||
}
|
||
|
||
setFillOpacity(t) {
|
||
}
|
||
|
||
setStrokeColor(t) {
|
||
var e = this.getStyle(), i = this.getStrokeStyle_(), r = ol.color.asArray(i.getColor())[3],
|
||
o = ol.color.asArray(t);
|
||
if (o[3] = r, i.setColor(o), this.setStyle(e), this.pointFeature_) {
|
||
var n = this.pointFeature_.getStyle().getImage(), s = new ol.style.Style({
|
||
image: new ol.style.RegularShape({
|
||
fill: new ol.style.Fill({color: o}),
|
||
stroke: new ol.style.Stroke({color: o, width: 1}),
|
||
points: 3,
|
||
radius: n.getRadius(),
|
||
rotation: n.getRotation(),
|
||
angle: Math.PI / 2
|
||
})
|
||
});
|
||
this.pointFeature_.setStyle(s)
|
||
}
|
||
}
|
||
|
||
setStrokeOpacity(t) {
|
||
vC.asserts.assert(t >= 0 && t <= 1, "设置的透明度必须在[0,1]范围内");
|
||
var e = this.getStyle(), i = this.getStrokeStyle_(), r = ol.color.asArray(i.getColor());
|
||
if (r[3] = t, i.setColor(r), this.setStyle(e), this.pointFeature_) {
|
||
var o = this.pointFeature_.getStyle().getImage(), n = new ol.style.Style({
|
||
image: new ol.style.RegularShape({
|
||
fill: new ol.style.Fill({color: r}),
|
||
stroke: new ol.style.Stroke({color: r, width: 1}),
|
||
points: 3,
|
||
radius: o.getRadius(),
|
||
rotation: o.getRotation(),
|
||
angle: Math.PI / 2
|
||
})
|
||
});
|
||
this.pointFeature_.setStyle(n)
|
||
}
|
||
}
|
||
|
||
getPoints() {
|
||
return this.getGeometry().getCoordinates()
|
||
}
|
||
|
||
addArrowHead(t) {
|
||
var e = t || {};
|
||
if (!this.get("isArrowHead")) {
|
||
var i = this.getGeometry().getCoordinates(), r = this.map_, o = i.length, n = i[o - 2],
|
||
s = i[o - 1], a = s[0] - n[0], l = s[1] - n[1], h = Math.atan2(l, a);
|
||
h = h > 0 ? (360 - 180 * parseFloat(h) / Math.PI) * Math.PI / 180 : Math.abs(Number(h));
|
||
var u = this.getStyle().getStroke().getColor(), c = new ol.style.Fill({color: u}),
|
||
p = new ol.style.Stroke({color: u, width: 1}), d = new ol.style.Style({
|
||
image: new ol.style.RegularShape({
|
||
fill: c,
|
||
stroke: p,
|
||
points: 3,
|
||
radius: e.radius || 10,
|
||
rotation: h,
|
||
angle: Math.PI / 2
|
||
})
|
||
}), f = new ol.geom.Point(s), g = new ol.Feature({geometry: f});
|
||
g.setStyle(d), r.getVectorLayers().getLayers().forEach(function (t, e, i) {
|
||
"vector_default" === t.get("name") && t.getSource().addFeature(g)
|
||
}), this.pointFeature_ = g, this.set("isArrowHead", !0), this.on("change", this.onHandleChange)
|
||
}
|
||
}
|
||
|
||
removeArrowHead() {
|
||
if (this.pointFeature_) {
|
||
this.un("change", this.onHandleChange);
|
||
var t = this.map_.getVectorLayers(), e = this;
|
||
t.getLayers().forEach(function (t, i, r) {
|
||
if ("vector_default" === t.get("name")) {
|
||
var o = t;
|
||
e.pointFeature_ && (o.getSource().removeFeature(e.pointFeature_), delete e.pointFeature_)
|
||
}
|
||
})
|
||
}
|
||
}
|
||
|
||
getArrowHeadPositions(t) {
|
||
if (this.get("isArrowHead")) {
|
||
var e = this.pointFeature_, i = e.getStyle().getImage(), r = e.getGeometry().getCoordinates(),
|
||
o = i.getRotation(), n = i.getRadius(), s = this.map_, a = s.getZoom(), l = a - (t = t || a);
|
||
l > 0 ? n = Math.pow(2, l) * n : l < 0 && (n = 1 / Math.pow(2, -l) * n);
|
||
var h = s.getPixelFromCoordinate(r);
|
||
if (h) return this.batchPixelsToCoordinates_(s, this.calcVertexs_(h, n, o))
|
||
}
|
||
}
|
||
|
||
calcVertexs_(t, e, i) {
|
||
var r = t[0], o = t[1];
|
||
return [[r + e * Math.cos(i), o + e * Math.sin(i)], [r - e * Math.cos(Math.PI / 3 - i), o + e * Math.sin(Math.PI / 3 - i)], [r + e * Math.cos(Math.PI / 3 * 2 - i), o - e * Math.sin(Math.PI / 3 * 2 - i)]]
|
||
}
|
||
|
||
batchPixelsToCoordinates_(t, e) {
|
||
for (var i = [], r = 0; r < e.length; r++) {
|
||
var o = t.getCoordinateFromPixel(e[r]);
|
||
i.push(o[0]), i.push(o[1])
|
||
}
|
||
return i.join(",")
|
||
}
|
||
};
|
||
var aS = class extends oC {
|
||
constructor(t, e, i) {
|
||
var r, o = [], n = "";
|
||
if (vC.isString(t)) {
|
||
var s = t.split(",");
|
||
4 === s.length ? (n += t, o.push([parseFloat(s[0]), parseFloat(s[1])]), o.push([parseFloat(s[0]), parseFloat(s[3])]), o.push([parseFloat(s[2]), parseFloat(s[3])]), o.push([parseFloat(s[2]), parseFloat(s[1])]), o.push([parseFloat(s[0]), parseFloat(s[1])])) : (n += t, o.push([parseFloat(s[0]), parseFloat(s[1])]), o.push([parseFloat(s[2]), parseFloat(s[3])]), o.push([parseFloat(s[4]), parseFloat(s[5])]), o.push([parseFloat(s[6]), parseFloat(s[7])]), o.push([parseFloat(s[0]), parseFloat(s[1])]))
|
||
} else Array.isArray(t) ? t[0] instanceof rC ? (o.push(t[0].getCoordinate()), n += t[0].getCoordinate(), o.push(t[1].getCoordinate()), n += ",", o.push(t[2].getCoordinate()), n += t[2].getCoordinate(), o.push(t[3].getCoordinate()), o.push(t[0].getCoordinate())) : (t = t[0], o.push(t[0]), n += t[0][0] + "," + t[2][1] + ",", o.push(t[1]), o.push(t[2]), n += t[2][0] + "," + t[0][1], o.push(t[3]), o.push(t[0])) : ol.asserts.assert(!1, "坐标格式不对");
|
||
var a = e || {};
|
||
if (o = [o], super({geometry: new ol.geom.Polygon(o)}), vC.isDef(e)) {
|
||
var l = vC.isDef(a.fillColor) ? a.fillColor : "#FFFFFF", h = super.hexToRgb_(l);
|
||
h[3] = vC.isDef(a.fillOpacity) ? a.fillOpacity : .5;
|
||
var u = vC.isDef(a.strokeColor) ? a.strokeColor : "#FFCC33", c = super.hexToRgb_(u);
|
||
c[3] = vC.isDef(a.strokeOpacity) ? a.strokeOpacity : 1;
|
||
var p = vC.isDef(a.strokeLineDash) ? a.strokeLineDash : void 0;
|
||
r = new ol.style.Style({
|
||
fill: new ol.style.Fill({color: h}),
|
||
stroke: new ol.style.Stroke({
|
||
color: c,
|
||
width: vC.isDef(a.strokeWidth) ? parseInt(a.strokeWidth) : 2,
|
||
lineDash: p
|
||
})
|
||
})
|
||
} else r = new ol.style.Style({
|
||
fill: new ol.style.Fill({color: [255, 255, 255, .5]}),
|
||
stroke: new ol.style.Stroke({color: [255, 204, 51, 1], width: 2})
|
||
});
|
||
this.coordString = n, this.rectFlag = !0, this.setStyle(r);
|
||
var d = i || {};
|
||
d.draggable && this.set("draggable", d.draggable)
|
||
}
|
||
|
||
getCenter() {
|
||
var t = this.getGeometry().getExtent(), e = ol.extent.getCenter(t);
|
||
return new rC(e[0], e[1])
|
||
}
|
||
|
||
getPoints() {
|
||
var t = this.getGeometry().getCoordinates();
|
||
return t.map(function (t) {
|
||
t.pop()
|
||
}), t
|
||
}
|
||
};
|
||
var lS = class extends ol.layer.Vector {
|
||
constructor(t) {
|
||
var e = t || {}, i = e.projection ? e.projection : "EPSG:4326", r = e.opacity ? e.opacity : 1,
|
||
o = Ez.Layer.Cluster.getResolution(e.maxZoom ? e.maxZoom : 18),
|
||
n = Ez.Layer.Cluster.getResolution(e.minZoom ? e.minZoom : 0), s = e.cluster ? e.cluster : {},
|
||
a = new ol.source.Vector;
|
||
super({
|
||
projection: i,
|
||
opacity: r,
|
||
minResolution: o,
|
||
maxResolution: n,
|
||
source: new ol.source.Cluster2({
|
||
geometryFunction: s.geometryFunction,
|
||
distance: s.distance ? s.distance : 40,
|
||
source: a,
|
||
minClusterNum: e.minClusterNum ? e.minClusterNum : 1
|
||
})
|
||
});
|
||
var l = e.type ? e.type : "default", h = {
|
||
default: this.styleFunctionDefault.bind(this),
|
||
scale: this.styleFunctionScale.bind(this),
|
||
nomarker: this.styleFunctionNoMarker.bind(this)
|
||
}, u = e.styleFunction ? e.styleFunction : h[l];
|
||
super.setStyle(u), this.minClusterNum = e.minClusterNum ? e.minClusterNum : 1, this.icon = e.icon ? e.icon : null, this.styleCache = {}, this.currentResolution_, this.maxFeatureCount_
|
||
}
|
||
|
||
styleFunctionDefault(t) {
|
||
var e = t.get("features").length, i = this.styleCache[e], r = new ol.style.Circle({
|
||
radius: 15,
|
||
stroke: new ol.style.Stroke({color: "#fff"}),
|
||
fill: new ol.style.Fill({color: "#3399CC"})
|
||
});
|
||
return i || (i = new ol.style.Style({
|
||
image: this.icon ? this.icon : r,
|
||
text: new ol.style.Text({text: e.toString(), fill: new ol.style.Fill({color: "#fff"})})
|
||
}), this.styleCache[e] = i), e > this.minClusterNum ? i : t.get("features")[0].getStyle()
|
||
}
|
||
|
||
styleFunctionNoMarker(t) {
|
||
var e = t.get("features").length, i = this.styleCache[e], r = new ol.style.Circle({
|
||
radius: 15,
|
||
stroke: new ol.style.Stroke({color: "#fff"}),
|
||
fill: new ol.style.Fill({color: "#F15D2D"})
|
||
});
|
||
return i || (i = new ol.style.Style({
|
||
image: this.icon ? this.icon : r,
|
||
text: new ol.style.Text({text: e.toString(), fill: new ol.style.Fill({color: "#fff"})})
|
||
}), this.styleCache[e] = i), i
|
||
}
|
||
|
||
styleFunctionScale(t, e) {
|
||
var i = new ol.style.Fill({color: "#fff"}),
|
||
r = new ol.style.Stroke({color: "rgba(0, 0, 0, 0.6)", width: 3});
|
||
e != this.currentResolution_ && (this.calculateClusterInfo_(e), this.currentResolution_ = e);
|
||
var o = t.get("features").length, n = new ol.style.Circle({
|
||
radius: t.get("radius"),
|
||
fill: new ol.style.Fill({color: [255, 153, 0, Math.min(.8, .4 + o / this.maxFeatureCount_)]})
|
||
});
|
||
return this.icon && (this.icon.scale_ = .5 + o / this.maxFeatureCount_ * .5), o > this.minClusterNum ? new ol.style.Style({
|
||
image: this.icon ? this.icon : n,
|
||
text: new ol.style.Text({text: o.toString(), fill: i, stroke: r})
|
||
}) : t.get("features")[0].getStyle()
|
||
}
|
||
|
||
calculateClusterInfo_(t) {
|
||
this.maxFeatureCount_ = 0;
|
||
for (var e, i, r = this.getSource().getFeatures(), o = r.length - 1; o >= 0; --o) {
|
||
var n = (e = r[o]).get("features");
|
||
if (null != n && null != n.length) {
|
||
var s, a, l = ol.extent.createEmpty();
|
||
for (s = 0, a = n.length; s < a; ++s) ol.extent.extend(l, n[s].getGeometry().getExtent());
|
||
this.maxFeatureCount_ = Math.max(this.maxFeatureCount_, a), i = .25 * (ol.extent.getWidth(l) + ol.extent.getHeight(l)) / t, e.set("radius", i)
|
||
}
|
||
}
|
||
}
|
||
|
||
static getResolution(t) {
|
||
return ol.tilegrid.createXYZ({
|
||
extent: ol.tilegrid.extentFromProjection("EPSG:4326"),
|
||
tileSize: 256
|
||
}).getResolution(t)
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t, t.getTileLayerOverlayLayers().getLayers().push(this)
|
||
}
|
||
|
||
onRemove(t) {
|
||
this.map_ = null, t.getTileLayerOverlayLayers().getLayers().remove(this)
|
||
}
|
||
|
||
addData(t) {
|
||
this.getSource().getSource().addFeatures(t)
|
||
}
|
||
};
|
||
var hS = class extends ol.layer.Group {
|
||
constructor(t) {
|
||
super(t), this.set("isAddToMap", !1)
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t, t.getTileLayers().getLayers().push(this), this.set("isAddToMap", !0)
|
||
}
|
||
|
||
onRemove(t) {
|
||
this.get("isAddToMap") && (this.map_ = null, t.getTileLayers().getLayers().remove(this), this.set("isAddToMap", !1))
|
||
}
|
||
|
||
push(t) {
|
||
this.getLayers().push(t)
|
||
}
|
||
|
||
remove(t) {
|
||
this.getLayers().remove(t)
|
||
}
|
||
|
||
clear() {
|
||
this.getLayers().clear()
|
||
}
|
||
|
||
show() {
|
||
this.setVisible(!0)
|
||
}
|
||
|
||
hide() {
|
||
this.setVisible(!1)
|
||
}
|
||
};
|
||
var uS = class extends ol.layer.Heatmap {
|
||
constructor(t) {
|
||
ol.asserts.assert(vC.isDef(t), "config参数不能为空");
|
||
var e = t.radius || 8, i = t.blur || 15, r = t.shadow || 250, o = t.weight, n = t.opacity || 1,
|
||
s = t.extent || void 0, a = t.gradient || void 0, l = t.isProj_ || !1,
|
||
h = t.source || new ol.source.Vector;
|
||
super({
|
||
source: h,
|
||
radius: e,
|
||
blur: i,
|
||
projection: l ? "EPSG:3857" : "EPSG:4326",
|
||
weight: o,
|
||
shadow: r,
|
||
opacity: n,
|
||
extent: s,
|
||
gradient: a
|
||
}), this.blur_ = i, this.radius_ = e, this.shadow_ = r, this.weight_ = o, this.opacity_ = n, this.extent_ = s, this.source_ = h, this.isProj_ = l, this.set("name", "heatmap"), this.set("isAddToMap", !1), this.xField_ = t.xField || null, this.yField_ = t.yField || null, this.valueField_ = t.valueField || null, this.map_ = null
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t, t.getVectorLayers().getLayers().push(this), this.set("isAddToMap", !0)
|
||
}
|
||
|
||
onRemove(t) {
|
||
if (this.get("isAddToMap")) {
|
||
this.map_ = null;
|
||
var e = t.getVectorLayers().getLayers(), i = this;
|
||
e.forEach(function (t) {
|
||
i === t && e.remove(t)
|
||
}), this.set("isAddToMap", !1)
|
||
}
|
||
}
|
||
|
||
show() {
|
||
this.setVisible(!0)
|
||
}
|
||
|
||
hide() {
|
||
this.setVisible(!1)
|
||
}
|
||
|
||
addData(t) {
|
||
var e = this.xField_, i = this.yField_, r = this.valueField_, o = new ol.source.Vector;
|
||
for (var n in ol.asserts.assert(!vC.isNull(e), "xField值必须指定"), ol.asserts.assert(!vC.isNull(i), "yField值必须指定"), ol.asserts.assert(!vC.isNull(r), "valueField值必须指定"), t) {
|
||
var s = t[n], a = new ol.geom.Point([s[e], s[i]]), l = new ol.Feature({geometry: a});
|
||
l.set("weight", s[r]), o.addFeature(l)
|
||
}
|
||
this.setSource(o)
|
||
}
|
||
};
|
||
var cS = class extends ol.layer.Image {
|
||
constructor(t) {
|
||
var e = t || {}, i = {
|
||
url: e.url,
|
||
serverType: e.serverType ? e.serverType : "mapserver",
|
||
params: e.params ? e.params : void 0,
|
||
imageLoadFunction: e.imageLoadFunction ? e.imageLoadFunction : void 0,
|
||
ratio: e.ratio ? e.ratio : void 0,
|
||
projection: e.projection ? e.projection : "EPSG:4326"
|
||
};
|
||
super({
|
||
source: new ol.source.ImageWMS(i),
|
||
extent: e.mbr ? e.mbr : void 0,
|
||
opacity: e.opacity ? e.opacity : 1
|
||
})
|
||
}
|
||
|
||
onAdd(t) {
|
||
this.map_ = t, t.getTileLayerOverlayLayers().getLayers().push(this)
|
||
}
|
||
|
||
onRemove(t) {
|
||
this.map_ = null, t.getTileLayerOverlayLayers().getLayers().remove(this)
|
||
}
|
||
};
|
||
var pS = class extends ol.style.Circle {
|
||
constructor(t) {
|
||
super(t)
|
||
}
|
||
};
|
||
var dS = class extends ol.style.Fill {
|
||
constructor(t) {
|
||
super(t)
|
||
}
|
||
};
|
||
var fS = class extends ol.style.Icon {
|
||
constructor(t) {
|
||
super(t)
|
||
}
|
||
};
|
||
var gS = class extends ol.style.Stroke {
|
||
constructor(t) {
|
||
super(t)
|
||
}
|
||
};
|
||
var mS = class extends ol.style.Style {
|
||
constructor(t) {
|
||
super(t)
|
||
}
|
||
};
|
||
var yS = class extends ol.style.Text {
|
||
constructor(t) {
|
||
super(t)
|
||
}
|
||
};
|
||
var vS = class extends ol.format.TextFeature {
|
||
constructor(t, e, i, r, o) {
|
||
super(), this.type_ = t, this.icon_ = e, this.clusterstyle_ = i, this.icongroup = r, this.clusterKeyName = o
|
||
}
|
||
|
||
readFeatureFromText(t) {
|
||
return []
|
||
}
|
||
|
||
readFeaturesFromText(t) {
|
||
var e, i, r, o = [], n = t.split("\r\n");
|
||
this.icon_ && (r = this.icon_);
|
||
for (var s = this.type_.trim(), a = 0; a < n.length; a++) if (n[a] && n[a].length > 0) {
|
||
i = JSON.parse(n[a]), e = new rC(i.X, i.Y);
|
||
var l = this.matchType(s, i);
|
||
null === l && new Error("输入的数据格式不正确!无法解析");
|
||
var h = new EzMarker(e, r, l.title);
|
||
for (var u in l.weight > 1 ? h.setStyle(this.calStyle(l.weight)) : l.videoDire && l.videoType && l.status && h.setIcon(this.getMarkerStyle(l.videoType, l.videoDire, l.status)), h.setId(i.ID), h.set("type_name", "hotspot"), h.set("nativeObject", i), l) "title" !== u && h.set(u, l[u]);
|
||
o.push(h)
|
||
}
|
||
return o
|
||
}
|
||
|
||
getMarkerStyle(t, e, i) {
|
||
var r = this.icongroup, o = {"东": 0, "南": 90, "西": 180, "北": 270}[e], n = r[t];
|
||
n || new Error("该类型不在你定义的图标集合中");
|
||
var s = n.getOptions(), a = s.src, l = a;
|
||
0 === parseInt(i) && (l = a.substring(0, a.lastIndexOf(".")) + "_no" + a.substring(a.lastIndexOf(".")));
|
||
var h = Object.assign({}, s, {src: l, rotation: o});
|
||
return new EzIcon(h)
|
||
}
|
||
|
||
calStyle(t) {
|
||
for (var e = this.clusterstyle_, i = e.threshold, r = e.thresholdColor, o = i.length - 1; o >= 0; o--) if (t >= i[o]) return this.calClusterStyle(t, r[o]);
|
||
return this.calClusterStyle(t)
|
||
}
|
||
|
||
calClusterStyle(t, e) {
|
||
var i = this.clusterstyle_, r = vC.isDef(i.fill) ? i.fill : "#7A9DF6",
|
||
o = vC.isDef(i.stroke) ? i.stroke : "#fff", n = vC.isDef(i.textFill) ? i.textFill : "#fff",
|
||
s = vC.isDef(i.radius) ? i.radius : 15;
|
||
return new ol.style.Style({
|
||
image: new ol.style.Circle({
|
||
fill: new ol.style.Fill({color: e || r}),
|
||
stroke: new ol.style.Stroke({color: o}),
|
||
radius: s
|
||
}), text: new ol.style.Text({fill: new ol.style.Fill({color: n}), text: t.toString()})
|
||
})
|
||
}
|
||
|
||
readProjection() {
|
||
return new ol.proj.get("EPSG:4326")
|
||
}
|
||
|
||
matchType(t, e) {
|
||
var i = this.clusterKeyName;
|
||
switch (t) {
|
||
case"jsonv1":
|
||
return {
|
||
title: e.LABEL,
|
||
weight: e.WEIGHT,
|
||
bbox: e.BBOX,
|
||
videoType: e.customs[i],
|
||
status: e.customs.STATUS,
|
||
videoDire: e.customs.VIDEO_DIRE,
|
||
customs: e.customs
|
||
};
|
||
case"jsonv1s":
|
||
return {
|
||
title: e.LABEL,
|
||
weight: e.WEIGHT,
|
||
bbox: e.BBOX,
|
||
videoType: e.customs[i],
|
||
status: e.customs.STATUS,
|
||
videoDire: e.customs.VIDEO_DIRE
|
||
};
|
||
case"jsonv2":
|
||
return {
|
||
title: e.name,
|
||
weight: e.weight,
|
||
bbox: e.bbox,
|
||
address: e.address,
|
||
layer: e.layer,
|
||
customs: e.customs
|
||
};
|
||
case"jsonv2s":
|
||
return {title: e.name, weight: e.weight, bbox: e.bbox, address: e.address, layer: e.layer}
|
||
}
|
||
return null
|
||
}
|
||
};
|
||
var _S = class extends ol.format.TextFeature {
|
||
constructor(t, e, i, r) {
|
||
super(), this.type_ = t, this.icon_ = e, this.scaleFactor_ = r || 1, this.scale_ = i || !1
|
||
}
|
||
|
||
readFeatureFromText(t) {
|
||
return []
|
||
}
|
||
|
||
readFeaturesFromText(t) {
|
||
var e, i, r, o = [], n = t.split("\r\n");
|
||
this.icon_ && (r = this.icon_);
|
||
for (var s = this.type_.trim(), a = 0; a < n.length; a++) if (n[a] && n[a].length > 0) {
|
||
i = JSON.parse(n[a]), e = new rC(i.X, i.Y);
|
||
var l = this.matchType(s, i);
|
||
if (null === l && new Error("输入的数据格式不正确!无法解析"), this.scale_) {
|
||
var h = r.getOptions(),
|
||
u = Object.assign({}, h, {scale: Math.pow(l.weight, .1) * this.scaleFactor_});
|
||
r = new EzIcon(u)
|
||
}
|
||
var c = new EzMarker(e, r, l.title);
|
||
for (var p in c.setId(i.ID), c.set("type_name", "hotspot"), c.set("nativeObject", i), l) "title" !== p && c.set(p, l[p]);
|
||
o.push(c)
|
||
}
|
||
return o
|
||
}
|
||
|
||
readProjection() {
|
||
return new ol.proj.get("EPSG:4326")
|
||
}
|
||
|
||
matchType(t, e) {
|
||
switch (t) {
|
||
case"jsonv1":
|
||
return {title: e.LABEL, weight: e.WEIGHT, bbox: e.BBOX, customs: e.customs};
|
||
case"jsonv1s":
|
||
return {title: e.LABEL, weight: e.WEIGHT, bbox: e.BBOX};
|
||
case"jsonv2":
|
||
return {
|
||
title: e.name,
|
||
weight: e.weight,
|
||
bbox: e.bbox,
|
||
address: e.address,
|
||
layer: e.layer,
|
||
customs: e.customs
|
||
};
|
||
case"jsonv2s":
|
||
return {title: e.name, weight: e.weight, bbox: e.bbox, address: e.address, layer: e.layer}
|
||
}
|
||
return null
|
||
}
|
||
};
|
||
|
||
class xS extends ol.interaction.Pointer {
|
||
constructor(t) {
|
||
super({handleDownEvent: xS.handleDownEvent_});
|
||
var e = vC.isDef(t) ? t : {}, i = document.createElement("div"), r = document.createTextNode("test");
|
||
i.appendChild(r), i.style.marginLeft = -5, i.style.marginTop = -3, this.overlay_ = vC.isDef(e.overlay) ? e.overlay : new ol.Overlay({element: i})
|
||
}
|
||
|
||
handleDownEvent_(t) {
|
||
if (t.browserEvent.isMouseActionButton()) {
|
||
var e = t.coordinate, i = t.map;
|
||
return this.overlay_.setPosition(e), i.addOverlay(this.overlay_), !0
|
||
}
|
||
return !1
|
||
}
|
||
}
|
||
|
||
var wS = xS;
|
||
|
||
class bS extends ol.interaction.Pointer {
|
||
constructor() {
|
||
super({
|
||
handleDownEvent: bS.handleDownEvent,
|
||
handleDragEvent: bS.handleDragEvent,
|
||
handleMoveEvent: bS.handleMoveEvent,
|
||
handleUpEvent: bS.handleUpEvent
|
||
}), this.coordinate_ = null, this.cursor_ = "pointer", this.feature_ = null, this.previousCursor_ = void 0
|
||
}
|
||
|
||
handleDownEvent(t) {
|
||
var e = t.map.forEachFeatureAtPixel(t.pixel, function (t) {
|
||
return t
|
||
});
|
||
return !(!e || !e.get("draggable")) && (this.coordinate_ = t.coordinate, this.feature_ = e, this.feature_ instanceof EzMarker && this.feature_.dispatchEvent(new _C("dragstart")), !0)
|
||
}
|
||
|
||
handleDragEvent(t) {
|
||
var e = t.coordinate[0] - this.coordinate_[0], i = t.coordinate[1] - this.coordinate_[1];
|
||
this.feature_.getGeometry().translate(e, i), this.coordinate_[0] = t.coordinate[0], this.coordinate_[1] = t.coordinate[1]
|
||
}
|
||
|
||
handleMoveEvent(t) {
|
||
if (this.cursor_) {
|
||
var e = t.map.forEachFeatureAtPixel(t.pixel, function (t) {
|
||
return t
|
||
}), i = t.map.getTargetElement();
|
||
e ? i.style.cursor != this.cursor_ && (this.previousCursor_ = i.style.cursor, i.style.cursor = this.cursor_) : void 0 !== this.previousCursor_ && (i.style.cursor = this.previousCursor_, this.previousCursor_ = void 0)
|
||
}
|
||
}
|
||
|
||
handleUpEvent() {
|
||
return this.feature_ instanceof EzMarker && this.feature_.dispatchEvent(new _C("dragend")), this.coordinate_ = null, this.feature_ = null, !1
|
||
}
|
||
}
|
||
|
||
var CS = bS;
|
||
|
||
class SS extends ol.interaction.Pointer {
|
||
constructor(t, e, i) {
|
||
t || new Error("圆编辑必须指定featue对象"), super({
|
||
handleDownEvent: SS.handleDownEvent_,
|
||
handleEvent: SS.handleEvent,
|
||
handleUpEvent: SS.handleUpEvent_
|
||
}), this.target_ = t, this.overlay_ = new ol.layer.Vector({
|
||
source: new ol.source.Vector({useSpatialIndex: !1}),
|
||
style: t.getStyle()
|
||
}), this.center_ = this.target_.getCenter().getCoordinate(), this.radius_ = this.target_.getGeometry().getRadius(), this.cb_ = e || function () {
|
||
}, this.cb2_ = i || function () {
|
||
}, this.controlBtn_ = new ol.Overlay({element: this.initElement()}), this.editing = !1, this.mousedown_ = !1, this.upfn_ = this.handleUpEvent_.bind(this), this.mapport
|
||
}
|
||
|
||
initSketch() {
|
||
this.getMap().removeOverlay(this.target_);
|
||
var t = this.target_.getGeometry(), e = new ol.Feature({geometry: t});
|
||
e.setId("skectchId"), this.overlay_.getSource().addFeature(e), this.controlBtn_.setPosition([this.center_[0] + this.radius_, this.center_[1]])
|
||
}
|
||
|
||
setMap(t) {
|
||
super.setMap(t), this.updateState_()
|
||
}
|
||
|
||
updateState_() {
|
||
var t = this.getMap();
|
||
vC.isNull(t) || (t.getVectorLayers().getLayers().push(this.overlay_), t.addOverlay(this.controlBtn_, !0), this.initSketch(), this.mapport = this.getMap().getViewport(), this.mapport.addEventListener("mouseup", this.upfn_))
|
||
}
|
||
|
||
initElement() {
|
||
var t = document.createElement("div");
|
||
return t.className = "ez-editCircle-btn", t.id = "ez_editCicle_btn", t.addEventListener("mousedown", this.handleDownEvent_.bind(this)), t
|
||
}
|
||
|
||
handleEvent(t) {
|
||
if (t.type === ol.MapBrowserEventType.POINTERMOVE && this.editing) {
|
||
this.getMap();
|
||
var e = this.overlay_.getSource().getFeatureById("skectchId"), i = e.getGeometry();
|
||
this.handleDragGeom_(i, t);
|
||
var r = e.getGeometry().getCenter(), o = new Ez.Coordinate(r[0], r[1]),
|
||
n = new Ez.g.Circle(o, e.getGeometry().getRadius(), {isMeter: !0});
|
||
this.cb2_(n)
|
||
}
|
||
return !1
|
||
}
|
||
|
||
handleDragGeom_(t, e) {
|
||
var i = e.coordinate, r = this.center_;
|
||
this.controlBtn_.setPosition([i[0], r[1]]);
|
||
var o = Math.abs(i[0] - r[0]);
|
||
t.setRadius(o)
|
||
}
|
||
|
||
handleDownEvent_(t) {
|
||
this.editing = !0, this.mousedown_ = !0
|
||
}
|
||
|
||
handleUpEvent_(t) {
|
||
this.editing = !1;
|
||
var e = this.overlay_.getSource().getFeatureById("skectchId"), i = e.getGeometry().getCenter(),
|
||
r = new Ez.Coordinate(i[0], i[1]),
|
||
o = new Ez.g.Circle(r, e.getGeometry().getRadius(), {isMeter: !0});
|
||
this.cb_(o)
|
||
}
|
||
|
||
disposeAll(t) {
|
||
var e = this.getMap(), i = this.overlay_.getSource().getFeatureById("skectchId").getGeometry();
|
||
e.getViewport();
|
||
this.mapport.removeEventListener("mouseup", this.upfn_);
|
||
var r = i.getCenter(), o = new Ez.Coordinate(r[0], r[1]),
|
||
n = new Ez.g.Circle(o, i.getRadius(), {isMeter: !0});
|
||
e.removeOverlay(this.controlBtn_, !0);
|
||
var s = e.getVectorLayers().getLayers(), a = this.overlay_;
|
||
s.forEach(function (t) {
|
||
a !== t || s.remove(t)
|
||
}), this.target_.getGeometry().setRadius(n.getGeometry().getRadius()), e.addOverlay(this.target_), t(this.target_)
|
||
}
|
||
}
|
||
|
||
var ES = SS;
|
||
const TS = {POINT: "Point", LINE_STRING: "LineString", POLYGON: "Polygon", CIRCLE: "Circle"},
|
||
RS = {DRAWSTART: "drawstart", DRAWEND: "drawend"};
|
||
|
||
class PS extends A {
|
||
constructor(t, e) {
|
||
super(t), this.feature = e
|
||
}
|
||
}
|
||
|
||
var LS = class extends ol.interaction.Pointer {
|
||
constructor(t) {
|
||
super({
|
||
handleDownEvent: function (t) {
|
||
return this.condition_(t) ? (this.downPx_ = t.pixel, !0) : !(this.mode_ !== TS.LINE_STRING && this.mode_ !== TS.POLYGON || !this.freehandCondition_(t) || (this.downPx_ = t.pixel, this.freehand_ = !0, vC.isNull(this.finishCoordinate_) && this.startDrawing_(t), 0))
|
||
}, handleUpEvent: function (t) {
|
||
var e = 2 === t.pointerEvent.button;
|
||
this.freehand_ = !1;
|
||
var i = this.downPx_, r = t.pixel, o = i[0] - r[0], n = i[1] - r[1], s = !0;
|
||
return o * o + n * n <= this.squaredClickTolerance_ && (this.handlePointerMove_(t), vC.isNull(this.finishCoordinate_) ? (this.startDrawing_(t), this.mode_ === TS.POINT && this.finishDrawing()) : this.mode_ === TS.CIRCLE ? this.finishDrawing() : this.addToDrawing_(t), s = !1), e && this.atFinish_(t) && this.finishDrawing(e), s
|
||
}
|
||
});
|
||
var e = vC.isDef(t) ? t : {};
|
||
this.downPx_ = null, this.source_ = vC.isDef(e.source) ? e.source : null, this.features_ = vC.isDef(e.features) ? e.features : null, this.snapTolerance_ = vC.isDef(e.snapTolerance) ? e.snapTolerance : 12, this.type_ = e.type, this.mode_ = this.getMode_(this.type_), this.minPoints_ = vC.isDef(e.minPoints) ? e.minPoints : this.mode_ === TS.POLYGON ? 3 : 2, this.maxPoints_ = vC.isDef(e.maxPoints) ? e.maxPoints : 1 / 0, this.helpTooltipElement = null, this.helpTooltip = null, this.tip_ = !vC.isDef(e.tip) || e.tip;
|
||
var i = e.geometryFunction;
|
||
if (!vC.isDef(i)) if (this.type_ === ol.geom.GeometryType.CIRCLE) i = function (t, e) {
|
||
var i = vC.isDef(e) ? e : new ol.geom.Circle([NaN, NaN]);
|
||
i instanceof ol.geom.Circle || ol.asserts.assert(!1, "初始化geometryFunction中opt_geometry必须是一个ol.geom.Circle");
|
||
var r = ol.coordinate.squaredDistance(t[0], t[1]);
|
||
return i.setCenterAndRadius(t[0], Math.sqrt(r)), i
|
||
}; else {
|
||
var r, o = this.mode_;
|
||
o === TS.POINT ? r = ol.geom.Point : o === TS.LINE_STRING ? r = ol.geom.LineString : o === TS.POLYGON && (r = ol.geom.Polygon), i = function (t, e) {
|
||
var i = e;
|
||
return vC.isDef(i) ? i.setCoordinates(t) : i = new r(t), i
|
||
}
|
||
}
|
||
this.geometryFunction_ = i, this.finishCoordinate_ = null, this.sketchFeature_ = null, this.sketchPoint_ = null, this.sketchCoords_ = null, this.sketchLine_ = null, this.sketchLineCoords_ = null, this.squaredClickTolerance_ = vC.isDef(e.clickTolerance) ? e.clickTolerance * e.clickTolerance : 36, this.overlay_ = new ol.layer.Vector({
|
||
source: new ol.source.Vector({
|
||
useSpatialIndex: !1,
|
||
wrapX: !!vC.isDef(e.wrapX) && e.wrapX
|
||
}), style: vC.isDef(e.style) ? e.style : this.getDefaultStyleFunction()
|
||
}), this.geometryName_ = e.geometryName, this.condition_ = vC.isDef(e.condition) ? e.condition : ol.events.condition.noModifierKeys, this.freehandCondition_ = vC.isDef(e.freehandCondition) ? e.freehandCondition : ol.events.condition.shiftKeyOnly, ol.events.listen(this, ol.Object.getChangeEventType(As.ACTIVE), this.updateState_, !1, this), this.shouldStopEvent = !1
|
||
}
|
||
|
||
changeStyle_(t) {
|
||
this.addClass(this.helpTooltipElement, "hidden")
|
||
}
|
||
|
||
createHelpTooltip() {
|
||
this.helpTooltipElement && this.helpTooltipElement.parentNode.removeChild(this.helpTooltipElement), this.helpTooltipElement = document.createElement("div"), this.helpTooltipElement.className = "tooltip hidden", this.helpTooltip = new ol.Overlay({
|
||
element: this.helpTooltipElement,
|
||
offset: [15, 0],
|
||
positioning: "center-left"
|
||
}), this.getMap().addOverlay(this.helpTooltip, !0)
|
||
}
|
||
|
||
getDefaultStyleFunction() {
|
||
var t = ol.style.Style.createEditingStyle();
|
||
return function (e, i) {
|
||
return t[e.getGeometry().getType()]
|
||
}
|
||
}
|
||
|
||
setMap(t) {
|
||
super.setMap(t);
|
||
var e = this.map;
|
||
this.updateState_(), t ? (this.map = t, !1 !== this.tip_ && (this.createHelpTooltip(), this.changeStyle_ = this.changeStyle_.bind(this), t.getViewport().addEventListener("mouseout", this.changeStyle_))) : !1 !== this.tip_ && (e.removeOverlay(this.helpTooltip, !0), e.getViewport().removeEventListener("mouseout", this.changeStyle_))
|
||
}
|
||
|
||
handleEvent(t) {
|
||
var e = !this.freehand_;
|
||
return this.freehand_ && t.type === ol.MapBrowserEventType.POINTERDRAG ? (this.addToDrawing_(t), e = !1) : t.type === ol.MapBrowserEventType.POINTERMOVE ? e = this.handlePointerMove_(t) : t.type === ol.MapBrowserEventType.DBLCLICK && (e = !1), super.handleEvent(t) && e
|
||
}
|
||
|
||
handleDownEvent_(t) {
|
||
return this.condition_(t) ? (this.downPx_ = t.pixel, !0) : !(this.mode_ !== TS.LINE_STRING && this.mode_ !== TS.POLYGON || !this.freehandCondition_(t) || (this.downPx_ = t.pixel, this.freehand_ = !0, vC.isNull(this.finishCoordinate_) && this.startDrawing_(t), 0))
|
||
}
|
||
|
||
handleUpEvent_(t) {
|
||
var e = 2 === t.pointerEvent.button;
|
||
this.freehand_ = !1;
|
||
var i = this.downPx_, r = t.pixel, o = i[0] - r[0], n = i[1] - r[1], s = !0;
|
||
return o * o + n * n <= this.squaredClickTolerance_ && (this.handlePointerMove_(t), vC.isNull(this.finishCoordinate_) ? (this.startDrawing_(t), this.mode_ === TS.POINT && this.finishDrawing()) : this.mode_ === TS.CIRCLE ? this.finishDrawing() : this.addToDrawing_(t), s = !1), e && this.atFinish_(t) && this.finishDrawing(e), s
|
||
}
|
||
|
||
handlePointerMove_(t) {
|
||
return vC.isNull(this.finishCoordinate_) ? this.createOrUpdateSketchPoint_(t) : this.modifyDrawing_(t), this.updateTipTool(t, this.startDrawingFlag), !0
|
||
}
|
||
|
||
updateTipTool(t, e) {
|
||
var i = "点击开始绘制";
|
||
if (e && this.type_) {
|
||
var r = this.type_;
|
||
r === ol.geom.GeometryType.CIRCLE ? i = "移动确定半径,单击完成绘制" : r === ol.geom.GeometryType.LINE_STRING && 2 === this.maxPoints_ ? i = "移动确定长度,单击完成绘制" : r === ol.geom.GeometryType.LINE_STRING ? i = "单击确定节点,右击完成绘制" : r === ol.geom.GeometryType.POLYGON && (i = "单击确定节点,右击完成绘制")
|
||
}
|
||
this.tip_ && (this.helpTooltipElement.innerHTML = i, this.helpTooltip.setPosition(t.coordinate), this.addClass(this.helpTooltipElement, "hidden"))
|
||
}
|
||
|
||
atFinish_(t) {
|
||
var e = !1;
|
||
if (!vC.isNull(this.sketchFeature_)) {
|
||
var i = !1, r = [this.finishCoordinate_];
|
||
if (this.mode_ === TS.LINE_STRING ? i = this.sketchCoords_.length > this.minPoints_ : this.mode_ === TS.POLYGON && (i = this.sketchCoords_[0].length > this.minPoints_, r = [this.sketchCoords_[0][0], this.sketchCoords_[0][this.sketchCoords_[0].length - 2]]), i) for (var o = t.map, n = 0, s = r.length; n < s; n++) {
|
||
var a = r[n], l = o.getPixelFromCoordinate(a), h = t.pixel, u = h[0] - l[0], c = h[1] - l[1],
|
||
p = this.freehand_ && this.freehandCondition_(t) ? 1 : this.snapTolerance_;
|
||
if (e = Math.sqrt(u * u + c * c) <= p) {
|
||
this.finishCoordinate_ = a;
|
||
break
|
||
}
|
||
}
|
||
}
|
||
return e
|
||
}
|
||
|
||
createOrUpdateSketchPoint_(t) {
|
||
var e = t.coordinate.slice();
|
||
if (vC.isNull(this.sketchPoint_)) this.sketchPoint_ = new ol.Feature(new ol.geom.Point(e)), this.updateSketchFeatures_(); else {
|
||
var i = this.sketchPoint_.getGeometry();
|
||
i instanceof ol.geom.Point && i.setCoordinates(e)
|
||
}
|
||
}
|
||
|
||
startDrawing_(t) {
|
||
var e = this.getMap();
|
||
if (e) {
|
||
e.getViewport().addEventListener("contextmenu", function (t) {
|
||
return t.preventDefault(), t.stopPropagation(), !1
|
||
});
|
||
var i = t.coordinate;
|
||
this.finishCoordinate_ = i, this.mode_ === TS.POINT ? this.sketchCoords_ = i.slice() : this.mode_ === TS.POLYGON ? (this.sketchCoords_ = [[i.slice(), i.slice()]], this.sketchLineCoords_ = this.sketchCoords_[0]) : (this.sketchCoords_ = [i.slice(), i.slice()], this.mode_ === TS.CIRCLE && (this.sketchLineCoords_ = this.sketchCoords_)), vC.isNull(this.sketchLineCoords_) || (this.sketchLine_ = new ol.Feature(new ol.geom.LineString(this.sketchLineCoords_)));
|
||
var r = this.geometryFunction_(this.sketchCoords_);
|
||
ol.asserts.assert(vC.isDef(r), "geometry should be defined"), this.sketchFeature_ = new ol.Feature, vC.isDef(this.geometryName_) && this.sketchFeature_.setGeometryName(this.geometryName_), this.sketchFeature_.setGeometry(r), this.updateSketchFeatures_(), this.dispatchEvent(new PS(RS.DRAWSTART, this.sketchFeature_))
|
||
}
|
||
}
|
||
|
||
modifyDrawing_(t) {
|
||
var e, i, r, o = t.coordinate, n = this.sketchFeature_.getGeometry();
|
||
if (this.mode_ === TS.POINT ? i = this.sketchCoords_ : this.mode_ === TS.POLYGON ? (i = (e = this.sketchCoords_[0])[e.length - 1], this.atFinish_(t) && (o = this.finishCoordinate_.slice())) : i = (e = this.sketchCoords_)[e.length - 1], i[0] = o[0], i[1] = o[1], this.geometryFunction_(this.sketchCoords_, n), !vC.isNull(this.sketchPoint_)) {
|
||
var s = this.sketchPoint_.getGeometry();
|
||
s instanceof ol.geom.Point && s.setCoordinates(o)
|
||
}
|
||
if (n instanceof ol.geom.Polygon && this.mode_ !== TS.POLYGON) {
|
||
var a = n.getLinearRing(0);
|
||
vC.isNull(this.sketchLine_) && (this.sketchLine_ = new ol.Feature(new ol.geom.LineString(a.getFlatCoordinates()))), (r = this.sketchLine_.getGeometry()) instanceof ol.geom.LineString && r.setFlatCoordinates(a.getLayout(), a.getFlatCoordinates())
|
||
} else vC.isNull(this.sketchLineCoords_) || (r = this.sketchLine_.getGeometry()) instanceof ol.geom.LineString && r.setCoordinates(this.sketchLineCoords_);
|
||
this.updateSketchFeatures_(), this.startDrawingFlag = !0
|
||
}
|
||
|
||
addToDrawing_(t) {
|
||
var e, i, r = t.coordinate, o = this.sketchFeature_.getGeometry();
|
||
this.mode_ === TS.LINE_STRING ? (this.finishCoordinate_ = r.slice(), (i = this.sketchCoords_).push(r.slice()), e = i.length > this.maxPoints_, this.geometryFunction_(i, o)) : this.mode_ === TS.POLYGON && ((i = this.sketchCoords_[0]).push(r.slice()), (e = i.length > this.maxPoints_) && (this.finishCoordinate_ = i[0]), this.geometryFunction_(this.sketchCoords_, o)), this.updateSketchFeatures_(), e && this.finishDrawing()
|
||
}
|
||
|
||
finishDrawing(t) {
|
||
var e = this.abortDrawing_();
|
||
ol.asserts.assert(!vC.isNull(e), "sketchFeature should not be null");
|
||
var i = this.sketchCoords_, r = e.getGeometry();
|
||
this.mode_ === TS.LINE_STRING ? (i.pop(), t && i.pop(), this.geometryFunction_(i, r)) : this.mode_ === TS.POLYGON && (i[0].pop(), t && i[0].pop(), i[0].push(i[0][0]), this.geometryFunction_(i, r)), this.type_ === ol.geom.GeometryType.MULTI_POINT ? e.setGeometry(new ol.geom.MultiPoint([i])) : this.type_ === ol.geom.GeometryType.MULTI_LINE_STRING ? e.setGeometry(new ol.geom.MultiLineString([i])) : this.type_ === ol.geom.GeometryType.MULTI_POLYGON && e.setGeometry(new ol.geom.MultiPolygon([i])), this.dispatchEvent(new PS(RS.DRAWEND, e)), vC.isNull(this.features_) || this.features_.push(e), vC.isNull(this.source_);
|
||
var o = this.map;
|
||
!1 !== this.tip_ && (o.removeOverlay(this.helpTooltip, !0), this.helpTooltip = null), o.getViewport().removeEventListener("mouseout", this.changeStyle_), delete this.map
|
||
}
|
||
|
||
abortDrawing_() {
|
||
this.finishCoordinate_ = null;
|
||
var t = this.sketchFeature_;
|
||
return vC.isNull(t) || (this.sketchFeature_ = null, this.sketchPoint_ = null, this.sketchLine_ = null, this.overlay_.getSource().clear(!0)), t
|
||
}
|
||
|
||
updateSketchFeatures_() {
|
||
var t = [];
|
||
vC.isNull(this.sketchFeature_) || t.push(this.sketchFeature_), vC.isNull(this.sketchLine_) || t.push(this.sketchLine_), vC.isNull(this.sketchPoint_) || t.push(this.sketchPoint_);
|
||
var e = this.overlay_.getSource();
|
||
e.clear(!0), e.addFeatures(t)
|
||
}
|
||
|
||
updateState_() {
|
||
var t = this.getMap(), e = this.getActive();
|
||
!vC.isNull(t) && e || this.abortDrawing_(), this.overlay_.setMap(e ? t : null)
|
||
}
|
||
|
||
createRegularPolygon(t, e) {
|
||
return function (i, r) {
|
||
var o = i[0], n = i[1], s = Math.sqrt(ol.coordinate.squaredDistance(o, n)),
|
||
a = vC.isDef(r) ? r : ol.geom.Polygon.fromCircle(new ol.geom.Circle(o), t),
|
||
l = vC.isDef(e) ? e : Math.atan((n[1] - o[1]) / (n[0] - o[0]));
|
||
return ol.geom.Polygon.makeRegular(a, o, s, l), a
|
||
}
|
||
}
|
||
|
||
getMode_(t) {
|
||
var e;
|
||
return t === ol.geom.GeometryType.POINT || t === ol.geom.GeometryType.MULTI_POINT ? e = TS.POINT : t === ol.geom.GeometryType.LINE_STRING || t === ol.geom.GeometryType.MULTI_LINE_STRING ? e = TS.LINE_STRING : t === ol.geom.GeometryType.POLYGON || t === ol.geom.GeometryType.MULTI_POLYGON ? e = TS.POLYGON : t === ol.geom.GeometryType.CIRCLE && (e = TS.CIRCLE), ol.asserts.assert(vC.isDef(e), "mode should be defined"), e
|
||
}
|
||
|
||
addClass(t, e) {
|
||
for (var i = t.className.split(" "), r = 0; r < i.length; r++) if (i[r] === e.trim()) return;
|
||
i.push(e.trim()), t.className = i.join(" ")
|
||
}
|
||
|
||
removeClass(t, e) {
|
||
for (var i = t.className.split(" "), r = 0; r < i.length; r++) if (i[r] === e) {
|
||
i[r] = "";
|
||
break
|
||
}
|
||
var o = i.join(" ");
|
||
t.className = o
|
||
}
|
||
};
|
||
var IS = class extends ol.source.Vector {
|
||
constructor(t) {
|
||
super({
|
||
attributions: t.attributions,
|
||
extent: t.extent,
|
||
logo: t.logo,
|
||
projection: t.projection,
|
||
wrapX: t.wrapX
|
||
}), this.minClusterNum = t.minClusterNum ? t.minClusterNum : 1, this.resolution_ = void 0, this.distance_ = void 0 !== t.distance ? t.distance : 20, this.features_ = [], this.geometryFunction_ = t.geometryFunction || function (t) {
|
||
var e = t.getGeometry();
|
||
return ol.asserts.assert(e instanceof ol.geom.Point, "feature geometry is a ol.geom.Point instance"), e
|
||
}, this.source_ = t.source, this.source_.on(ol.events.EventType.CHANGE, this.onSourceChange_.bind(this), this)
|
||
}
|
||
|
||
getSource() {
|
||
return this.source_
|
||
}
|
||
|
||
loadFeatures(t, e, i) {
|
||
this.source_.loadFeatures(t, e, i), e !== this.resolution_ && (super.clear(), this.resolution_ = e, this.cluster_(), super.addFeatures(this.features_))
|
||
}
|
||
|
||
onSourceChange_() {
|
||
super.clear(), this.cluster_(), super.addFeatures(this.features_), super.changed()
|
||
}
|
||
|
||
cluster_() {
|
||
if (void 0 !== this.resolution_) {
|
||
this.features_.length = 0;
|
||
for (var t = ol.extent.createEmpty(), e = this.distance_ * this.resolution_, i = this.source_.getFeatures(), r = {}, o = 0, n = i.length; o < n; o++) {
|
||
var s = i[o];
|
||
if (!(ol.util.getUid(s).toString() in r)) {
|
||
var a = this.geometryFunction_(s);
|
||
if (a) {
|
||
var l = a.getCoordinates();
|
||
ol.extent.createOrUpdateFromCoordinate(l, t), ol.extent.buffer(t, e, t);
|
||
var h = this.source_.getFeaturesInExtent(t);
|
||
ol.asserts.assert(h.length >= 1, "at least one neighbor found");
|
||
var u = {};
|
||
if ((h = h.filter(function (t) {
|
||
var e = ol.util.getUid(t).toString();
|
||
return !(e in r || (r[e] = !0, u[e] = !0, 0))
|
||
})).length > this.minClusterNum) this.features_.push(this.createCluster_(h)); else {
|
||
for (var c in this.features_.push(s), u) delete r[c];
|
||
var p = ol.util.getUid(s).toString();
|
||
r[p] = !0
|
||
}
|
||
u = null
|
||
}
|
||
}
|
||
}
|
||
ol.asserts.assert(Object.keys(r).length == this.source_.getFeatures().length, "number of clustered equals number of features in the source")
|
||
}
|
||
}
|
||
|
||
createCluster_(t) {
|
||
for (var e, i = [0, 0], r = t.length - 1; r >= 0; --r) {
|
||
var o = this.geometryFunction_(t[r]);
|
||
o ? ol.coordinate.add(i, o.getCoordinates()) : t.splice(r, 1)
|
||
}
|
||
return ol.coordinate.scale(i, 1 / t.length), t.length > this.minClusterNum ? (e = new ol.Feature(new ol.geom.Point(i))).set("features", t) : e = t[0], e
|
||
}
|
||
};
|
||
var OS = class extends ol.source.TileImage {
|
||
constructor(t) {
|
||
for (var e = vC.isDef(t.projection) ? t.projection : "EPSG:4326", i = ol.proj.get(e).getExtent(), r = vC.isDef(t.tileSize) ? t.tileSize : 256, o = 360 / r, n = new Array(18), s = 0; s < 18; ++s) n[s] = o / Math.pow(2, s);
|
||
var a = vC.isDef(t.resolutions) ? t.resolutions : n;
|
||
super({
|
||
projection: e,
|
||
tileUrlFunction: function (t, e, i) {
|
||
var r = t[0], o = t[1], n = -t[2] - 1, s = this.hotspotUrlTemplate_, a = this.tileUrlTemplate_,
|
||
l = (s = s.replace(/{z}/g, r.toString()).replace(/{y}/g, n.toString()).replace(/{x}/g, o.toString()), this.markerData_),
|
||
h = this.createXHR();
|
||
return h.onreadystatechange = function (t) {
|
||
if (!(h.readyState < 4) && 200 === h.status && 4 === h.readyState) {
|
||
var e = h.responseText.replace(/((\r\n)+)$/, "").replace(/\r\n/g, ",").replace(/(.\d+)$/, "");
|
||
e = "[" + e + "]", r in l ? l[r][o + ":" + n] = JSON.parse(e) : (l[r] = {}, l[r][o + ":" + n] = JSON.parse(e))
|
||
}
|
||
}, h.open("GET", this.proxyUrl_ + encodeURIComponent(s), !0), h.send(null), a.replace("{z}", r.toString()).replace("{y}", n.toString()).replace("{x}", o.toString())
|
||
},
|
||
tileGrid: new ol.tilegrid.TileGrid({origin: ol.extent.getTopLeft(i), resolutions: a, tileSize: r})
|
||
}), ol.asserts.assert(vC.isDef(t.hotspotUrlTemplate), "热点数据URL模板不能为空"), this.hotspotUrlTemplate_ = t.hotspotUrlTemplate, ol.asserts.assert(vC.isDef(t.tileUrlTemplate), "热点数据URL模板不能为空"), this.tileUrlTemplate_ = t.tileUrlTemplate, this.markerData_ = {}, this.proxyUrl_ = vC.isDef(t.proxyUrl) ? t.proxyUrl + "?request=gotourl&url=" : ""
|
||
}
|
||
|
||
urlCallbackFunction_(t, e, i) {
|
||
var r = t[0], o = t[1], n = -t[2] - 1, s = this.hotspotUrlTemplate_, a = this.tileUrlTemplate_,
|
||
l = (s = s.replace(/{z}/g, r.toString()).replace(/{y}/g, n.toString()).replace(/{x}/g, o.toString()), this.markerData_),
|
||
h = this.createXHR();
|
||
return h.onreadystatechange = function (t) {
|
||
if (!(h.readyState < 4) && 200 === h.status && 4 === h.readyState) {
|
||
var e = h.responseText.replace(/((\r\n)+)$/, "").replace(/\r\n/g, ",").replace(/(.\d+)$/, "");
|
||
e = "[" + e + "]", r in l ? l[r][o + ":" + n] = JSON.parse(e) : (l[r] = {}, l[r][o + ":" + n] = JSON.parse(e))
|
||
}
|
||
}, h.open("GET", this.proxyUrl_ + encodeURIComponent(s), !0), h.send(null), a.replace("{z}", r.toString()).replace("{y}", n.toString()).replace("{x}", o.toString())
|
||
}
|
||
|
||
createXHR() {
|
||
var t;
|
||
if ("undefined" != typeof XMLHttpRequest) t = new XMLHttpRequest; else for (var e = ["MSXML2.XmlHttp.5.0", "MSXML2.XmlHttp.4.0", "MSXML2.XmlHttp.3.0", "MSXML2.XmlHttp.2.0", "Microsoft.XmlHttp"], i = 0, r = e.length; i < r; i++) try {
|
||
t = new ActiveXObject(e[i]);
|
||
break
|
||
} catch (t) {
|
||
new Error("查看浏览器版本")
|
||
}
|
||
return t
|
||
}
|
||
|
||
getMarkerData() {
|
||
return this.markerData_
|
||
}
|
||
};
|
||
var MS = class extends ol.source.Vector {
|
||
constructor(t) {
|
||
if (t.url) {
|
||
var e = t.type, i = t.icon, r = t.isScale, o = t.scaleFactor, n = t.format || "scale";
|
||
if ("cluster" === n) {
|
||
var s = t.clusterStyle, a = t.clusterIconGroup, l = t.clusterKeyName;
|
||
n = new ol.format.HotSpotCluster(e, i, s, a, l)
|
||
} else n = new ol.format.HotSpot(e, i, r, o);
|
||
for (var h = new Array(22), u = 0; u <= 22; ++u) h[u] = 1.40625 / Math.pow(2, u);
|
||
var c = new ol.tilegrid.TileGrid({
|
||
origin: t.origin || [-180, 90],
|
||
resolutions: t.resolutions || h,
|
||
tileSize: t.tileSize || 256
|
||
});
|
||
super({
|
||
projection: t.projection || "EPSG:4326", tileGrid: c, url: function (e, i) {
|
||
var r = c.getTileCoordForCoordAndResolution(ol.extent.getCenter(e), i), o = r[0], n = r[1],
|
||
s = -r[2] - 1,
|
||
a = t.url.replace("{z}", o.toString()).replace("{y}", s.toString()).replace("{x}", n.toString());
|
||
if ("POST" == t.proxyType) {
|
||
var l = a.split("?"), h = {url: l[0]};
|
||
return h.content = l[1], h.proxyurl = t.proxyurl, h.proxyType = t.proxyType, h
|
||
}
|
||
var u = t.proxyJoin || "?toUrl=";
|
||
return t.proxyurl + u + encodeURIComponent(a + "&appkey=" + t.appkey)
|
||
}, strategy: ol.loadingstrategy.tile(c), format: n
|
||
}), this.format = n, this.tilegrid = c, this.proxyType = t.proxyType, this.url_ = t.url, this.proxyurl = t.proxyurl, this.appkey = t.appkey, this.proxyurlJoin = t.proxyJoin || "?toUrl=", this.lasttime_ = null, this.loading_ = !1, this.loadend_ = !0
|
||
}
|
||
}
|
||
|
||
setLoadingState(t) {
|
||
this.loading_ = t
|
||
}
|
||
|
||
setLoadendState(t) {
|
||
this.loadend_ = t
|
||
}
|
||
|
||
tileurlfunc(t, e) {
|
||
var i = this.tilegrid.getTileCoordForCoordAndResolution(ol.extent.getCenter(t), e), r = i[0], o = i[1],
|
||
n = -i[2] - 1,
|
||
s = this.url_.replace("{z}", r.toString()).replace("{y}", n.toString()).replace("{x}", o.toString());
|
||
if ("POST" == this.proxyType) {
|
||
var a = s.split("?"), l = {url: a[0]};
|
||
return l.content = a[1], l.proxyurl = this.proxyurl, l.proxyType = this.proxyType, l
|
||
}
|
||
return this.proxyurl + this.proxyurlJoin + encodeURIComponent(s + "&appkey=" + this.appkey)
|
||
}
|
||
|
||
loadFeatures(t, e, i) {
|
||
var r, o, n = this.loadedExtentsRtree_, s = this.strategy_(t, e);
|
||
for (r = 0, o = s.length; r < o; ++r) {
|
||
var a = s[r];
|
||
n.forEachInExtent(a, function (t) {
|
||
return ol.extent.containsExtent(t.extent, a)
|
||
}) || !this.loading_ && this.loadend_ && (this.loader_.call(this, a, e, i), n.insert(a, {extent: a.slice()}))
|
||
}
|
||
}
|
||
};
|
||
const AS = function () {
|
||
this.Events = {}, this.__cnt = 0
|
||
};
|
||
AS.hasOwnKey = Function.call.bind(Object.hasOwnProperty), AS.slice = Function.call.bind(Array.prototype.slice), AS.prototype.on = function (t, e, i) {
|
||
return this.bindEvent(t, e, 0, i)
|
||
}, AS.prototype.un = function (t) {
|
||
var e = "", i = "", r = !1, o = typeof t, n = this;
|
||
return "string" === o ? !!AS.hasOwnKey(this.Events, t) && (delete this.Events[t], !0) : "object" === o ? (e = t[0], i = t[1], !(!AS.hasOwnKey(this.Events, e) || !AS.hasOwnKey(this.Events[e], i)) && (delete this.Events[e][i], !0)) : "function" !== o || (n.eachEvent(n.Events, function (e, i) {
|
||
n.eachEvent(i, function (i, o) {
|
||
o[0] === t && (delete n.Events[e][i], r = !0)
|
||
})
|
||
}), r)
|
||
}, AS.prototype.once = function (t, e, i) {
|
||
return this.bindEvent(t, e, 1, i)
|
||
}, AS.prototype.action = function (t, e) {
|
||
AS.hasOwnKey(this.Events, t) && this.eachEvent(this.Events[t], function (i, r) {
|
||
r[0].apply(r[2], e), r[1] && delete this.Events[t][i]
|
||
})
|
||
}, AS.prototype.dispatch = function (t) {
|
||
var e = this, i = AS.slice(arguments, 1);
|
||
setTimeout(function () {
|
||
e.action(t, i)
|
||
})
|
||
}, AS.prototype.dispatchSync = function (t) {
|
||
this.action(t, AS.slice(arguments, 1))
|
||
}, AS.prototype.clear = function () {
|
||
this.Events = {}
|
||
}, AS.prototype.bindEvent = function (t, e, i, r) {
|
||
if ("string" != typeof t || "function" != typeof e) throw new Error("传入的事件名称和回调函数有误!");
|
||
return AS.hasOwnKey(this.Events, t) || (this.Events[t] = {}), this.Events[t][++this.__cnt] = [e, i, r], [t, this.__cnt]
|
||
}, AS.prototype.eachEvent = function (t, e) {
|
||
for (var i in t) AS.hasOwnKey(t, i) && e(i, t[i])
|
||
};
|
||
var kS = AS;
|
||
const FS = 100, NS = Math.PI / 2, DS = (Math.PI, "ol-plot-vector-layer"), GS = "plot-helper-control-point-div",
|
||
jS = "plot-helper-hidden-div", zS = {
|
||
borderRadius: "2px",
|
||
fontSize: "12px",
|
||
outline: 0,
|
||
overflow: "hidden",
|
||
boxSizing: "border-box",
|
||
border: "1px solid #eeeeee",
|
||
fontFamily: "Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Noto Sans CJK SC,WenQuanYi Micro Hei,Arial,sans-serif",
|
||
color: "#010500",
|
||
fontWeight: 400,
|
||
padding: "3px",
|
||
fontStretch: "normal",
|
||
lineHeight: "normal",
|
||
textAlign: "left",
|
||
marginLeft: "auto",
|
||
marginRight: "auto",
|
||
width: "auto",
|
||
height: "auto",
|
||
background: "rgb(255, 255, 255)",
|
||
fontStyle: "",
|
||
fontVariant: ""
|
||
}, US = (t, e) => Math.sqrt(Math.pow(t[0] - e[0], 2) + Math.pow(t[1] - e[1], 2)), BS = t => {
|
||
let e = 0;
|
||
return t && Array.isArray(t) && t.length > 0 && t.forEach((i, r) => {
|
||
r < t.length - 1 && (e += US(i, t[r + 1]))
|
||
}), e
|
||
}, VS = t => Math.pow(BS(t), .99), YS = (t, e) => [(t[0] + e[0]) / 2, (t[1] + e[1]) / 2], WS = (t, e, i) => {
|
||
let r = [(t[0] + e[0]) / 2, (t[1] + e[1]) / 2], o = [r[0] - t[1] + e[1], r[1] + t[0] - e[0]],
|
||
n = [(t[0] + i[0]) / 2, (t[1] + i[1]) / 2], s = [n[0] - t[1] + i[1], n[1] + t[0] - i[0]];
|
||
return HS(r, o, n, s)
|
||
}, HS = (t, e, i, r) => {
|
||
if (t[1] === e[1]) {
|
||
return [(r[0] - i[0]) / (r[1] - i[1]) * (t[1] - i[1]) + i[0], t[1]]
|
||
}
|
||
if (i[1] === r[1]) {
|
||
return [(e[0] - t[0]) / (e[1] - t[1]) * (i[1] - t[1]) + t[0], i[1]]
|
||
}
|
||
let o = (e[0] - t[0]) / (e[1] - t[1]), n = (r[0] - i[0]) / (r[1] - i[1]),
|
||
s = (o * t[1] - t[0] - n * i[1] + i[0]) / (o - n);
|
||
return [o * s - o * t[1] + t[0], s]
|
||
}, XS = (t, e) => {
|
||
let i, r = Math.asin(Math.abs(e[1] - t[1]) / US(t, e));
|
||
return e[1] >= t[1] && e[0] >= t[0] ? i = r + Math.PI : e[1] >= t[1] && e[0] < t[0] ? i = 2 * Math.PI - r : e[1] < t[1] && e[0] < t[0] ? i = r : e[1] < t[1] && e[0] >= t[0] && (i = Math.PI - r), i
|
||
}, qS = (t, e, i) => {
|
||
let r = XS(e, t) - XS(e, i);
|
||
return r < 0 ? r + 2 * Math.PI : r
|
||
}, ZS = (t, e, i) => (i[1] - t[1]) * (e[0] - t[0]) > (e[1] - t[1]) * (i[0] - t[0]), KS = (t, e, i, r, o) => {
|
||
t = Math.max(Math.min(t, 1), 0);
|
||
let [n, s] = [1 - t, t * t], a = s * t, l = n * n, h = l * n;
|
||
return [h * e[0] + 3 * l * t * i[0] + 3 * n * s * r[0] + a * o[0], h * e[1] + 3 * l * t * i[1] + 3 * n * s * r[1] + a * o[1]]
|
||
}, JS = (t, e, i, r, o) => {
|
||
let n = XS(t, e), s = o ? n + i : n - i, a = r * Math.cos(s), l = r * Math.sin(s);
|
||
return [e[0] + a, e[1] + l]
|
||
}, $S = (t, e, i, r) => {
|
||
let [o, n, s, a] = [null, null, [], r - i];
|
||
a = a < 0 ? a + 2 * Math.PI : a;
|
||
for (let r = 0; r <= 100; r++) {
|
||
let l = i + a * r / 100;
|
||
o = t[0] + e * Math.cos(l), n = t[1] + e * Math.sin(l), s.push([o, n])
|
||
}
|
||
return s
|
||
}, QS = (t, e, i, r) => {
|
||
let o = tE(e, i, r), [n, s, a, l, h] = [null, null, null, null, null],
|
||
u = Math.sqrt(o[0] * o[0] + o[1] * o[1]), c = o[0] / u, p = o[1] / u, d = US(e, i), f = US(i, r);
|
||
return u > 1e-4 ? ZS(e, i, r) ? (a = t * d, n = [l = i[0] - a * p, h = i[1] + a * c], a = t * f, s = [l = i[0] + a * p, h = i[1] - a * c]) : (a = t * d, n = [l = i[0] + a * p, h = i[1] - a * c], a = t * f, s = [l = i[0] - a * p, h = i[1] + a * c]) : (n = [l = i[0] + t * (e[0] - i[0]), h = i[1] + t * (e[1] - i[1])], s = [l = i[0] + t * (r[0] - i[0]), h = i[1] + t * (r[1] - i[1])]), [n, s]
|
||
}, tE = (t, e, i) => {
|
||
let r = t[0] - e[0], o = t[1] - e[1], n = Math.sqrt(r * r + o * o);
|
||
r /= n, o /= n;
|
||
let s = i[0] - e[0], a = i[1] - e[1], l = Math.sqrt(s * s + a * a);
|
||
return [r + (s /= l), o + (a /= l)]
|
||
}, eE = (t, e) => {
|
||
let i = ((t, e) => {
|
||
let [i, r, o, n, s] = [t[0], t[1], t[2], null, null], a = QS(0, i, r, o)[0], l = tE(i, r, o);
|
||
if (Math.sqrt(l[0] * l[0] + l[1] * l[1]) > 1e-4) {
|
||
let t = YS(i, r), e = i[0] - t[0], o = i[1] - t[1], l = 2 / US(i, r), h = -l * o, u = l * e,
|
||
c = h * h - u * u, p = 2 * h * u, d = u * u - h * h, f = a[0] - t[0], g = a[1] - t[1];
|
||
n = t[0] + c * f + p * g, s = t[1] + p * f + d * g
|
||
} else n = i[0] + e * (r[0] - i[0]), s = i[1] + e * (r[1] - i[1]);
|
||
return [n, s]
|
||
})(e, t), [r, o, n, s, a] = [null, null, null, [i], []];
|
||
for (let i = 0; i < e.length - 2; i++) {
|
||
[r, o, n] = [e[i], e[i + 1], e[i + 2]];
|
||
let a = QS(t, r, o, n);
|
||
s = s.concat(a)
|
||
}
|
||
let l = ((t, e) => {
|
||
let i = t.length, r = t[i - 3], o = t[i - 2], n = t[i - 1], s = QS(0, r, o, n)[1], a = tE(r, o, n),
|
||
l = Math.sqrt(a[0] * a[0] + a[1] * a[1]), [h, u] = [null, null];
|
||
if (l > 1e-4) {
|
||
let t = YS(o, n), e = n[0] - t[0], i = n[1] - t[1], r = 2 / US(o, n), a = -r * i, l = r * e,
|
||
c = a * a - l * l, p = 2 * a * l, d = l * l - a * a, f = s[0] - t[0], g = s[1] - t[1];
|
||
h = t[0] + c * f + p * g, u = t[1] + p * f + d * g
|
||
} else h = n[0] + e * (o[0] - n[0]), u = n[1] + e * (o[1] - n[1]);
|
||
return [h, u]
|
||
})(e, t);
|
||
l && s.push(l);
|
||
for (let t = 0; t < e.length - 1; t++) {
|
||
r = e[t], o = e[t + 1], a.push(r);
|
||
for (let e = 0; e < FS; e++) {
|
||
let i = KS(e / FS, r, s[2 * t], s[2 * t + 1], o);
|
||
a.push(i)
|
||
}
|
||
a.push(o)
|
||
}
|
||
return a
|
||
}, iE = function (t) {
|
||
if (t.length <= 2) return t;
|
||
{
|
||
let e = [], i = t.length - 1;
|
||
for (let r = 0; r <= 1; r += .01) {
|
||
let [o, n] = [0, 0];
|
||
for (let e = 0; e <= i; e++) {
|
||
let s = oE(i, e), a = Math.pow(r, e), l = Math.pow(1 - r, i - e);
|
||
o += s * a * l * t[e][0], n += s * a * l * t[e][1]
|
||
}
|
||
e.push([o, n])
|
||
}
|
||
return e.push(t[i]), e
|
||
}
|
||
}, rE = t => {
|
||
let e = 1;
|
||
switch (t) {
|
||
case t <= 1:
|
||
e = 1;
|
||
break;
|
||
case 2 === t:
|
||
e = 2;
|
||
break;
|
||
case 3 === t:
|
||
e = 6;
|
||
break;
|
||
case 24 === t:
|
||
e = 24;
|
||
break;
|
||
case 5 === t:
|
||
e = 120;
|
||
break;
|
||
default:
|
||
for (let i = 1; i <= t; i++) e *= i
|
||
}
|
||
return e
|
||
}, oE = (t, e) => rE(t) / (rE(e) * rE(t - e)), nE = t => {
|
||
if (t.length <= 2) return t;
|
||
{
|
||
let [e, i] = [2, []], r = t.length - e - 1;
|
||
i.push(t[0]);
|
||
for (let o = 0; o <= r; o++) for (let r = 0; r <= 1; r += .05) {
|
||
let [n, s] = [0, 0];
|
||
for (let i = 0; i <= e; i++) {
|
||
let e = sE(i, r);
|
||
n += e * t[o + i][0], s += e * t[o + i][1]
|
||
}
|
||
i.push([n, s])
|
||
}
|
||
return i.push(t[t.length - 1]), i
|
||
}
|
||
}, sE = (t, e) => {
|
||
let i = 0;
|
||
return 0 === t ? i = Math.pow(e - 1, 2) / 2 : 1 === t ? i = (-2 * Math.pow(e, 2) + 2 * e + 1) / 2 : 2 === t && (i = Math.pow(e, 2) / 2), i
|
||
}, aE = () => {
|
||
let [t, e] = [[], "0123456789abcdef"];
|
||
for (let i = 0; i < 36; i++) t[i] = e.substr(Math.floor(16 * Math.random()), 1);
|
||
return t[14] = "4", t[19] = e.substr(3 & t[19] | 8, 1), t[8] = t[13] = t[18] = t[23] = "-", t.join("")
|
||
}, lE = t => {
|
||
const e = typeof t;
|
||
return null !== t && ("object" === e || "function" === e)
|
||
}, hE = (t, e) => {
|
||
for (const i in e) lE(e[i]) && lE(t[i]) ? hE(t[i], e[i]) : t[i] = e[i];
|
||
return t
|
||
};
|
||
|
||
function uE(t, e) {
|
||
t.forEach(t => {
|
||
e[t] && (e[t] = e[t].bind(e))
|
||
})
|
||
}
|
||
|
||
const cE = function (t, e) {
|
||
try {
|
||
let i = null;
|
||
if (t) {
|
||
let r = t.getLayers().getArray();
|
||
i = pE(r, "layerName", e)
|
||
}
|
||
return i
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}, pE = function (t, e, i) {
|
||
let r = null;
|
||
return t.length > 0 && t.every(t => {
|
||
if (t instanceof cs) {
|
||
let o = t.getLayers().getArray();
|
||
return !(r = pE(o, e, i))
|
||
}
|
||
return t.get(e) !== i || (r = t, !1)
|
||
}), r
|
||
}, dE = function (t, e, i) {
|
||
try {
|
||
if (t) {
|
||
let r = cE(t, e);
|
||
if (r instanceof v_ || (r = null), r || i && i.create && (r = new v_({
|
||
layerName: e,
|
||
params: i,
|
||
layerType: "vector",
|
||
source: new b_({wrapX: !1}),
|
||
style: new uf({
|
||
fill: new po({color: "rgba(67, 110, 238, 0.4)"}),
|
||
stroke: new go({color: "#4781d9", width: 2}),
|
||
image: new Zd({radius: 7, fill: new po({color: "#ffcc33"})})
|
||
})
|
||
})), t && r) {
|
||
i && i.hasOwnProperty("selectable") && r.set("selectable", i.selectable);
|
||
let o = cE(t, e);
|
||
o && o instanceof v_ || t.addLayer(r, !0)
|
||
}
|
||
return r
|
||
}
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
};
|
||
var fE = i(6), gE = i.n(fE);
|
||
const mE = /([\:\-\_]+(.))/g, yE = /^moz([A-Z])/, vE = function (t, e, i, r) {
|
||
let o = document.createElement(t);
|
||
return o.className = e || "", r && (o.id = r), i && i.appendChild(o), o
|
||
}, _E = function (t) {
|
||
return "string" == typeof t ? document.getElementById(t) : t
|
||
}, xE = function (t) {
|
||
let e = t.parentNode;
|
||
e && e.removeChild(t)
|
||
}, wE = function (t, e, i) {
|
||
let r = document.createElement(t);
|
||
return r.style.display = "none", i && (r.id = i), e && e.appendChild(r), r
|
||
}, bE = function (t) {
|
||
return t.replace(mE, function (t, e, i, r) {
|
||
return r ? i.toUpperCase() : i
|
||
}).replace(yE, "Moz$1")
|
||
}, CE = function () {
|
||
if (document.addEventListener) return function (t, e, i) {
|
||
t && e && i && t.addEventListener(e, i, !1)
|
||
}
|
||
}(), SE = function () {
|
||
if (document.removeEventListener) return function (t, e, i) {
|
||
t && e && t.removeEventListener(e, i, !1)
|
||
}
|
||
}();
|
||
|
||
function EE(t, e) {
|
||
if (!t || !e) return !1;
|
||
if (-1 !== e.indexOf(" ")) throw new Error("className should not contain space.");
|
||
return t.classList ? t.classList.contains(e) : (" " + t.className + " ").indexOf(" " + e + " ") > -1
|
||
}
|
||
|
||
function TE(t, e) {
|
||
if (!t || !e) return null;
|
||
"float" === (e = bE(e)) && (e = "cssFloat");
|
||
try {
|
||
const i = document.defaultView.getComputedStyle(t, "");
|
||
return t.style[e] || i ? i[e] : null
|
||
} catch (i) {
|
||
return t.style[e]
|
||
}
|
||
}
|
||
|
||
function RE(t, e, i) {
|
||
if (t && e) if ("object" == typeof e) for (var r in e) e.hasOwnProperty(r) && RE(t, r, e[r]); else "opacity" === (e = bE(e)) ? t.style.filter = isNaN(i) ? "" : "alpha(opacity=" + 100 * i + ")" : t.style[e] = i
|
||
}
|
||
|
||
var PE = class extends sh {
|
||
constructor(t = {}) {
|
||
const [e, i, r, o, n, s, a, l, h, u] = [t.id, t.element, t.offset, t.stopEvent, t.positioning, t.insertFirst, t.autoPan, t.autoPanAnimation, t.autoPanMargin, t.className ? t.className : "ol-plot-text-editor"];
|
||
super({
|
||
id: e,
|
||
element: i,
|
||
stopEvent: o,
|
||
insertFirst: s,
|
||
autoPan: a,
|
||
autoPanAnimation: l,
|
||
autoPanMargin: h,
|
||
className: u
|
||
}), this.setOffset(void 0 !== r ? r : [0, 0]), this.setPositioning(void 0 !== n ? n : "center-center"), this.mapDragPan = void 0, this.isClick_ = !1, this.dragging_ = !1, this.isFocus_ = !1, this.options_ = t, this._position = t.position && t.position.length > 0 ? t.position : [], this.handleTimer_ = null, this.currentPixel_ = [], uE(["handleFocus_", "handleBlur_", "handleClick_", "handleDragStart_", "handleDragEnd_", "handleDragDrag_", "closeCurrentPlotText", "handleResizeMouseDown_", "handleResizeMouseMove_", "handleResizeMouseUp_", "resizeButtonMoveHandler_"], this), this.createTextContent(t)
|
||
}
|
||
|
||
createTextContent(t) {
|
||
const e = t.className || "ol-plot-text-editor", i = document.createElement("textarea");
|
||
i.className = e, i.style.width = t.width + "px", i.style.height = t.height + "px", i.style.minHeight = t.minHeight + "px", i.setAttribute("id", t.id), i.setAttribute("autofocus", !0), gE()(i), CE(i, "focus", this.handleFocus_), CE(i, "blur", this.handleBlur_), CE(i, "click", this.handleClick_), CE(i, "mousedown", this.handleDragStart_), CE(window, "mouseup", this.handleDragEnd_), this.set("isPlotText", !0), this.setElement(i), this.createCloseButton(t), this.createResizeButton(t), this.setPosition(this._position), this.dispatchEvent("textBoxDrawEnd", {
|
||
overlay: this,
|
||
element: i,
|
||
uuid: t.id
|
||
})
|
||
}
|
||
|
||
getTextAreaFromContent_() {
|
||
let t = "";
|
||
const e = Array.prototype.slice.call(this.element && this.element.children, 0);
|
||
return e.length > 0 && e.every(e => 1 !== e.nodeType || "textarea" !== e.nodeName.toLowerCase() || (t = e, !1)), t
|
||
}
|
||
|
||
createCloseButton(t) {
|
||
const e = document.createElement("span");
|
||
e.className = "ol-plot-text-editor-close", e.setAttribute("data-id", t.id), SE(e, "click", this.closeCurrentPlotText), CE(e, "click", this.closeCurrentPlotText), this.element.appendChild(e)
|
||
}
|
||
|
||
createResizeButton(t) {
|
||
const e = document.createElement("span");
|
||
e.className = "ol-plot-text-editor-resize", e.setAttribute("data-id", t.id), SE(e, "mousedown", this.handleResizeMouseDown_), SE(e, "mousemove", this.handleResizeMouseMove_), CE(e, "mousedown", this.handleResizeMouseDown_), CE(e, "mousemove", this.handleResizeMouseMove_), this.element.appendChild(e)
|
||
}
|
||
|
||
resizeButtonMoveHandler_(t) {
|
||
const e = t.pixel, i = this.getTextAreaFromContent_();
|
||
if (e.length < 1 || this.currentPixel_.length < 1 || !i) return;
|
||
const r = [e[0] - this.currentPixel_[0], e[1] - this.currentPixel_[1]],
|
||
o = [i.offsetWidth, i.offsetHeight], n = o[1] + 2 * r[1];
|
||
RE(i, "width", o[0] + 2 * r[0] + "px"), RE(i, "height", n + "px"), this.currentPixel_ = e, this.getMap().render()
|
||
}
|
||
|
||
handleResizeMouseMove_(t) {
|
||
t.stopImmediatePropagation()
|
||
}
|
||
|
||
handleResizeMouseDown_(t) {
|
||
this.getMap() && (this.currentPixel_ = [t.x, t.y], this.getMap().on("pointermove", this.resizeButtonMoveHandler_), CE(this.getMap().getViewport(), "mouseup", this.handleResizeMouseUp_))
|
||
}
|
||
|
||
handleResizeMouseUp_(t) {
|
||
this.getMap() && (this.getMap().un("pointermove", this.resizeButtonMoveHandler_), SE(this.getMap().getViewport(), "mouseup", this.handleResizeMouseUp_), this.currentPixel_ = [])
|
||
}
|
||
|
||
closeCurrentPlotText(t) {
|
||
if (this.getMap() && t && EE(t.target, "ol-plot-text-editor-close")) {
|
||
let e = t.target.getAttribute("data-id");
|
||
if (e) {
|
||
const t = this.getMap().getOverlayById(e);
|
||
t && this.getMap().removeOverlay(t)
|
||
}
|
||
}
|
||
}
|
||
|
||
handleFocus_() {
|
||
this.isFocus_ = !0, this.getMap() && (this.getMap().set("activeTextArea", this), this.getMap().dispatchEvent("activeTextArea"))
|
||
}
|
||
|
||
handleBlur_() {
|
||
this.isFocus_ = !1, this.getMap() && (this.getMap().set("activeTextArea", null), this.getMap().set("disActiveTextArea", this), this.getMap().dispatchEvent("disActiveTextArea"))
|
||
}
|
||
|
||
handleDragStart_(t) {
|
||
this.getMap() && !this.dragging_ && this.isMoveModel() && this.isFocus_ && (this.handleTimer_ = window.setTimeout(() => {
|
||
window.clearTimeout(this.handleTimer_), this.handleTimer_ = null, this.isClick_ || (this.dragging_ = !0, this.disableMapDragPan(), this.preCursor_ = this.element.style.cursor, CE(this.getMap().getViewport(), "mousemove", this.handleDragDrag_), CE(this.element, "mouseup", this.handleDragEnd_))
|
||
}, 300))
|
||
}
|
||
|
||
handleDragDrag_(t) {
|
||
this.dragging_ && (this.element.style.cursor = "move", this._position = this.getMap().getCoordinateFromPixel([t.clientX, t.clientY]), this.setPosition(this._position))
|
||
}
|
||
|
||
handleDragEnd_(t) {
|
||
this.isClick_ = !1, window.clearTimeout(this.handleTimer_), this.handleTimer_ = null, this.dragging_ && this.isFocus_ && (this.dragging_ = !1, this.enableMapDragPan(), this.element.style.cursor = this.preCursor_, SE(this.getMap().getViewport(), "mousemove", this.handleDragDrag_), SE(this.element, "mouseup", this.handleDragEnd_))
|
||
}
|
||
|
||
handleClick_(t) {
|
||
t.target === this.element ? this.isClick_ = !0 : this.isClick_ = !1
|
||
}
|
||
|
||
isMoveModel() {
|
||
return window.getSelection().getRangeAt(0).collapsed
|
||
}
|
||
|
||
setStyle(t = {}) {
|
||
const e = this.getTextAreaFromContent_();
|
||
if (e) for (let i in t) t[i] && RE(e, i, t[i])
|
||
}
|
||
|
||
getStyle() {
|
||
const t = {}, e = this.getTextAreaFromContent_();
|
||
if (e) for (let i in zS) t[i] = TE(e, i);
|
||
return t
|
||
}
|
||
|
||
setValue(t) {
|
||
const e = this.getTextAreaFromContent_();
|
||
e && (e.value = t, t && gE.a.update(e), this.getMap().render())
|
||
}
|
||
|
||
getValue() {
|
||
const t = this.getTextAreaFromContent_();
|
||
return t ? t.value : ""
|
||
}
|
||
|
||
getWidth() {
|
||
const t = this.getTextAreaFromContent_();
|
||
return t && t.offsetWidth ? t.offsetWidth : 0
|
||
}
|
||
|
||
getHeight() {
|
||
const t = this.getTextAreaFromContent_();
|
||
return t && t.offsetHeight ? t.offsetHeight : 0
|
||
}
|
||
|
||
enableMapDragPan() {
|
||
const t = this.getMap();
|
||
t && this.mapDragPan && this.mapDragPan instanceof oa && (t.addInteraction(this.mapDragPan), delete this.mapDragPan)
|
||
}
|
||
|
||
disableMapDragPan() {
|
||
const t = this.getMap();
|
||
t && t.getInteractions().getArray().every(e => !(e instanceof oa && (this.mapDragPan = e, t.removeInteraction(e), 1)))
|
||
}
|
||
|
||
setMap(t) {
|
||
super.setMap(t), t && t instanceof rh && (this.setStyle(hE(zS, this.options_.style)), this.setValue(this.options_.value))
|
||
}
|
||
};
|
||
const LE = "TextArea", IE = "Arc", OE = "Curve", ME = "GatheringPlace", AE = "Polyline", kE = "FreeHandLine",
|
||
FE = "Point", NE = "Pennant", DE = "RectAngle", GE = "Circle", jE = "Ellipse", zE = "Lune", UE = "Sector",
|
||
BE = "ClosedCurve", VE = "Polygon", YE = "FreePolygon", WE = "AttackArrow", HE = "DoubleArrow",
|
||
XE = "StraightArrow", qE = "FineArrow", ZE = "AssaultDirection", KE = "TailedAttackArrow",
|
||
JE = "SquadCombat", $E = "TailedSquadCombat", QE = "RectFlag", tT = "TriangleFlag", eT = "CurveFlag";
|
||
var iT = class extends qi {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = FE, this.options = i || {}, this.set("params", this.options), this.fixPointCount = 1, e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
let t = this.points[0];
|
||
this.setCoordinates(t)
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var rT = class extends qi {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = NE, this.options = i || {}, this.set("params", this.options), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
this.setCoordinates(this.points)
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var oT = class extends Jr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = AE, this.freehand = !1, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
this.setCoordinates(this.points)
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var nT = class extends Jr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = IE, this.fixPointCount = 3, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
let t = this.getPointCount();
|
||
if (!(t < 2)) if (2 === t) this.setCoordinates(this.points); else {
|
||
let [t, e, i, r, o] = [this.points[0], this.points[1], this.points[2], null, null], n = WS(t, e, i),
|
||
s = US(t, n), a = XS(t, n), l = XS(e, n);
|
||
ZS(t, e, i) ? (r = l, o = a) : (r = a, o = l), this.setCoordinates($S(n, s, r, o))
|
||
}
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var sT = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = GE, this.fixPointCount = 2, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
if (this.getPointCount() < 2) return !1;
|
||
{
|
||
let t = this.points[0], e = US(t, this.points[1]);
|
||
this.setCoordinates([this.generatePoints(t, e)])
|
||
}
|
||
}
|
||
|
||
generatePoints(t, e) {
|
||
let [i, r, o, n] = [null, null, null, []];
|
||
for (let s = 0; s <= 100; s++) o = 2 * Math.PI * s / 100, i = t[0] + e * Math.cos(o), r = t[1] + e * Math.sin(o), n.push([i, r]);
|
||
return n
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var aT = class extends Jr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = OE, this.t = .3, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
let t = this.getPointCount();
|
||
if (t < 2) return !1;
|
||
if (2 === t) this.setCoordinates(this.points); else {
|
||
let t = eE(this.t, this.points);
|
||
this.setCoordinates(t)
|
||
}
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var lT = class extends Jr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = kE, this.freehand = !0, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
this.setCoordinates(this.points)
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var hT = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = DE, this.fixPointCount = 2, this.set("params", i), this.isFill = !1 !== i.isFill || i.isFill, e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
if (2 === this.points.length) {
|
||
let t = [];
|
||
if (this.isFill) t = mr(lt(this.points)).getCoordinates(); else {
|
||
let e = this.points[0], i = this.points[1];
|
||
t = [e, [e[0], i[1]], i, [i[0], e[1]], e]
|
||
}
|
||
this.setCoordinates(t)
|
||
}
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var uT = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = jE, this.fixPointCount = 2, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
if (this.getPointCount() < 2) return !1;
|
||
{
|
||
let [t, e] = [this.points[0], this.points[1]], i = YS(t, e), r = Math.abs((t[0] - e[0]) / 2),
|
||
o = Math.abs((t[1] - e[1]) / 2), n = this.generatePoints(i, r, o);
|
||
this.setCoordinates([n])
|
||
}
|
||
}
|
||
|
||
generatePoints(t, e, i) {
|
||
let [r, o, n, s] = [null, null, null, []];
|
||
for (let a = 0; a <= FS; a++) n = 2 * Math.PI * a / FS, r = t[0] + e * Math.cos(n), o = t[1] + i * Math.sin(n), s.push([r, o]);
|
||
return s
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var cT = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = zE, this.fixPointCount = 3, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
if (this.getPointCount() < 2) return !1;
|
||
{
|
||
let t = this.getPoints();
|
||
if (2 === this.getPointCount()) {
|
||
let e = YS(t[0], t[1]), i = US(t[0], e), r = JS(t[0], e, NS, i);
|
||
t.push(r)
|
||
}
|
||
let [e, i, r, o, n] = [t[0], t[1], t[2], void 0, void 0], s = WS(e, i, r), a = US(e, s),
|
||
l = XS(e, s), h = XS(i, s);
|
||
ZS(e, i, r) ? (o = h, n = l) : (o = l, n = h), (t = $S(s, a, o, n)).push(t[0]), this.setCoordinates([t])
|
||
}
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var pT = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = UE, this.fixPointCount = 3, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
let t = this.getPointCount();
|
||
if (t < 2) return !1;
|
||
if (2 === t) this.setCoordinates([this.points]); else {
|
||
let t = this.getPoints(), [e, i, r] = [t[0], t[1], t[2]], o = US(i, e), n = XS(i, e), s = XS(r, e),
|
||
a = $S(e, o, n, s);
|
||
a.push(e, a[0]), this.setCoordinates([a])
|
||
}
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var dT = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = BE, this.t = .3, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
let t = this.getPointCount();
|
||
if (t < 2) return !1;
|
||
if (2 === t) this.setCoordinates([this.points]); else {
|
||
let t = this.getPoints();
|
||
t.push(t[0], t[1]);
|
||
let [e, i] = [[], []];
|
||
for (let i = 0; i < t.length - 2; i++) {
|
||
let r = QS(this.t, t[i], t[i + 1], t[i + 2]);
|
||
e = e.concat(r)
|
||
}
|
||
let r = e.length;
|
||
e = [e[r - 1]].concat(e.slice(0, r - 1));
|
||
for (let r = 0; r < t.length - 2; r++) {
|
||
let o = t[r], n = t[r + 1];
|
||
i.push(o);
|
||
for (let t = 0; t <= FS; t++) {
|
||
let s = KS(t / FS, o, e[2 * r], e[2 * r + 1], n);
|
||
i.push(s)
|
||
}
|
||
i.push(n)
|
||
}
|
||
this.setCoordinates([i])
|
||
}
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var fT = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = VE, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
if (this.getPointCount() < 2) return !1;
|
||
this.setCoordinates([this.points])
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var gT = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = YE, this.freehand = !0, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
this.setCoordinates([this.points])
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var mT = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = WE, this.headHeightFactor = .18, this.headWidthFactor = .3, this.neckHeightFactor = .85, this.neckWidthFactor = .15, this.headTailFactor = .8, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
try {
|
||
let t = this.getPointCount();
|
||
if (t < 2) return !1;
|
||
if (2 === t) this.setCoordinates([this.points]); else {
|
||
let t = this.getPoints(), [e, i] = [t[0], t[1]];
|
||
ZS(t[0], t[1], t[2]) && (e = t[1], i = t[0]);
|
||
let r = [YS(e, i)].concat(t.slice(2)),
|
||
o = this.getArrowHeadPoints(r, e, i), [n, s] = [o[0], o[4]], a = US(e, i) / VS(r),
|
||
l = this.getArrowBodyPoints(r, n, s, a), h = l.length, u = [e].concat(l.slice(0, h / 2));
|
||
u.push(n);
|
||
let c = [i].concat(l.slice(h / 2, h));
|
||
c.push(s), u = nE(u), c = nE(c), this.setCoordinates([u.concat(o, c.reverse())])
|
||
}
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}
|
||
|
||
getArrowPoints(t, e, i, r) {
|
||
let o = YS(t, e), n = US(o, i), s = JS(i, o, 0, .3 * n, !0), a = JS(i, o, 0, .5 * n, !0),
|
||
l = [o, s = JS(o, s, NS, n / 5, r), a = JS(o, a, NS, n / 4, r), i], h = this.getArrowHeadPoints(l);
|
||
if (!(h && Array.isArray(h) && h.length > 0)) throw new Error("插值出错");
|
||
{
|
||
let [i, r] = [h[0], h[4]], o = US(t, e) / VS(l) / 2, n = this.getArrowBodyPoints(l, i, r, o);
|
||
if (n) {
|
||
let o = n.length, s = n.slice(0, o / 2), a = n.slice(o / 2, o);
|
||
return s.push(i), a.push(r), (s = s.reverse()).push(e), (a = a.reverse()).push(t), s.reverse().concat(h, a)
|
||
}
|
||
}
|
||
}
|
||
|
||
getArrowHeadPoints(t, e, i) {
|
||
try {
|
||
let r = VS(t), o = r * this.headHeightFactor, n = t[t.length - 1];
|
||
r = US(n, t[t.length - 2]);
|
||
let s = US(e, i);
|
||
o > s * this.headTailFactor && (o = s * this.headTailFactor);
|
||
let a = o * this.headWidthFactor, l = o * this.neckWidthFactor,
|
||
h = (o = o > r ? r : o) * this.neckHeightFactor, u = JS(t[t.length - 2], n, 0, o, !0),
|
||
c = JS(t[t.length - 2], n, 0, h, !0), p = JS(n, u, NS, a, !1), d = JS(n, u, NS, a, !0);
|
||
return [JS(n, c, NS, l, !1), p, n, d, JS(n, c, NS, l, !0)]
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}
|
||
|
||
getArrowBodyPoints(t, e, i, r) {
|
||
let o = BS(t), n = VS(t) * r, s = (n - US(e, i)) / 2, [a, l, h] = [0, [], []];
|
||
for (let e = 1; e < t.length - 1; e++) {
|
||
let i = qS(t[e - 1], t[e], t[e + 1]) / 2,
|
||
r = (n / 2 - (a += US(t[e - 1], t[e])) / o * s) / Math.sin(i),
|
||
u = JS(t[e - 1], t[e], Math.PI - i, r, !0), c = JS(t[e - 1], t[e], i, r, !1);
|
||
l.push(u), h.push(c)
|
||
}
|
||
return l.concat(h)
|
||
}
|
||
|
||
getTempPoint4(t, e, i) {
|
||
try {
|
||
let r = YS(t, e), o = US(r, i), n = qS(t, r, i), [s, a, l, h] = [void 0, void 0, void 0, void 0];
|
||
return n < NS ? (a = o * Math.sin(n), l = o * Math.cos(n), h = JS(t, r, NS, a, !1), s = JS(r, h, NS, l, !0)) : n >= NS && n < Math.PI ? (a = o * Math.sin(Math.PI - n), l = o * Math.cos(Math.PI - n), h = JS(t, r, NS, a, !1), s = JS(r, h, NS, l, !1)) : n >= Math.PI && n < 1.5 * Math.PI ? (a = o * Math.sin(n - Math.PI), l = o * Math.cos(n - Math.PI), h = JS(t, r, NS, a, !0), s = JS(r, h, NS, l, !0)) : (a = o * Math.sin(2 * Math.PI - n), l = o * Math.cos(2 * Math.PI - n), h = JS(t, r, NS, a, !0), s = JS(r, h, NS, l, !1)), s
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var yT = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = HE, this.headHeightFactor = .25, this.headWidthFactor = .3, this.neckHeightFactor = .85, this.neckWidthFactor = .15, this.connPoint = null, this.tempPoint4 = null, this.fixPointCount = 4, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
try {
|
||
let t = this.getPointCount();
|
||
if (t < 2) return !1;
|
||
if (2 === t) return this.setCoordinates([this.points]), !1;
|
||
if (t > 2) {
|
||
let [e, i, r] = [this.points[0], this.points[1], this.points[2]];
|
||
3 === t ? (this.tempPoint4 = this.getTempPoint4(e, i, r), this.connPoint = YS(e, i)) : 4 === t ? (this.tempPoint4 = this.points[3], this.connPoint = YS(e, i)) : (this.tempPoint4 = this.points[3], this.connPoint = this.points[4]);
|
||
let [o, n] = [void 0, void 0];
|
||
ZS(e, i, r) ? (o = this.getArrowPoints(e, this.connPoint, this.tempPoint4, !1), n = this.getArrowPoints(this.connPoint, i, r, !0)) : (o = this.getArrowPoints(i, this.connPoint, r, !1), n = this.getArrowPoints(this.connPoint, e, this.tempPoint4, !0));
|
||
let s = o.length, a = (s - 5) / 2, l = o.slice(0, a), h = o.slice(a, a + 5),
|
||
u = o.slice(a + 5, s), c = n.slice(0, a), p = n.slice(a, a + 5), d = n.slice(a + 5, s);
|
||
c = iE(c);
|
||
let f = iE(d.concat(l.slice(1)));
|
||
u = iE(u);
|
||
let g = c.concat(p, f, h, u);
|
||
this.setCoordinates([g])
|
||
}
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}
|
||
|
||
getArrowPoints(t, e, i, r) {
|
||
let o = YS(t, e), n = US(o, i), s = JS(i, o, 0, .3 * n, !0), a = JS(i, o, 0, .5 * n, !0),
|
||
l = [o, s = JS(o, s, NS, n / 5, r), a = JS(o, a, NS, n / 4, r), i], h = this.getArrowHeadPoints(l);
|
||
if (!(h && Array.isArray(h) && h.length > 0)) throw new Error("插值出错");
|
||
{
|
||
let [i, r] = [h[0], h[4]], o = US(t, e) / VS(l) / 2, n = this.getArrowBodyPoints(l, i, r, o);
|
||
if (n) {
|
||
let o = n.length, s = n.slice(0, o / 2), a = n.slice(o / 2, o);
|
||
return s.push(i), a.push(r), (s = s.reverse()).push(e), (a = a.reverse()).push(t), s.reverse().concat(h, a)
|
||
}
|
||
}
|
||
}
|
||
|
||
getArrowHeadPoints(t) {
|
||
try {
|
||
let e = VS(t) * this.headHeightFactor, i = t[t.length - 1], r = e * this.headWidthFactor,
|
||
o = e * this.neckWidthFactor, n = e * this.neckHeightFactor,
|
||
s = JS(t[t.length - 2], i, 0, e, !0), a = JS(t[t.length - 2], i, 0, n, !0),
|
||
l = JS(i, s, NS, r, !1), h = JS(i, s, NS, r, !0);
|
||
return [JS(i, a, NS, o, !1), l, i, h, JS(i, a, NS, o, !0)]
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}
|
||
|
||
getArrowBodyPoints(t, e, i, r) {
|
||
let o = BS(t), n = VS(t) * r, s = (n - US(e, i)) / 2, [a, l, h] = [0, [], []];
|
||
for (let e = 1; e < t.length - 1; e++) {
|
||
let i = qS(t[e - 1], t[e], t[e + 1]) / 2,
|
||
r = (n / 2 - (a += US(t[e - 1], t[e])) / o * s) / Math.sin(i),
|
||
u = JS(t[e - 1], t[e], Math.PI - i, r, !0), c = JS(t[e - 1], t[e], i, r, !1);
|
||
l.push(u), h.push(c)
|
||
}
|
||
return l.concat(h)
|
||
}
|
||
|
||
getTempPoint4(t, e, i) {
|
||
try {
|
||
let r = YS(t, e), o = US(r, i), n = qS(t, r, i), [s, a, l, h] = [void 0, void 0, void 0, void 0];
|
||
return n < NS ? (a = o * Math.sin(n), l = o * Math.cos(n), h = JS(t, r, NS, a, !1), s = JS(r, h, NS, l, !0)) : n >= NS && n < Math.PI ? (a = o * Math.sin(Math.PI - n), l = o * Math.cos(Math.PI - n), h = JS(t, r, NS, a, !1), s = JS(r, h, NS, l, !1)) : n >= Math.PI && n < 1.5 * Math.PI ? (a = o * Math.sin(n - Math.PI), l = o * Math.cos(n - Math.PI), h = JS(t, r, NS, a, !0), s = JS(r, h, NS, l, !0)) : (a = o * Math.sin(2 * Math.PI - n), l = o * Math.cos(2 * Math.PI - n), h = JS(t, r, NS, a, !0), s = JS(r, h, NS, l, !1)), s
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
3 === this.getPointCount() && null !== this.tempPoint4 && this.points.push(this.tempPoint4), null !== this.connPoint && this.points.push(this.connPoint)
|
||
}
|
||
};
|
||
var vT = class extends Jr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = XE, this.fixPointCount = 2, this.maxArrowLength = 3e6, this.arrowLengthScale = 5, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
try {
|
||
if (this.getPointCount() < 2) return !1;
|
||
{
|
||
let t = this.getPoints(), [e, i] = [t[0], t[1]], r = US(e, i) / this.arrowLengthScale;
|
||
r = r > this.maxArrowLength ? this.maxArrowLength : r;
|
||
let o = JS(e, i, Math.PI / 6, r, !1), n = JS(e, i, Math.PI / 6, r, !0);
|
||
this.setCoordinates([e, i, o, i, n])
|
||
}
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var _T = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = qE, this.tailWidthFactor = .1, this.neckWidthFactor = .2, this.headWidthFactor = .25, this.headAngle = Math.PI / 8.5, this.neckAngle = Math.PI / 13, this.fixPointCount = 2, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
try {
|
||
if (this.getPointCount() < 2) return !1;
|
||
{
|
||
let t = this.getPoints(), [e, i] = [t[0], t[1]], r = VS(t), o = r * this.tailWidthFactor,
|
||
n = r * this.neckWidthFactor, s = r * this.headWidthFactor, a = JS(i, e, NS, o, !0),
|
||
l = JS(i, e, NS, o, !1), h = JS(e, i, this.headAngle, s, !1),
|
||
u = JS(e, i, this.headAngle, s, !0),
|
||
c = [a, JS(e, i, this.neckAngle, n, !1), h, i, u, JS(e, i, this.neckAngle, n, !0), l];
|
||
this.setCoordinates([c])
|
||
}
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var xT = class extends _T {
|
||
constructor(t, e, i) {
|
||
super(t, e, i), this.tailWidthFactor = .05, this.neckWidthFactor = .1, this.headWidthFactor = .15, this.type = ZE, this.headAngle = Math.PI / 4, this.neckAngle = .17741 * Math.PI, e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t), this.set("params", i)
|
||
}
|
||
};
|
||
var wT = class extends mT {
|
||
constructor(t, e, i) {
|
||
super(t, e, i), this.type = KE, this.headHeightFactor = .18, this.headWidthFactor = .3, this.neckHeightFactor = .85, this.neckWidthFactor = .15, this.tailWidthFactor = .1, this.headTailFactor = .8, this.swallowTailFactor = 1, this.swallowTailPnt = null, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
generate() {
|
||
try {
|
||
let t = this.getPointCount();
|
||
if (t < 2) return !1;
|
||
if (2 === t) return this.setCoordinates([this.points]), !1;
|
||
{
|
||
let t = this.getPoints(), [e, i] = [t[0], t[1]];
|
||
ZS(t[0], t[1], t[2]) && (e = t[1], i = t[0]);
|
||
let r = [YS(e, i)].concat(t.slice(2)),
|
||
o = this.getArrowHeadPoints(r, e, i), [n, s] = [o[0], o[4]], a = US(e, i), l = VS(r),
|
||
h = l * this.tailWidthFactor * this.swallowTailFactor;
|
||
this.swallowTailPnt = JS(r[1], r[0], 0, h, !0);
|
||
let u = a / l, c = this.getArrowBodyPoints(r, n, s, u), p = c.length,
|
||
d = [e].concat(c.slice(0, p / 2));
|
||
d.push(n);
|
||
let f = [i].concat(c.slice(p / 2, p));
|
||
f.push(s), d = nE(d), f = nE(f), this.setCoordinates([d.concat(o, f.reverse(), [this.swallowTailPnt, d[0]])])
|
||
}
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}
|
||
};
|
||
var bT = class extends mT {
|
||
constructor(t, e, i) {
|
||
super(t, e, i), this.type = JE, this.headHeightFactor = .18, this.headWidthFactor = .3, this.neckHeightFactor = .85, this.neckWidthFactor = .15, this.tailWidthFactor = .1, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
generate() {
|
||
try {
|
||
if (this.getPointCount() < 2) return !1;
|
||
{
|
||
let t = this.getPoints(), e = this.getTailPoints(t), i = this.getArrowHeadPoints(t, e[0], e[1]),
|
||
r = i[0], o = i[4], n = this.getArrowBodyPoints(t, r, o, this.tailWidthFactor),
|
||
s = n.length, a = [e[0]].concat(n.slice(0, s / 2));
|
||
a.push(r);
|
||
let l = [e[1]].concat(n.slice(s / 2, s));
|
||
l.push(o), a = nE(a), l = nE(l), this.setCoordinates([a.concat(i, l.reverse())])
|
||
}
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}
|
||
|
||
getTailPoints(t) {
|
||
let e = VS(t) * this.tailWidthFactor;
|
||
return [JS(t[1], t[0], NS, e, !1), JS(t[1], t[0], NS, e, !0)]
|
||
}
|
||
};
|
||
var CT = class extends mT {
|
||
constructor(t, e, i) {
|
||
super(t, e, i), this.type = $E, this.headHeightFactor = .18, this.headWidthFactor = .3, this.neckHeightFactor = .85, this.neckWidthFactor = .15, this.tailWidthFactor = .1, this.swallowTailFactor = 1, this.swallowTailPnt = null, this.fixPointCount = 2, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
generate() {
|
||
try {
|
||
if (this.getPointCount() < 2) return !1;
|
||
{
|
||
let t = this.getPoints(), e = this.getTailPoints(t), i = this.getArrowHeadPoints(t, e[0], e[2]),
|
||
r = i[0], o = i[4], n = this.getArrowBodyPoints(t, r, o, this.tailWidthFactor),
|
||
s = n.length, a = [e[0]].concat(n.slice(0, s / 2));
|
||
a.push(r);
|
||
let l = [e[2]].concat(n.slice(s / 2, s));
|
||
l.push(o), a = nE(a), l = nE(l), this.setCoordinates([a.concat(i, l.reverse(), [e[1], a[0]])])
|
||
}
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}
|
||
|
||
getTailPoints(t) {
|
||
let e = VS(t) * this.tailWidthFactor, i = JS(t[1], t[0], NS, e, !1), r = JS(t[1], t[0], NS, e, !0),
|
||
o = e * this.swallowTailFactor;
|
||
return [i, JS(t[1], t[0], 0, o, !0), r]
|
||
}
|
||
};
|
||
var ST = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = ME, this.t = .4, this.fixPointCount = 3, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
let t = this.getPoints(), e = this.getPointCount();
|
||
if (t.length < 2) return !1;
|
||
{
|
||
if (2 === e) {
|
||
let e = YS(t[0], t[1]), i = US(t[0], e) / .9, r = JS(t[0], e, NS, i, !0);
|
||
t = [t[0], r, t[1]]
|
||
}
|
||
let i = YS(t[0], t[2]);
|
||
t.push(i, t[0], t[1]);
|
||
let [r, o, n, s, a] = [[], void 0, void 0, void 0, []];
|
||
for (let e = 0; e < t.length - 2; e++) {
|
||
o = t[e], n = t[e + 1], s = t[e + 2];
|
||
let i = QS(this.t, o, n, s);
|
||
r = r.concat(i)
|
||
}
|
||
let l = r.length;
|
||
r = [r[l - 1]].concat(r.slice(0, l - 1));
|
||
for (let e = 0; e < t.length - 2; e++) {
|
||
o = t[e], n = t[e + 1], a.push(o);
|
||
for (let t = 0; t <= FS; t++) {
|
||
let i = KS(t / FS, o, r[2 * e], r[2 * e + 1], n);
|
||
a.push(i)
|
||
}
|
||
a.push(n)
|
||
}
|
||
this.setCoordinates([a])
|
||
}
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var ET = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = QE, this.fixPointCount = 2, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
if (this.getPointCount() < 2) return !1;
|
||
this.setCoordinates([this.calculatePonits(this.points)])
|
||
}
|
||
|
||
calculatePonits(t) {
|
||
let e = [];
|
||
if (t.length > 1) {
|
||
let i = t[0], r = t[t.length - 1];
|
||
e = [i, [r[0], i[1]], [r[0], (i[1] + r[1]) / 2], [i[0], (i[1] + r[1]) / 2], [i[0], r[1]]]
|
||
}
|
||
return e
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var TT = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = tT, this.fixPointCount = 2, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
if (this.getPointCount() < 2) return !1;
|
||
this.setCoordinates([this.calculatePonits(this.points)])
|
||
}
|
||
|
||
calculatePonits(t) {
|
||
let e = [];
|
||
if (t.length > 1) {
|
||
let i = t[0], r = t[t.length - 1];
|
||
e = [i, [r[0], (i[1] + r[1]) / 2], [i[0], (i[1] + r[1]) / 2], [i[0], r[1]]]
|
||
}
|
||
return e
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var RT = class extends fr {
|
||
constructor(t, e, i) {
|
||
super([]), this.type = eT, this.fixPointCount = 2, this.set("params", i), e && e.length > 0 ? this.setPoints(e) : t && t.length > 0 && this.setCoordinates(t)
|
||
}
|
||
|
||
getPlotType() {
|
||
return this.type
|
||
}
|
||
|
||
generate() {
|
||
if (this.getPointCount() < 2) return !1;
|
||
this.setCoordinates([this.calculatePonits(this.points)])
|
||
}
|
||
|
||
calculatePonits(t) {
|
||
let e = [];
|
||
if (t.length > 1) {
|
||
let i = t[0], r = t[t.length - 1], o = i, n = [(r[0] - i[0]) / 4 + i[0], (r[1] - i[1]) / 8 + i[1]],
|
||
s = [(i[0] + r[0]) / 2, i[1]], a = [3 * (r[0] - i[0]) / 4 + i[0], -(r[1] - i[1]) / 8 + i[1]],
|
||
l = [r[0], i[1]], h = [r[0], (i[1] + r[1]) / 2],
|
||
u = [3 * (r[0] - i[0]) / 4 + i[0], 3 * (r[1] - i[1]) / 8 + i[1]],
|
||
c = [(i[0] + r[0]) / 2, (i[1] + r[1]) / 2],
|
||
p = [(r[0] - i[0]) / 4 + i[0], 5 * (r[1] - i[1]) / 8 + i[1]], d = [i[0], (i[1] + r[1]) / 2],
|
||
f = [i[0], r[1]], g = iE([o, n, s, a, l]), m = iE([h, u, c, p, d]);
|
||
(e = g.concat(m)).push(f)
|
||
}
|
||
return e
|
||
}
|
||
|
||
setMap(t) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t
|
||
}
|
||
|
||
getMap() {
|
||
return this.map
|
||
}
|
||
|
||
isPlot() {
|
||
return !0
|
||
}
|
||
|
||
setPoints(t) {
|
||
this.points = t || [], this.points.length >= 1 && this.generate()
|
||
}
|
||
|
||
getPoints() {
|
||
return this.points.slice(0)
|
||
}
|
||
|
||
getPointCount() {
|
||
return this.points.length
|
||
}
|
||
|
||
updatePoint(t, e) {
|
||
e >= 0 && e < this.points.length && (this.points[e] = t, this.generate())
|
||
}
|
||
|
||
updateLastPoint(t) {
|
||
this.updatePoint(t, this.points.length - 1)
|
||
}
|
||
|
||
finishDrawing() {
|
||
}
|
||
};
|
||
var PT = class extends kS {
|
||
constructor(t, e) {
|
||
if (super(), !(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t, this.options = e || {}, this.points = null, this.plot = null, this.feature = null, this.plotType = null, this.plotParams = null, this.mapViewport = this.map.getViewport(), this.dblClickZoomInteraction = null, this.drawInteraction_ = null, this.layerName = this.options && this.options.layerName ? this.options.layerName : DS, uE(["textAreaDrawEnd", "mapFirstClickHandler", "mapNextClickHandler", "mapDoubleClickHandler", "mapMouseMoveHandler"], this), this.drawLayer = dE(this.map, this.layerName, {create: !0}), this.drawLayer.setZIndex(this.options.zIndex || 99)
|
||
}
|
||
|
||
createPlot(t, e, i) {
|
||
let r = i || {};
|
||
switch (t) {
|
||
case LE:
|
||
return "TextArea";
|
||
case FE:
|
||
return new iT([], e, r);
|
||
case NE:
|
||
return new rT([], e, r);
|
||
case AE:
|
||
return new oT([], e, r);
|
||
case IE:
|
||
return new nT([], e, r);
|
||
case GE:
|
||
return new sT([], e, r);
|
||
case OE:
|
||
return new aT([], e, r);
|
||
case kE:
|
||
return new lT([], e, r);
|
||
case DE:
|
||
return new hT([], e, r);
|
||
case jE:
|
||
return new uT([], e, r);
|
||
case zE:
|
||
return new cT([], e, r);
|
||
case UE:
|
||
return new pT([], e, r);
|
||
case BE:
|
||
return new dT([], e, r);
|
||
case VE:
|
||
return new fT([], e, r);
|
||
case WE:
|
||
return new mT([], e, r);
|
||
case YE:
|
||
return new gT([], e, r);
|
||
case HE:
|
||
return new yT([], e, r);
|
||
case XE:
|
||
return new vT([], e, r);
|
||
case qE:
|
||
return new _T([], e, r);
|
||
case ZE:
|
||
return new xT([], e, r);
|
||
case KE:
|
||
return new wT([], e, r);
|
||
case JE:
|
||
return new bT([], e, r);
|
||
case $E:
|
||
return new CT([], e, r);
|
||
case ME:
|
||
return new ST([], e, r);
|
||
case QE:
|
||
return new ET([], e, r);
|
||
case tT:
|
||
return new TT([], e, r);
|
||
case eT:
|
||
return new RT([], e, r)
|
||
}
|
||
return null
|
||
}
|
||
|
||
active(t, e = {}) {
|
||
this.disActive(), this.deactiveMapTools(), this.plotType = t, this.plotParams = e, t === LE ? this.activeInteraction() : Object.keys(r).some(e => r[e] === t) ? this.map.on("click", this.mapFirstClickHandler) : console.warn("不存在的标绘类型!")
|
||
}
|
||
|
||
activeInteraction() {
|
||
this.drawInteraction_ = new P_({
|
||
style: new uf({
|
||
fill: new po({color: "rgba(255, 255, 255, 0.7)"}),
|
||
stroke: new go({color: "rgba(0, 0, 0, 0.15)", width: 2}),
|
||
image: new Xd({
|
||
anchor: [1, 1],
|
||
anchorXUnits: "fraction",
|
||
anchorYUnits: "fraction",
|
||
opacity: .75,
|
||
src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABgklEQVQ4T41T0W3CQAy1lfwRqR0h/CE5UhkBJmiZADpB0wlKJwA2aDegE5QR+Igl/noj9OPuLydXPuXQEYUKS5FyPvvd87ONRDRFxEdr7c4Y8ws3WFmW90VRvIjIF1ZVtQaANxH59N6v8zwvRaQEgCMATDu88I+Ipm1bk2XZHhEfAOAdFW00Gh2YOQafOeidHoaYEdGHc65GDZhMJuXpdDJ99hqkPmZe9e9iTgCoqmrWNM0hDerq/FGftXbcZxFzAgARrZg5vBaNiGpE3OhZRF6Zedu7DzkRYMrMKlQKYBBRQVVgw8zj3n3IGWSg9ESkds6tiqJQbe4AYJ6WGVkPAqh4+romdP9LbXMqZh/gXIKqm+d5EK9vbduOY7d0AAdL6AYLmqbRAQtGRMc4ONF/wSC2RF/PsuwbABapqLEjKqb3fq4sLtoYh6Lbiydr7TbtuwYDgH5qB9XmPEjdKG+Y+Xmo7ms+Lcs5N0uX6ei9X9y4TGtEXIZlukb7PzbdmNcisv8DtQILak2vZsYAAAAASUVORK5CYII="
|
||
})
|
||
}), type: "Circle", geometryFunction: R_()
|
||
}), this.map.addInteraction(this.drawInteraction_), this.drawInteraction_.on("drawend", this.textAreaDrawEnd)
|
||
}
|
||
|
||
textAreaDrawEnd(t) {
|
||
if (t && t.feature) {
|
||
this.map.removeInteraction(this.drawInteraction_);
|
||
const e = t.feature.getGeometry().getExtent(), i = [(e[0] + e[2]) / 2, (e[1] + e[3]) / 2],
|
||
r = this.map.getPixelFromCoordinate([e[0], e[1]]),
|
||
o = this.map.getPixelFromCoordinate([e[2], e[3]]), [n, s] = [Math.abs(r[0] - o[0]), Math.abs(r[1] - o[1])],
|
||
a = new PE({
|
||
id: aE(),
|
||
position: i,
|
||
value: "",
|
||
width: n,
|
||
height: s,
|
||
style: {width: n + "px", height: s + "px"}
|
||
});
|
||
this.map && this.map instanceof rh && a ? this.map.addOverlay(a) : console.warn("未传入地图对象或者plotText创建失败!")
|
||
} else console.info("未获取到要素!")
|
||
}
|
||
|
||
disActive() {
|
||
this.removeEventHandlers(), this.drawInteraction_ && (this.map.removeInteraction(this.drawInteraction_), this.drawInteraction_ = null), this.points = [], this.plot = null, this.feature = null, this.plotType = null, this.plotParams = null, this.activateMapTools()
|
||
}
|
||
|
||
isDrawing() {
|
||
return !!this.plotType
|
||
}
|
||
|
||
mapFirstClickHandler(t) {
|
||
this.map.un("click", this.mapFirstClickHandler), this.points.push(t.coordinate), this.plot = this.createPlot(this.plotType, this.points, this.plotParams), this.feature = new X(this.plot), this.feature.set("isPlot", !0), this.drawLayer.getSource().addFeature(this.feature), this.plotType === FE || this.plotType === NE ? (this.plot.finishDrawing(), this.drawEnd(t)) : (this.map.on("click", this.mapNextClickHandler), this.plot.freehand || this.map.on("dblclick", this.mapDoubleClickHandler), this.map.un("pointermove", this.mapMouseMoveHandler), this.map.on("pointermove", this.mapMouseMoveHandler)), this.plotType && this.feature && (this.plotParams.plotType = this.plotType, this.feature.setProperties(this.plotParams))
|
||
}
|
||
|
||
mapNextClickHandler(t) {
|
||
if (!this.plot.freehand && US(t.coordinate, this.points[this.points.length - 1]) < 1e-4) return !1;
|
||
this.points.push(t.coordinate), this.plot.setPoints(this.points), this.plot.fixPointCount === this.plot.getPointCount() && this.mapDoubleClickHandler(t), this.plot && this.plot.freehand && this.mapDoubleClickHandler(t)
|
||
}
|
||
|
||
mapDoubleClickHandler(t) {
|
||
t.preventDefault(), this.plot.finishDrawing(), this.drawEnd(t)
|
||
}
|
||
|
||
mapMouseMoveHandler(t) {
|
||
let e = t.coordinate;
|
||
if (US(e, this.points[this.points.length - 1]) < 1e-4) return !1;
|
||
if (this.plot.freehand) this.points.push(e), this.plot.setPoints(this.points); else {
|
||
let t = this.points.concat([e]);
|
||
this.plot.setPoints(t)
|
||
}
|
||
}
|
||
|
||
removeEventHandlers() {
|
||
this.map.un("click", this.mapFirstClickHandler), this.map.un("click", this.mapNextClickHandler), this.map.un("pointermove", this.mapMouseMoveHandler), this.map.un("dblclick", this.mapDoubleClickHandler)
|
||
}
|
||
|
||
drawEnd(t) {
|
||
this.dispatchSync("drawEnd", {
|
||
type: "drawEnd",
|
||
originalEvent: t,
|
||
feature: this.feature
|
||
}), this.feature && this.options.isClear && this.drawLayer.getSource().removeFeature(this.feature), this.disActive()
|
||
}
|
||
|
||
addFeature() {
|
||
this.feature = new X(this.plot), this.feature && this.drawLayer && this.drawLayer.getSource().addFeature(this.feature)
|
||
}
|
||
|
||
deactiveMapTools() {
|
||
this.map.getInteractions().getArray().every(t => !(t instanceof Bs && (this.dblClickZoomInteraction = t, this.map.removeInteraction(t), 1)))
|
||
}
|
||
|
||
activateMapTools() {
|
||
this.dblClickZoomInteraction && this.dblClickZoomInteraction instanceof Bs && (this.map.addInteraction(this.dblClickZoomInteraction), this.dblClickZoomInteraction = null)
|
||
}
|
||
};
|
||
var LT = class extends kS {
|
||
constructor(t) {
|
||
if (super(), !(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t, this.mapViewport = this.map.getViewport(), this.activePlot = null, this.startPoint = null, this.ghostControlPoints = null, this.controlPoints = null, this.mouseOver = !1, this.elementTable = {}, this.activeControlPointId = null, this.mapDragPan = null, this.previousCursor_ = null, uE(["controlPointMouseDownHandler", "controlPointMouseMoveHandler2", "controlPointMouseUpHandler", "controlPointMouseMoveHandler", "plotMouseOverOutHandler", "plotMouseDownHandler", "plotMouseUpHandler", "plotMouseMoveHandler"], this)
|
||
}
|
||
|
||
initHelperDom() {
|
||
if (!this.map || !this.activePlot) return !1;
|
||
let t = this.getMapParentElement();
|
||
if (!t) return !1;
|
||
{
|
||
let e = wE("div", t, jS), i = this.getControlPoints();
|
||
i && Array.isArray(i) && i.length > 0 && i.forEach((t, i) => {
|
||
let r = GS + "-" + i;
|
||
vE("div", GS, e, r), this.elementTable[r] = i
|
||
})
|
||
}
|
||
}
|
||
|
||
getMapParentElement() {
|
||
let t = this.map.getTargetElement();
|
||
return !!t && t.parentNode
|
||
}
|
||
|
||
destroyHelperDom() {
|
||
this.controlPoints && Array.isArray(this.controlPoints) && this.controlPoints.length > 0 && (this.controlPoints.forEach((t, e) => {
|
||
t && t instanceof sh && this.map.removeOverlay(t);
|
||
let i = _E(GS + "-" + e);
|
||
i && (SE(i, "mousedown", this.controlPointMouseDownHandler.bind(this)), SE(i, "mousemove", this.controlPointMouseMoveHandler2.bind(this)))
|
||
}), this.controlPoints = []);
|
||
let t = this.getMapParentElement(), e = _E(jS);
|
||
e && t && xE(e, t)
|
||
}
|
||
|
||
initControlPoints() {
|
||
this.controlPoints = [];
|
||
let t = this.getControlPoints();
|
||
t && Array.isArray(t) && t.length > 0 && t.forEach((e, i) => {
|
||
let r = GS + "-" + i;
|
||
this.elementTable[r] = i;
|
||
let o = _E(r), n = new sh({id: r, position: t[i], positioning: "center-center", element: o});
|
||
this.controlPoints.push(n), this.map.addOverlay(n, !0), this.map.render(), CE(o, "mousedown", this.controlPointMouseDownHandler), CE(o, "mousemove", this.controlPointMouseMoveHandler2)
|
||
})
|
||
}
|
||
|
||
controlPointMouseMoveHandler2(t) {
|
||
t.stopImmediatePropagation()
|
||
}
|
||
|
||
controlPointMouseDownHandler(t) {
|
||
this.activeControlPointId = t.target.id, this.map.on("pointermove", this.controlPointMouseMoveHandler), CE(this.mapViewport, "mouseup", this.controlPointMouseUpHandler)
|
||
}
|
||
|
||
controlPointMouseMoveHandler(t) {
|
||
let e = t.coordinate;
|
||
if (this.activeControlPointId) {
|
||
let t = this.activePlot.getGeometry(), i = this.elementTable[this.activeControlPointId];
|
||
t.updatePoint(e, i);
|
||
let r = this.map.getOverlayById(this.activeControlPointId);
|
||
r && r.setPosition(e)
|
||
}
|
||
}
|
||
|
||
controlPointMouseUpHandler(t) {
|
||
this.map.un("pointermove", this.controlPointMouseMoveHandler), SE(this.mapViewport, "mouseup", this.controlPointMouseUpHandler)
|
||
}
|
||
|
||
activate(t) {
|
||
t && t instanceof X && t.get("isPlot") && t.getGeometry().isPlot && t !== this.activePlot && (this.deactivate(), this.activePlot = t, this.previousCursor_ = this.map.getTargetElement().style.cursor, window.setTimeout(() => {
|
||
this.dispatch("active_plot_change", this.activePlot)
|
||
}, 500), this.map.on("pointermove", this.plotMouseOverOutHandler), this.initHelperDom(), this.initControlPoints())
|
||
}
|
||
|
||
getControlPoints() {
|
||
let t = [];
|
||
if (this.activePlot) {
|
||
let e = this.activePlot.getGeometry();
|
||
e && (t = e.getPoints())
|
||
}
|
||
return t
|
||
}
|
||
|
||
plotMouseOverOutHandler(t) {
|
||
let e = this.map.forEachFeatureAtPixel(t.pixel, function (t) {
|
||
return t
|
||
});
|
||
return e && e === this.activePlot ? this.mouseOver || (this.mouseOver = !0, this.map.getTargetElement().style.cursor = "move", this.map.on("pointerdown", this.plotMouseDownHandler)) : this.mouseOver && (this.mouseOver = !1, this.map.getTargetElement().style.cursor = "default", this.map.un("pointerdown", this.plotMouseDownHandler)), e
|
||
}
|
||
|
||
plotMouseDownHandler(t) {
|
||
this.ghostControlPoints = this.getControlPoints(), this.startPoint = t.coordinate, this.disableMapDragPan(), this.map.on("pointerup", this.plotMouseUpHandler), this.map.on("pointerdrag", this.plotMouseMoveHandler)
|
||
}
|
||
|
||
plotMouseMoveHandler(t) {
|
||
let [e, i, r] = [t.coordinate[0] - this.startPoint[0], t.coordinate[1] - this.startPoint[1], []];
|
||
if (this.ghostControlPoints && Array.isArray(this.ghostControlPoints) && this.ghostControlPoints.length > 0) for (let t = 0; t < this.ghostControlPoints.length; t++) {
|
||
let o = [this.ghostControlPoints[t][0] + e, this.ghostControlPoints[t][1] + i];
|
||
r.push(o);
|
||
let n = GS + "-" + t, s = this.map.getOverlayById(n);
|
||
s && (s.setPosition(o), s.setPositioning("center-center"))
|
||
}
|
||
this.activePlot.getGeometry().setPoints(r)
|
||
}
|
||
|
||
plotMouseUpHandler(t) {
|
||
this.enableMapDragPan(), this.map.un("pointerup", this.plotMouseUpHandler), this.map.un("pointerdrag", this.plotMouseMoveHandler)
|
||
}
|
||
|
||
disconnectEventHandlers() {
|
||
this.map.un("pointermove", this.plotMouseOverOutHandler), this.map.un("pointermove", this.controlPointMouseMoveHandler), SE(this.mapViewport, "mouseup", this.controlPointMouseUpHandler), this.map.un("pointerdown", this.plotMouseDownHandler), this.map.un("pointerup", this.plotMouseUpHandler), this.map.un("pointerdrag", this.plotMouseMoveHandler)
|
||
}
|
||
|
||
deactivate() {
|
||
this.activePlot = null, this.mouseOver = !1, this.map.getTargetElement().style.cursor = this.previousCursor_, this.previousCursor_ = null, this.destroyHelperDom(), this.disconnectEventHandlers(), this.enableMapDragPan(), this.elementTable = {}, this.activeControlPointId = null, this.startPoint = null
|
||
}
|
||
|
||
disableMapDragPan() {
|
||
this.map.getInteractions().getArray().every(t => !(t instanceof oa && (this.mapDragPan = t, this.map.removeInteraction(t), 1)))
|
||
}
|
||
|
||
enableMapDragPan() {
|
||
this.mapDragPan && this.mapDragPan instanceof oa && (this.map.addInteraction(this.mapDragPan), this.mapDragPan = null)
|
||
}
|
||
};
|
||
const IT = function (t) {
|
||
let e = t && "object" == typeof t ? t : {}, i = new uf({});
|
||
return e.geometry && e.geometry instanceof _i && i.setGeometry(e.geometry), e.zIndex && "number" == typeof e.zIndex && i.setZIndex(e.zIndex), e.fill && "object" == typeof e.fill && i.setFill(this._getFill(e.fill)), e.image && "object" == typeof e.image && i.setImage(this._getImage(e.image)), e.stroke && "object" == typeof e.stroke && i.setStroke(this._getStroke(e.stroke)), e.text && "object" == typeof e.text && i.setText(this._getText(e.text)), i
|
||
};
|
||
IT.prototype._getRegularShape = function (t) {
|
||
try {
|
||
return new qd({
|
||
fill: this._getFill(t.fill) || void 0,
|
||
points: "number" == typeof t.points ? t.points : 1,
|
||
radius: "number" == typeof t.radius ? t.radius : void 0,
|
||
radius1: "number" == typeof t.radius1 ? t.radius1 : void 0,
|
||
radius2: "number" == typeof t.radius2 ? t.radius2 : void 0,
|
||
angle: "number" == typeof t.angle ? t.angle : 0,
|
||
snapToPixel: "boolean" != typeof t.snapToPixel || t.snapToPixel,
|
||
stroke: this._getStroke(t.stroke) || void 0,
|
||
rotation: "number" == typeof t.rotation ? t.rotation : 0,
|
||
rotateWithView: "boolean" == typeof t.rotateWithView && t.rotateWithView,
|
||
atlasManager: t.atlasManager ? t.atlasManager : void 0
|
||
})
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}, IT.prototype._getImage = function (t) {
|
||
try {
|
||
let e;
|
||
return e = "icon" === (t = t || {}).type ? this._getIcon(t.image) : this._getRegularShape(t.image)
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}, IT.prototype._getIcon = function (t) {
|
||
try {
|
||
return new Xd({
|
||
anchor: (t = t || {}).imageAnchor ? t.imageAnchor : [.5, .5],
|
||
anchorXUnits: t.imageAnchorXUnits ? t.imageAnchorXUnits : "fraction",
|
||
anchorYUnits: t.imageAnchorYUnits ? t.imageAnchorYUnits : "fraction",
|
||
anchorOrigin: t.imageAnchorOrigin ? t.imageAnchorYUnits : "top-left",
|
||
color: t.imageColor ? t.imageColor : void 0,
|
||
crossOrigin: t.crossOrigin ? t.crossOrigin : void 0,
|
||
img: t.img ? t.img : void 0,
|
||
offset: t.offset && Array.isArray(t.offset) && 2 === t.offset.length ? t.offset : [0, 0],
|
||
offsetOrigin: t.offsetOrigin ? t.offsetOrigin : "top-left",
|
||
scale: "number" == typeof t.scale ? t.scale : 1,
|
||
snapToPixel: "boolean" != typeof t.snapToPixel || t.snapToPixel,
|
||
rotateWithView: "boolean" == typeof t.rotateWithView && t.rotateWithView,
|
||
opacity: "number" == typeof t.imageOpacity ? t.imageOpacity : 1,
|
||
rotation: "number" == typeof t.imageRotation ? t.imageRotation : 0,
|
||
size: t.size && Array.isArray(t.size) && 2 === t.size.length ? t.size : void 0,
|
||
imgSize: t.imgSize && Array.isArray(t.imgSize) && 2 === t.imgSize.length ? t.imgSize : void 0,
|
||
src: t.imageSrc ? t.imageSrc : void 0
|
||
})
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}, IT.prototype._getStroke = function (t) {
|
||
try {
|
||
return new go({
|
||
color: (t = t || {}).strokeColor ? t.strokeColor : void 0,
|
||
lineCap: t.strokeLineCap && "string" == typeof t.strokeLineCap ? t.strokeLineCap : "round",
|
||
lineJoin: t.strokeLineJoin && "string" == typeof t.strokeLineJoin ? t.strokeLineJoin : "round",
|
||
lineDash: t.strokeLineDash ? t.strokeLineDash : void 0,
|
||
lineDashOffset: "number" == typeof t.strokeLineDashOffset ? t.strokeLineDashOffset : "0",
|
||
miterLimit: "number" == typeof t.strokeMiterLimit ? t.strokeMiterLimit : 10,
|
||
width: "number" == typeof t.strokeWidth ? t.strokeWidth : void 0
|
||
})
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}, IT.prototype._getText = function (t) {
|
||
try {
|
||
return new vo({
|
||
font: t.textFont && "string" == typeof t.textFont ? t.textFont : "10px sans-serif",
|
||
offsetX: "number" == typeof t.textOffsetX ? t.textOffsetX : 0,
|
||
offsetY: "number" == typeof t.textOffsetY ? t.textOffsetY : 0,
|
||
scale: "number" == typeof t.textScale ? t.textScale : void 0,
|
||
rotation: "number" == typeof t.textRotation ? t.textRotation : 0,
|
||
text: t.text && "string" == typeof t.text ? t.text : void 0,
|
||
textAlign: t.textAlign && "string" == typeof t.textAlign ? t.textAlign : "start",
|
||
textBaseline: t.textBaseline && "string" == typeof t.textBaseline ? t.textBaseline : "alphabetic",
|
||
rotateWithView: "boolean" == typeof t.rotateWithView && t.rotateWithView,
|
||
fill: this._getFill(t.textFill),
|
||
stroke: this._getStroke(t.textStroke)
|
||
})
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
}, IT.prototype._getFill = function (t) {
|
||
try {
|
||
return new po({color: (t = t || {}).fillColor ? t.fillColor : void 0})
|
||
} catch (t) {
|
||
console.log(t)
|
||
}
|
||
};
|
||
var OT = IT;
|
||
var MT = class {
|
||
constructor(t, e) {
|
||
if (!(t && t instanceof rh)) throw new Error("传入的不是地图对象!");
|
||
this.map = t, this.options = e, this.layerName = this.options && this.options.layerName ? this.options.layerName : DS
|
||
}
|
||
|
||
getBaseStyle(t) {
|
||
let e = t.getStyle();
|
||
if (!e) {
|
||
let t = cE(this.map, this.layerName);
|
||
if (!(t && t instanceof v_)) return !1;
|
||
e = t.getStyle()
|
||
}
|
||
return e
|
||
}
|
||
|
||
setIcon(t, e) {
|
||
try {
|
||
if (t && t instanceof X) {
|
||
let i = this.getBaseStyle(t).clone(), r = this._getImage(e);
|
||
r && (i.setImage(r), t.setStyle(i))
|
||
}
|
||
} catch (t) {
|
||
console.warn(t)
|
||
}
|
||
}
|
||
|
||
setBackgroundColor(t, e) {
|
||
try {
|
||
if (t && t instanceof X) {
|
||
let i = this.getBaseStyle(t).clone(), r = i.getFill(), o = r.getColor();
|
||
if (o) {
|
||
let n = lo(o), s = lo(e), a = this.handleBackgroundColor(s, n[3]);
|
||
r.setColor(a), t.setStyle(i)
|
||
}
|
||
}
|
||
} catch (t) {
|
||
console.warn(t)
|
||
}
|
||
}
|
||
|
||
setOpacity(t, e) {
|
||
try {
|
||
if (t && t instanceof X) {
|
||
let i = this.getBaseStyle(t);
|
||
if (i) {
|
||
let r = i.clone(), o = r.getFill(), n = o.getColor();
|
||
if (n) {
|
||
let i = lo(n);
|
||
i[3] = e;
|
||
let s = "rgba(" + i.join(",") + ")";
|
||
o.setColor(s), t.setStyle(r)
|
||
}
|
||
}
|
||
}
|
||
} catch (t) {
|
||
console.warn(t)
|
||
}
|
||
}
|
||
|
||
setBorderColor(t, e) {
|
||
try {
|
||
if (t && t instanceof X) {
|
||
let i = this.getBaseStyle(t).clone();
|
||
i.getStroke().setColor(e), t.setStyle(i)
|
||
}
|
||
} catch (t) {
|
||
console.warn(t)
|
||
}
|
||
}
|
||
|
||
setBorderWidth(t, e) {
|
||
try {
|
||
if (t && t instanceof X) {
|
||
let i = this.getBaseStyle(t).clone();
|
||
i.getStroke().setWidth(e), t.setStyle(i)
|
||
}
|
||
} catch (t) {
|
||
console.warn(t)
|
||
}
|
||
}
|
||
|
||
handleBackgroundColor(t, e) {
|
||
try {
|
||
e || (e = 1);
|
||
let i = lo(t);
|
||
return i[3] = e, "rgba(" + i.join(",") + ")"
|
||
} catch (t) {
|
||
console.warn(t)
|
||
}
|
||
}
|
||
|
||
getColor(t) {
|
||
try {
|
||
return oo(lo(t))
|
||
} catch (t) {
|
||
console.warn(t)
|
||
}
|
||
}
|
||
|
||
fixObject(t) {
|
||
if (t && "object" == typeof t) for (let e in t) e && void 0 === t[e] && delete t[e];
|
||
return t
|
||
}
|
||
|
||
getStroke_(t) {
|
||
let e = null;
|
||
if (t) {
|
||
let i = t.getStroke();
|
||
i && ((e = {}).strokeColor = this.getColor(i.getColor()), e.strokeWidth = i.getWidth(), e.strokeLineDash = i.getLineDash(), e.lineDashOffset = i.getLineDashOffset(), e.strokeLineCap = i.getLineCap(), e.strokeLineJoin = i.getLineJoin(), e.strokeMiterLimit = i.getMiterLimit())
|
||
}
|
||
return this.fixObject(e)
|
||
}
|
||
|
||
getFill_(t) {
|
||
let e = null;
|
||
if (t) {
|
||
let i = t.getFill();
|
||
if (i) {
|
||
e = {};
|
||
let t = i.getColor();
|
||
e.fillColor = this.getColor(t)
|
||
}
|
||
}
|
||
return this.fixObject(e)
|
||
}
|
||
|
||
getText_(t) {
|
||
let e = null;
|
||
if (t) {
|
||
let i = t.getText();
|
||
i && ((e = {}).textFont = i.getFont(), e.textOffsetX = i.getOffsetX(), e.textOffsetY = i.getOffsetY(), e.textScale = i.getScale(), e.textRotation = i.getRotation(), e.text = i.getText(), e.textAlign = i.getTextAlign(), e.textBaseline = i.getTextBaseline(), e.rotateWithView = i.getRotateWithView(), e.textFill = this.getFill_(i), e.textStroke = this.getStroke_(i))
|
||
}
|
||
return this.fixObject(e)
|
||
}
|
||
|
||
getImage_(t) {
|
||
let e = null;
|
||
if (t) {
|
||
let i = t.getImage();
|
||
i && (e = {}, i instanceof Xd ? (e.type = "icon", e.image = {}, e.image.imageAnchor = i.getAnchor(), e.image.imageColor = i.getColor(), e.image.imageSrc = i.getSrc(), e.image.imgSize = i.getSize(), e.image.scale = i.getScale(), e.image.imageRotation = i.getRotation(), e.image.rotateWithView = i.getRotateWithView(), e.image.imageOpacity = i.getOpacity(), e.image.snapToPixel = i.getSnapToPixel(), e.image.offset = i.getOrigin()) : i instanceof qd && (e.type = "", e.image = {}, e.image.fill = this.getFill_(i), e.image.points = i.getPoints(), e.image.radius = i.getRadius(), e.image.radius2 = i.getRadius2(), e.image.angle = i.getAngle(), e.image.stroke = this.getStroke_(i), e.image.rotateWithView = i.getRotateWithView(), e.image.snapToPixel = i.getSnapToPixel()))
|
||
}
|
||
return this.fixObject(e)
|
||
}
|
||
|
||
getStyleCode(t) {
|
||
try {
|
||
if (t && t instanceof X) {
|
||
let e = this.getBaseStyle(t);
|
||
if (e && e instanceof uf) {
|
||
let t = this.getFill_(e), [i, r, o] = [1, null];
|
||
t && t.fillColor && (r = lo(t.fillColor), i = parseFloat(r[3]), r && "number" == typeof i && (o = this.handleBackgroundColor(oo(r), i)));
|
||
let n = this.getStroke_(e), s = this.getText_(e);
|
||
return {fill: {fillColor: o, opacity: i}, stroke: n, image: this.getImage_(e), text: s}
|
||
}
|
||
}
|
||
} catch (t) {
|
||
console.warn(t)
|
||
}
|
||
}
|
||
|
||
removeAllFeatures() {
|
||
const t = cE(this.map, this.layerName), e = this.map.getOverlays().getArray();
|
||
if (t && t.getSource().clear(), e && e.length > 0) {
|
||
let t = e.length;
|
||
for (let i = 0; i < t; i++) e[i] && e[i].get("isPlotText") && (this.map.removeOverlay(e[i]), i--)
|
||
}
|
||
}
|
||
|
||
getFeatures() {
|
||
let t = [], e = cE(this.map, this.layerName);
|
||
if (e) {
|
||
let i = e.getSource();
|
||
if (i && i instanceof b_) {
|
||
let e = i.getFeatures();
|
||
e && e.length > 0 && e.forEach((e, i) => {
|
||
if (e && e.getGeometry) {
|
||
let i = e.getGeometry();
|
||
if (i && i.getCoordinates) {
|
||
let r = i.getType(), o = i.getCoordinates();
|
||
t.push({
|
||
type: "Feature",
|
||
geometry: {type: r, coordinates: o},
|
||
properties: {
|
||
type: e.getGeometry().getPlotType(),
|
||
style: this.getStyleCode(e),
|
||
points: e.getGeometry().getPoints()
|
||
}
|
||
})
|
||
}
|
||
}
|
||
})
|
||
}
|
||
}
|
||
return this.map.getOverlays().getArray().forEach(e => {
|
||
if (e.get("isPlotText")) {
|
||
const i = e.getStyle();
|
||
i.width = e.getWidth() + "px", i.height = e.getHeight() + "px", t.push({
|
||
type: "Feature",
|
||
geometry: {type: "PlotText", coordinates: e.getPosition()},
|
||
properties: {
|
||
id: e.getId(),
|
||
width: e.getWidth(),
|
||
height: e.getHeight(),
|
||
style: i,
|
||
value: e.getValue()
|
||
}
|
||
})
|
||
}
|
||
}), t
|
||
}
|
||
|
||
addFeatures(t) {
|
||
if (t && Array.isArray(t) && t.length > 0) {
|
||
let e = cE(this.map, this.layerName);
|
||
if (e || (e = dE(this.map, this.layerName, {create: !0})).setZIndex(this.options.zIndex || 99), e) {
|
||
let i = e.getSource();
|
||
if (i && i instanceof b_) {
|
||
const e = [];
|
||
if (t.forEach(t => {
|
||
if (t && t.geometry && "PlotText" !== t.geometry.type) if (t.properties.type && o[t.properties.type]) {
|
||
let r = new X({geometry: new o[t.properties.type]([], t.properties.points, t.properties)});
|
||
if (r.set("isPlot", !0), e.push(r.getGeometry().getExtent()), t.properties.style) {
|
||
let e = new OT(t.properties.style);
|
||
e && r.setStyle(e)
|
||
}
|
||
i.addFeature(r)
|
||
} else console.warn("不存在的标绘类型!"); else if (t && t.geometry && "PlotText" === t.geometry.type) {
|
||
e.push(new qi(t.geometry.coordinates).getExtent());
|
||
const i = new PE({
|
||
id: t.properties.id,
|
||
position: t.geometry.coordinates,
|
||
width: t.properties.width,
|
||
height: t.properties.height,
|
||
value: t.properties.value,
|
||
style: t.properties.style
|
||
});
|
||
this.map && this.map instanceof rh && i ? this.map.addOverlay(i) : console.warn("未传入地图对象或者plotText创建失败!")
|
||
}
|
||
}), this.options.zoomToExtent && e && e.length > 0) {
|
||
const t = this._getExtent(e), i = this.map.getSize(), r = this.map.getView();
|
||
r.fit(t, {size: i, duration: 800, maxZoom: r.getMaxZoom() || void 0})
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
_getExtent(t, e = {}) {
|
||
const i = [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY];
|
||
let r = t.reduce(function (t, e) {
|
||
return [Math.min(e[0], t[0]), Math.min(e[1], t[1]), Math.max(e[2], t[2]), Math.max(e[3], t[3])]
|
||
}, i), o = Gt(r), n = "number" == typeof e.adjust ? e.adjust : .2,
|
||
s = "number" == typeof e.minWidth ? e.minWidth : .05,
|
||
a = "number" == typeof e.minHeight ? e.minHeight : .05;
|
||
if (o[0] <= s || o[1] <= a) {
|
||
let t = Ot(r), e = zt(r);
|
||
r = ht([t[0] - n, t[1] - n, e[0] + n, e[1] + n], n)
|
||
}
|
||
return r
|
||
}
|
||
};
|
||
var AT = class {
|
||
constructor(t, e) {
|
||
this.plotDraw = new PT(t, e), this.plotEdit = new LT(t, e), this.plotUtils = new MT(t, e)
|
||
}
|
||
}, kT = window.Ez = {};
|
||
kT.Coordinate = rC, window.EzCoord = rC, kT.Overlay = oC, window.EzOverlay = oC, kT.Icon = nC, window.EzIcon = nC, kT.MBR = sC, window.EzMBR = sC, kT.Event = aC, kT.Global = gC, window.EzGlobal = gC, kT.HTMLElementOverLay = mC, window.HTMLElementOverLay = mC, kT.License = yC, kT.MarkerDragEvent = _C, kT.Marker = xC, window.EzMarker = xC, kT.PopupEvent = wC, kT.Popup = bC, window.EzPopup = bC, kT.Title = CC, window.EzTitle = CC, kT.Map = TC, window.EzMap = TC, kT.PopupTargetMoveEvent = class extends ol.events.Event {
|
||
constructor(t) {
|
||
super(t)
|
||
}
|
||
}, kT.ViewOptions = EC, kT.Json2Style = RC, window.EzJson2Style = RC, kT.Json2StyleMapbox = PC, window.EzJson2StyleMapbox = PC, kT.utility = {}, kT.utility.Measure = SC, kT.VectorLayer = {}, kT.VectorLayer.Base = LC, window.EzVectorLayerBase = LC, kT.VectorLayer.WMTS_SL = IC, window.EzVectorLayerWMTS_SL = IC, kT.TileLayer = {}, kT.TileLayer.Base = lC, window.EzTileLayerBase = lC, kT.TileLayer.GD = dC, window.EzTileLayerGD = dC, kT.TileLayer.XYZ = OC, window.EzTileLayerXYZ = OC, kT.TileLayer.EzMap2010Proj = cC, window.EzTileLayerEzMap2010Proj = cC, kT.TileLayer.EzMap2010 = uC, window.EzTileLayerEzMap2010 = uC, kT.TileLayer.TDT = fC, window.EzTileLayerTDT = fC, kT.TileLayer.WMTS = pC, window.EzTileLayerWMTS = pC, kT.TileLayer.HotSpot = AC, window.EzTileLayerHotSpot = AC, kT.TileLayer.MultiHotSpot = kC, window.EzTileLayerMultiHotSpot = kC, kT.TileLayer.SingleHotSpot = FC, window.EzTileLayerSingleHotSpot = FC, kT.animation = {}, kT.animation.Compose = DC, kT.animation.ComposeEvent = NC, kT.animation.InteropFn = GC, kT.animation.linear = jC, kT.animation.Parallel = zC, kT.animation.Transition = UC, kT.animation.Sequence = BC, kT.animation.Translate = VC, kT.animation.Rotate = YC, kT.controls = {}, kT.controls.Attr = WC, kT.controls.Layers = XC, kT.control = {}, kT.controls.NavBar = qC, kT.controls.Overview = ZC, kT.controls.ScaleLine = KC, kT.controls.SimpleLayers = JC, kT.controls.SimpleZoom = QC, kT.controls.ZoomSlider = eS, kT.g = {}, kT.g.Circle = iS, window.Circle = iS, kT.g.Point = rS, window.Point = rS, kT.g.Polygon = nS, window.Polygon = nS, kT.g.Polyline = sS, window.Polyline = sS, kT.g.Rectangle = aS, window.Rectangle = aS, kT.Layer = {}, kT.Layer.Cluster = lS, window.EzLayerCluster = lS, kT.Layer.Group = hS, window.EzLayerGroup = hS, kT.Layer.HeatMap = uS, window.EzLayerHeatMap = uS, kT.Layer.ImageWMS = cS, kT.style = {}, kT.style.Circle = pS, kT.style.Fill = dS, kT.style.Icon = fS,kT.style.Stroke = gS,kT.style.Style = mS,kT.style.Text = yS,ol.format.HotSpotCluster = vS,ol.format.HotSpot = _S,ol.interaction.AddDOMForClick = wS,ol.interaction.DragFeature = CS,ol.interaction.EditCircle = ES,ol.interaction.Draw2 = LS,ol.source.Cluster2 = IS,ol.source.EzMap2010 = hC,ol.source.EzHotspot = OS,ol.source.SingleHotSpot = MS,kT.olPlot = AT
|
||
}])
|
||
});
|
||
//# sourceMappingURL=FMapClient.js.map |