mapshaper 0.5.65 → 0.5.69

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.
@@ -1561,6 +1561,19 @@
1561
1561
  }
1562
1562
 
1563
1563
  function downloadNextFile(memo, item, next) {
1564
+ var blob, err;
1565
+ fetch(item.url).then(resp => resp.blob()).then(b => {
1566
+ blob = b;
1567
+ blob.name = item.basename;
1568
+ memo.push(blob);
1569
+ }).catch(e => {
1570
+ err = "Error loading " + item.name + ". Possible causes include: wrong URL, no network connection, server not configured for cross-domain sharing (CORS).";
1571
+ }).finally(() => {
1572
+ next(err, memo);
1573
+ });
1574
+ }
1575
+
1576
+ function downloadNextFile_v1(memo, item, next) {
1564
1577
  var req = new XMLHttpRequest();
1565
1578
  var blob;
1566
1579
  req.responseType = 'blob';
@@ -1570,6 +1583,7 @@
1570
1583
  }
1571
1584
  });
1572
1585
  req.addEventListener('progress', function(e) {
1586
+ if (!e.lengthComputable) return;
1573
1587
  var pct = e.loaded / e.total;
1574
1588
  if (catalog) catalog.progress(pct);
1575
1589
  });
@@ -3962,6 +3976,10 @@
3962
3976
  throw new UserError$1(formatLogArgs(arguments));
3963
3977
  };
3964
3978
 
3979
+ var _interrupt = function() {
3980
+ throw new NonFatalError(formatLogArgs(arguments));
3981
+ };
3982
+
3965
3983
  var _message = function() {
3966
3984
  logArgs(arguments);
3967
3985
  };
@@ -3980,10 +3998,14 @@
3980
3998
  }
3981
3999
 
3982
4000
  // Handle an error caused by invalid input or misuse of API
