@gis_victory/gismap 1.0.32 → 1.0.35

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
@@ -32797,7 +32797,6 @@ async function loadAsText(url) {
32797
32797
  }
32798
32798
  return await readFileAsText(url);
32799
32799
  }
32800
- const crypto = {};
32801
32800
  function canParseWithWorker(loader, options) {
32802
32801
  if (!WorkerFarm.isSupported()) {
32803
32802
  return false;
@@ -33417,15 +33416,15 @@ function normalizeStringPosix(path, allowAboveRoot) {
33417
33416
  }
33418
33417
  const isBoolean$2 = (x2) => typeof x2 === "boolean";
33419
33418
  const isFunction$3 = (x2) => typeof x2 === "function";
33420
- const isObject$4 = (x2) => x2 !== null && typeof x2 === "object";
33421
- 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;
33422
33421
  const isIterable$1 = (x2) => Boolean(x2) && typeof x2[Symbol.iterator] === "function";
33423
33422
  const isAsyncIterable$1 = (x2) => x2 && typeof x2[Symbol.asyncIterator] === "function";
33424
33423
  const isResponse$1 = (x2) => typeof Response !== "undefined" && x2 instanceof Response || x2 && x2.arrayBuffer && x2.text && x2.json;
33425
33424
  const isBlob$1 = (x2) => typeof Blob !== "undefined" && x2 instanceof Blob;
33426
33425
  const isBuffer$2 = (x2) => x2 && typeof x2 === "object" && x2.isBuffer;
33427
- const isReadableDOMStream = (x2) => typeof ReadableStream !== "undefined" && x2 instanceof ReadableStream || isObject$4(x2) && isFunction$3(x2.tee) && isFunction$3(x2.cancel) && isFunction$3(x2.getReader);
33428
- 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);
33429
33428
  const isReadableStream$1 = (x2) => isReadableDOMStream(x2) || isReadableNodeStream(x2);
33430
33429
  class FetchError extends Error {
33431
33430
  constructor(message2, info) {
@@ -33741,7 +33740,7 @@ function validateOptionsObject(options, id, defaultOptions2, deprecatedOptions,
33741
33740
  const loaderName = id || "Top level";
33742
33741
  const prefix = id ? `${id}.` : "";
33743
33742
  for (const key in options) {
33744
- const isSubOptions = !id && isObject$4(options[key]);
33743
+ const isSubOptions = !id && isObject$5(options[key]);
33745
33744
  const isBaseUriOption = key === "baseUri" && !id;
33746
33745
  const isWorkerUrlOption = key === "workerUrl" && id;
33747
33746
  if (!(key in defaultOptions2) && !isBaseUriOption && !isWorkerUrlOption) {
@@ -34174,7 +34173,7 @@ function getFetchFunction(options, context) {
34174
34173
  if (typeof loaderOptions.fetch === "function") {
34175
34174
  return loaderOptions.fetch;
34176
34175
  }
34177
- if (isObject$4(loaderOptions.fetch)) {
34176
+ if (isObject$5(loaderOptions.fetch)) {
34178
34177
  return (url) => fetchFile(url, loaderOptions.fetch);
34179
34178
  }
34180
34179
  if (context?.fetch) {
@@ -62643,9 +62642,9 @@ class WEBGLCommandBuffer extends CommandBuffer {
62643
62642
  }
62644
62643
  function _copyBufferToBuffer(device, options) {
62645
62644
  const source2 = options.sourceBuffer;
62646
- const destination = options.destinationBuffer;
62645
+ const destination2 = options.destinationBuffer;
62647
62646
  device.gl.bindBuffer(36662, source2.handle);
62648
- device.gl.bindBuffer(36663, destination.handle);
62647
+ device.gl.bindBuffer(36663, destination2.handle);
62649
62648
  device.gl.copyBufferSubData(36662, 36663, options.sourceOffset ?? 0, options.destinationOffset ?? 0, options.size);
62650
62649
  device.gl.bindBuffer(36662, null);
62651
62650
  device.gl.bindBuffer(36663, null);
@@ -62821,7 +62820,7 @@ class WEBGLCommandEncoder extends CommandEncoder {
62821
62820
  }
62822
62821
  insertDebugMarker(markerLabel) {
62823
62822
  }
62824
- resolveQuerySet(querySet, destination, options) {
62823
+ resolveQuerySet(querySet, destination2, options) {
62825
62824
  }
62826
62825
  }
62827
62826
  function fillArray(options) {
@@ -66510,7 +66509,7 @@ function diffUpdateTrigger(props, oldProps, triggerName) {
66510
66509
  const ERR_NOT_OBJECT = "count(): argument not an object";
66511
66510
  const ERR_NOT_CONTAINER = "count(): argument not a container";
66512
66511
  function count(container) {
66513
- if (!isObject$3(container)) {
66512
+ if (!isObject$4(container)) {
66514
66513
  throw new Error(ERR_NOT_OBJECT);
66515
66514
  }
66516
66515
  if (typeof container.count === "function") {
@@ -66530,7 +66529,7 @@ function count(container) {
66530
66529
  function isPlainObject$2(value) {
66531
66530
  return value !== null && typeof value === "object" && value.constructor === Object;
66532
66531
  }
66533
- function isObject$3(value) {
66532
+ function isObject$4(value) {
66534
66533
  return value !== null && typeof value === "object";
66535
66534
  }
66536
66535
  function mergeShaders(target, source2) {
@@ -81956,6 +81955,675 @@ class GSMarker extends mapboxgl.Marker {
81956
81955
  return this.data;
81957
81956
  }
81958
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
+ sectorAngle = 30;
82498
+ // 扫描扇形角度(度)
82499
+ sectorColor = "rgba(0,255,0,0.4)";
82500
+ // 扇形颜色
82501
+ sectorBorderColor = "rgba(0,0,255,0.8)";
82502
+ // 扇形边框颜色
82503
+ center = [0, 0];
82504
+ animationId = null;
82505
+ // 添加动画ID属性
82506
+ constructor(map2) {
82507
+ this.map = map2;
82508
+ }
82509
+ add(options) {
82510
+ this.center = options.center;
82511
+ if (options.radius) {
82512
+ this.radius = options.radius;
82513
+ }
82514
+ if (options.period) {
82515
+ this.period = options.period;
82516
+ }
82517
+ if (options.backgroundColor) {
82518
+ this.backgroundColor = options.backgroundColor;
82519
+ }
82520
+ if (options.borderColor) {
82521
+ this.borderColor = options.borderColor;
82522
+ }
82523
+ if (options.borderWidth) {
82524
+ this.borderWidth = options.borderWidth;
82525
+ }
82526
+ if (options.sectorAngle) {
82527
+ this.sectorAngle = options.sectorAngle;
82528
+ }
82529
+ if (options.sectorColor) {
82530
+ this.sectorColor = options.sectorColor;
82531
+ }
82532
+ if (options.sectorBorderColor) {
82533
+ this.sectorBorderColor = options.sectorBorderColor;
82534
+ }
82535
+ const circle$1 = circle(this.center, this.radius, {
82536
+ steps: 64,
82537
+ units: "meters"
82538
+ });
82539
+ const sector$1 = sector(this.center, this.radius, 0, this.sectorAngle, {
82540
+ steps: 64,
82541
+ units: "meters"
82542
+ });
82543
+ this.map?.addSource(this.id + "-circle", {
82544
+ type: "geojson",
82545
+ data: circle$1
82546
+ });
82547
+ this.map?.addSource(this.id + "-sector", {
82548
+ type: "geojson",
82549
+ data: sector$1
82550
+ });
82551
+ this.map?.addLayer({
82552
+ id: this.id + "-circle-fill",
82553
+ type: "fill",
82554
+ source: this.id + "-circle",
82555
+ paint: {
82556
+ "fill-color": this.backgroundColor,
82557
+ "fill-outline-color": this.borderColor
82558
+ }
82559
+ });
82560
+ this.map?.addLayer({
82561
+ id: this.id + "-circle-outline",
82562
+ type: "line",
82563
+ source: this.id + "-circle",
82564
+ paint: {
82565
+ "line-color": this.borderColor,
82566
+ "line-width": this.borderWidth
82567
+ }
82568
+ });
82569
+ this.map?.addLayer({
82570
+ id: this.id + "-sector-fill",
82571
+ type: "fill",
82572
+ source: this.id + "-sector",
82573
+ paint: {
82574
+ "fill-color": this.sectorColor,
82575
+ "fill-outline-color": this.sectorBorderColor
82576
+ }
82577
+ });
82578
+ return this;
82579
+ }
82580
+ // 扫描
82581
+ startScan() {
82582
+ this.stopScan();
82583
+ let startTime = performance.now();
82584
+ const animate = (time) => {
82585
+ let elapsed = time - startTime;
82586
+ let angle2 = elapsed % this.period / this.period * 360;
82587
+ const newSector = sector(this.center, this.radius, angle2, angle2 + this.sectorAngle, {
82588
+ steps: 64,
82589
+ units: "meters"
82590
+ });
82591
+ if (this.map?.getSource(this.id + "-sector")) {
82592
+ this.map?.getSource(this.id + "-sector")?.setData(
82593
+ newSector
82594
+ );
82595
+ }
82596
+ this.animationId = requestAnimationFrame(animate);
82597
+ };
82598
+ this.animationId = requestAnimationFrame(animate);
82599
+ return this;
82600
+ }
82601
+ stopScan() {
82602
+ if (this.animationId) {
82603
+ cancelAnimationFrame(this.animationId);
82604
+ this.animationId = null;
82605
+ }
82606
+ return this;
82607
+ }
82608
+ remove() {
82609
+ this.stopScan();
82610
+ if (this.map?.getLayer(this.id + "-circle-fill")) {
82611
+ this.map?.removeLayer(this.id + "-circle-fill");
82612
+ }
82613
+ if (this.map?.getLayer(this.id + "-circle-outline")) {
82614
+ this.map?.removeLayer(this.id + "-circle-outline");
82615
+ }
82616
+ if (this.map?.getLayer(this.id + "-sector-fill")) {
82617
+ this.map?.removeLayer(this.id + "-sector-fill");
82618
+ }
82619
+ if (this.map?.getSource(this.id + "-circle")) {
82620
+ this.map?.removeSource(this.id + "-circle");
82621
+ }
82622
+ if (this.map?.getSource(this.id + "-sector")) {
82623
+ this.map?.removeSource(this.id + "-sector");
82624
+ }
82625
+ }
82626
+ }
81959
82627
  class PlaceholderManager {
81960
82628
  map;
81961
82629
  sourceId = `gismap_placeholder_source_${Math.random().toString(10)}`;
@@ -82644,8 +83312,16 @@ function getToken() {
82644
83312
  return sessionStorage.getItem("token");
82645
83313
  }
82646
83314
  function generateUUID(len2 = 10) {
82647
- const fullUUID = crypto.randomUUID().replace(/-/g, "");
82648
- return fullUUID.substring(0, len2);
83315
+ if (len2 <= 0) {
83316
+ throw new Error("随机数长度必须大于0");
83317
+ }
83318
+ let result = "";
83319
+ const firstDigit = Math.floor(Math.random() * 9) + 1;
83320
+ result += firstDigit;
83321
+ for (let i2 = 1; i2 < len2; i2++) {
83322
+ result += Math.floor(Math.random() * 10);
83323
+ }
83324
+ return result;
82649
83325
  }
82650
83326
  class TemplateManager {
82651
83327
  templates = /* @__PURE__ */ new Map();
@@ -82822,150 +83498,6 @@ class FogManager {
82822
83498
  this.map.setFog({ ...this.options, ...options });
82823
83499
  }
82824
83500
  }
82825
- function feature(geom, properties, options = {}) {
82826
- const feat = { type: "Feature" };
82827
- if (options.id === 0 || options.id) {
82828
- feat.id = options.id;
82829
- }
82830
- if (options.bbox) {
82831
- feat.bbox = options.bbox;
82832
- }
82833
- feat.properties = properties || {};
82834
- feat.geometry = geom;
82835
- return feat;
82836
- }
82837
- function point(coordinates, properties, options = {}) {
82838
- if (!coordinates) {
82839
- throw new Error("coordinates is required");
82840
- }
82841
- if (!Array.isArray(coordinates)) {
82842
- throw new Error("coordinates must be an Array");
82843
- }
82844
- if (coordinates.length < 2) {
82845
- throw new Error("coordinates must be at least 2 numbers long");
82846
- }
82847
- if (!isNumber$2(coordinates[0]) || !isNumber$2(coordinates[1])) {
82848
- throw new Error("coordinates must contain numbers");
82849
- }
82850
- const geom = {
82851
- type: "Point",
82852
- coordinates
82853
- };
82854
- return feature(geom, properties, options);
82855
- }
82856
- function isNumber$2(num) {
82857
- return !isNaN(num) && num !== null && !Array.isArray(num);
82858
- }
82859
- function coordEach(geojson, callback, excludeWrapCoord) {
82860
- if (geojson === null) return;
82861
- 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;
82862
- for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
82863
- geometryMaybeCollection = isFeatureCollection ? geojson.features[featureIndex].geometry : isFeature ? geojson.geometry : geojson;
82864
- isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
82865
- stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
82866
- for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {
82867
- var multiFeatureIndex = 0;
82868
- var geometryIndex = 0;
82869
- geometry2 = isGeometryCollection ? geometryMaybeCollection.geometries[geomIndex] : geometryMaybeCollection;
82870
- if (geometry2 === null) continue;
82871
- coords = geometry2.coordinates;
82872
- var geomType = geometry2.type;
82873
- wrapShrink = geomType === "Polygon" || geomType === "MultiPolygon" ? 1 : 0;
82874
- switch (geomType) {
82875
- case null:
82876
- break;
82877
- case "Point":
82878
- if (callback(
82879
- coords,
82880
- coordIndex,
82881
- featureIndex,
82882
- multiFeatureIndex,
82883
- geometryIndex
82884
- ) === false)
82885
- return false;
82886
- coordIndex++;
82887
- multiFeatureIndex++;
82888
- break;
82889
- case "LineString":
82890
- case "MultiPoint":
82891
- for (j2 = 0; j2 < coords.length; j2++) {
82892
- if (callback(
82893
- coords[j2],
82894
- coordIndex,
82895
- featureIndex,
82896
- multiFeatureIndex,
82897
- geometryIndex
82898
- ) === false)
82899
- return false;
82900
- coordIndex++;
82901
- if (geomType === "MultiPoint") multiFeatureIndex++;
82902
- }
82903
- if (geomType === "LineString") multiFeatureIndex++;
82904
- break;
82905
- case "Polygon":
82906
- case "MultiLineString":
82907
- for (j2 = 0; j2 < coords.length; j2++) {
82908
- for (k2 = 0; k2 < coords[j2].length - wrapShrink; k2++) {
82909
- if (callback(
82910
- coords[j2][k2],
82911
- coordIndex,
82912
- featureIndex,
82913
- multiFeatureIndex,
82914
- geometryIndex
82915
- ) === false)
82916
- return false;
82917
- coordIndex++;
82918
- }
82919
- if (geomType === "MultiLineString") multiFeatureIndex++;
82920
- if (geomType === "Polygon") geometryIndex++;
82921
- }
82922
- if (geomType === "Polygon") multiFeatureIndex++;
82923
- break;
82924
- case "MultiPolygon":
82925
- for (j2 = 0; j2 < coords.length; j2++) {
82926
- geometryIndex = 0;
82927
- for (k2 = 0; k2 < coords[j2].length; k2++) {
82928
- for (l2 = 0; l2 < coords[j2][k2].length - wrapShrink; l2++) {
82929
- if (callback(
82930
- coords[j2][k2][l2],
82931
- coordIndex,
82932
- featureIndex,
82933
- multiFeatureIndex,
82934
- geometryIndex
82935
- ) === false)
82936
- return false;
82937
- coordIndex++;
82938
- }
82939
- geometryIndex++;
82940
- }
82941
- multiFeatureIndex++;
82942
- }
82943
- break;
82944
- case "GeometryCollection":
82945
- for (j2 = 0; j2 < geometry2.geometries.length; j2++)
82946
- if (coordEach(geometry2.geometries[j2], callback) === false)
82947
- return false;
82948
- break;
82949
- default:
82950
- throw new Error("Unknown Geometry Type");
82951
- }
82952
- }
82953
- }
82954
- }
82955
- function centroid(geojson, options = {}) {
82956
- let xSum = 0;
82957
- let ySum = 0;
82958
- let len2 = 0;
82959
- coordEach(
82960
- geojson,
82961
- function(coord) {
82962
- xSum += coord[0];
82963
- ySum += coord[1];
82964
- len2++;
82965
- }
82966
- );
82967
- return point([xSum / len2, ySum / len2], options.properties);
82968
- }
82969
83501
  class QuickSearchManager {
82970
83502
  map;
82971
83503
  markers = /* @__PURE__ */ new Map();
@@ -97819,5 +98351,6 @@ export {
97819
98351
  _sfc_main$F as GisMapView,
97820
98352
  _sfc_main as MapPage,
97821
98353
  MarkerLayer,
98354
+ RadarManager,
97822
98355
  Tile3DLayer2 as Tile3DLayer
97823
98356
  };