augustine-jkmap 1.1.1 → 1.1.3

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.
@@ -11,305 +11,6 @@
11
11
  return /******/ (() => { // webpackBootstrap
12
12
  /******/ var __webpack_modules__ = ({
13
13
 
14
- /***/ 3
15
- (__unused_webpack_module, exports) {
16
-
17
- (function (global, factory) {
18
- true ? factory(exports) :
19
- 0;
20
- }(this, (function (exports) { 'use strict';
21
-
22
- /* Copyright (c) 2022 Environmental Systems Research Institute, Inc.
23
- * Apache-2.0 */
24
- var isBrowser = typeof window !== 'undefined';
25
- // allow consuming libraries to provide their own Promise implementations
26
- var utils = {
27
- Promise: isBrowser ? window['Promise'] : undefined
28
- };
29
-
30
- /* Copyright (c) 2022 Environmental Systems Research Institute, Inc.
31
- * Apache-2.0 */
32
- var DEFAULT_VERSION = '4.25';
33
- var NEXT = 'next';
34
- function parseVersion(version) {
35
- if (version.toLowerCase() === NEXT) {
36
- return NEXT;
37
- }
38
- var match = version && version.match(/^(\d)\.(\d+)/);
39
- return match && {
40
- major: parseInt(match[1], 10),
41
- minor: parseInt(match[2], 10)
42
- };
43
- }
44
- /**
45
- * Get the CDN url for a given version
46
- *
47
- * @param version Ex: '4.25' or '3.42'. Defaults to the latest 4.x version.
48
- */
49
- function getCdnUrl(version) {
50
- if (version === void 0) { version = DEFAULT_VERSION; }
51
- return "https://js.arcgis.com/".concat(version, "/");
52
- }
53
- /**
54
- * Get the CDN url for a the CSS for a given version and/or theme
55
- *
56
- * @param version Ex: '4.25', '3.42', or 'next'. Defaults to the latest 4.x version.
57
- */
58
- function getCdnCssUrl(version) {
59
- if (version === void 0) { version = DEFAULT_VERSION; }
60
- var baseUrl = getCdnUrl(version);
61
- var parsedVersion = parseVersion(version);
62
- if (parsedVersion !== NEXT && parsedVersion.major === 3) {
63
- // NOTE: at 3.11 the CSS moved from the /js folder to the root
64
- var path = parsedVersion.minor <= 10 ? 'js/' : '';
65
- return "".concat(baseUrl).concat(path, "esri/css/esri.css");
66
- }
67
- else {
68
- // assume 4.x
69
- return "".concat(baseUrl, "esri/themes/light/main.css");
70
- }
71
- }
72
-
73
- /* Copyright (c) 2022 Environmental Systems Research Institute, Inc.
74
- * Apache-2.0 */
75
- function createStylesheetLink(href) {
76
- var link = document.createElement('link');
77
- link.rel = 'stylesheet';
78
- link.href = href;
79
- return link;
80
- }
81
- function insertLink(link, before) {
82
- if (before) {
83
- // the link should be inserted before a specific node
84
- var beforeNode = document.querySelector(before);
85
- beforeNode.parentNode.insertBefore(link, beforeNode);
86
- }
87
- else {
88
- // append the link to then end of the head tag
89
- document.head.appendChild(link);
90
- }
91
- }
92
- // check if the css url has been injected or added manually
93
- function getCss(url) {
94
- return document.querySelector("link[href*=\"".concat(url, "\"]"));
95
- }
96
- function getCssUrl(urlOrVersion) {
97
- return !urlOrVersion || parseVersion(urlOrVersion)
98
- // if it's a valid version string return the CDN URL
99
- ? getCdnCssUrl(urlOrVersion)
100
- // otherwise assume it's a URL and return that
101
- : urlOrVersion;
102
- }
103
- // lazy load the CSS needed for the ArcGIS API
104
- function loadCss(urlOrVersion, before) {
105
- var url = getCssUrl(urlOrVersion);
106
- var link = getCss(url);
107
- if (!link) {
108
- // create & load the css link
109
- link = createStylesheetLink(url);
110
- insertLink(link, before);
111
- }
112
- return link;
113
- }
114
-
115
- /* Copyright (c) 2022 Environmental Systems Research Institute, Inc.
116
- * Apache-2.0 */
117
- var defaultOptions = {};
118
- function createScript(url) {
119
- var script = document.createElement('script');
120
- script.type = 'text/javascript';
121
- script.src = url;
122
- script.setAttribute('data-esri-loader', 'loading');
123
- return script;
124
- }
125
- // add a one-time load handler to script
126
- // and optionally add a one time error handler as well
127
- function handleScriptLoad(script, callback, errback) {
128
- var onScriptError;
129
- if (errback) {
130
- // set up an error handler as well
131
- onScriptError = handleScriptError(script, errback);
132
- }
133
- var onScriptLoad = function () {
134
- // pass the script to the callback
135
- callback(script);
136
- // remove this event listener
137
- script.removeEventListener('load', onScriptLoad, false);
138
- if (onScriptError) {
139
- // remove the error listener as well
140
- script.removeEventListener('error', onScriptError, false);
141
- }
142
- };
143
- script.addEventListener('load', onScriptLoad, false);
144
- }
145
- // add a one-time error handler to the script
146
- function handleScriptError(script, callback) {
147
- var onScriptError = function (e) {
148
- // reject the promise and remove this event listener
149
- callback(e.error || new Error("There was an error attempting to load ".concat(script.src)));
150
- // remove this event listener
151
- script.removeEventListener('error', onScriptError, false);
152
- };
153
- script.addEventListener('error', onScriptError, false);
154
- return onScriptError;
155
- }
156
- // allow the user to configure default script options rather than passing options to `loadModules` each time
157
- function setDefaultOptions(options) {
158
- if (options === void 0) { options = {}; }
159
- defaultOptions = options;
160
- }
161
- // get the script injected by this library
162
- function getScript() {
163
- return document.querySelector('script[data-esri-loader]');
164
- }
165
- // has ArcGIS API been loaded on the page yet?
166
- function isLoaded() {
167
- var globalRequire = window['require'];
168
- // .on() ensures that it's Dojo's AMD loader
169
- return globalRequire && globalRequire.on;
170
- }
171
- // load the ArcGIS API on the page
172
- function loadScript(options) {
173
- if (options === void 0) { options = {}; }
174
- // we would have liked to use spread like { ...defaultOptions, ...options }
175
- // but TS would inject a polyfill that would require use to configure rollup w content: 'window'
176
- // if we have another occasion to use spread, let's do that and replace this for...in
177
- var opts = {};
178
- [defaultOptions, options].forEach(function (obj) {
179
- for (var prop in obj) {
180
- if (Object.prototype.hasOwnProperty.call(obj, prop)) {
181
- opts[prop] = obj[prop];
182
- }
183
- }
184
- });
185
- // URL to load
186
- var version = opts.version;
187
- var url = opts.url || getCdnUrl(version);
188
- return new utils.Promise(function (resolve, reject) {
189
- var script = getScript();
190
- if (script) {
191
- // the API is already loaded or in the process of loading...
192
- // NOTE: have to test against scr attribute value, not script.src
193
- // b/c the latter will return the full url for relative paths
194
- var src = script.getAttribute('src');
195
- if (src !== url) {
196
- // potentially trying to load a different version of the API
197
- reject(new Error("The ArcGIS API for JavaScript is already loaded (".concat(src, ").")));
198
- }
199
- else {
200
- if (isLoaded()) {
201
- // the script has already successfully loaded
202
- resolve(script);
203
- }
204
- else {
205
- // wait for the script to load and then resolve
206
- handleScriptLoad(script, resolve, reject);
207
- }
208
- }
209
- }
210
- else {
211
- if (isLoaded()) {
212
- // the API has been loaded by some other means
213
- // potentially trying to load a different version of the API
214
- reject(new Error("The ArcGIS API for JavaScript is already loaded."));
215
- }
216
- else {
217
- // this is the first time attempting to load the API
218
- var css = opts.css;
219
- if (css) {
220
- var useVersion = css === true;
221
- // load the css before loading the script
222
- loadCss(useVersion ? version : css, opts.insertCssBefore);
223
- }
224
- // create a script object whose source points to the API
225
- script = createScript(url);
226
- // _currentUrl = url;
227
- // once the script is loaded...
228
- handleScriptLoad(script, function () {
229
- // update the status of the script
230
- script.setAttribute('data-esri-loader', 'loaded');
231
- // return the script
232
- resolve(script);
233
- }, reject);
234
- // load the script
235
- document.body.appendChild(script);
236
- }
237
- }
238
- });
239
- }
240
-
241
- /* Copyright (c) 2022 Environmental Systems Research Institute, Inc.
242
- * Apache-2.0 */
243
- // wrap Dojo's require() in a promise
244
- function requireModules(modules) {
245
- return new utils.Promise(function (resolve, reject) {
246
- // If something goes wrong loading the esri/dojo scripts, reject with the error.
247
- var errorHandler = window['require'].on('error', reject);
248
- window['require'](modules, function () {
249
- var args = [];
250
- for (var _i = 0; _i < arguments.length; _i++) {
251
- args[_i] = arguments[_i];
252
- }
253
- // remove error handler
254
- errorHandler.remove();
255
- // Resolve with the parameters from dojo require as an array.
256
- resolve(args);
257
- });
258
- });
259
- }
260
- // returns a promise that resolves with an array of the required modules
261
- // also will attempt to lazy load the ArcGIS API if it has not already been loaded
262
- function loadModules(modules, loadScriptOptions) {
263
- if (loadScriptOptions === void 0) { loadScriptOptions = {}; }
264
- if (!isLoaded()) {
265
- // script is not yet loaded, is it in the process of loading?
266
- var script = getScript();
267
- var src = script && script.getAttribute('src');
268
- if (!loadScriptOptions.url && src) {
269
- // script is still loading and user did not specify a URL
270
- // in this case we want to default to the URL that's being loaded
271
- // instead of defaulting to the latest 4.x URL
272
- loadScriptOptions.url = src;
273
- }
274
- // attempt to load the script then load the modules
275
- return loadScript(loadScriptOptions).then(function () { return requireModules(modules); });
276
- }
277
- else {
278
- // script is already loaded, just load the modules
279
- return requireModules(modules);
280
- }
281
- }
282
-
283
- /*
284
- Copyright (c) 2022 Esri
285
- Licensed under the Apache License, Version 2.0 (the "License");
286
- you may not use this file except in compliance with the License.
287
- You may obtain a copy of the License at
288
- http://www.apache.org/licenses/LICENSE-2.0
289
- Unless required by applicable law or agreed to in writing, software
290
- distributed under the License is distributed on an "AS IS" BASIS,
291
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
292
- See the License for the specific language governing permissions and
293
- limitations under the License.
294
- */
295
- // re-export the functions that are part of the public API
296
-
297
- exports.utils = utils;
298
- exports.loadModules = loadModules;
299
- exports.getScript = getScript;
300
- exports.isLoaded = isLoaded;
301
- exports.loadScript = loadScript;
302
- exports.setDefaultOptions = setDefaultOptions;
303
- exports.loadCss = loadCss;
304
-
305
- Object.defineProperty(exports, '__esModule', { value: true });
306
-
307
- })));
308
- //# sourceMappingURL=esri-loader.js.map
309
-
310
-
311
- /***/ },
312
-
313
14
  /***/ 337
314
15
  (module, exports, __webpack_require__) {
315
16
 
@@ -2318,216 +2019,515 @@ return new Parser;
2318
2019
  return this;
2319
2020
  };
2320
2021
 
2321
- /*
2322
- GeoJSON Feature Class
2323
- new Feature();
2324
- new Feature({
2325
- type: "Feature",
2326
- geometry: {
2327
- type: "Polygon",
2328
- coordinates: [ [ [[x,y], [x1,y1]], [[x2,y2], [x3,y3]] ] ]
2329
- }
2330
- });
2331
- new Feature({
2332
- type: "Polygon",
2333
- coordinates: [ [ [[x,y], [x1,y1]], [[x2,y2], [x3,y3]] ] ]
2334
- });
2335
- */
2336
- function Feature(input){
2337
- if(input && input.type === "Feature"){
2338
- extend(this, input);
2339
- } else if(input && input.type && input.coordinates) {
2340
- this.geometry = input;
2341
- } else {
2342
- throw "Terraformer: invalid input for Terraformer.Feature";
2343
- }
2022
+ /*
2023
+ GeoJSON Feature Class
2024
+ new Feature();
2025
+ new Feature({
2026
+ type: "Feature",
2027
+ geometry: {
2028
+ type: "Polygon",
2029
+ coordinates: [ [ [[x,y], [x1,y1]], [[x2,y2], [x3,y3]] ] ]
2030
+ }
2031
+ });
2032
+ new Feature({
2033
+ type: "Polygon",
2034
+ coordinates: [ [ [[x,y], [x1,y1]], [[x2,y2], [x3,y3]] ] ]
2035
+ });
2036
+ */
2037
+ function Feature(input){
2038
+ if(input && input.type === "Feature"){
2039
+ extend(this, input);
2040
+ } else if(input && input.type && input.coordinates) {
2041
+ this.geometry = input;
2042
+ } else {
2043
+ throw "Terraformer: invalid input for Terraformer.Feature";
2044
+ }
2045
+
2046
+ this.type = "Feature";
2047
+ }
2048
+
2049
+ Feature.prototype = new Primitive();
2050
+ Feature.prototype.constructor = Feature;
2051
+
2052
+ /*
2053
+ GeoJSON FeatureCollection Class
2054
+ new FeatureCollection();
2055
+ new FeatureCollection([feature, feature1]);
2056
+ new FeatureCollection({
2057
+ type: "FeatureCollection",
2058
+ coordinates: [feature, feature1]
2059
+ });
2060
+ */
2061
+ function FeatureCollection(input){
2062
+ if(input && input.type === "FeatureCollection" && input.features){
2063
+ extend(this, input);
2064
+ } else if(isArray(input)) {
2065
+ this.features = input;
2066
+ } else {
2067
+ throw "Terraformer: invalid input for Terraformer.FeatureCollection";
2068
+ }
2069
+
2070
+ this.type = "FeatureCollection";
2071
+ }
2072
+
2073
+ FeatureCollection.prototype = new Primitive();
2074
+ FeatureCollection.prototype.constructor = FeatureCollection;
2075
+ FeatureCollection.prototype.forEach = function(func){
2076
+ for (var i = 0; i < this.features.length; i++) {
2077
+ func.apply(this, [this.features[i], i, this.features]);
2078
+ }
2079
+ };
2080
+ FeatureCollection.prototype.get = function(id){
2081
+ var found;
2082
+ this.forEach(function(feature){
2083
+ if(feature.id === id){
2084
+ found = feature;
2085
+ }
2086
+ });
2087
+ return new Feature(found);
2088
+ };
2089
+
2090
+ /*
2091
+ GeoJSON GeometryCollection Class
2092
+ new GeometryCollection();
2093
+ new GeometryCollection([geometry, geometry1]);
2094
+ new GeometryCollection({
2095
+ type: "GeometryCollection",
2096
+ coordinates: [geometry, geometry1]
2097
+ });
2098
+ */
2099
+ function GeometryCollection(input){
2100
+ if(input && input.type === "GeometryCollection" && input.geometries){
2101
+ extend(this, input);
2102
+ } else if(isArray(input)) {
2103
+ this.geometries = input;
2104
+ } else if(input.coordinates && input.type){
2105
+ this.type = "GeometryCollection";
2106
+ this.geometries = [input];
2107
+ } else {
2108
+ throw "Terraformer: invalid input for Terraformer.GeometryCollection";
2109
+ }
2110
+
2111
+ this.type = "GeometryCollection";
2112
+ }
2113
+
2114
+ GeometryCollection.prototype = new Primitive();
2115
+ GeometryCollection.prototype.constructor = GeometryCollection;
2116
+ GeometryCollection.prototype.forEach = function(func){
2117
+ for (var i = 0; i < this.geometries.length; i++) {
2118
+ func.apply(this, [this.geometries[i], i, this.geometries]);
2119
+ }
2120
+ };
2121
+ GeometryCollection.prototype.get = function(i){
2122
+ return new Primitive(this.geometries[i]);
2123
+ };
2124
+
2125
+ function createCircle(center, radius, interpolate){
2126
+ var mercatorPosition = positionToMercator(center);
2127
+ var steps = interpolate || 64;
2128
+ var polygon = {
2129
+ type: "Polygon",
2130
+ coordinates: [[]]
2131
+ };
2132
+ for(var i=1; i<=steps; i++) {
2133
+ var radians = i * (360/steps) * Math.PI / 180;
2134
+ polygon.coordinates[0].push([mercatorPosition[0] + radius * Math.cos(radians), mercatorPosition[1] + radius * Math.sin(radians)]);
2135
+ }
2136
+ polygon.coordinates = closedPolygon(polygon.coordinates);
2137
+
2138
+ return toGeographic(polygon);
2139
+ }
2140
+
2141
+ function Circle (center, radius, interpolate) {
2142
+ var steps = interpolate || 64;
2143
+ var rad = radius || 250;
2144
+
2145
+ if(!center || center.length < 2 || !rad || !steps) {
2146
+ throw new Error("Terraformer: missing parameter for Terraformer.Circle");
2147
+ }
2148
+
2149
+ extend(this, new Feature({
2150
+ type: "Feature",
2151
+ geometry: createCircle(center, rad, steps),
2152
+ properties: {
2153
+ radius: rad,
2154
+ center: center,
2155
+ steps: steps
2156
+ }
2157
+ }));
2158
+ }
2159
+
2160
+ Circle.prototype = new Primitive();
2161
+ Circle.prototype.constructor = Circle;
2162
+ Circle.prototype.recalculate = function(){
2163
+ this.geometry = createCircle(this.properties.center, this.properties.radius, this.properties.steps);
2164
+ return this;
2165
+ };
2166
+ Circle.prototype.center = function(coordinates){
2167
+ if(coordinates){
2168
+ this.properties.center = coordinates;
2169
+ this.recalculate();
2170
+ }
2171
+ return this.properties.center;
2172
+ };
2173
+ Circle.prototype.radius = function(radius){
2174
+ if(radius){
2175
+ this.properties.radius = radius;
2176
+ this.recalculate();
2177
+ }
2178
+ return this.properties.radius;
2179
+ };
2180
+ Circle.prototype.steps = function(steps){
2181
+ if(steps){
2182
+ this.properties.steps = steps;
2183
+ this.recalculate();
2184
+ }
2185
+ return this.properties.steps;
2186
+ };
2187
+
2188
+ Circle.prototype.toJSON = function() {
2189
+ var output = Primitive.prototype.toJSON.call(this);
2190
+ return output;
2191
+ };
2192
+
2193
+ exports.Primitive = Primitive;
2194
+ exports.Point = Point;
2195
+ exports.MultiPoint = MultiPoint;
2196
+ exports.LineString = LineString;
2197
+ exports.MultiLineString = MultiLineString;
2198
+ exports.Polygon = Polygon;
2199
+ exports.MultiPolygon = MultiPolygon;
2200
+ exports.Feature = Feature;
2201
+ exports.FeatureCollection = FeatureCollection;
2202
+ exports.GeometryCollection = GeometryCollection;
2203
+ exports.Circle = Circle;
2204
+
2205
+ exports.toMercator = toMercator;
2206
+ exports.toGeographic = toGeographic;
2207
+
2208
+ exports.Tools = {};
2209
+ exports.Tools.positionToMercator = positionToMercator;
2210
+ exports.Tools.positionToGeographic = positionToGeographic;
2211
+ exports.Tools.applyConverter = applyConverter;
2212
+ exports.Tools.toMercator = toMercator;
2213
+ exports.Tools.toGeographic = toGeographic;
2214
+ exports.Tools.createCircle = createCircle;
2215
+
2216
+ exports.Tools.calculateBounds = calculateBounds;
2217
+ exports.Tools.calculateEnvelope = calculateEnvelope;
2218
+
2219
+ exports.Tools.coordinatesContainPoint = coordinatesContainPoint;
2220
+ exports.Tools.polygonContainsPoint = polygonContainsPoint;
2221
+ exports.Tools.arraysIntersectArrays = arraysIntersectArrays;
2222
+ exports.Tools.coordinatesContainPoint = coordinatesContainPoint;
2223
+ exports.Tools.coordinatesEqual = coordinatesEqual;
2224
+ exports.Tools.convexHull = convexHull;
2225
+ exports.Tools.isConvex = isConvex;
2226
+
2227
+ exports.MercatorCRS = MercatorCRS;
2228
+ exports.GeographicCRS = GeographicCRS;
2229
+
2230
+ return exports;
2231
+ }));
2232
+
2233
+
2234
+ /***/ },
2344
2235
 
2345
- this.type = "Feature";
2346
- }
2236
+ /***/ 384
2237
+ (__unused_webpack_module, exports) {
2347
2238
 
2348
- Feature.prototype = new Primitive();
2349
- Feature.prototype.constructor = Feature;
2239
+ (function (global, factory) {
2240
+ true ? factory(exports) :
2241
+ 0;
2242
+ }(this, (function (exports) { 'use strict';
2350
2243
 
2351
- /*
2352
- GeoJSON FeatureCollection Class
2353
- new FeatureCollection();
2354
- new FeatureCollection([feature, feature1]);
2355
- new FeatureCollection({
2356
- type: "FeatureCollection",
2357
- coordinates: [feature, feature1]
2358
- });
2359
- */
2360
- function FeatureCollection(input){
2361
- if(input && input.type === "FeatureCollection" && input.features){
2362
- extend(this, input);
2363
- } else if(isArray(input)) {
2364
- this.features = input;
2365
- } else {
2366
- throw "Terraformer: invalid input for Terraformer.FeatureCollection";
2244
+ /* Copyright (c) 2022 Environmental Systems Research Institute, Inc.
2245
+ * Apache-2.0 */
2246
+ var isBrowser = typeof window !== 'undefined';
2247
+ // allow consuming libraries to provide their own Promise implementations
2248
+ var utils = {
2249
+ Promise: isBrowser ? window['Promise'] : undefined
2250
+ };
2251
+
2252
+ /* Copyright (c) 2022 Environmental Systems Research Institute, Inc.
2253
+ * Apache-2.0 */
2254
+ var DEFAULT_VERSION = '4.25';
2255
+ var NEXT = 'next';
2256
+ function parseVersion(version) {
2257
+ if (version.toLowerCase() === NEXT) {
2258
+ return NEXT;
2367
2259
  }
2260
+ var match = version && version.match(/^(\d)\.(\d+)/);
2261
+ return match && {
2262
+ major: parseInt(match[1], 10),
2263
+ minor: parseInt(match[2], 10)
2264
+ };
2265
+ }
2266
+ /**
2267
+ * Get the CDN url for a given version
2268
+ *
2269
+ * @param version Ex: '4.25' or '3.42'. Defaults to the latest 4.x version.
2270
+ */
2271
+ function getCdnUrl(version) {
2272
+ if (version === void 0) { version = DEFAULT_VERSION; }
2273
+ return "https://js.arcgis.com/".concat(version, "/");
2274
+ }
2275
+ /**
2276
+ * Get the CDN url for a the CSS for a given version and/or theme
2277
+ *
2278
+ * @param version Ex: '4.25', '3.42', or 'next'. Defaults to the latest 4.x version.
2279
+ */
2280
+ function getCdnCssUrl(version) {
2281
+ if (version === void 0) { version = DEFAULT_VERSION; }
2282
+ var baseUrl = getCdnUrl(version);
2283
+ var parsedVersion = parseVersion(version);
2284
+ if (parsedVersion !== NEXT && parsedVersion.major === 3) {
2285
+ // NOTE: at 3.11 the CSS moved from the /js folder to the root
2286
+ var path = parsedVersion.minor <= 10 ? 'js/' : '';
2287
+ return "".concat(baseUrl).concat(path, "esri/css/esri.css");
2288
+ }
2289
+ else {
2290
+ // assume 4.x
2291
+ return "".concat(baseUrl, "esri/themes/light/main.css");
2292
+ }
2293
+ }
2368
2294
 
2369
- this.type = "FeatureCollection";
2370
- }
2295
+ /* Copyright (c) 2022 Environmental Systems Research Institute, Inc.
2296
+ * Apache-2.0 */
2297
+ function createStylesheetLink(href) {
2298
+ var link = document.createElement('link');
2299
+ link.rel = 'stylesheet';
2300
+ link.href = href;
2301
+ return link;
2302
+ }
2303
+ function insertLink(link, before) {
2304
+ if (before) {
2305
+ // the link should be inserted before a specific node
2306
+ var beforeNode = document.querySelector(before);
2307
+ beforeNode.parentNode.insertBefore(link, beforeNode);
2308
+ }
2309
+ else {
2310
+ // append the link to then end of the head tag
2311
+ document.head.appendChild(link);
2312
+ }
2313
+ }
2314
+ // check if the css url has been injected or added manually
2315
+ function getCss(url) {
2316
+ return document.querySelector("link[href*=\"".concat(url, "\"]"));
2317
+ }
2318
+ function getCssUrl(urlOrVersion) {
2319
+ return !urlOrVersion || parseVersion(urlOrVersion)
2320
+ // if it's a valid version string return the CDN URL
2321
+ ? getCdnCssUrl(urlOrVersion)
2322
+ // otherwise assume it's a URL and return that
2323
+ : urlOrVersion;
2324
+ }
2325
+ // lazy load the CSS needed for the ArcGIS API
2326
+ function loadCss(urlOrVersion, before) {
2327
+ var url = getCssUrl(urlOrVersion);
2328
+ var link = getCss(url);
2329
+ if (!link) {
2330
+ // create & load the css link
2331
+ link = createStylesheetLink(url);
2332
+ insertLink(link, before);
2333
+ }
2334
+ return link;
2335
+ }
2371
2336
 
2372
- FeatureCollection.prototype = new Primitive();
2373
- FeatureCollection.prototype.constructor = FeatureCollection;
2374
- FeatureCollection.prototype.forEach = function(func){
2375
- for (var i = 0; i < this.features.length; i++) {
2376
- func.apply(this, [this.features[i], i, this.features]);
2337
+ /* Copyright (c) 2022 Environmental Systems Research Institute, Inc.
2338
+ * Apache-2.0 */
2339
+ var defaultOptions = {};
2340
+ function createScript(url) {
2341
+ var script = document.createElement('script');
2342
+ script.type = 'text/javascript';
2343
+ script.src = url;
2344
+ script.setAttribute('data-esri-loader', 'loading');
2345
+ return script;
2346
+ }
2347
+ // add a one-time load handler to script
2348
+ // and optionally add a one time error handler as well
2349
+ function handleScriptLoad(script, callback, errback) {
2350
+ var onScriptError;
2351
+ if (errback) {
2352
+ // set up an error handler as well
2353
+ onScriptError = handleScriptError(script, errback);
2377
2354
  }
2378
- };
2379
- FeatureCollection.prototype.get = function(id){
2380
- var found;
2381
- this.forEach(function(feature){
2382
- if(feature.id === id){
2383
- found = feature;
2384
- }
2355
+ var onScriptLoad = function () {
2356
+ // pass the script to the callback
2357
+ callback(script);
2358
+ // remove this event listener
2359
+ script.removeEventListener('load', onScriptLoad, false);
2360
+ if (onScriptError) {
2361
+ // remove the error listener as well
2362
+ script.removeEventListener('error', onScriptError, false);
2363
+ }
2364
+ };
2365
+ script.addEventListener('load', onScriptLoad, false);
2366
+ }
2367
+ // add a one-time error handler to the script
2368
+ function handleScriptError(script, callback) {
2369
+ var onScriptError = function (e) {
2370
+ // reject the promise and remove this event listener
2371
+ callback(e.error || new Error("There was an error attempting to load ".concat(script.src)));
2372
+ // remove this event listener
2373
+ script.removeEventListener('error', onScriptError, false);
2374
+ };
2375
+ script.addEventListener('error', onScriptError, false);
2376
+ return onScriptError;
2377
+ }
2378
+ // allow the user to configure default script options rather than passing options to `loadModules` each time
2379
+ function setDefaultOptions(options) {
2380
+ if (options === void 0) { options = {}; }
2381
+ defaultOptions = options;
2382
+ }
2383
+ // get the script injected by this library
2384
+ function getScript() {
2385
+ return document.querySelector('script[data-esri-loader]');
2386
+ }
2387
+ // has ArcGIS API been loaded on the page yet?
2388
+ function isLoaded() {
2389
+ var globalRequire = window['require'];
2390
+ // .on() ensures that it's Dojo's AMD loader
2391
+ return globalRequire && globalRequire.on;
2392
+ }
2393
+ // load the ArcGIS API on the page
2394
+ function loadScript(options) {
2395
+ if (options === void 0) { options = {}; }
2396
+ // we would have liked to use spread like { ...defaultOptions, ...options }
2397
+ // but TS would inject a polyfill that would require use to configure rollup w content: 'window'
2398
+ // if we have another occasion to use spread, let's do that and replace this for...in
2399
+ var opts = {};
2400
+ [defaultOptions, options].forEach(function (obj) {
2401
+ for (var prop in obj) {
2402
+ if (Object.prototype.hasOwnProperty.call(obj, prop)) {
2403
+ opts[prop] = obj[prop];
2404
+ }
2405
+ }
2406
+ });
2407
+ // URL to load
2408
+ var version = opts.version;
2409
+ var url = opts.url || getCdnUrl(version);
2410
+ return new utils.Promise(function (resolve, reject) {
2411
+ var script = getScript();
2412
+ if (script) {
2413
+ // the API is already loaded or in the process of loading...
2414
+ // NOTE: have to test against scr attribute value, not script.src
2415
+ // b/c the latter will return the full url for relative paths
2416
+ var src = script.getAttribute('src');
2417
+ if (src !== url) {
2418
+ // potentially trying to load a different version of the API
2419
+ reject(new Error("The ArcGIS API for JavaScript is already loaded (".concat(src, ").")));
2420
+ }
2421
+ else {
2422
+ if (isLoaded()) {
2423
+ // the script has already successfully loaded
2424
+ resolve(script);
2425
+ }
2426
+ else {
2427
+ // wait for the script to load and then resolve
2428
+ handleScriptLoad(script, resolve, reject);
2429
+ }
2430
+ }
2431
+ }
2432
+ else {
2433
+ if (isLoaded()) {
2434
+ // the API has been loaded by some other means
2435
+ // potentially trying to load a different version of the API
2436
+ reject(new Error("The ArcGIS API for JavaScript is already loaded."));
2437
+ }
2438
+ else {
2439
+ // this is the first time attempting to load the API
2440
+ var css = opts.css;
2441
+ if (css) {
2442
+ var useVersion = css === true;
2443
+ // load the css before loading the script
2444
+ loadCss(useVersion ? version : css, opts.insertCssBefore);
2445
+ }
2446
+ // create a script object whose source points to the API
2447
+ script = createScript(url);
2448
+ // _currentUrl = url;
2449
+ // once the script is loaded...
2450
+ handleScriptLoad(script, function () {
2451
+ // update the status of the script
2452
+ script.setAttribute('data-esri-loader', 'loaded');
2453
+ // return the script
2454
+ resolve(script);
2455
+ }, reject);
2456
+ // load the script
2457
+ document.body.appendChild(script);
2458
+ }
2459
+ }
2385
2460
  });
2386
- return new Feature(found);
2387
- };
2388
-
2389
- /*
2390
- GeoJSON GeometryCollection Class
2391
- new GeometryCollection();
2392
- new GeometryCollection([geometry, geometry1]);
2393
- new GeometryCollection({
2394
- type: "GeometryCollection",
2395
- coordinates: [geometry, geometry1]
2396
- });
2397
- */
2398
- function GeometryCollection(input){
2399
- if(input && input.type === "GeometryCollection" && input.geometries){
2400
- extend(this, input);
2401
- } else if(isArray(input)) {
2402
- this.geometries = input;
2403
- } else if(input.coordinates && input.type){
2404
- this.type = "GeometryCollection";
2405
- this.geometries = [input];
2406
- } else {
2407
- throw "Terraformer: invalid input for Terraformer.GeometryCollection";
2408
- }
2409
-
2410
- this.type = "GeometryCollection";
2411
- }
2412
-
2413
- GeometryCollection.prototype = new Primitive();
2414
- GeometryCollection.prototype.constructor = GeometryCollection;
2415
- GeometryCollection.prototype.forEach = function(func){
2416
- for (var i = 0; i < this.geometries.length; i++) {
2417
- func.apply(this, [this.geometries[i], i, this.geometries]);
2418
- }
2419
- };
2420
- GeometryCollection.prototype.get = function(i){
2421
- return new Primitive(this.geometries[i]);
2422
- };
2423
-
2424
- function createCircle(center, radius, interpolate){
2425
- var mercatorPosition = positionToMercator(center);
2426
- var steps = interpolate || 64;
2427
- var polygon = {
2428
- type: "Polygon",
2429
- coordinates: [[]]
2430
- };
2431
- for(var i=1; i<=steps; i++) {
2432
- var radians = i * (360/steps) * Math.PI / 180;
2433
- polygon.coordinates[0].push([mercatorPosition[0] + radius * Math.cos(radians), mercatorPosition[1] + radius * Math.sin(radians)]);
2434
- }
2435
- polygon.coordinates = closedPolygon(polygon.coordinates);
2436
-
2437
- return toGeographic(polygon);
2438
- }
2439
-
2440
- function Circle (center, radius, interpolate) {
2441
- var steps = interpolate || 64;
2442
- var rad = radius || 250;
2443
-
2444
- if(!center || center.length < 2 || !rad || !steps) {
2445
- throw new Error("Terraformer: missing parameter for Terraformer.Circle");
2446
- }
2447
-
2448
- extend(this, new Feature({
2449
- type: "Feature",
2450
- geometry: createCircle(center, rad, steps),
2451
- properties: {
2452
- radius: rad,
2453
- center: center,
2454
- steps: steps
2455
- }
2456
- }));
2457
- }
2461
+ }
2458
2462
 
2459
- Circle.prototype = new Primitive();
2460
- Circle.prototype.constructor = Circle;
2461
- Circle.prototype.recalculate = function(){
2462
- this.geometry = createCircle(this.properties.center, this.properties.radius, this.properties.steps);
2463
- return this;
2464
- };
2465
- Circle.prototype.center = function(coordinates){
2466
- if(coordinates){
2467
- this.properties.center = coordinates;
2468
- this.recalculate();
2469
- }
2470
- return this.properties.center;
2471
- };
2472
- Circle.prototype.radius = function(radius){
2473
- if(radius){
2474
- this.properties.radius = radius;
2475
- this.recalculate();
2463
+ /* Copyright (c) 2022 Environmental Systems Research Institute, Inc.
2464
+ * Apache-2.0 */
2465
+ // wrap Dojo's require() in a promise
2466
+ function requireModules(modules) {
2467
+ return new utils.Promise(function (resolve, reject) {
2468
+ // If something goes wrong loading the esri/dojo scripts, reject with the error.
2469
+ var errorHandler = window['require'].on('error', reject);
2470
+ window['require'](modules, function () {
2471
+ var args = [];
2472
+ for (var _i = 0; _i < arguments.length; _i++) {
2473
+ args[_i] = arguments[_i];
2474
+ }
2475
+ // remove error handler
2476
+ errorHandler.remove();
2477
+ // Resolve with the parameters from dojo require as an array.
2478
+ resolve(args);
2479
+ });
2480
+ });
2481
+ }
2482
+ // returns a promise that resolves with an array of the required modules
2483
+ // also will attempt to lazy load the ArcGIS API if it has not already been loaded
2484
+ function loadModules(modules, loadScriptOptions) {
2485
+ if (loadScriptOptions === void 0) { loadScriptOptions = {}; }
2486
+ if (!isLoaded()) {
2487
+ // script is not yet loaded, is it in the process of loading?
2488
+ var script = getScript();
2489
+ var src = script && script.getAttribute('src');
2490
+ if (!loadScriptOptions.url && src) {
2491
+ // script is still loading and user did not specify a URL
2492
+ // in this case we want to default to the URL that's being loaded
2493
+ // instead of defaulting to the latest 4.x URL
2494
+ loadScriptOptions.url = src;
2495
+ }
2496
+ // attempt to load the script then load the modules
2497
+ return loadScript(loadScriptOptions).then(function () { return requireModules(modules); });
2476
2498
  }
2477
- return this.properties.radius;
2478
- };
2479
- Circle.prototype.steps = function(steps){
2480
- if(steps){
2481
- this.properties.steps = steps;
2482
- this.recalculate();
2499
+ else {
2500
+ // script is already loaded, just load the modules
2501
+ return requireModules(modules);
2483
2502
  }
2484
- return this.properties.steps;
2485
- };
2486
-
2487
- Circle.prototype.toJSON = function() {
2488
- var output = Primitive.prototype.toJSON.call(this);
2489
- return output;
2490
- };
2491
-
2492
- exports.Primitive = Primitive;
2493
- exports.Point = Point;
2494
- exports.MultiPoint = MultiPoint;
2495
- exports.LineString = LineString;
2496
- exports.MultiLineString = MultiLineString;
2497
- exports.Polygon = Polygon;
2498
- exports.MultiPolygon = MultiPolygon;
2499
- exports.Feature = Feature;
2500
- exports.FeatureCollection = FeatureCollection;
2501
- exports.GeometryCollection = GeometryCollection;
2502
- exports.Circle = Circle;
2503
-
2504
- exports.toMercator = toMercator;
2505
- exports.toGeographic = toGeographic;
2506
-
2507
- exports.Tools = {};
2508
- exports.Tools.positionToMercator = positionToMercator;
2509
- exports.Tools.positionToGeographic = positionToGeographic;
2510
- exports.Tools.applyConverter = applyConverter;
2511
- exports.Tools.toMercator = toMercator;
2512
- exports.Tools.toGeographic = toGeographic;
2513
- exports.Tools.createCircle = createCircle;
2503
+ }
2514
2504
 
2515
- exports.Tools.calculateBounds = calculateBounds;
2516
- exports.Tools.calculateEnvelope = calculateEnvelope;
2505
+ /*
2506
+ Copyright (c) 2022 Esri
2507
+ Licensed under the Apache License, Version 2.0 (the "License");
2508
+ you may not use this file except in compliance with the License.
2509
+ You may obtain a copy of the License at
2510
+ http://www.apache.org/licenses/LICENSE-2.0
2511
+ Unless required by applicable law or agreed to in writing, software
2512
+ distributed under the License is distributed on an "AS IS" BASIS,
2513
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2514
+ See the License for the specific language governing permissions and
2515
+ limitations under the License.
2516
+ */
2517
+ // re-export the functions that are part of the public API
2517
2518
 
2518
- exports.Tools.coordinatesContainPoint = coordinatesContainPoint;
2519
- exports.Tools.polygonContainsPoint = polygonContainsPoint;
2520
- exports.Tools.arraysIntersectArrays = arraysIntersectArrays;
2521
- exports.Tools.coordinatesContainPoint = coordinatesContainPoint;
2522
- exports.Tools.coordinatesEqual = coordinatesEqual;
2523
- exports.Tools.convexHull = convexHull;
2524
- exports.Tools.isConvex = isConvex;
2519
+ exports.utils = utils;
2520
+ exports.loadModules = loadModules;
2521
+ exports.getScript = getScript;
2522
+ exports.isLoaded = isLoaded;
2523
+ exports.loadScript = loadScript;
2524
+ exports.setDefaultOptions = setDefaultOptions;
2525
+ exports.loadCss = loadCss;
2525
2526
 
2526
- exports.MercatorCRS = MercatorCRS;
2527
- exports.GeographicCRS = GeographicCRS;
2527
+ Object.defineProperty(exports, '__esModule', { value: true });
2528
2528
 
2529
- return exports;
2530
- }));
2529
+ })));
2530
+ //# sourceMappingURL=esri-loader.js.map
2531
2531
 
2532
2532
 
2533
2533
  /***/ },
@@ -3054,8 +3054,6 @@ __webpack_require__.d(__webpack_exports__, {
3054
3054
  "default": () => (/* binding */ entry_lib)
3055
3055
  });
3056
3056
 
3057
- // UNUSED EXPORTS: arcGISTranformGeoJson, arcgisTranformWkt, augustineGjMap, augustineMap, createBase, createGrahic, createGraphicsLayer, createMapView, createMaskLayer, drawPoint, drawPolygon, drawPolygonArr, drawPolyline, geoJsonTranformArcgis, geoJsonTranformWkt, getArea, getPictureMarker, getSimpleFill, getSimpleLine, getSimpleMarker, getSimpleText, initMapPack, locationMap, mapJumpTo, mapList, toArcGISPoint, wktTranformArcgis, wktTranformGeoJson
3058
-
3059
3057
  // NAMESPACE OBJECT: ./node_modules/axios/lib/platform/common/utils.js
3060
3058
  var common_utils_namespaceObject = {};
3061
3059
  __webpack_require__.r(common_utils_namespaceObject);
@@ -3067,10 +3065,6 @@ __webpack_require__.d(common_utils_namespaceObject, {
3067
3065
  origin: () => (origin)
3068
3066
  });
3069
3067
 
3070
- // NAMESPACE OBJECT: ./src/index.js
3071
- var src_namespaceObject = {};
3072
- __webpack_require__.r(src_namespaceObject);
3073
-
3074
3068
  ;// ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
3075
3069
  /* eslint-disable no-var */
3076
3070
  // This file is imported into lib/wc client bundles.
@@ -3089,14 +3083,14 @@ if (typeof window !== 'undefined') {
3089
3083
  // Indicate to webpack that this file can be concatenated
3090
3084
  /* harmony default export */ const setPublicPath = (null);
3091
3085
 
3092
- ;// ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/vue2/augustineGjMap.vue?vue&type=template&id=eb2cfe64
3086
+ ;// ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/vue2/augustineGjMap.vue?vue&type=template&id=5cdfceff
3093
3087
  var render = function render(){var _vm=this,_c=_vm._self._c;return _c('loading-box',{attrs:{"loading":_vm.isLoading}},[_c('div',{staticClass:"arcgisMap-box"},[_c('div',{staticClass:"arcgisMapBox",attrs:{"id":_vm.mapId}}),(_vm.pathCoordinates.length > 0 && _vm.noAbleMoving)?_c('div',{staticClass:"controls",class:'controls_' + _vm.postion},[_c('div',{staticClass:"controls-item",class:{ 'controls-active': _vm.currentPathIndex > 0 },on:{"click":_vm.changeMove}},[_vm._v(" "+_vm._s(_vm.currentPathIndex == 0 ? '开始' : _vm.isPaused ? '继续' : '暂停')+" ")]),_c('div',{staticClass:"controls-item",on:{"click":_vm.changeSpeed}},[_c('p',[_vm._v(_vm._s(_vm.speedNum)+" "),_c('svgIcon',{attrs:{"name":"close","width":"14","color":"#000"}})],1),_c('p',[_vm._v("加速")])]),_c('div',{staticClass:"controls-item",on:{"click":_vm.stopAnimation}},[_vm._v("重置")]),(_vm.postion == 'top' || _vm.postion == 'bottom')?_c('div',{staticClass:"controls-item",on:{"click":function($event){return _vm.drawMeasurement('distance')}}},[_vm._v(" 测距 ")]):_vm._e(),(_vm.postion == 'top' || _vm.postion == 'bottom')?_c('div',{staticClass:"controls-item",on:{"click":function($event){return _vm.drawMeasurement('area')}}},[_vm._v("测面积")]):_vm._e(),(_vm.postion == 'top' || _vm.postion == 'bottom')?_c('div',{staticClass:"controls-item",on:{"click":_vm.clearMeasurement}},[_vm._v("清除")]):_vm._e()]):_vm._e(),_c('CustomTooltip',{ref:"tooltip",scopedSlots:_vm._u([{key:"default",fn:function({ data }){return [_c('div',[_vm._v(" 经纬度: "),_c('b',[_vm._v(_vm._s(data.longitude)+"-"+_vm._s(data.latitude))])]),_c('div',[_vm._v(" 时间: "),_c('b',[_vm._v(_vm._s(data.time))])])]}}])})],1)])
3094
3088
  }
3095
3089
  var staticRenderFns = []
3096
3090
 
3097
3091
 
3098
3092
  // EXTERNAL MODULE: ./node_modules/esri-loader/dist/umd/esri-loader.js
3099
- var esri_loader = __webpack_require__(3);
3093
+ var esri_loader = __webpack_require__(384);
3100
3094
  ;// ./src/config/mapGj.config.js
3101
3095
  const mapConfig = {
3102
3096
  initJs: 'https://web.joinken.cn:82/arcgis/4.30/init.js', // arcgis的JS地址
@@ -3478,6 +3472,7 @@ var terraformer_arcgis_parser = __webpack_require__(979);
3478
3472
  var terraformer_arcgis_parser_default = /*#__PURE__*/__webpack_require__.n(terraformer_arcgis_parser);
3479
3473
  // EXTERNAL MODULE: ./node_modules/terraformer-wkt-parser/terraformer-wkt-parser.js
3480
3474
  var terraformer_wkt_parser = __webpack_require__(337);
3475
+ var terraformer_wkt_parser_default = /*#__PURE__*/__webpack_require__.n(terraformer_wkt_parser);
3481
3476
  ;// ./src/config/wktMethods.js
3482
3477
  // import { judgmentMapDataType, isValidArcGISPoint } from './comstom'
3483
3478
  /**
@@ -3542,7 +3537,7 @@ function geoJsonTranformArcgis(data) {
3542
3537
  properties: {}
3543
3538
  }
3544
3539
  }
3545
- const arcgisData = ArcGIS.convert(jsonData)
3540
+ const arcgisData = terraformer_arcgis_parser_default().convert(jsonData)
3546
3541
  if (arcgisData && JSON.stringify(arcgisData) != '{}') {
3547
3542
  return arcgisData.geometry ? arcgisData.geometry : arcgisData
3548
3543
  } else throw new Error(errorText)
@@ -3625,7 +3620,7 @@ function geoJsonTranformWkt(geojson) {
3625
3620
  if (!geojson && !geojson.type) {
3626
3621
  throw new Error(`[geoJsonTranformWkt] 期望字符串,但收到: ${geojson}`)
3627
3622
  }
3628
- return WKT.convert(geojson)
3623
+ return terraformer_wkt_parser_default().convert(geojson)
3629
3624
  } catch (error) {
3630
3625
  throw new Error(`geojson解析失败: ${error.message}`)
3631
3626
  }
@@ -3640,7 +3635,7 @@ function wktTranformGeoJson(wkt) {
3640
3635
  if (!wkt) {
3641
3636
  throw new Error(`[wktTranformGeoJson] 期望字符串,但收到: ${wkt}`)
3642
3637
  }
3643
- return WKT.parse(wkt)
3638
+ return terraformer_wkt_parser_default().parse(wkt)
3644
3639
  } catch (error) {
3645
3640
  throw new Error(`wkt解析失败: ${error.message}`)
3646
3641
  }
@@ -3656,8 +3651,8 @@ function wktTranformArcgis(wktString) {
3656
3651
  throw new Error(`[wktTranformArcgis] 期望字符串,但收到: ${typeof wktString}`)
3657
3652
  }
3658
3653
 
3659
- const geojson = WKT.parse(wktString.trim())
3660
- const arcgis = ArcGIS.convert(geojson)
3654
+ const geojson = terraformer_wkt_parser_default().parse(wktString.trim())
3655
+ const arcgis = terraformer_arcgis_parser_default().convert(geojson)
3661
3656
  return arcgis
3662
3657
  } catch (error) {
3663
3658
  throw new Error(`WKT 解析失败: ${error.message}`)
@@ -3673,8 +3668,8 @@ function arcgisTranformWkt(arcgisJson) {
3673
3668
  if (!isValidArcGIS(arcgisJson)) {
3674
3669
  throw new Error(`[arcgisTranformWkt] 期望字符串,但收到: ${arcgisJson}`)
3675
3670
  }
3676
- const geojson = ArcGIS.parse(arcgisJson)
3677
- const wkt = WKT.convert(geojson)
3671
+ const geojson = terraformer_arcgis_parser_default().parse(arcgisJson)
3672
+ const wkt = terraformer_wkt_parser_default().convert(geojson)
3678
3673
  return wkt
3679
3674
  } catch (error) {
3680
3675
  throw new Error(`[arcgisTranformWkt] ArcGIS 解析失败:${error.message}输入:${arcgisJson}`)
@@ -5416,6 +5411,24 @@ async function createMaskLayer(polygonDataList = [], options, context = null, ma
5416
5411
  return null
5417
5412
  }
5418
5413
  }
5414
+ /**
5415
+ * 防抖
5416
+ * @param {*} fn
5417
+ * @param {*} delay
5418
+ * @returns
5419
+ */
5420
+ function debounce(fn, delay = 300) {
5421
+ let timer = null // 存储定时器
5422
+ return function (...args) {
5423
+ // 清除上一次的定时器
5424
+ if (timer) clearTimeout(timer)
5425
+ // 重新设置定时器,延迟执行
5426
+ timer = setTimeout(() => {
5427
+ fn.apply(this, args) // 保留 this 指向和函数参数
5428
+ timer = null // 执行后清空定时器
5429
+ }, delay)
5430
+ }
5431
+ }
5419
5432
 
5420
5433
 
5421
5434
  ;// ./src/utils/bearing.js
@@ -5770,7 +5783,7 @@ var jk_map,
5770
5783
  /**
5771
5784
  * 防抖
5772
5785
  */
5773
- function debounce(fn, delay) {
5786
+ function augustineGjMapvue_type_script_lang_js_debounce(fn, delay) {
5774
5787
  let timer
5775
5788
  return (...args) => {
5776
5789
  clearTimeout(timer)
@@ -5785,9 +5798,9 @@ function debounce(fn, delay) {
5785
5798
  type: Object,
5786
5799
  default: mapGj_config
5787
5800
  },
5788
- load: {
5789
- type: Function,
5790
- default: null
5801
+ noAbleMoving: {
5802
+ type: Boolean,
5803
+ default: true
5791
5804
  },
5792
5805
  center: {
5793
5806
  type: Array,
@@ -5824,8 +5837,6 @@ function debounce(fn, delay) {
5824
5837
  mapId: 'map' + Math.round(Math.random() * 10000),
5825
5838
  //地图加载loading
5826
5839
  isLoading: true,
5827
- gjParams: null,
5828
- apiToken: null,
5829
5840
  currentPathIndex: 0,
5830
5841
  //轨迹点
5831
5842
  pathCoordinates: [],
@@ -5834,19 +5845,9 @@ function debounce(fn, delay) {
5834
5845
  isPaused: false,
5835
5846
  speedNum: 1,
5836
5847
  speed: 500,
5837
- noAbleMoving: true,
5838
5848
  imgPathData: null
5839
5849
  }
5840
5850
  },
5841
- activated() {
5842
- let route = this.$route
5843
- this.gjParams = route.query
5844
- this.noAbleMoving = route.query && route.query.cannotMove ? false : true
5845
- this.isLoading = true
5846
- if (route.query.token) {
5847
- this.apiToken = route.query.token
5848
- }
5849
- },
5850
5851
  mounted() {
5851
5852
  this.isLoading = true
5852
5853
  this.init(this.mapParams)
@@ -6191,7 +6192,7 @@ function debounce(fn, delay) {
6191
6192
  measurement = new window.jkEsri.Measurement({
6192
6193
  view: jk_view
6193
6194
  })
6194
- jk_view.on('pointer-move', debounce(this.debouncedHover, 300))
6195
+ jk_view.on('pointer-move', augustineGjMapvue_type_script_lang_js_debounce(this.debouncedHover, 300))
6195
6196
  this.loadMapData()
6196
6197
  })
6197
6198
  },
@@ -11074,9 +11075,9 @@ const mapLocationMixin = {
11074
11075
  },
11075
11076
  setupMapEvents(view) {
11076
11077
  // 点击
11077
- this._clickHandler = view.on('click', this.debounce(this.handleMapClick, 300))
11078
+ this._clickHandler = view.on('click', debounce(this.handleMapClick, 300))
11078
11079
  // 悬浮
11079
- this._hoverHandler = view.on('pointer-move', this.debounce(this.handleMapHover, 80))
11080
+ this._hoverHandler = view.on('pointer-move', debounce(this.handleMapHover, 80))
11080
11081
  },
11081
11082
 
11082
11083
  handleMapClick(e) {
@@ -11132,14 +11133,6 @@ const mapLocationMixin = {
11132
11133
  } else arcgisView.container.style.cursor = 'default'
11133
11134
  },
11134
11135
 
11135
- debounce(fn, delay) {
11136
- let timer
11137
- return (...args) => {
11138
- clearTimeout(timer)
11139
- timer = setTimeout(() => fn.apply(this, args), delay)
11140
- }
11141
- },
11142
-
11143
11136
  cleanupMapEvents() {
11144
11137
  this._clickHandler?.remove()
11145
11138
  this._hoverHandler?.remove()
@@ -11944,6 +11937,7 @@ class SketchManager {
11944
11937
  this.drawIngArea = this.getArea(event.graphic.geometry)
11945
11938
  }
11946
11939
  }
11940
+ this.isActive = true
11947
11941
  if (event.state === 'complete') {
11948
11942
  const graphic = event.graphic
11949
11943
  this.isActive = false
@@ -11963,6 +11957,7 @@ class SketchManager {
11963
11957
  if (selectedGrahic && selectedGrahic.length > 0) {
11964
11958
  this.drawIngArea = this.getArea(selectedGrahic[0].geometry)
11965
11959
  }
11960
+ this.isActive = true
11966
11961
  if (event.state === 'complete') {
11967
11962
  this.isActive = false
11968
11963
  this.isNextList = []
@@ -12062,7 +12057,7 @@ const mapMixin = {
12062
12057
  module: {
12063
12058
  type: Array,
12064
12059
  default: () => {
12065
- return ['search', 'edit', 'screen'] //edit:编辑,screen:全屏,search:搜索-'search', 'edit', 'screen'
12060
+ return [] //edit:编辑,screen:全屏,search:搜索-'search', 'edit', 'screen'
12066
12061
  }
12067
12062
  },
12068
12063
  //最大可绘制的图形数量
@@ -12102,9 +12097,17 @@ const mapMixin = {
12102
12097
  isPer: false,
12103
12098
  drawIngArea: 0,
12104
12099
  isDel: false,
12105
- isDelAll: false
12100
+ isDelAll: false,
12101
+ debouncedRetuanGraphics: null
12106
12102
  }
12107
12103
  },
12104
+ created() {
12105
+ // 包装 retuanGraphics 为防抖方法,延迟 500ms(可自定义)
12106
+ // 此处用箭头函数确保 this 指向组件实例,或用 bind(this)
12107
+ this.debouncedRetuanGraphics = debounce(() => {
12108
+ this.retuanGraphics()
12109
+ }, 500) // 防抖延迟与原 setTimeout 一致,也可调整
12110
+ },
12108
12111
  methods: {
12109
12112
  /**
12110
12113
  * 给数值添加千分位(强制保留2位小数,兼容负数/0/超长字符串等场景)
@@ -12138,8 +12141,8 @@ const mapMixin = {
12138
12141
  * @param {*} view
12139
12142
  */
12140
12143
  setupMapEvents(view) {
12141
- this._clickHandler = view.on('click', this.debounce(this.handleMapClick, 300))
12142
- this._hoverHandler = view.on('pointer-move', this.debounce(this.handleMapHover, 80))
12144
+ this._clickHandler = view.on('click', debounce(this.handleMapClick, 300))
12145
+ this._hoverHandler = view.on('pointer-move', debounce(this.handleMapHover, 80))
12143
12146
  },
12144
12147
  /**
12145
12148
  * 鼠标点击
@@ -12188,13 +12191,6 @@ const mapMixin = {
12188
12191
  mapMixin_arcgisView.container.style.cursor = 'default'
12189
12192
  }
12190
12193
  },
12191
- debounce(fn, delay) {
12192
- let timer
12193
- return (...args) => {
12194
- clearTimeout(timer)
12195
- timer = setTimeout(() => fn.apply(this, args), delay)
12196
- }
12197
- },
12198
12194
  /**
12199
12195
  * 清除监听
12200
12196
  */
@@ -12246,9 +12242,8 @@ const mapMixin = {
12246
12242
  : 0
12247
12243
  graphics = data.graphics
12248
12244
  this.isDelAll = graphics.length > 0
12249
- setTimeout(() => {
12250
- this.retuanGraphics()
12251
- }, 500)
12245
+
12246
+ this.debouncedRetuanGraphics()
12252
12247
  })
12253
12248
  }
12254
12249
  this.setupMapEvents(data.view)
@@ -12361,7 +12356,6 @@ const mapMixin = {
12361
12356
  form.mArea = Number(area) * 0.0015 // 亩
12362
12357
  form.hectareArea = Number(area) * 0.0001 // 公顷
12363
12358
  }
12364
- console.log('formatMapData00', form, graphics)
12365
12359
  return form
12366
12360
  },
12367
12361
  /**
@@ -12376,8 +12370,9 @@ const mapMixin = {
12376
12370
  * @param {*} type
12377
12371
  */
12378
12372
  batchDraw(graphics) {
12379
- sketchLayer && sketchLayer.removeAll()
12380
- if (graphics.length > 0) {
12373
+ if (graphics.length > 0 && sketchLayer) {
12374
+ sketchLayer && sketchLayer.removeAll()
12375
+
12381
12376
  let sketchArr = []
12382
12377
  graphics.map((item) => {
12383
12378
  let grahic = null
@@ -12398,8 +12393,8 @@ const mapMixin = {
12398
12393
  } else this.goToCenter()
12399
12394
  },
12400
12395
  batchNnselectDraw(graphics, textKey = 'text') {
12401
- unselectableLayer && unselectableLayer.removeAll()
12402
- if (graphics.length > 0) {
12396
+ if (graphics.length > 0 && unselectableLayer) {
12397
+ unselectableLayer && unselectableLayer.removeAll()
12403
12398
  let sketchArr = []
12404
12399
  graphics.map((item) => {
12405
12400
  let grahic = null
@@ -12435,10 +12430,15 @@ const mapMixin = {
12435
12430
  destroy() {
12436
12431
  this.cleanupMapEvents()
12437
12432
  if (mapMixin_sketch && mapMixin_sketch.destroy) mapMixin_sketch.destroy()
12433
+ unselectableLayer && unselectableLayer.removeAll()
12438
12434
  this.goToCenter()
12439
12435
  if (this.$refs.searchRef && this.$refs.searchRef.clearSearch) {
12440
12436
  this.$refs.searchRef.clearSearch()
12441
12437
  }
12438
+ if (this.debouncedRetuanGraphics) {
12439
+ // 若防抖函数支持取消,可在此处取消(需修改防抖函数)
12440
+ clearTimeout(this.debouncedRetuanGraphics.timer)
12441
+ }
12442
12442
  }
12443
12443
  },
12444
12444
  beforeUnmount() {
@@ -12542,9 +12542,9 @@ const mapListMixin = {
12542
12542
  },
12543
12543
  setupMapEvents(view) {
12544
12544
  // 点击
12545
- this._clickHandler = view.on('click', this.debounce(this.handleMapClick, 300))
12545
+ this._clickHandler = view.on('click', debounce(this.handleMapClick, 300))
12546
12546
  // 悬浮
12547
- this._hoverHandler = view.on('pointer-move', this.debounce(this.handleMapHover, 80))
12547
+ this._hoverHandler = view.on('pointer-move', debounce(this.handleMapHover, 80))
12548
12548
  },
12549
12549
  changeGraphic(data) {
12550
12550
  if (mapListMixin_pointLayer && mapListMixin_pointLayer.graphics && mapListMixin_pointLayer.graphics._items) {
@@ -12618,13 +12618,6 @@ const mapListMixin = {
12618
12618
  this.$emit('mapEventMouse', hitData)
12619
12619
  } else mapListMixin_arcgisView.container.style.cursor = 'default'
12620
12620
  },
12621
- debounce(fn, delay) {
12622
- let timer
12623
- return (...args) => {
12624
- clearTimeout(timer)
12625
- timer = setTimeout(() => fn.apply(this, args), delay)
12626
- }
12627
- },
12628
12621
  cleanupMapEvents() {
12629
12622
  this._clickHandler?.remove()
12630
12623
  this._hoverHandler?.remove()
@@ -12737,34 +12730,58 @@ var mapList_component = normalizeComponent(
12737
12730
 
12738
12731
 
12739
12732
  // 所有组件列表
12740
- // const components = [augustineGjMap, augustineMap, locationMap, mapList];
12741
- // // install 方法
12742
- // const install = (Vue) => {
12743
- // if (install.installed) return;
12744
- // install.installed = true;
12745
- // components.forEach((comp) => {
12746
- // Vue.component(comp.name, comp);
12747
- // });
12748
- // };
12749
-
12750
- // // 支持 Vue.use(MyLib)
12751
- // export default {
12752
- // install,
12753
- // ...components,
12754
- // };
12755
-
12756
- // // 浏览器环境自动安装
12757
- // if (typeof window !== "undefined" && window.Vue) {
12758
- // install(window.Vue);
12759
- // }
12760
-
12733
+ const components = [augustineGjMap, augustineMap, locationMap, mapList]
12734
+ // install 方法
12735
+ const install = (Vue) => {
12736
+ if (install.installed) return
12737
+ install.installed = true
12738
+ components.forEach((comp) => {
12739
+ Vue.component(comp.name, comp)
12740
+ })
12741
+ }
12761
12742
 
12743
+ // 支持 Vue.use(MyLib)
12744
+ /* harmony default export */ const src_0 = ({
12745
+ install,
12746
+ augustineGjMap: augustineGjMap,
12747
+ augustineMap: augustineMap,
12748
+ locationMap: locationMap,
12749
+ mapList: mapList,
12750
+ arcGISTranformGeoJson: arcGISTranformGeoJson,
12751
+ geoJsonTranformArcgis: geoJsonTranformArcgis,
12752
+ geoJsonTranformWkt: geoJsonTranformWkt,
12753
+ wktTranformGeoJson: wktTranformGeoJson,
12754
+ wktTranformArcgis: wktTranformArcgis,
12755
+ arcgisTranformWkt: arcgisTranformWkt,
12756
+ initMapPack: initMapPack,
12757
+ createBase: createBase,
12758
+ createMapView: createMapView,
12759
+ toArcGISPoint: toArcGISPoint,
12760
+ getSimpleText: getSimpleText,
12761
+ getSimpleMarker: getSimpleMarker,
12762
+ getPictureMarker: getPictureMarker,
12763
+ getSimpleLine: getSimpleLine,
12764
+ getSimpleFill: getSimpleFill,
12765
+ createGrahic: createGrahic,
12766
+ createMaskLayer: createMaskLayer,
12767
+ createGraphicsLayer: createGraphicsLayer,
12768
+ mapJumpTo: mapJumpTo,
12769
+ drawPoint: drawPoint,
12770
+ drawPolyline: drawPolyline,
12771
+ drawPolygon: drawPolygon,
12772
+ drawPolygonArr: drawPolygonArr,
12773
+ getArea: getArea
12774
+ });
12762
12775
 
12776
+ // 浏览器环境自动安装
12777
+ if (typeof window !== 'undefined' && window.Vue) {
12778
+ install(window.Vue)
12779
+ }
12763
12780
 
12764
12781
  ;// ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
12765
12782
 
12766
12783
 
12767
- /* harmony default export */ const entry_lib = (src_namespaceObject["default"]);
12784
+ /* harmony default export */ const entry_lib = (src_0);
12768
12785
 
12769
12786
 
12770
12787
  })();