augustine-jkmap 1.1.2 → 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
+ }));
2344
2232
 
2345
- this.type = "Feature";
2346
- }
2347
2233
 
2348
- Feature.prototype = new Primitive();
2349
- Feature.prototype.constructor = Feature;
2234
+ /***/ },
2350
2235
 
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";
2236
+ /***/ 384
2237
+ (__unused_webpack_module, exports) {
2238
+
2239
+ (function (global, factory) {
2240
+ true ? factory(exports) :
2241
+ 0;
2242
+ }(this, (function (exports) { 'use strict';
2243
+
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;
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");
2367
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
  /***/ },
@@ -3083,14 +3083,14 @@ if (typeof window !== 'undefined') {
3083
3083
  // Indicate to webpack that this file can be concatenated
3084
3084
  /* harmony default export */ const setPublicPath = (null);
3085
3085
 
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=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
3087
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)])
3088
3088
  }
3089
3089
  var staticRenderFns = []
3090
3090
 
3091
3091
 
3092
3092
  // EXTERNAL MODULE: ./node_modules/esri-loader/dist/umd/esri-loader.js
3093
- var esri_loader = __webpack_require__(3);
3093
+ var esri_loader = __webpack_require__(384);
3094
3094
  ;// ./src/config/mapGj.config.js
3095
3095
  const mapConfig = {
3096
3096
  initJs: 'https://web.joinken.cn:82/arcgis/4.30/init.js', // arcgis的JS地址
@@ -5411,6 +5411,24 @@ async function createMaskLayer(polygonDataList = [], options, context = null, ma
5411
5411
  return null
5412
5412
  }
5413
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
+ }
5414
5432
 
5415
5433
 
5416
5434
  ;// ./src/utils/bearing.js
@@ -5765,7 +5783,7 @@ var jk_map,
5765
5783
  /**
5766
5784
  * 防抖
5767
5785
  */
5768
- function debounce(fn, delay) {
5786
+ function augustineGjMapvue_type_script_lang_js_debounce(fn, delay) {
5769
5787
  let timer
5770
5788
  return (...args) => {
5771
5789
  clearTimeout(timer)
@@ -5780,9 +5798,9 @@ function debounce(fn, delay) {
5780
5798
  type: Object,
5781
5799
  default: mapGj_config
5782
5800
  },
5783
- load: {
5784
- type: Function,
5785
- default: null
5801
+ noAbleMoving: {
5802
+ type: Boolean,
5803
+ default: true
5786
5804
  },
5787
5805
  center: {
5788
5806
  type: Array,
@@ -5819,8 +5837,6 @@ function debounce(fn, delay) {
5819
5837
  mapId: 'map' + Math.round(Math.random() * 10000),
5820
5838
  //地图加载loading
5821
5839
  isLoading: true,
5822
- gjParams: null,
5823
- apiToken: null,
5824
5840
  currentPathIndex: 0,
5825
5841
  //轨迹点
5826
5842
  pathCoordinates: [],
@@ -5829,19 +5845,9 @@ function debounce(fn, delay) {
5829
5845
  isPaused: false,
5830
5846
  speedNum: 1,
5831
5847
  speed: 500,
5832
- noAbleMoving: true,
5833
5848
  imgPathData: null
5834
5849
  }
5835
5850
  },
5836
- activated() {
5837
- let route = this.$route
5838
- this.gjParams = route.query
5839
- this.noAbleMoving = route.query && route.query.cannotMove ? false : true
5840
- this.isLoading = true
5841
- if (route.query.token) {
5842
- this.apiToken = route.query.token
5843
- }
5844
- },
5845
5851
  mounted() {
5846
5852
  this.isLoading = true
5847
5853
  this.init(this.mapParams)
@@ -6186,7 +6192,7 @@ function debounce(fn, delay) {
6186
6192
  measurement = new window.jkEsri.Measurement({
6187
6193
  view: jk_view
6188
6194
  })
6189
- jk_view.on('pointer-move', debounce(this.debouncedHover, 300))
6195
+ jk_view.on('pointer-move', augustineGjMapvue_type_script_lang_js_debounce(this.debouncedHover, 300))
6190
6196
  this.loadMapData()
6191
6197
  })
6192
6198
  },
@@ -11069,9 +11075,9 @@ const mapLocationMixin = {
11069
11075
  },
11070
11076
  setupMapEvents(view) {
11071
11077
  // 点击
11072
- this._clickHandler = view.on('click', this.debounce(this.handleMapClick, 300))
11078
+ this._clickHandler = view.on('click', debounce(this.handleMapClick, 300))
11073
11079
  // 悬浮
11074
- this._hoverHandler = view.on('pointer-move', this.debounce(this.handleMapHover, 80))
11080
+ this._hoverHandler = view.on('pointer-move', debounce(this.handleMapHover, 80))
11075
11081
  },
11076
11082
 
11077
11083
  handleMapClick(e) {
@@ -11127,14 +11133,6 @@ const mapLocationMixin = {
11127
11133
  } else arcgisView.container.style.cursor = 'default'
11128
11134
  },
11129
11135
 
11130
- debounce(fn, delay) {
11131
- let timer
11132
- return (...args) => {
11133
- clearTimeout(timer)
11134
- timer = setTimeout(() => fn.apply(this, args), delay)
11135
- }
11136
- },
11137
-
11138
11136
  cleanupMapEvents() {
11139
11137
  this._clickHandler?.remove()
11140
11138
  this._hoverHandler?.remove()
@@ -11939,6 +11937,7 @@ class SketchManager {
11939
11937
  this.drawIngArea = this.getArea(event.graphic.geometry)
11940
11938
  }
11941
11939
  }
11940
+ this.isActive = true
11942
11941
  if (event.state === 'complete') {
11943
11942
  const graphic = event.graphic
11944
11943
  this.isActive = false
@@ -11958,6 +11957,7 @@ class SketchManager {
11958
11957
  if (selectedGrahic && selectedGrahic.length > 0) {
11959
11958
  this.drawIngArea = this.getArea(selectedGrahic[0].geometry)
11960
11959
  }
11960
+ this.isActive = true
11961
11961
  if (event.state === 'complete') {
11962
11962
  this.isActive = false
11963
11963
  this.isNextList = []
@@ -12057,7 +12057,7 @@ const mapMixin = {
12057
12057
  module: {
12058
12058
  type: Array,
12059
12059
  default: () => {
12060
- return ['search', 'edit', 'screen'] //edit:编辑,screen:全屏,search:搜索-'search', 'edit', 'screen'
12060
+ return [] //edit:编辑,screen:全屏,search:搜索-'search', 'edit', 'screen'
12061
12061
  }
12062
12062
  },
12063
12063
  //最大可绘制的图形数量
@@ -12097,9 +12097,17 @@ const mapMixin = {
12097
12097
  isPer: false,
12098
12098
  drawIngArea: 0,
12099
12099
  isDel: false,
12100
- isDelAll: false
12100
+ isDelAll: false,
12101
+ debouncedRetuanGraphics: null
12101
12102
  }
12102
12103
  },
12104
+ created() {
12105
+ // 包装 retuanGraphics 为防抖方法,延迟 500ms(可自定义)
12106
+ // 此处用箭头函数确保 this 指向组件实例,或用 bind(this)
12107
+ this.debouncedRetuanGraphics = debounce(() => {
12108
+ this.retuanGraphics()
12109
+ }, 500) // 防抖延迟与原 setTimeout 一致,也可调整
12110
+ },
12103
12111
  methods: {
12104
12112
  /**
12105
12113
  * 给数值添加千分位(强制保留2位小数,兼容负数/0/超长字符串等场景)
@@ -12133,8 +12141,8 @@ const mapMixin = {
12133
12141
  * @param {*} view
12134
12142
  */
12135
12143
  setupMapEvents(view) {
12136
- this._clickHandler = view.on('click', this.debounce(this.handleMapClick, 300))
12137
- 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))
12138
12146
  },
12139
12147
  /**
12140
12148
  * 鼠标点击
@@ -12183,13 +12191,6 @@ const mapMixin = {
12183
12191
  mapMixin_arcgisView.container.style.cursor = 'default'
12184
12192
  }
12185
12193
  },
12186
- debounce(fn, delay) {
12187
- let timer
12188
- return (...args) => {
12189
- clearTimeout(timer)
12190
- timer = setTimeout(() => fn.apply(this, args), delay)
12191
- }
12192
- },
12193
12194
  /**
12194
12195
  * 清除监听
12195
12196
  */
@@ -12241,9 +12242,8 @@ const mapMixin = {
12241
12242
  : 0
12242
12243
  graphics = data.graphics
12243
12244
  this.isDelAll = graphics.length > 0
12244
- setTimeout(() => {
12245
- this.retuanGraphics()
12246
- }, 500)
12245
+
12246
+ this.debouncedRetuanGraphics()
12247
12247
  })
12248
12248
  }
12249
12249
  this.setupMapEvents(data.view)
@@ -12356,7 +12356,6 @@ const mapMixin = {
12356
12356
  form.mArea = Number(area) * 0.0015 // 亩
12357
12357
  form.hectareArea = Number(area) * 0.0001 // 公顷
12358
12358
  }
12359
- console.log('formatMapData00', form, graphics)
12360
12359
  return form
12361
12360
  },
12362
12361
  /**
@@ -12371,8 +12370,9 @@ const mapMixin = {
12371
12370
  * @param {*} type
12372
12371
  */
12373
12372
  batchDraw(graphics) {
12374
- sketchLayer && sketchLayer.removeAll()
12375
- if (graphics.length > 0) {
12373
+ if (graphics.length > 0 && sketchLayer) {
12374
+ sketchLayer && sketchLayer.removeAll()
12375
+
12376
12376
  let sketchArr = []
12377
12377
  graphics.map((item) => {
12378
12378
  let grahic = null
@@ -12393,8 +12393,8 @@ const mapMixin = {
12393
12393
  } else this.goToCenter()
12394
12394
  },
12395
12395
  batchNnselectDraw(graphics, textKey = 'text') {
12396
- unselectableLayer && unselectableLayer.removeAll()
12397
- if (graphics.length > 0) {
12396
+ if (graphics.length > 0 && unselectableLayer) {
12397
+ unselectableLayer && unselectableLayer.removeAll()
12398
12398
  let sketchArr = []
12399
12399
  graphics.map((item) => {
12400
12400
  let grahic = null
@@ -12430,10 +12430,15 @@ const mapMixin = {
12430
12430
  destroy() {
12431
12431
  this.cleanupMapEvents()
12432
12432
  if (mapMixin_sketch && mapMixin_sketch.destroy) mapMixin_sketch.destroy()
12433
+ unselectableLayer && unselectableLayer.removeAll()
12433
12434
  this.goToCenter()
12434
12435
  if (this.$refs.searchRef && this.$refs.searchRef.clearSearch) {
12435
12436
  this.$refs.searchRef.clearSearch()
12436
12437
  }
12438
+ if (this.debouncedRetuanGraphics) {
12439
+ // 若防抖函数支持取消,可在此处取消(需修改防抖函数)
12440
+ clearTimeout(this.debouncedRetuanGraphics.timer)
12441
+ }
12437
12442
  }
12438
12443
  },
12439
12444
  beforeUnmount() {
@@ -12537,9 +12542,9 @@ const mapListMixin = {
12537
12542
  },
12538
12543
  setupMapEvents(view) {
12539
12544
  // 点击
12540
- this._clickHandler = view.on('click', this.debounce(this.handleMapClick, 300))
12545
+ this._clickHandler = view.on('click', debounce(this.handleMapClick, 300))
12541
12546
  // 悬浮
12542
- this._hoverHandler = view.on('pointer-move', this.debounce(this.handleMapHover, 80))
12547
+ this._hoverHandler = view.on('pointer-move', debounce(this.handleMapHover, 80))
12543
12548
  },
12544
12549
  changeGraphic(data) {
12545
12550
  if (mapListMixin_pointLayer && mapListMixin_pointLayer.graphics && mapListMixin_pointLayer.graphics._items) {
@@ -12613,13 +12618,6 @@ const mapListMixin = {
12613
12618
  this.$emit('mapEventMouse', hitData)
12614
12619
  } else mapListMixin_arcgisView.container.style.cursor = 'default'
12615
12620
  },
12616
- debounce(fn, delay) {
12617
- let timer
12618
- return (...args) => {
12619
- clearTimeout(timer)
12620
- timer = setTimeout(() => fn.apply(this, args), delay)
12621
- }
12622
- },
12623
12621
  cleanupMapEvents() {
12624
12622
  this._clickHandler?.remove()
12625
12623
  this._hoverHandler?.remove()
@@ -12731,17 +12729,16 @@ var mapList_component = normalizeComponent(
12731
12729
 
12732
12730
 
12733
12731
 
12734
- // export { augustineGjMap, augustineMap, locationMap, mapList };
12735
12732
  // 所有组件列表
12736
- const components = [augustineGjMap, augustineMap, locationMap, mapList];
12733
+ const components = [augustineGjMap, augustineMap, locationMap, mapList]
12737
12734
  // install 方法
12738
12735
  const install = (Vue) => {
12739
- if (install.installed) return;
12740
- install.installed = true;
12736
+ if (install.installed) return
12737
+ install.installed = true
12741
12738
  components.forEach((comp) => {
12742
- Vue.component(comp.name, comp);
12743
- });
12744
- };
12739
+ Vue.component(comp.name, comp)
12740
+ })
12741
+ }
12745
12742
 
12746
12743
  // 支持 Vue.use(MyLib)
12747
12744
  /* harmony default export */ const src_0 = ({
@@ -12773,12 +12770,12 @@ const install = (Vue) => {
12773
12770
  drawPolyline: drawPolyline,
12774
12771
  drawPolygon: drawPolygon,
12775
12772
  drawPolygonArr: drawPolygonArr,
12776
- getArea: getArea,
12773
+ getArea: getArea
12777
12774
  });
12778
12775
 
12779
12776
  // 浏览器环境自动安装
12780
- if (typeof window !== "undefined" && window.Vue) {
12781
- install(window.Vue);
12777
+ if (typeof window !== 'undefined' && window.Vue) {
12778
+ install(window.Vue)
12782
12779
  }
12783
12780
 
12784
12781
  ;// ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js