mapshaper 0.7.18 → 0.7.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mapshaper.js +415 -51
- package/package.json +2 -2
- package/www/index.html +2 -2
- package/www/mapshaper-gui.js +146 -52
- package/www/mapshaper.js +415 -51
- package/www/modules.js +71 -0
- package/www/page.css +15 -8
- package/www/sponsor.html +3 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mapshaper",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.20",
|
|
4
4
|
"description": "A tool for editing geospatial data for mapping and GIS.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shapefile",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"idb-keyval": "^6.2.0",
|
|
74
74
|
"jpeg-js": "^0.4.4",
|
|
75
75
|
"kdbush": "^3.0.0",
|
|
76
|
-
"mproj": "0.1.
|
|
76
|
+
"mproj": "0.1.3",
|
|
77
77
|
"msgpackr": "^1.10.1",
|
|
78
78
|
"open": "^11.0.0",
|
|
79
79
|
"pngjs": "^7.0.0",
|
package/www/index.html
CHANGED
|
@@ -375,8 +375,8 @@ encoding=big5</span>. Click to see all options.</div></div></div>
|
|
|
375
375
|
</div>
|
|
376
376
|
<div class="mshp-main-map main-area map-area">
|
|
377
377
|
<div class="intersection-display">
|
|
378
|
-
<span class="intersection-count">0 line intersections</span
|
|
379
|
-
<
|
|
378
|
+
<span class="intersection-count">0 line intersections</span>
|
|
379
|
+
<span class="repair-btn text-btn colored-text">repair</span>
|
|
380
380
|
</div>
|
|
381
381
|
<div class="basemap-overlay-buttons basemap-buttons"></div>
|
|
382
382
|
<div class="map-layers"></div>
|
package/www/mapshaper-gui.js
CHANGED
|
@@ -6611,34 +6611,42 @@
|
|
|
6611
6611
|
|
|
6612
6612
|
function getPayloadStore() {
|
|
6613
6613
|
if (!gui.undoPayloadStore) {
|
|
6614
|
-
gui.undoPayloadStore = createUndoPayloadStore(getUndoPayloadStoreOptions());
|
|
6615
|
-
gui.undoPayloadStore.startLifecycle();
|
|
6616
|
-
gui.undoPayloadStore.cleanupStaleSessions().then(function(result) {
|
|
6617
|
-
logStartupCleanup({
|
|
6618
|
-
count: result.keys.length,
|
|
6619
|
-
sessionCount: result.sessionCount,
|
|
6620
|
-
singular: 'undo payload',
|
|
6621
|
-
plural: 'undo payloads',
|
|
6622
|
-
sizeBytes: result.sizeBytes
|
|
6623
|
-
});
|
|
6624
|
-
}).catch(function() {});
|
|
6614
|
+
gui.undoPayloadStore = createUndoPayloadStore(getUndoPayloadStoreOptions(gui));
|
|
6625
6615
|
}
|
|
6616
|
+
gui.undoPayloadStore.startLifecycle();
|
|
6626
6617
|
return gui.undoPayloadStore;
|
|
6627
6618
|
}
|
|
6619
|
+
}
|
|
6628
6620
|
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
maxPayloadBytes: getUndoStorageLimit('undoPayloadMaxBytes', 512 * 1024 * 1024)
|
|
6633
|
-
};
|
|
6621
|
+
function cleanupStaleUndoPayloads(gui) {
|
|
6622
|
+
if (!gui.undoPayloadStore) {
|
|
6623
|
+
gui.undoPayloadStore = createUndoPayloadStore(getUndoPayloadStoreOptions(gui));
|
|
6634
6624
|
}
|
|
6625
|
+
var store = gui.undoPayloadStore;
|
|
6626
|
+
return store.cleanupStaleSessions().then(function(result) {
|
|
6627
|
+
logStartupCleanup({
|
|
6628
|
+
count: result.keys.length,
|
|
6629
|
+
sessionCount: result.sessionCount,
|
|
6630
|
+
singular: 'undo payload',
|
|
6631
|
+
plural: 'undo payloads',
|
|
6632
|
+
sizeBytes: result.sizeBytes
|
|
6633
|
+
});
|
|
6634
|
+
return result;
|
|
6635
|
+
});
|
|
6636
|
+
}
|
|
6635
6637
|
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6638
|
+
function getUndoPayloadStoreOptions(gui) {
|
|
6639
|
+
return {
|
|
6640
|
+
maxBytes: getUndoStorageLimit(gui, 'undoStorageMaxBytes', 1024 * 1024 * 1024),
|
|
6641
|
+
maxPayloadBytes: getUndoStorageLimit(gui, 'undoPayloadMaxBytes', 512 * 1024 * 1024)
|
|
6642
|
+
};
|
|
6643
|
+
}
|
|
6644
|
+
|
|
6645
|
+
function getUndoStorageLimit(gui, name, defaultValue) {
|
|
6646
|
+
var opt = gui && gui.options && gui.options[name],
|
|
6647
|
+
query = getQueryValue$2(name);
|
|
6648
|
+
if (query !== null && +query >= 0) return +query;
|
|
6649
|
+
return opt >= 0 ? opt : defaultValue;
|
|
6642
6650
|
}
|
|
6643
6651
|
|
|
6644
6652
|
function getRedoCaptureUnits(units) {
|
|
@@ -6872,7 +6880,7 @@
|
|
|
6872
6880
|
var mapCRS = gui.map.getActiveLayerCRS();
|
|
6873
6881
|
var dataCRS = internal.getDatasetCRS(dataset);
|
|
6874
6882
|
var msg, reproject;
|
|
6875
|
-
if (!dataCRS || !mapCRS || internal.
|
|
6883
|
+
if (!dataCRS || !mapCRS || internal.crsHaveSameTransform(mapCRS, dataCRS)) return;
|
|
6876
6884
|
if (!datasetCanBeReprojected(dataset, dataCRS, mapCRS)) {
|
|
6877
6885
|
notifyProjectionMismatch(gui, dataset);
|
|
6878
6886
|
return;
|
|
@@ -8373,7 +8381,7 @@
|
|
|
8373
8381
|
if (!sourceCRS || !displayCRS) {
|
|
8374
8382
|
return false;
|
|
8375
8383
|
}
|
|
8376
|
-
if (internal.
|
|
8384
|
+
if (internal.crsHaveSameTransform(sourceCRS, displayCRS)) {
|
|
8377
8385
|
return false;
|
|
8378
8386
|
}
|
|
8379
8387
|
return true;
|
|
@@ -8522,7 +8530,7 @@
|
|
|
8522
8530
|
if (!lyr.gui.geographic) {
|
|
8523
8531
|
return;
|
|
8524
8532
|
}
|
|
8525
|
-
if (lyr.gui.dynamic_crs && internal.
|
|
8533
|
+
if (lyr.gui.dynamic_crs && internal.crsHaveSameTransform(sourceCRS, lyr.gui.dynamic_crs)) {
|
|
8526
8534
|
return;
|
|
8527
8535
|
}
|
|
8528
8536
|
var gui = lyr.gui;
|
|
@@ -15074,6 +15082,7 @@
|
|
|
15074
15082
|
}
|
|
15075
15083
|
|
|
15076
15084
|
function updateControls() {
|
|
15085
|
+
syncTargetLayer();
|
|
15077
15086
|
var geom = targetLayer && targetLayer.geometry_type;
|
|
15078
15087
|
var manualIds = getSelectionIds();
|
|
15079
15088
|
if (!targetLayer) return;
|
|
@@ -15159,6 +15168,7 @@
|
|
|
15159
15168
|
|
|
15160
15169
|
function runStyleCommand(styles, opts) {
|
|
15161
15170
|
var parts = ['-style'];
|
|
15171
|
+
syncTargetLayer();
|
|
15162
15172
|
var ids = getTargetIds();
|
|
15163
15173
|
if (!gui.console || !targetLayer || ids.length === 0) return;
|
|
15164
15174
|
if (!opts || !opts.preservePreset) {
|
|
@@ -15187,6 +15197,7 @@
|
|
|
15187
15197
|
|
|
15188
15198
|
function applyRandomFillColors() {
|
|
15189
15199
|
var cmd = '-classify colors=random non-adjacent';
|
|
15200
|
+
syncTargetLayer();
|
|
15190
15201
|
if (!gui.console || !targetLayer || targetLayer.geometry_type != 'polygon') return;
|
|
15191
15202
|
if (getActiveLayer() != targetLayer) {
|
|
15192
15203
|
cmd += ' target=' + internal.formatOptionValue(internal.getLayerTargetId(gui.model, targetLayer));
|
|
@@ -15250,6 +15261,7 @@
|
|
|
15250
15261
|
|
|
15251
15262
|
function clearLayerStyle() {
|
|
15252
15263
|
var parts = ['-style clear'];
|
|
15264
|
+
syncTargetLayer();
|
|
15253
15265
|
if (!gui.console || !targetLayer) return;
|
|
15254
15266
|
presetControl.clearSelection();
|
|
15255
15267
|
addTargetOption(parts);
|
|
@@ -15335,6 +15347,17 @@
|
|
|
15335
15347
|
return active && active.layer;
|
|
15336
15348
|
}
|
|
15337
15349
|
|
|
15350
|
+
function syncTargetLayer() {
|
|
15351
|
+
var lyr = getActiveLayer();
|
|
15352
|
+
if (lyr == targetLayer) return;
|
|
15353
|
+
if (layerCanBeStyled(lyr)) {
|
|
15354
|
+
targetLayer = lyr;
|
|
15355
|
+
if (hit) hit.clearSelection();
|
|
15356
|
+
} else {
|
|
15357
|
+
targetLayer = null;
|
|
15358
|
+
}
|
|
15359
|
+
}
|
|
15360
|
+
|
|
15338
15361
|
function closePanel() {
|
|
15339
15362
|
turnOff();
|
|
15340
15363
|
if (gui.interaction.getMode() == 'line_style' || gui.interaction.getMode() == 'polygon_style') {
|
|
@@ -15654,6 +15677,7 @@
|
|
|
15654
15677
|
}
|
|
15655
15678
|
|
|
15656
15679
|
function updateControls() {
|
|
15680
|
+
syncTargetLayer();
|
|
15657
15681
|
var representation = getPointRepresentation();
|
|
15658
15682
|
updateCreateLabelsButton();
|
|
15659
15683
|
title.text(representation == 'circle' ? 'Circle styles' : 'Point symbols');
|
|
@@ -15798,6 +15822,7 @@
|
|
|
15798
15822
|
}
|
|
15799
15823
|
|
|
15800
15824
|
function runStyleCommand(args, title) {
|
|
15825
|
+
syncTargetLayer();
|
|
15801
15826
|
var ids = getTargetIds();
|
|
15802
15827
|
var parts = ['-style'].concat(args);
|
|
15803
15828
|
if (!targetLayer || ids.length === 0) return;
|
|
@@ -16001,6 +16026,17 @@
|
|
|
16001
16026
|
return active && active.layer;
|
|
16002
16027
|
}
|
|
16003
16028
|
|
|
16029
|
+
function syncTargetLayer() {
|
|
16030
|
+
var lyr = getActiveLayer();
|
|
16031
|
+
if (lyr == targetLayer) return;
|
|
16032
|
+
if (layerCanBeStyled(lyr)) {
|
|
16033
|
+
targetLayer = lyr;
|
|
16034
|
+
if (hit) hit.clearSelection();
|
|
16035
|
+
} else {
|
|
16036
|
+
targetLayer = null;
|
|
16037
|
+
}
|
|
16038
|
+
}
|
|
16039
|
+
|
|
16004
16040
|
function modelSelectLayer(lyr, dataset) {
|
|
16005
16041
|
if (lyr) lyr.hidden = false;
|
|
16006
16042
|
gui.model.selectLayer(lyr, dataset);
|
|
@@ -17274,18 +17310,18 @@
|
|
|
17274
17310
|
height = 0;
|
|
17275
17311
|
|
|
17276
17312
|
el.on('mouseover', update);
|
|
17277
|
-
if (window.onorientationchange) window.addEventListener('orientationchange', update);
|
|
17313
|
+
if (window.onorientationchange) window.addEventListener('orientationchange', function() { update('window'); });
|
|
17278
17314
|
window.addEventListener('scroll', update);
|
|
17279
|
-
window.addEventListener('resize', update);
|
|
17315
|
+
window.addEventListener('resize', function() { update('window'); });
|
|
17280
17316
|
|
|
17281
17317
|
// trigger an update, e.g. when map container is resized
|
|
17282
|
-
this.update = function() {
|
|
17283
|
-
update();
|
|
17318
|
+
this.update = function(source) {
|
|
17319
|
+
update(source);
|
|
17284
17320
|
};
|
|
17285
17321
|
|
|
17286
|
-
this.resize = function(w, h) {
|
|
17322
|
+
this.resize = function(w, h, source) {
|
|
17287
17323
|
el.css('width', w).css('height', h);
|
|
17288
|
-
update();
|
|
17324
|
+
update(source);
|
|
17289
17325
|
};
|
|
17290
17326
|
|
|
17291
17327
|
this.width = function() { return width; };
|
|
@@ -17300,7 +17336,7 @@
|
|
|
17300
17336
|
};
|
|
17301
17337
|
};
|
|
17302
17338
|
|
|
17303
|
-
function update() {
|
|
17339
|
+
function update(source) {
|
|
17304
17340
|
var div = el.node(),
|
|
17305
17341
|
xy = getPageXY(div),
|
|
17306
17342
|
w = div.clientWidth,
|
|
@@ -17316,7 +17352,7 @@
|
|
|
17316
17352
|
height = h;
|
|
17317
17353
|
self.dispatchEvent('change', self.position());
|
|
17318
17354
|
if (resized) {
|
|
17319
|
-
self.dispatchEvent('resize', self.position());
|
|
17355
|
+
self.dispatchEvent('resize', Object.assign(self.position(), {source: source}));
|
|
17320
17356
|
}
|
|
17321
17357
|
}
|
|
17322
17358
|
}
|
|
@@ -20279,7 +20315,7 @@
|
|
|
20279
20315
|
_position.on('resize', function(e) {
|
|
20280
20316
|
if (ready()) {
|
|
20281
20317
|
// triggerChangeEvent({resize: true});
|
|
20282
|
-
triggerChangeEvent();
|
|
20318
|
+
triggerChangeEvent({resize: true, resizeSource: e.source});
|
|
20283
20319
|
}
|
|
20284
20320
|
});
|
|
20285
20321
|
|
|
@@ -20450,8 +20486,8 @@
|
|
|
20450
20486
|
_scale = scale;
|
|
20451
20487
|
}
|
|
20452
20488
|
|
|
20453
|
-
function triggerChangeEvent() {
|
|
20454
|
-
_self.dispatchEvent('change');
|
|
20489
|
+
function triggerChangeEvent(data) {
|
|
20490
|
+
_self.dispatchEvent('change', data);
|
|
20455
20491
|
}
|
|
20456
20492
|
|
|
20457
20493
|
// stop zooming before rounding errors become too obvious
|
|
@@ -20543,7 +20579,7 @@
|
|
|
20543
20579
|
function getCachedRasterViewportPreview(layer, ext) {
|
|
20544
20580
|
var entry = cache$1.get(layer);
|
|
20545
20581
|
var params = getRasterViewportPreviewParams(layer, ext);
|
|
20546
|
-
if (!entry || !params || entry
|
|
20582
|
+
if (!entry || !params || !rasterViewportCacheEntryMatches(entry, params)) return null;
|
|
20547
20583
|
return entry.preview;
|
|
20548
20584
|
}
|
|
20549
20585
|
|
|
@@ -20552,9 +20588,9 @@
|
|
|
20552
20588
|
var entry = cache$1.get(layer);
|
|
20553
20589
|
var id, stats, timing, preview;
|
|
20554
20590
|
if (!params || !params.needed) return;
|
|
20555
|
-
if (entry && entry
|
|
20591
|
+
if (entry && rasterViewportCacheEntryMatches(entry, params)) return;
|
|
20556
20592
|
id = ++requestId$1;
|
|
20557
|
-
cache$1.set(layer,
|
|
20593
|
+
cache$1.set(layer, getRasterViewportCacheEntry(params, {pending: id}));
|
|
20558
20594
|
setTimeout(function() {
|
|
20559
20595
|
var current = cache$1.get(layer);
|
|
20560
20596
|
if (!current || current.pending != id) return;
|
|
@@ -20566,10 +20602,7 @@
|
|
|
20566
20602
|
logRasterPreviewTiming(params, timing);
|
|
20567
20603
|
current = cache$1.get(layer);
|
|
20568
20604
|
if (!preview || !current || current.pending != id) return;
|
|
20569
|
-
cache$1.set(layer, {
|
|
20570
|
-
key: params.key,
|
|
20571
|
-
preview: preview
|
|
20572
|
-
});
|
|
20605
|
+
cache$1.set(layer, getRasterViewportCacheEntry(params, {preview: preview}));
|
|
20573
20606
|
onReady();
|
|
20574
20607
|
}, 0);
|
|
20575
20608
|
}
|
|
@@ -20631,6 +20664,17 @@
|
|
|
20631
20664
|
};
|
|
20632
20665
|
}
|
|
20633
20666
|
|
|
20667
|
+
function rasterViewportCacheEntryMatches(entry, params) {
|
|
20668
|
+
return entry.key == params.key && entry.grid == params.grid && entry.samples == params.grid.samples;
|
|
20669
|
+
}
|
|
20670
|
+
|
|
20671
|
+
function getRasterViewportCacheEntry(params, entry) {
|
|
20672
|
+
entry.key = params.key;
|
|
20673
|
+
entry.grid = params.grid;
|
|
20674
|
+
entry.samples = params.grid.samples;
|
|
20675
|
+
return entry;
|
|
20676
|
+
}
|
|
20677
|
+
|
|
20634
20678
|
function getCachedRasterScalingStats(params, timing) {
|
|
20635
20679
|
var cached = params.raster.view && params.raster.view.scalingStats;
|
|
20636
20680
|
var key;
|
|
@@ -20736,6 +20780,7 @@
|
|
|
20736
20780
|
var params = getRasterReprojectedPreviewParams(layer, ext);
|
|
20737
20781
|
var entry = cache.get(layer);
|
|
20738
20782
|
if (!entry || !entry.preview) return null;
|
|
20783
|
+
if (params && !rasterReprojectedCacheSourceMatches(entry, params)) return null;
|
|
20739
20784
|
if (!params || entry.key != params.key) return entry.preview;
|
|
20740
20785
|
return entry.preview;
|
|
20741
20786
|
}
|
|
@@ -20745,9 +20790,9 @@
|
|
|
20745
20790
|
var entry = cache.get(layer);
|
|
20746
20791
|
var id, timing;
|
|
20747
20792
|
if (!params) return;
|
|
20748
|
-
if (entry && entry
|
|
20793
|
+
if (entry && rasterReprojectedCacheEntryMatches(entry, params)) return;
|
|
20749
20794
|
id = ++requestId;
|
|
20750
|
-
cache.set(layer,
|
|
20795
|
+
cache.set(layer, getRasterReprojectedCacheEntry(params, {pending: id}));
|
|
20751
20796
|
setTimeout(function() {
|
|
20752
20797
|
var current = cache.get(layer);
|
|
20753
20798
|
var grid, preview;
|
|
@@ -20777,7 +20822,7 @@
|
|
|
20777
20822
|
preview.bbox = grid.bbox;
|
|
20778
20823
|
current = cache.get(layer);
|
|
20779
20824
|
if (!current || current.pending != id) return;
|
|
20780
|
-
cache.set(layer,
|
|
20825
|
+
cache.set(layer, getRasterReprojectedCacheEntry(params, {preview: preview}));
|
|
20781
20826
|
onReady();
|
|
20782
20827
|
}, 0);
|
|
20783
20828
|
}
|
|
@@ -20843,6 +20888,21 @@
|
|
|
20843
20888
|
].join('|');
|
|
20844
20889
|
}
|
|
20845
20890
|
|
|
20891
|
+
function rasterReprojectedCacheEntryMatches(entry, params) {
|
|
20892
|
+
return entry.key == params.key && rasterReprojectedCacheSourceMatches(entry, params);
|
|
20893
|
+
}
|
|
20894
|
+
|
|
20895
|
+
function rasterReprojectedCacheSourceMatches(entry, params) {
|
|
20896
|
+
return entry.grid == params.grid && entry.samples == params.grid.samples;
|
|
20897
|
+
}
|
|
20898
|
+
|
|
20899
|
+
function getRasterReprojectedCacheEntry(params, entry) {
|
|
20900
|
+
entry.key = params.key;
|
|
20901
|
+
entry.grid = params.grid;
|
|
20902
|
+
entry.samples = params.grid.samples;
|
|
20903
|
+
return entry;
|
|
20904
|
+
}
|
|
20905
|
+
|
|
20846
20906
|
function applyCoverageMask(preview, coverage) {
|
|
20847
20907
|
var pixels = preview && preview.pixels;
|
|
20848
20908
|
if (!pixels || !coverage) return;
|
|
@@ -22349,7 +22409,10 @@ GUI and setting the size and crop of SVG output.</p><div><input type="text" clas
|
|
|
22349
22409
|
_visibleLayers = [], // cached visible map layers
|
|
22350
22410
|
_hit, _nav,
|
|
22351
22411
|
_intersectionLyr, _activeLyr, _overlayLayers,
|
|
22352
|
-
_renderer, _dynamicCRS
|
|
22412
|
+
_renderer, _dynamicCRS,
|
|
22413
|
+
_resizeRedrawTimer = null;
|
|
22414
|
+
|
|
22415
|
+
var RESIZE_REDRAW_DELAY = 200;
|
|
22353
22416
|
|
|
22354
22417
|
_mouse.disable(); // wait for gui.focus() to activate mouse events
|
|
22355
22418
|
|
|
@@ -22499,14 +22562,44 @@ GUI and setting the size and crop of SVG output.</p><div><input type="text" clas
|
|
|
22499
22562
|
|
|
22500
22563
|
_ext.on('change', function(e) {
|
|
22501
22564
|
gui?.basemap.refresh(); // keep basemap synced up (if enabled)
|
|
22502
|
-
|
|
22565
|
+
if (e.resize) {
|
|
22566
|
+
drawLayersForResize(e.resizeSource);
|
|
22567
|
+
} else {
|
|
22568
|
+
cancelResizeRedraw();
|
|
22569
|
+
drawLayers(e.redraw ? '' : 'nav');
|
|
22570
|
+
}
|
|
22503
22571
|
});
|
|
22504
22572
|
|
|
22505
|
-
gui.on('resize', function() {
|
|
22506
|
-
position.update(); // kludge to detect new map size after console toggle
|
|
22573
|
+
gui.on('resize', function(e) {
|
|
22574
|
+
position.update(e.source); // kludge to detect new map size after console toggle
|
|
22507
22575
|
});
|
|
22508
22576
|
};
|
|
22509
22577
|
|
|
22578
|
+
function drawLayersForResize(source) {
|
|
22579
|
+
if (source == 'sidebar') {
|
|
22580
|
+
cancelResizeRedraw();
|
|
22581
|
+
drawLayers();
|
|
22582
|
+
} else {
|
|
22583
|
+
drawLayers('nav');
|
|
22584
|
+
scheduleResizeRedraw();
|
|
22585
|
+
}
|
|
22586
|
+
}
|
|
22587
|
+
|
|
22588
|
+
function scheduleResizeRedraw() {
|
|
22589
|
+
cancelResizeRedraw();
|
|
22590
|
+
_resizeRedrawTimer = setTimeout(function() {
|
|
22591
|
+
_resizeRedrawTimer = null;
|
|
22592
|
+
drawLayers();
|
|
22593
|
+
}, RESIZE_REDRAW_DELAY);
|
|
22594
|
+
}
|
|
22595
|
+
|
|
22596
|
+
function cancelResizeRedraw() {
|
|
22597
|
+
if (_resizeRedrawTimer) {
|
|
22598
|
+
clearTimeout(_resizeRedrawTimer);
|
|
22599
|
+
_resizeRedrawTimer = null;
|
|
22600
|
+
}
|
|
22601
|
+
}
|
|
22602
|
+
|
|
22510
22603
|
function getGlobalStyleOptions(opts) {
|
|
22511
22604
|
var mode = gui.state.interaction_mode;
|
|
22512
22605
|
return Object.assign({
|
|
@@ -23605,6 +23698,7 @@ GUI and setting the size and crop of SVG output.</p><div><input type="text" clas
|
|
|
23605
23698
|
|
|
23606
23699
|
initModeRules(gui);
|
|
23607
23700
|
startRasterSourceStoreLifecycle();
|
|
23701
|
+
cleanupStaleUndoPayloads(gui).catch(function() {});
|
|
23608
23702
|
gui.map.init();
|
|
23609
23703
|
|
|
23610
23704
|
if (opts.saveControl) {
|
|
@@ -23666,7 +23760,7 @@ GUI and setting the size and crop of SVG output.</p><div><input type="text" clas
|
|
|
23666
23760
|
.classed('layers-open', sidebarPanel == 'layers')
|
|
23667
23761
|
.classed('console-open', sidebarPanel == 'console');
|
|
23668
23762
|
gui.dispatchEvent('sidebar', {name: sidebarPanel, prev: prev});
|
|
23669
|
-
gui.dispatchEvent('resize');
|
|
23763
|
+
gui.dispatchEvent('resize', {source: 'sidebar'});
|
|
23670
23764
|
};
|
|
23671
23765
|
|
|
23672
23766
|
gui.toggleSidebarPanel = function(name) {
|
|
@@ -23769,7 +23863,7 @@ GUI and setting the size and crop of SVG output.</p><div><input type="text" clas
|
|
|
23769
23863
|
if (sidebarResizeFrame) return;
|
|
23770
23864
|
sidebarResizeFrame = requestAnimationFrame(function() {
|
|
23771
23865
|
sidebarResizeFrame = null;
|
|
23772
|
-
gui.dispatchEvent('resize');
|
|
23866
|
+
gui.dispatchEvent('resize', {source: 'sidebar-resize'});
|
|
23773
23867
|
});
|
|
23774
23868
|
}
|
|
23775
23869
|
}
|