@gis_victory/gismap 1.0.34 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -33416,15 +33416,15 @@ function normalizeStringPosix(path, allowAboveRoot) {
33416
33416
  }
33417
33417
  const isBoolean$2 = (x2) => typeof x2 === "boolean";
33418
33418
  const isFunction$3 = (x2) => typeof x2 === "function";
33419
- const isObject$4 = (x2) => x2 !== null && typeof x2 === "object";
33420
- const isPureObject = (x2) => isObject$4(x2) && x2.constructor === {}.constructor;
33419
+ const isObject$5 = (x2) => x2 !== null && typeof x2 === "object";
33420
+ const isPureObject = (x2) => isObject$5(x2) && x2.constructor === {}.constructor;
33421
33421
  const isIterable$1 = (x2) => Boolean(x2) && typeof x2[Symbol.iterator] === "function";
33422
33422
  const isAsyncIterable$1 = (x2) => x2 && typeof x2[Symbol.asyncIterator] === "function";
33423
33423
  const isResponse$1 = (x2) => typeof Response !== "undefined" && x2 instanceof Response || x2 && x2.arrayBuffer && x2.text && x2.json;
33424
33424
  const isBlob$1 = (x2) => typeof Blob !== "undefined" && x2 instanceof Blob;
33425
33425
  const isBuffer$2 = (x2) => x2 && typeof x2 === "object" && x2.isBuffer;
33426
- const isReadableDOMStream = (x2) => typeof ReadableStream !== "undefined" && x2 instanceof ReadableStream || isObject$4(x2) && isFunction$3(x2.tee) && isFunction$3(x2.cancel) && isFunction$3(x2.getReader);
33427
- const isReadableNodeStream = (x2) => isObject$4(x2) && isFunction$3(x2.read) && isFunction$3(x2.pipe) && isBoolean$2(x2.readable);
33426
+ const isReadableDOMStream = (x2) => typeof ReadableStream !== "undefined" && x2 instanceof ReadableStream || isObject$5(x2) && isFunction$3(x2.tee) && isFunction$3(x2.cancel) && isFunction$3(x2.getReader);
33427
+ const isReadableNodeStream = (x2) => isObject$5(x2) && isFunction$3(x2.read) && isFunction$3(x2.pipe) && isBoolean$2(x2.readable);
33428
33428
  const isReadableStream$1 = (x2) => isReadableDOMStream(x2) || isReadableNodeStream(x2);