3983
- function stop$1 () {
4001
+ function stop$1() {
3984
4002
  _stop.apply(null, utils$1.toArray(arguments));
3985
4003
  }
3986
4004
 
4005
+ function interrupt() {
4006
+ _interrupt.apply(null, utils$1.toArray(arguments));
4007
+ }
4008
+
3987
4009
  // Print a status message
3988
4010
  function message$1() {
3989
4011
  _message.apply(null, messageArgs(arguments));
@@ -4023,7 +4045,9 @@
4023
4045
  if (utils$1.isString(err)) {
4024
4046
  err = new UserError$1(err);
4025
4047
  }
4026
- if (err.name == 'UserError') {
4048
+ if (err.name == 'NonFatalError') {
4049
+ console.error(messageArgs([err.message]).join(' '));
4050
+ } else if (err.name == 'UserError') {
4027
4051
  msg = err.message;
4028
4052
  if (!/Error/.test(msg)) {
4029
4053
  msg = "Error: " + msg;
@@ -4043,6 +4067,12 @@
4043
4067
  return err;
4044
4068
  }
4045
4069
 
4070
+ function NonFatalError(msg) {
4071
+ var err = new Error(msg);
4072
+ err.name = 'NonFatalError';
4073
+ return err;
4074
+ }
4075
+
4046
4076
  function formatColumns(arr, alignments) {
4047
4077
  var widths = arr.reduce(function(memo, line) {
4048
4078
  return line.map(function(str, i) {
@@ -5627,6 +5657,7 @@
5627
5657
  var self = new EventDispatcher();
5628
5658
  var storedData = noHitData(); // may include additional data from SVG symbol hit (e.g. hit node)
5629
5659
  var selectionIds = [];
5660
+ var transientIds = []; // e.g. hit ids while dragging a box
5630
5661
  var active = false;
5631
5662
  var interactionMode;
5632
5663
  var targetLayer;
@@ -5721,6 +5752,14 @@
5721
5752
  updateSelectionState({ids: ids});
5722
5753
  };
5723
5754
 
5755
+ self.setTransientIds = function(ids) {
5756
+ // turnOn('selection');
5757
+ transientIds = ids || [];
5758
+ if (active) {
5759
+ triggerHitEvent('change');
5760
+ }
5761
+ };
5762
+
5724
5763
  self.clearSelection = function() {
5725
5764
  updateSelectionState(null);
5726
5765
  };
@@ -5876,6 +5915,7 @@
5876
5915
  // evt: (optional) mouse event
5877
5916
  function updateSelectionState(newData) {
5878
5917
  var nonEmpty = newData && (newData.ids.length || newData.id > -1);
5918
+ transientIds = [];
5879
5919
  if (!newData) {
5880
5920
  newData = noHitData();
5881
5921
  selectionIds = [];
@@ -5919,6 +5959,9 @@
5919
5959
  function triggerHitEvent(type, d) {
5920
5960
  // Merge stored hit data into the event data
5921
5961
  var eventData = utils.extend({mode: interactionMode}, d || {}, storedData);
5962
+ if (transientIds.length) {
5963
+ eventData.ids = utils.uniq(transientIds.concat(eventData.ids || []));
5964
+ }
5922
5965
  self.dispatchEvent(type, eventData);
5923
5966
  }
5924
5967
 
@@ -6562,8 +6605,8 @@
6562
6605
  }
6563
6606
  }
6564
6607
 
6565
- function HighlightBox(el) {
6566
- var box = El('div').addClass('zoom-box').appendTo(el),
6608
+ function HighlightBox() {
6609
+ var box = El('div').addClass('zoom-box').appendTo('body'),
6567
6610
  show = box.show.bind(box), // original show() function
6568
6611
  stroke = 2;
6569
6612
  box.hide();
@@ -6583,7 +6626,7 @@
6583
6626
 
6584
6627
  function SelectionTool(gui, ext, hit) {
6585
6628
  var popup = gui.container.findChild('.selection-tool-options');
6586
- var box = new HighlightBox('body');
6629
+ var box = new HighlightBox();
6587
6630
  var _on = false;
6588
6631
 
6589
6632
  gui.addMode('selection_tool', turnOn, turnOff);
@@ -6600,6 +6643,7 @@
6600
6643
  if (!_on) return;
6601
6644
  var b = e.page_bbox;
6602
6645
  box.show(b[0], b[1], b[2], b[3]);
6646
+ updateSelection(e.map_bbox, true);
6603
6647
  });
6604
6648
 
6605
6649
  gui.on('box_drag_end', function(e) {
@@ -6608,12 +6652,15 @@
6608
6652
  updateSelection(e.map_bbox);
6609
6653
  });
6610
6654
 
6611
- function updateSelection(bboxPixels) {
6655
+ function updateSelection(bboxPixels, transient) {
6612
6656
  var bbox = bboxToCoords(bboxPixels);
6613
6657
  var active = gui.model.getActiveLayer();
6614
6658
  var ids = internal.findShapesIntersectingBBox(bbox, active.layer, active.dataset.arcs);
6615
- if (!ids.length) return;
6616
- hit.addSelectionIds(ids);
6659
+ if (transient) {
6660
+ hit.setTransientIds(ids);
6661
+ } else if (ids.length) {
6662
+ hit.addSelectionIds(ids);
6663
+ }
6617
6664
  }
6618
6665
 
6619
6666
  function turnOn() {
@@ -6656,20 +6703,17 @@
6656
6703
  new SimpleButton(popup.findChild('.delete-btn')).on('click', function() {
6657
6704
  var cmd = '-filter "$$set.has(this.id) === false"';
6658
6705
  runCommand(cmd);
6659
- hit.clearSelection();
6660
6706
  });
6661
6707
 
6662
6708
  new SimpleButton(popup.findChild('.filter-btn')).on('click', function() {
6663
6709
 
6664
6710
  var cmd = '-filter "$$set.has(this.id)"';
6665
6711
  runCommand(cmd);
6666
- hit.clearSelection();
6667
6712
  });
6668
6713
 
6669
6714
  new SimpleButton(popup.findChild('.split-btn')).on('click', function() {
6670
6715
  var cmd = '-each "split_id = $$set.has(this.id) ? \'1\' : \'2\'" -split split_id';
6671
6716
  runCommand(cmd);
6672
- hit.clearSelection();
6673
6717
  });
6674
6718
 
6675
6719
  new SimpleButton(popup.findChild('.cancel-btn')).on('click', function() {
@@ -6681,10 +6725,10 @@
6681
6725
  // defs.$$selection = utils.arrayToIndex(hit.getSelectionIds());
6682
6726
  var ids = JSON.stringify(hit.getSelectionIds());
6683
6727
  cmd = `-define "$$set = new Set(${ids})" ${cmd} -define "delete $$set"`;
6728
+ popup.hide();
6684
6729
  if (gui.console) gui.console.runMapshaperCommands(cmd, function(err) {
6685
- // delete defs.$$selection;
6730
+ reset();
6686
6731
  });
6687
- reset();
6688
6732
  }
6689
6733
  }
6690
6734
 
@@ -9356,22 +9400,22 @@
9356
9400
  strokeColors: [lightStroke, darkStroke],
9357
9401
  strokeWidth: 0.7,
9358
9402
  dotColor: "#223",
9359
- dotSize: 4
9403
+ dotSize: 1
9360
9404
  },
9361
9405
  activeStyleForLabels = {
9362
9406
  dotColor: "rgba(250, 0, 250, 0.45)", // violet dot with transparency
9363
- dotSize: 4
9407
+ dotSize: 1
9364
9408
  },
9365
9409
  referenceStyle = { // outline style for reference layers
9366
9410
  type: 'outline',
9367
9411
  strokeColors: [null, '#86c927'],
9368
9412
  strokeWidth: 0.85,
9369
9413
  dotColor: "#73ba20",
9370
- dotSize: 4
9414
+ dotSize: 1
9371
9415
  },
9372
9416
  intersectionStyle = {
9373
9417
  dotColor: "#F24400",
9374
- dotSize: 4
9418
+ dotSize: 1
9375
9419
  },
9376
9420
  hoverStyles = {
9377
9421
  polygon: {
@@ -9379,39 +9423,40 @@
9379
9423
  strokeColor: black,
9380
9424
  strokeWidth: 1.2
9381
9425
  }, point: {
9382
- dotColor: black,
9383
- dotSize: 8
9384
- }, polyline: {
9426
+ dotColor: violet, // black,
9427
+ dotSize: 2.5
9428
+ }, polyline: {
9385
9429
  strokeColor: black,
9386
9430
  strokeWidth: 2.5
9387
9431
  }
9388
9432
  },
9389
- unfilledHoverStyles = {
9433
+ unselectedHoverStyles = {
9390
9434
  polygon: {
9391
9435
  fillColor: 'rgba(0,0,0,0)',
9392
9436
  strokeColor: black,
9393
9437
  strokeWidth: 1.2
9394
9438
  }, point: {
9395
- dotColor: grey,
9396
- dotSize: 8
9439
+ dotColor: black, // grey,
9440
+ dotSize: 2
9397
9441
  }, polyline: {
9398
- strokeColor: grey,
9442
+ strokeColor: black, // grey,
9399
9443
  strokeWidth: 2.5
9400
9444
  }
9401
9445
  },
9402
9446
  selectionStyles = {
9403
9447
  polygon: {
9404
- fillColor: selectionFill,
9405
- strokeColor: gold,
9406
- strokeWidth: 1
9448
+ fillColor: hoverFill,
9449
+ strokeColor: black,
9450
+ strokeWidth: 1.2
9407
9451
  }, point: {
9408
- dotColor: gold,
9409
- dotSize: 6
9452
+ dotColor: violet, // black,
9453
+ dotSize: 1.5
9410
9454
  }, polyline: {
9411
- strokeColor: gold,
9412
- strokeWidth: 1.5
9455
+ strokeColor: violet, // black,
9456
+ strokeWidth: 2.5
9413
9457
  }
9414
9458
  },
9459
+ // not used
9415
9460
  selectionHoverStyles = {
9416
9461
  polygon: {
9417
9462
  fillColor: selectionFill,
@@ -9419,7 +9464,7 @@
9419
9464
  strokeWidth: 1.2
9420
9465
  }, point: {
9421
9466
  dotColor: black,
9422
- dotSize: 6
9467
+ dotSize: 1.5
9423
9468
  }, polyline: {
9424
9469
  strokeColor: black,
9425
9470
  strokeWidth: 2
@@ -9431,18 +9476,48 @@
9431
9476
  strokeColor: violet,
9432
9477
  strokeWidth: 1.8
9433
9478
  }, point: {
9434
- dotColor: 'violet',
9435
- dotSize: 8
9479
+ dotColor: violet,
9480
+ dotSize: 3
9436
9481
  }, polyline: {
9437
- strokeColor: violet,
9482
+ strokeColor: black, // violet,
9438
9483
  strokeWidth: 3
9439
9484
  }
9440
9485
  };
9441
9486
 
9442
9487
  function getIntersectionStyle(lyr) {
9443
- return utils.extend({}, intersectionStyle);
9488
+ return getDefaultStyle(lyr, intersectionStyle);
9489
+ }
9490
+
9491
+ function getDefaultStyle(lyr, baseStyle) {
9492
+ var style = utils.extend({}, baseStyle);
9493
+ // reduce the dot size of large point layers
9494
+ if (lyr.geometry_type == 'point' && style.dotSize > 0) {
9495
+ style.dotSize *= getDotScale(lyr);
9496
+ }
9497
+ return style;
9498
+ }
9499
+
9500
+ function getDotScale(lyr) {
9501
+ var topTier = 50000;
9502
+ var n = countPoints(lyr.shapes, topTier + 2); // short-circuit point counting above top threshold
9503
+ var k = n < 200 && 4 || n < 2500 && 3 || n < 10000 && 2 || 1;
9504
+ // var k = n >= topTier && 0.25 || n > 10000 && 0.45 || n > 2500 && 0.65 || n > 200 && 0.85 || 1;
9505
+ return k;
9444
9506
  }
9445
9507
 
9508
+ function countPoints(shapes, max) {
9509
+ var count = 0;
9510
+ var i, n, shp;
9511
+ max = max || Infinity;
9512
+ for (i=0, n=shapes.length; i<n && count<=max; i++) {
9513
+ shp = shapes[i];
9514
+ count += shp ? shp.length : 0;
9515
+ }
9516
+ return count;
9517
+ }
9518
+
9519
+ // Style for unselected layers with visibility turned on
9520
+ // (styled layers have)
9446
9521
  function getReferenceStyle(lyr) {
9447
9522
  var style;
9448
9523
  if (layerHasCanvasDisplayStyle(lyr)) {
@@ -9450,7 +9525,7 @@
9450
9525
  } else if (internal.layerHasLabels(lyr)) {
9451
9526
  style = {dotSize: 0}; // no reference dots if labels are visible
9452
9527
  } else {
9453
- style = utils.extend({}, referenceStyle);
9528
+ style = getDefaultStyle(lyr, referenceStyle);
9454
9529
  }
9455
9530
  return style;
9456
9531
  }
@@ -9460,72 +9535,79 @@
9460
9535
  if (layerHasCanvasDisplayStyle(lyr)) {
9461
9536
  style = getCanvasDisplayStyle(lyr);
9462
9537
  } else if (internal.layerHasLabels(lyr)) {
9463
- style = utils.extend({}, activeStyleForLabels);
9538
+ style = getDefaultStyle(lyr, activeStyleForLabels);
9464
9539
  } else {
9465
- style = utils.extend({}, activeStyle);
9540
+ style = getDefaultStyle(lyr, activeStyle);
9466
9541
  }
9467
9542
  return style;
9468
9543
  }
9469
9544
 
9470
-
9471
- // Returns a display style for the overlay layer. This style displays any
9472
- // hover or selection affects for the active data layer.
9545
+ // Returns a display style for the overlay layer.
9546
+ // The overlay layer renders several kinds of feature, each of which is displayed
9547
+ // with a different style.
9548
+ //
9549
+ // * hover shapes
9550
+ // * selected shapes
9551
+ // * pinned shapes
9552
+ //
9473
9553
  function getOverlayStyle(lyr, o) {
9474
- var type = lyr.geometry_type;
9475
- var topId = o.id;
9476
- var ids = [];
9477
- var styles = [];
9554
+ var geomType = lyr.geometry_type;
9555
+ var topId = o.id; // pinned id (if pinned) or hover id
9556
+ var topIdx = -1;
9478
9557
  var styler = function(o, i) {
9479
- utils.extend(o, styles[i]);
9480
- };
9481
- var overlayStyle = {
9482
- styler: styler
9558
+ utils.extend(o, i === topIdx ? topStyle: baseStyle);
9483
9559
  };
9484
-
9485
- o.ids.forEach(function(i) {
9486
- var style;
9487
- if (i == topId) return;
9488
- style = hoverStyles[type];
9489
- // style = o.selection_ids.indexOf(i) > -1 ? selectionHoverStyles[type] : hoverStyles[type];
9490
- ids.push(i);
9491
- styles.push(style);
9560
+ var baseStyle = getDefaultStyle(lyr, selectionStyles[geomType]);
9561
+ var topStyle;
9562
+ var ids = o.ids.filter(function(i) {
9563
+ return i != o.id; // move selected id to the end
9492
9564
  });
9493
- // top layer: feature that was selected by clicking in inspection mode ([i])
9494
- if (topId > -1) {
9495
- var isPinned = o.pinned;
9496
- var inSelection = o.ids.indexOf(topId) > -1;
9497
- var style;
9498
- if (isPinned) {
9499
- style = pinnedStyles[type];
9500
- } else if (inSelection) {
9501
- style = hoverStyles[type];
9502
- } else {
9503
- style = unfilledHoverStyles[type];
9504
- }
9505
- ids.push(topId);
9506
- styles.push(style);
9565
+ if (o.id > -1) {
9566
+ topStyle = getSelectedFeatureStyle(lyr, o);
9567
+ topIdx = ids.length;
9568
+ ids.push(o.id); // put the pinned/hover feature last in the render order
9507
9569
  }
9508
-
9570
+ var overlayStyle = {
9571
+ styler: styler,
9572
+ ids: ids,
9573
+ overlay: true
9574
+ };
9509
9575
  if (layerHasCanvasDisplayStyle(lyr)) {
9510
- if (type == 'point') {
9511
- overlayStyle = wrapOverlayStyle(getCanvasDisplayStyle(lyr), overlayStyle);
9576
+ if (geomType == 'point') {
9577
+ overlayStyle.styler = getOverlayPointStyler(getCanvasDisplayStyle(lyr).styler, styler);
9512
9578
  }
9513
9579
  overlayStyle.type = 'styled';
9514
9580
  }
9515
- overlayStyle.ids = ids;
9516
- overlayStyle.overlay = true;
9517
9581
  return ids.length > 0 ? overlayStyle : null;
9518
9582
  }
9519
9583
 
9584
+ function getSelectedFeatureStyle(lyr, o) {
9585
+ var isPinned = o.pinned;
9586
+ var inSelection = o.ids.indexOf(o.id) > -1;
9587
+ var geomType = lyr.geometry_type;
9588
+ var style;
9589
+ if (isPinned) {
9590
+ // a feature is pinned
9591
+ style = pinnedStyles[geomType];
9592
+ } else if (inSelection) {
9593
+ // normal hover, or hover id is in the selection set
9594
+ style = hoverStyles[geomType];
9595
+ } else {
9596
+ // features are selected, but hover id is not in the selection set
9597
+ style = unselectedHoverStyles[geomType];
9598
+ }
9599
+ return getDefaultStyle(lyr, style);
9600
+ }
9601
+
9520
9602
  // Modify style to use scaled circle instead of dot symbol
9521
- function wrapOverlayStyle(style, hoverStyle) {
9522
- var styler = function(obj, i) {
9603
+ function getOverlayPointStyler(baseStyler, overlayStyler) {
9604
+ return function(obj, i) {
9523
9605
  var dotColor;
9524
9606
  var id = obj.ids ? obj.ids[i] : -1;
9525
9607
  obj.strokeWidth = 0; // kludge to support setting minimum stroke width
9526
- style.styler(obj, id);
9527
- if (hoverStyle.styler) {
9528
- hoverStyle.styler(obj, i);
9608
+ baseStyler(obj, id);
9609
+ if (overlayStyler) {
9610
+ overlayStyler(obj, i);
9529
9611
  }
9530
9612
  dotColor = obj.dotColor;
9531
9613
  if (obj.radius && dotColor) {
@@ -9537,7 +9619,6 @@
9537
9619
  obj.opacity = 1;
9538
9620
  }
9539
9621
  };
9540
- return {styler: styler};
9541
9622
  }
9542
9623
 
9543
9624
  function getCanvasDisplayStyle(lyr) {
@@ -9987,8 +10068,8 @@
9987
10068
 
9988
10069
  _self.drawSquareDots = function(shapes, style) {
9989
10070
  var t = getScaledTransform(_ext),
9990
- scaleRatio = getDotScale2(shapes, _ext),
9991
- size = Math.ceil((style.dotSize >= 0 ? style.dotSize : 3) * scaleRatio),
10071
+ scaleRatio = getDotScale$1(_ext),
10072
+ size = Math.round((style.dotSize || 1) * scaleRatio),
9992
10073
  styler = style.styler || null,
9993
10074
  xmax = _canvas.width + size,
9994
10075
  ymax = _canvas.height + size,
@@ -10150,42 +10231,24 @@
10150
10231
  return s;
10151
10232
  }
10152
10233
 
10153
- function getDotScale(ext) {
10154
- return Math.pow(getLineScale(ext), 0.7);
10155
- }
10156
10234
 
10157
- function countPoints(shapes, test, max) {
10158
- var count = 0;
10159
- var i, n, j, m, shp;
10160
- max = max || Infinity;
10161
- for (i=0, n=shapes.length; i<n && count<=max; i++) {
10162
- shp = shapes[i];
10163
- for (j=0, m=shp ? shp.length : 0; j<m; j++) {
10164
- if (!test || test(shp[j])) {
10165
- count++;
10166
- }
10167
- }
10235
+ function getDotScale$1(ext) {
10236
+ var smallSide = Math.min(ext.width(), ext.height());
10237
+ // reduce size on smaller screens
10238
+ var j = smallSide < 200 && 0.5 || smallSide < 400 && 0.75 || 1;
10239
+ var k = 1;
10240
+ var mapScale = ext.scale();
10241
+ if (mapScale < 0.5) {
10242
+ k = Math.pow(mapScale + 0.5, 0.35);
10168
10243
  }
10169
- return count;
10170
- }
10171
-
10172
-
10173
- function getDotScale2(shapes, ext) {
10174
- var pixRatio = GUI.getPixelRatio();
10175
- var scale = ext.scale();
10176
- var side = Math.min(ext.width(), ext.height());
10177
- var bounds = ext.getBounds();
10178
- var topTier = 50000;
10179
- var test, n, k, j;
10180
- if (scale >= 2) {
10181
- test = function(p) {
10182
- return bounds.containsPoint(p[0], p[1]);
10183
- };
10244
+ if (mapScale > 1) {
10245
+ // scale faster at first, so small dots in large datasets
10246
+ // become easily visible and clickable after zooming in a bit
10247
+ k *= Math.pow(Math.min(mapScale, 10), 0.3);
10248
+ k *= Math.pow(mapScale, 0.1);
10184
10249
  }
10185
- n = countPoints(shapes, test, topTier + 2); // short-circuit point counting above top threshold
10186
- k = n >= topTier && 0.25 || n > 10000 && 0.45 || n > 2500 && 0.65 || n > 200 && 0.85 || 1;
10187
- j = side < 200 && 0.5 || side < 400 && 0.75 || 1;
10188
- return getDotScale(ext) * k * j * pixRatio;
10250
+
10251
+ return k * j * GUI.getPixelRatio();
10189
10252
  }
10190
10253
 
10191
10254
  function getScaledTransform(ext) {
@@ -10572,7 +10635,7 @@
10572
10635
 
10573
10636
  function BoxTool(gui, ext, mouse, nav) {
10574
10637
  var self = new EventDispatcher();
10575
- var box = new HighlightBox('body');
10638
+ var box = new HighlightBox();
10576
10639
  var popup = gui.container.findChild('.box-tool-options');
10577
10640
  var coords = popup.findChild('.box-coords');
10578
10641
  var _on = false;
@@ -11164,18 +11227,26 @@
11164
11227
  drawLayers('nav');
11165
11228
  });
11166
11229
 
11167
- _hit.on('change', function(e) {
11168
- // draw highlight effect for hover and select
11169
- _overlayLyr = getDisplayLayerOverlay(_activeLyr, e);
11170
- drawLayers('hover');
11171
- // _stack.drawOverlayLayer(_overlayLyr);
11172
- });
11230
+ _hit.on('change', updateOverlayLayer);
11173
11231
 
11174
11232
  gui.on('resize', function() {
11175
11233
  position.update(); // kludge to detect new map size after console toggle
11176
11234
  });
11177
11235
  }
11178
11236
 
11237
+ function updateOverlayLayer(e) {
11238
+ var style = getOverlayStyle(_activeLyr.layer, e);
11239
+ if (style) {
11240
+ _overlayLyr = utils.defaults({
11241
+ layer: filterLayerByIds(_activeLyr.layer, style.ids),
11242
+ style: style
11243
+ }, _activeLyr);
11244
+ } else {
11245
+ _overlayLyr = null;
11246
+ }
11247
+ drawLayers('hover');
11248
+ }
11249
+
11179
11250
  function getDisplayOptions() {
11180
11251
  return {
11181
11252
  crs: _dynamicCRS
@@ -11385,15 +11456,6 @@
11385
11456
  }
11386
11457
  }
11387
11458
 
11388
- function getDisplayLayerOverlay(obj, e) {
11389
- var style = getOverlayStyle(obj.layer, e);
11390
- if (!style) return null;
11391
- return utils.defaults({
11392
- layer: filterLayerByIds(obj.layer, style.ids),
11393
- style: style
11394
- }, obj);
11395
- }
11396
-
11397
11459
  function GuiInstance(container, opts) {
11398
11460
  var gui = new ModeSwitcher();
11399
11461
  opts = utils.extend({