33429
33429
  class FetchError extends Error {
33430
33430
  constructor(message2, info) {
@@ -33740,7 +33740,7 @@ function validateOptionsObject(options, id, defaultOptions2, deprecatedOptions,
33740
33740
  const loaderName = id || "Top level";
33741
33741
  const prefix = id ? `${id}.` : "";
33742
33742
  for (const key in options) {
33743
- const isSubOptions = !id && isObject$4(options[key]);
33743
+ const isSubOptions = !id && isObject$5(options[key]);
33744
33744
  const isBaseUriOption = key === "baseUri" && !id;
33745
33745
  const isWorkerUrlOption = key === "workerUrl" && id;
33746
33746
  if (!(key in defaultOptions2) && !isBaseUriOption && !isWorkerUrlOption) {
@@ -34173,7 +34173,7 @@ function getFetchFunction(options, context) {
34173
34173
  if (typeof loaderOptions.fetch === "function") {
34174
34174
  return loaderOptions.fetch;
34175
34175
  }
34176
- if (isObject$4(loaderOptions.fetch)) {
34176
+ if (isObject$5(loaderOptions.fetch)) {
34177
34177
  return (url) => fetchFile(url, loaderOptions.fetch);
34178
34178
  }
34179
34179
  if (context?.fetch) {
@@ -62642,9 +62642,9 @@ class WEBGLCommandBuffer extends CommandBuffer {
62642
62642
  }
62643
62643
  function _copyBufferToBuffer(device, options) {
62644
62644
  const source2 = options.sourceBuffer;
62645
- const destination = options.destinationBuffer;
62645
+ const destination2 = options.destinationBuffer;
62646
62646
  device.gl.bindBuffer(36662, source2.handle);
62647
- device.gl.bindBuffer(36663, destination.handle);
62647
+ device.gl.bindBuffer(36663, destination2.handle);
62648
62648
  device.gl.copyBufferSubData(36662, 36663, options.sourceOffset ?? 0, options.destinationOffset ?? 0, options.size);
62649
62649
  device.gl.bindBuffer(36662, null);
62650
62650
  device.gl.bindBuffer(36663, null);
@@ -62820,7 +62820,7 @@ class WEBGLCommandEncoder extends CommandEncoder {
62820
62820
  }
62821
62821
  insertDebugMarker(markerLabel) {
62822
62822
  }
62823
- resolveQuerySet(querySet, destination, options) {
62823
+ resolveQuerySet(querySet, destination2, options) {
62824
62824
  }
62825
62825
  }
62826
62826
  function fillArray(options) {
@@ -66509,7 +66509,7 @@ function diffUpdateTrigger(props, oldProps, triggerName) {
66509
66509
  const ERR_NOT_OBJECT = "count(): argument not an object";
66510
66510
  const ERR_NOT_CONTAINER = "count(): argument not a container";
66511
66511
  function count(container) {
66512
- if (!isObject$3(container)) {
66512
+ if (!isObject$4(container)) {
66513
66513
  throw new Error(ERR_NOT_OBJECT);
66514
66514
  }
66515
66515
  if (typeof container.count === "function") {
@@ -66529,7 +66529,7 @@ function count(container) {
66529
66529
  function isPlainObject$2(value) {
66530
66530
  return value !== null && typeof value === "object" && value.constructor === Object;
66531
66531
  }
66532
- function isObject$3(value) {
66532
+ function isObject$4(value) {
66533
66533
  return value !== null && typeof value === "object";
66534
66534
  }
66535
66535
  function mergeShaders(target, source2) {
@@ -81955,6 +81955,685 @@ class GSMarker extends mapboxgl.Marker {
81955
81955
  return this.data;
81956
81956
  }
81957
81957
  }
81958
+ var earthRadius = 63710088e-1;
81959
+ var factors = {
81960
+ centimeters: earthRadius * 100,
81961
+ centimetres: earthRadius * 100,
81962
+ degrees: 360 / (2 * Math.PI),
81963
+ feet: earthRadius * 3.28084,
81964
+ inches: earthRadius * 39.37,
81965
+ kilometers: earthRadius / 1e3,
81966
+ kilometres: earthRadius / 1e3,
81967
+ meters: earthRadius,
81968
+ metres: earthRadius,
81969
+ miles: earthRadius / 1609.344,
81970
+ millimeters: earthRadius * 1e3,
81971
+ millimetres: earthRadius * 1e3,
81972
+ nauticalmiles: earthRadius / 1852,
81973
+ radians: 1,
81974
+ yards: earthRadius * 1.0936
81975
+ };
81976
+ function feature$4(geom, properties, options = {}) {
81977
+ const feat = { type: "Feature" };
81978
+ if (options.id === 0 || options.id) {
81979
+ feat.id = options.id;
81980
+ }
81981
+ if (options.bbox) {
81982
+ feat.bbox = options.bbox;
81983
+ }
81984
+ feat.properties = properties || {};
81985
+ feat.geometry = geom;
81986
+ return feat;
81987
+ }
81988
+ function point$1(coordinates, properties, options = {}) {
81989
+ if (!coordinates) {
81990
+ throw new Error("coordinates is required");
81991
+ }
81992
+ if (!Array.isArray(coordinates)) {
81993
+ throw new Error("coordinates must be an Array");
81994
+ }
81995
+ if (coordinates.length < 2) {
81996
+ throw new Error("coordinates must be at least 2 numbers long");
81997
+ }
81998
+ if (!isNumber$3(coordinates[0]) || !isNumber$3(coordinates[1])) {
81999
+ throw new Error("coordinates must contain numbers");
82000
+ }
82001
+ const geom = {
82002
+ type: "Point",
82003
+ coordinates
82004
+ };
82005
+ return feature$4(geom, properties, options);
82006
+ }
82007
+ function lengthToRadians(distance2, units = "kilometers") {
82008
+ const factor = factors[units];
82009
+ if (!factor) {
82010
+ throw new Error(units + " units is invalid");
82011
+ }
82012
+ return distance2 / factor;
82013
+ }
82014
+ function radiansToDegrees(radians2) {
82015
+ const normalisedRadians = radians2 % (2 * Math.PI);
82016
+ return normalisedRadians * 180 / Math.PI;
82017
+ }
82018
+ function degreesToRadians(degrees2) {
82019
+ const normalisedDegrees = degrees2 % 360;
82020
+ return normalisedDegrees * Math.PI / 180;
82021
+ }
82022
+ function isNumber$3(num) {
82023
+ return !isNaN(num) && num !== null && !Array.isArray(num);
82024
+ }
82025
+ function getCoord(coord) {
82026
+ if (!coord) {
82027
+ throw new Error("coord is required");
82028
+ }
82029
+ if (!Array.isArray(coord)) {
82030
+ if (coord.type === "Feature" && coord.geometry !== null && coord.geometry.type === "Point") {
82031
+ return [...coord.geometry.coordinates];
82032
+ }
82033
+ if (coord.type === "Point") {
82034
+ return [...coord.coordinates];
82035
+ }
82036
+ }
82037
+ if (Array.isArray(coord) && coord.length >= 2 && !Array.isArray(coord[0]) && !Array.isArray(coord[1])) {
82038
+ return [...coord];
82039
+ }
82040
+ throw new Error("coord must be GeoJSON Point or an Array of numbers");
82041
+ }
82042
+ function destination(origin2, distance2, bearing, options = {}) {
82043
+ const coordinates1 = getCoord(origin2);
82044
+ const longitude1 = degreesToRadians(coordinates1[0]);
82045
+ const latitude1 = degreesToRadians(coordinates1[1]);
82046
+ const bearingRad = degreesToRadians(bearing);
82047
+ const radians2 = lengthToRadians(distance2, options.units);
82048
+ const latitude2 = Math.asin(
82049
+ Math.sin(latitude1) * Math.cos(radians2) + Math.cos(latitude1) * Math.sin(radians2) * Math.cos(bearingRad)
82050
+ );
82051
+ const longitude2 = longitude1 + Math.atan2(
82052
+ Math.sin(bearingRad) * Math.sin(radians2) * Math.cos(latitude1),
82053
+ Math.cos(radians2) - Math.sin(latitude1) * Math.sin(latitude2)
82054
+ );
82055
+ const lng = radiansToDegrees(longitude2);
82056
+ const lat = radiansToDegrees(latitude2);
82057
+ return point$1([lng, lat], options.properties);
82058
+ }
82059
+ function feature$3(geom, properties, options = {}) {
82060
+ const feat = { type: "Feature" };
82061
+ if (options.id === 0 || options.id) {
82062
+ feat.id = options.id;
82063
+ }
82064
+ if (options.bbox) {
82065
+ feat.bbox = options.bbox;
82066
+ }
82067
+ feat.properties = properties || {};
82068
+ feat.geometry = geom;
82069
+ return feat;
82070
+ }
82071
+ function point(coordinates, properties, options = {}) {
82072
+ if (!coordinates) {
82073
+ throw new Error("coordinates is required");
82074
+ }
82075
+ if (!Array.isArray(coordinates)) {
82076
+ throw new Error("coordinates must be an Array");
82077
+ }
82078
+ if (coordinates.length < 2) {
82079
+ throw new Error("coordinates must be at least 2 numbers long");
82080
+ }
82081
+ if (!isNumber$2(coordinates[0]) || !isNumber$2(coordinates[1])) {
82082
+ throw new Error("coordinates must contain numbers");
82083
+ }
82084
+ const geom = {
82085
+ type: "Point",
82086
+ coordinates
82087
+ };
82088
+ return feature$3(geom, properties, options);
82089
+ }
82090
+ function isNumber$2(num) {
82091
+ return !isNaN(num) && num !== null && !Array.isArray(num);
82092
+ }
82093
+ function coordEach$1(geojson, callback, excludeWrapCoord) {
82094
+ if (geojson === null) return;
82095
+ var j2, k2, l2, geometry2, stopG, coords, geometryMaybeCollection, wrapShrink = 0, coordIndex = 0, isGeometryCollection, type = geojson.type, isFeatureCollection = type === "FeatureCollection", isFeature = type === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
82096
+ for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
82097
+ geometryMaybeCollection = isFeatureCollection ? geojson.features[featureIndex].geometry : isFeature ? geojson.geometry : geojson;
82098
+ isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
82099
+ stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
82100
+ for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {
82101
+ var multiFeatureIndex = 0;
82102
+ var geometryIndex = 0;
82103
+ geometry2 = isGeometryCollection ? geometryMaybeCollection.geometries[geomIndex] : geometryMaybeCollection;
82104
+ if (geometry2 === null) continue;
82105
+ coords = geometry2.coordinates;
82106
+ var geomType = geometry2.type;
82107
+ wrapShrink = geomType === "Polygon" || geomType === "MultiPolygon" ? 1 : 0;
82108
+ switch (geomType) {
82109
+ case null:
82110
+ break;
82111
+ case "Point":
82112
+ if (callback(
82113
+ coords,
82114
+ coordIndex,
82115
+ featureIndex,
82116
+ multiFeatureIndex,
82117
+ geometryIndex
82118
+ ) === false)
82119
+ return false;
82120
+ coordIndex++;
82121
+ multiFeatureIndex++;
82122
+ break;
82123
+ case "LineString":
82124
+ case "MultiPoint":
82125
+ for (j2 = 0; j2 < coords.length; j2++) {
82126
+ if (callback(
82127
+ coords[j2],
82128
+ coordIndex,
82129
+ featureIndex,
82130
+ multiFeatureIndex,
82131
+ geometryIndex
82132
+ ) === false)
82133
+ return false;
82134
+ coordIndex++;
82135
+ if (geomType === "MultiPoint") multiFeatureIndex++;
82136
+ }
82137
+ if (geomType === "LineString") multiFeatureIndex++;
82138
+ break;
82139
+ case "Polygon":
82140
+ case "MultiLineString":
82141
+ for (j2 = 0; j2 < coords.length; j2++) {
82142
+ for (k2 = 0; k2 < coords[j2].length - wrapShrink; k2++) {
82143
+ if (callback(
82144
+ coords[j2][k2],
82145
+ coordIndex,
82146
+ featureIndex,
82147
+ multiFeatureIndex,
82148
+ geometryIndex
82149
+ ) === false)
82150
+ return false;
82151
+ coordIndex++;
82152
+ }
82153
+ if (geomType === "MultiLineString") multiFeatureIndex++;
82154
+ if (geomType === "Polygon") geometryIndex++;
82155
+ }
82156
+ if (geomType === "Polygon") multiFeatureIndex++;
82157
+ break;
82158
+ case "MultiPolygon":
82159
+ for (j2 = 0; j2 < coords.length; j2++) {
82160
+ geometryIndex = 0;
82161
+ for (k2 = 0; k2 < coords[j2].length; k2++) {
82162
+ for (l2 = 0; l2 < coords[j2][k2].length - wrapShrink; l2++) {
82163
+ if (callback(
82164
+ coords[j2][k2][l2],
82165
+ coordIndex,
82166
+ featureIndex,
82167
+ multiFeatureIndex,
82168
+ geometryIndex
82169
+ ) === false)
82170
+ return false;
82171
+ coordIndex++;
82172
+ }
82173
+ geometryIndex++;
82174
+ }
82175
+ multiFeatureIndex++;
82176
+ }
82177
+ break;
82178
+ case "GeometryCollection":
82179
+ for (j2 = 0; j2 < geometry2.geometries.length; j2++)
82180
+ if (coordEach$1(geometry2.geometries[j2], callback) === false)
82181
+ return false;
82182
+ break;
82183
+ default:
82184
+ throw new Error("Unknown Geometry Type");
82185
+ }
82186
+ }
82187
+ }
82188
+ }
82189
+ function centroid(geojson, options = {}) {
82190
+ let xSum = 0;
82191
+ let ySum = 0;
82192
+ let len2 = 0;
82193
+ coordEach$1(
82194
+ geojson,
82195
+ function(coord) {
82196
+ xSum += coord[0];
82197
+ ySum += coord[1];
82198
+ len2++;
82199
+ }
82200
+ );
82201
+ return point([xSum / len2, ySum / len2], options.properties);
82202
+ }
82203
+ function feature$2(geom, properties, options = {}) {
82204
+ const feat = { type: "Feature" };
82205
+ if (options.id === 0 || options.id) {
82206
+ feat.id = options.id;
82207
+ }
82208
+ if (options.bbox) {
82209
+ feat.bbox = options.bbox;
82210
+ }
82211
+ feat.properties = properties || {};
82212
+ feat.geometry = geom;
82213
+ return feat;
82214
+ }
82215
+ function polygon$1(coordinates, properties, options = {}) {
82216
+ for (const ring of coordinates) {
82217
+ if (ring.length < 4) {
82218
+ throw new Error(
82219
+ "Each LinearRing of a Polygon must have 4 or more Positions."
82220
+ );
82221
+ }
82222
+ if (ring[ring.length - 1].length !== ring[0].length) {
82223
+ throw new Error("First and last Position are not equivalent.");
82224
+ }
82225
+ for (let j2 = 0; j2 < ring[ring.length - 1].length; j2++) {
82226
+ if (ring[ring.length - 1][j2] !== ring[0][j2]) {
82227
+ throw new Error("First and last Position are not equivalent.");
82228
+ }
82229
+ }
82230
+ }
82231
+ const geom = {
82232
+ type: "Polygon",
82233
+ coordinates
82234
+ };
82235
+ return feature$2(geom, properties, options);
82236
+ }
82237
+ function circle(center, radius, options = {}) {
82238
+ const steps = options.steps || 64;
82239
+ const properties = options.properties ? options.properties : !Array.isArray(center) && center.type === "Feature" && center.properties ? center.properties : {};
82240
+ const coordinates = [];
82241
+ for (let i2 = 0; i2 < steps; i2++) {
82242
+ coordinates.push(
82243
+ destination(center, radius, i2 * -360 / steps, options).geometry.coordinates
82244
+ );
82245
+ }
82246
+ coordinates.push(coordinates[0]);
82247
+ return polygon$1([coordinates], properties);
82248
+ }
82249
+ function feature$1(geom, properties, options = {}) {
82250
+ const feat = { type: "Feature" };
82251
+ if (options.id === 0 || options.id) {
82252
+ feat.id = options.id;
82253
+ }
82254
+ if (options.bbox) {
82255
+ feat.bbox = options.bbox;
82256
+ }
82257
+ feat.properties = properties || {};
82258
+ feat.geometry = geom;
82259
+ return feat;
82260
+ }
82261
+ function lineString(coordinates, properties, options = {}) {
82262
+ if (coordinates.length < 2) {
82263
+ throw new Error("coordinates must be an array of two or more positions");
82264
+ }
82265
+ const geom = {
82266
+ type: "LineString",
82267
+ coordinates
82268
+ };
82269
+ return feature$1(geom, properties, options);
82270
+ }
82271
+ function lineArc(center, radius, bearing1, bearing2, options = {}) {
82272
+ const steps = options.steps || 64;
82273
+ const angle1 = convertAngleTo360$1(bearing1);
82274
+ const angle2 = convertAngleTo360$1(bearing2);
82275
+ const properties = !Array.isArray(center) && center.type === "Feature" ? center.properties : {};
82276
+ if (angle1 === angle2) {
82277
+ return lineString(
82278
+ circle(center, radius, options).geometry.coordinates[0],
82279
+ properties
82280
+ );
82281
+ }
82282
+ const arcStartDegree = angle1;
82283
+ const arcEndDegree = angle1 < angle2 ? angle2 : angle2 + 360;
82284
+ let alpha = arcStartDegree;
82285
+ const coordinates = [];
82286
+ let i2 = 0;
82287
+ const arcStep = (arcEndDegree - arcStartDegree) / steps;
82288
+ while (alpha <= arcEndDegree) {
82289
+ coordinates.push(
82290
+ destination(center, radius, alpha, options).geometry.coordinates
82291
+ );
82292
+ i2++;
82293
+ alpha = arcStartDegree + i2 * arcStep;
82294
+ }
82295
+ return lineString(coordinates, properties);
82296
+ }
82297
+ function convertAngleTo360$1(alpha) {
82298
+ let beta = alpha % 360;
82299
+ if (beta < 0) {
82300
+ beta += 360;
82301
+ }
82302
+ return beta;
82303
+ }
82304
+ function feature(geom, properties, options = {}) {
82305
+ const feat = { type: "Feature" };
82306
+ if (options.id === 0 || options.id) {
82307
+ feat.id = options.id;
82308
+ }
82309
+ if (options.bbox) {
82310
+ feat.bbox = options.bbox;
82311
+ }
82312
+ feat.properties = properties || {};
82313
+ feat.geometry = geom;
82314
+ return feat;
82315
+ }
82316
+ function polygon(coordinates, properties, options = {}) {
82317
+ for (const ring of coordinates) {
82318
+ if (ring.length < 4) {
82319
+ throw new Error(
82320
+ "Each LinearRing of a Polygon must have 4 or more Positions."
82321
+ );
82322
+ }
82323
+ if (ring[ring.length - 1].length !== ring[0].length) {
82324
+ throw new Error("First and last Position are not equivalent.");
82325
+ }
82326
+ for (let j2 = 0; j2 < ring[ring.length - 1].length; j2++) {
82327
+ if (ring[ring.length - 1][j2] !== ring[0][j2]) {
82328
+ throw new Error("First and last Position are not equivalent.");
82329
+ }
82330
+ }
82331
+ }
82332
+ const geom = {
82333
+ type: "Polygon",
82334
+ coordinates
82335
+ };
82336
+ return feature(geom, properties, options);
82337
+ }
82338
+ function isObject$3(input) {
82339
+ return input !== null && typeof input === "object" && !Array.isArray(input);
82340
+ }
82341
+ function coordEach(geojson, callback, excludeWrapCoord) {
82342
+ if (geojson === null) return;
82343
+ var j2, k2, l2, geometry2, stopG, coords, geometryMaybeCollection, wrapShrink = 0, coordIndex = 0, isGeometryCollection, type = geojson.type, isFeatureCollection = type === "FeatureCollection", isFeature = type === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
82344
+ for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
82345
+ geometryMaybeCollection = isFeatureCollection ? geojson.features[featureIndex].geometry : isFeature ? geojson.geometry : geojson;
82346
+ isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
82347
+ stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
82348
+ for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {
82349
+ var multiFeatureIndex = 0;
82350
+ var geometryIndex = 0;
82351
+ geometry2 = isGeometryCollection ? geometryMaybeCollection.geometries[geomIndex] : geometryMaybeCollection;
82352
+ if (geometry2 === null) continue;
82353
+ coords = geometry2.coordinates;
82354
+ var geomType = geometry2.type;
82355
+ wrapShrink = 0;
82356
+ switch (geomType) {
82357
+ case null:
82358
+ break;
82359
+ case "Point":
82360
+ if (callback(
82361
+ coords,
82362
+ coordIndex,
82363
+ featureIndex,
82364
+ multiFeatureIndex,
82365
+ geometryIndex
82366
+ ) === false)
82367
+ return false;
82368
+ coordIndex++;
82369
+ multiFeatureIndex++;
82370
+ break;
82371
+ case "LineString":
82372
+ case "MultiPoint":
82373
+ for (j2 = 0; j2 < coords.length; j2++) {
82374
+ if (callback(
82375
+ coords[j2],
82376
+ coordIndex,
82377
+ featureIndex,
82378
+ multiFeatureIndex,
82379
+ geometryIndex
82380
+ ) === false)
82381
+ return false;
82382
+ coordIndex++;
82383
+ if (geomType === "MultiPoint") multiFeatureIndex++;
82384
+ }
82385
+ if (geomType === "LineString") multiFeatureIndex++;
82386
+ break;
82387
+ case "Polygon":
82388
+ case "MultiLineString":
82389
+ for (j2 = 0; j2 < coords.length; j2++) {
82390
+ for (k2 = 0; k2 < coords[j2].length - wrapShrink; k2++) {
82391
+ if (callback(
82392
+ coords[j2][k2],
82393
+ coordIndex,
82394
+ featureIndex,
82395
+ multiFeatureIndex,
82396
+ geometryIndex
82397
+ ) === false)
82398
+ return false;
82399
+ coordIndex++;
82400
+ }
82401
+ if (geomType === "MultiLineString") multiFeatureIndex++;
82402
+ if (geomType === "Polygon") geometryIndex++;
82403
+ }
82404
+ if (geomType === "Polygon") multiFeatureIndex++;
82405
+ break;
82406
+ case "MultiPolygon":
82407
+ for (j2 = 0; j2 < coords.length; j2++) {
82408
+ geometryIndex = 0;
82409
+ for (k2 = 0; k2 < coords[j2].length; k2++) {
82410
+ for (l2 = 0; l2 < coords[j2][k2].length - wrapShrink; l2++) {
82411
+ if (callback(
82412
+ coords[j2][k2][l2],
82413
+ coordIndex,
82414
+ featureIndex,
82415
+ multiFeatureIndex,
82416
+ geometryIndex
82417
+ ) === false)
82418
+ return false;
82419
+ coordIndex++;
82420
+ }
82421
+ geometryIndex++;
82422
+ }
82423
+ multiFeatureIndex++;
82424
+ }
82425
+ break;
82426
+ case "GeometryCollection":
82427
+ for (j2 = 0; j2 < geometry2.geometries.length; j2++)
82428
+ if (coordEach(geometry2.geometries[j2], callback) === false)
82429
+ return false;
82430
+ break;
82431
+ default:
82432
+ throw new Error("Unknown Geometry Type");
82433
+ }
82434
+ }
82435
+ }
82436
+ }
82437
+ function getCoords(coords) {
82438
+ if (Array.isArray(coords)) {
82439
+ return coords;
82440
+ }
82441
+ if (coords.type === "Feature") {
82442
+ if (coords.geometry !== null) {
82443
+ return coords.geometry.coordinates;
82444
+ }
82445
+ } else {
82446
+ if (coords.coordinates) {
82447
+ return coords.coordinates;
82448
+ }
82449
+ }
82450
+ throw new Error(
82451
+ "coords must be GeoJSON Feature, Geometry Object or an Array"
82452
+ );
82453
+ }
82454
+ function sector(center, radius, bearing1, bearing2, options = {}) {
82455
+ options = options || {};
82456
+ if (!isObject$3(options)) throw new Error("options is invalid");
82457
+ const properties = options.properties;
82458
+ if (!center) throw new Error("center is required");
82459
+ if (bearing1 === void 0 || bearing1 === null)
82460
+ throw new Error("bearing1 is required");
82461
+ if (bearing2 === void 0 || bearing2 === null)
82462
+ throw new Error("bearing2 is required");
82463
+ if (!radius) throw new Error("radius is required");
82464
+ if (typeof options !== "object") throw new Error("options must be an object");
82465
+ if (convertAngleTo360(bearing1) === convertAngleTo360(bearing2)) {
82466
+ return circle(center, radius, options);
82467
+ }
82468
+ const coords = getCoords(center);
82469
+ const arc = lineArc(center, radius, bearing1, bearing2, options);
82470
+ const sliceCoords = [[coords]];
82471
+ coordEach(arc, function(currentCoords) {
82472
+ sliceCoords[0].push(currentCoords);
82473
+ });
82474
+ sliceCoords[0].push(coords);
82475
+ return polygon(sliceCoords, properties);
82476
+ }
82477
+ function convertAngleTo360(alpha) {
82478
+ let beta = alpha % 360;
82479
+ if (beta < 0) {
82480
+ beta += 360;
82481
+ }
82482
+ return beta;
82483
+ }
82484
+ class RadarManager {
82485
+ map;
82486
+ id = `radar-${Math.random()}`;
82487
+ radius = 100;
82488
+ // 半径(米)
82489
+ period = 3e3;
82490
+ // 扫描一圈时间(毫秒)
82491
+ backgroundColor = "rgba(255,0,0,0.1)";
82492
+ // 背景颜色
82493
+ borderColor = "rgba(255,0,0,0.8)";
82494
+ // 边框颜色
82495
+ borderWidth = 2;
82496
+ // 边框宽度
82497
+ sectorVisible = false;
82498
+ // 扇形是否可见
82499
+ sectorAngle = 30;
82500
+ // 扫描扇形角度(度)
82501
+ sectorColor = "rgba(0,255,0,0.4)";
82502
+ // 扇形颜色
82503
+ sectorBorderColor = "rgba(0,0,255,0.8)";
82504
+ // 扇形边框颜色
82505
+ center = [0, 0];
82506
+ animationId = null;
82507
+ // 添加动画ID属性
82508
+ constructor(map2) {
82509
+ this.map = map2;
82510
+ }
82511
+ add(options) {
82512
+ this.center = options.center;
82513
+ if (options.radius) {
82514
+ this.radius = options.radius;
82515
+ }
82516
+ if (options.period) {
82517
+ this.period = options.period;
82518
+ }
82519
+ if (options.backgroundColor) {
82520
+ this.backgroundColor = options.backgroundColor;
82521
+ }
82522
+ if (options.borderColor) {
82523
+ this.borderColor = options.borderColor;
82524
+ }
82525
+ if (options.borderWidth) {
82526
+ this.borderWidth = options.borderWidth;
82527
+ }
82528
+ if (options.sectorVisible) {
82529
+ this.sectorVisible = options.sectorVisible;
82530
+ }
82531
+ if (options.sectorAngle) {
82532
+ this.sectorAngle = options.sectorAngle;
82533
+ }
82534
+ if (options.sectorColor) {
82535
+ this.sectorColor = options.sectorColor;
82536
+ }
82537
+ if (options.sectorBorderColor) {
82538
+ this.sectorBorderColor = options.sectorBorderColor;
82539
+ }
82540
+ const circle$1 = circle(this.center, this.radius, {
82541
+ steps: 64,
82542
+ units: "meters"
82543
+ });
82544
+ const sector$1 = sector(this.center, this.radius, 0, this.sectorAngle, {
82545
+ steps: 64,
82546
+ units: "meters"
82547
+ });
82548
+ this.map?.addSource(this.id + "-circle", {
82549
+ type: "geojson",
82550
+ data: circle$1
82551
+ });
82552
+ this.map?.addSource(this.id + "-sector", {
82553
+ type: "geojson",
82554
+ data: sector$1
82555
+ });
82556
+ this.map?.addLayer({
82557
+ id: this.id + "-circle-fill",
82558
+ type: "fill",
82559
+ source: this.id + "-circle",
82560
+ paint: {
82561
+ "fill-color": this.backgroundColor,
82562
+ "fill-outline-color": this.borderColor
82563
+ }
82564
+ });
82565
+ this.map?.addLayer({
82566
+ id: this.id + "-circle-outline",
82567
+ type: "line",
82568
+ source: this.id + "-circle",
82569
+ paint: {
82570
+ "line-color": this.borderColor,
82571
+ "line-width": this.borderWidth
82572
+ }
82573
+ });
82574
+ if (this.sectorVisible) {
82575
+ this.map?.addLayer({
82576
+ id: this.id + "-sector-fill",
82577
+ type: "fill",
82578
+ source: this.id + "-sector",
82579
+ paint: {
82580
+ "fill-color": this.sectorColor,
82581
+ "fill-outline-color": this.sectorBorderColor
82582
+ }
82583
+ });
82584
+ }
82585
+ return this;
82586
+ }
82587
+ // 扫描
82588
+ startScan() {
82589
+ if (!this.sectorVisible) {
82590
+ return this;
82591
+ }
82592
+ this.stopScan();
82593
+ let startTime = performance.now();
82594
+ const animate = (time) => {
82595
+ let elapsed = time - startTime;
82596
+ let angle2 = elapsed % this.period / this.period * 360;
82597
+ const newSector = sector(this.center, this.radius, angle2, angle2 + this.sectorAngle, {
82598
+ steps: 64,
82599
+ units: "meters"
82600
+ });
82601
+ if (this.map?.getSource(this.id + "-sector")) {
82602
+ this.map?.getSource(this.id + "-sector")?.setData(
82603
+ newSector
82604
+ );
82605
+ }
82606
+ this.animationId = requestAnimationFrame(animate);
82607
+ };
82608
+ this.animationId = requestAnimationFrame(animate);
82609
+ return this;
82610
+ }
82611
+ stopScan() {
82612
+ if (this.animationId) {
82613
+ cancelAnimationFrame(this.animationId);
82614
+ this.animationId = null;
82615
+ }
82616
+ return this;
82617
+ }
82618
+ remove() {
82619
+ this.stopScan();
82620
+ if (this.map?.getLayer(this.id + "-circle-fill")) {
82621
+ this.map?.removeLayer(this.id + "-circle-fill");
82622
+ }
82623
+ if (this.map?.getLayer(this.id + "-circle-outline")) {
82624
+ this.map?.removeLayer(this.id + "-circle-outline");
82625
+ }
82626
+ if (this.map?.getLayer(this.id + "-sector-fill")) {
82627
+ this.map?.removeLayer(this.id + "-sector-fill");
82628
+ }
82629
+ if (this.map?.getSource(this.id + "-circle")) {
82630
+ this.map?.removeSource(this.id + "-circle");
82631
+ }
82632
+ if (this.map?.getSource(this.id + "-sector")) {
82633
+ this.map?.removeSource(this.id + "-sector");
82634
+ }
82635
+ }
82636
+ }
81958
82637
  class PlaceholderManager {
81959
82638
  map;
81960
82639
  sourceId = `gismap_placeholder_source_${Math.random().toString(10)}`;
@@ -82829,150 +83508,6 @@ class FogManager {
82829
83508
  this.map.setFog({ ...this.options, ...options });
82830
83509
  }
82831
83510
  }
82832
- function feature(geom, properties, options = {}) {
82833
- const feat = { type: "Feature" };
82834
- if (options.id === 0 || options.id) {
82835
- feat.id = options.id;
82836
- }
82837
- if (options.bbox) {
82838
- feat.bbox = options.bbox;
82839
- }
82840
- feat.properties = properties || {};
82841
- feat.geometry = geom;
82842
- return feat;
82843
- }
82844
- function point(coordinates, properties, options = {}) {
82845
- if (!coordinates) {
82846
- throw new Error("coordinates is required");
82847
- }
82848
- if (!Array.isArray(coordinates)) {
82849
- throw new Error("coordinates must be an Array");
82850
- }
82851
- if (coordinates.length < 2) {
82852
- throw new Error("coordinates must be at least 2 numbers long");
82853
- }
82854
- if (!isNumber$2(coordinates[0]) || !isNumber$2(coordinates[1])) {
82855
- throw new Error("coordinates must contain numbers");
82856
- }
82857
- const geom = {
82858
- type: "Point",
82859
- coordinates
82860
- };
82861
- return feature(geom, properties, options);
82862
- }
82863
- function isNumber$2(num) {
82864
- return !isNaN(num) && num !== null && !Array.isArray(num);
82865
- }
82866
- function coordEach(geojson, callback, excludeWrapCoord) {
82867
- if (geojson === null) return;
82868
- var j2, k2, l2, geometry2, stopG, coords, geometryMaybeCollection, wrapShrink = 0, coordIndex = 0, isGeometryCollection, type = geojson.type, isFeatureCollection = type === "FeatureCollection", isFeature = type === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
82869
- for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
82870
- geometryMaybeCollection = isFeatureCollection ? geojson.features[featureIndex].geometry : isFeature ? geojson.geometry : geojson;
82871
- isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
82872
- stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
82873
- for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {
82874
- var multiFeatureIndex = 0;
82875
- var geometryIndex = 0;
82876
- geometry2 = isGeometryCollection ? geometryMaybeCollection.geometries[geomIndex] : geometryMaybeCollection;
82877
- if (geometry2 === null) continue;
82878
- coords = geometry2.coordinates;
82879
- var geomType = geometry2.type;
82880
- wrapShrink = geomType === "Polygon" || geomType === "MultiPolygon" ? 1 : 0;
82881
- switch (geomType) {
82882
- case null:
82883
- break;
82884
- case "Point":
82885
- if (callback(
82886
- coords,
82887
- coordIndex,
82888
- featureIndex,
82889
- multiFeatureIndex,
82890
- geometryIndex
82891
- ) === false)
82892
- return false;
82893
- coordIndex++;
82894
- multiFeatureIndex++;
82895
- break;
82896
- case "LineString":
82897
- case "MultiPoint":
82898
- for (j2 = 0; j2 < coords.length; j2++) {
82899
- if (callback(
82900
- coords[j2],
82901
- coordIndex,
82902
- featureIndex,
82903
- multiFeatureIndex,
82904
- geometryIndex
82905
- ) === false)
82906
- return false;
82907
- coordIndex++;
82908
- if (geomType === "MultiPoint") multiFeatureIndex++;
82909
- }
82910
- if (geomType === "LineString") multiFeatureIndex++;
82911
- break;
82912
- case "Polygon":
82913
- case "MultiLineString":
82914
- for (j2 = 0; j2 < coords.length; j2++) {
82915
- for (k2 = 0; k2 < coords[j2].length - wrapShrink; k2++) {
82916
- if (callback(
82917
- coords[j2][k2],
82918
- coordIndex,
82919
- featureIndex,
82920
- multiFeatureIndex,
82921
- geometryIndex
82922
- ) === false)
82923
- return false;
82924
- coordIndex++;
82925
- }
82926
- if (geomType === "MultiLineString") multiFeatureIndex++;
82927
- if (geomType === "Polygon") geometryIndex++;
82928
- }
82929
- if (geomType === "Polygon") multiFeatureIndex++;
82930
- break;
82931
- case "MultiPolygon":
82932
- for (j2 = 0; j2 < coords.length; j2++) {
82933
- geometryIndex = 0;
82934
- for (k2 = 0; k2 < coords[j2].length; k2++) {
82935
- for (l2 = 0; l2 < coords[j2][k2].length - wrapShrink; l2++) {
82936
- if (callback(
82937
- coords[j2][k2][l2],
82938
- coordIndex,
82939
- featureIndex,
82940
- multiFeatureIndex,
82941
- geometryIndex
82942
- ) === false)
82943
- return false;
82944
- coordIndex++;
82945
- }
82946
- geometryIndex++;
82947
- }
82948
- multiFeatureIndex++;
82949
- }
82950
- break;
82951
- case "GeometryCollection":
82952
- for (j2 = 0; j2 < geometry2.geometries.length; j2++)
82953
- if (coordEach(geometry2.geometries[j2], callback) === false)
82954
- return false;
82955
- break;
82956
- default:
82957
- throw new Error("Unknown Geometry Type");
82958
- }
82959
- }
82960
- }
82961
- }
82962
- function centroid(geojson, options = {}) {
82963
- let xSum = 0;
82964
- let ySum = 0;
82965
- let len2 = 0;
82966
- coordEach(
82967
- geojson,
82968
- function(coord) {
82969
- xSum += coord[0];
82970
- ySum += coord[1];
82971
- len2++;
82972
- }
82973
- );
82974
- return point([xSum / len2, ySum / len2], options.properties);
82975
- }
82976
83511
  class QuickSearchManager {
82977
83512
  map;
82978
83513
  markers = /* @__PURE__ */ new Map();
@@ -97826,5 +98361,6 @@ export {
97826
98361
  _sfc_main$F as GisMapView,
97827
98362
  _sfc_main as MapPage,
97828
98363
  MarkerLayer,
98364
+ RadarManager,
97829
98365
  Tile3DLayer2 as Tile3DLayer
97830
98366
  };