mapshaper 0.6.110 → 0.6.111

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mapshaper",
3
- "version": "0.6.110",
3
+ "version": "0.6.111",
4
4
  "description": "A tool for editing vector datasets for mapping and GIS.",
5
5
  "keywords": [
6
6
  "shapefile",
@@ -4176,13 +4176,6 @@
4176
4176
  flags.union || flags.mosaic || flags.snap || flags.clean || flags.drop || false;
4177
4177
  }
4178
4178
 
4179
- // check for operations that may change the number of self intersections in the
4180
- // target layer.
4181
- function intersectionsMayHaveChanged(flags) {
4182
- return arcsMayHaveChanged(flags) || flags.select || flags['merge-layers'] ||
4183
- flags.filter || flags.dissolve || flags.dissolve2;
4184
- }
4185
-
4186
4179
  // Test if an update allows hover popup to stay open
4187
4180
  function popupCanStayOpen(flags) {
4188
4181
  // keeping popup open after -drop geometry causes problems...
@@ -4207,7 +4200,7 @@
4207
4200
  return c;
4208
4201
  }
4209
4202
 
4210
- function RepairControl(gui) {
4203
+ function IntersectionControl(gui) {
4211
4204
  var map = gui.map,
4212
4205
  model = gui.model,
4213
4206
  el = gui.container.findChild(".intersection-display"),
@@ -4243,12 +4236,24 @@
4243
4236
  gui.session.simplificationRepair();
4244
4237
  });
4245
4238
 
4239
+ // check for operations that may change the number of self intersections in the
4240
+ // target layer.
4241
+ function intersectionsMayHaveChanged(flags) {
4242
+ return arcsMayHaveChanged(flags) || flags.select || flags.repair ||
4243
+ flags.clean || flags.filter || flags.dissolve || flags.dissolve2 ||
4244
+ flags['merge-layers'] || flags.simplify_method || flags.simplify ||
4245
+ flags.split;
4246
+ }
4247
+
4248
+
4246
4249
  model.on('update', function(e) {
4247
- var needRefresh = e.flags.simplify_method || e.flags.simplify ||
4248
- e.flags.repair || e.flags.clean || e.flags.select || intersectionsMayHaveChanged(e.flags);
4250
+ var needRefresh = intersectionsMayHaveChanged(e.flags);
4249
4251
  if (!intersectionsAreOn()) {
4250
4252
  reset();
4251
4253
  } else if (needRefresh) {
4254
+ // don't continue to show old intersections when map redraws
4255
+ map.setIntersectionLayer(null, null, false);
4256
+ // regenerate intersections and redraw map
4252
4257
  updateAsync();
4253
4258
  } else if (e.flags.simplify_amount) {
4254
4259
  // slider is being dragged - hide readout and dots, retain data
@@ -4256,7 +4261,7 @@
4256
4261
  } else {
4257
4262
  // keep displaying the current intersections
4258
4263
  }
4259
- });
4264
+ }, 10);
4260
4265
 
4261
4266
  function updateRepairBtn() {
4262
4267
  if (intersectionsAreOn() && gui.getMode() == 'simplify' &&
@@ -4340,7 +4345,7 @@
4340
4345
  }
4341
4346
  }
4342
4347
 
4343
- utils$1.inherit(RepairControl, EventDispatcher);
4348
+ utils$1.inherit(IntersectionControl, EventDispatcher);
4344
4349
 
4345
4350
  async function saveFileContentToClipboard(content) {
4346
4351
  var str = utils$1.isString(content) ? content : content.toString();
@@ -10100,6 +10105,9 @@
10100
10105
  // special overlay: shape editing mode
10101
10106
  lyr = getOverlayLayer(activeLyr, hitData.ids);
10102
10107
  lyr.gui.style = getLineEditingStyle(hitData);
10108
+ if (activeLyr.geometry_type == 'polygon') {
10109
+ lyr.gui.style.fillColor = hoverFill;
10110
+ }
10103
10111
  return [lyr];
10104
10112
  }
10105
10113
  layers = [];
@@ -13014,7 +13022,7 @@ GUI and setting the size and crop of SVG output.</p><div><input type="text" clas
13014
13022
  });
13015
13023
 
13016
13024
  // Update display of segment intersections
13017
- this.setIntersectionLayer = function(lyr, dataset) {
13025
+ this.setIntersectionLayer = function(lyr, dataset, redraw) {
13018
13026
  if (lyr == _intersectionLyr) return; // no change
13019
13027
  if (lyr) {
13020
13028
  enhanceLayerForDisplay(lyr, dataset, getDisplayOptions());
@@ -13024,7 +13032,9 @@ GUI and setting the size and crop of SVG output.</p><div><input type="text" clas
13024
13032
  _intersectionLyr = null;
13025
13033
  }
13026
13034
  // TODO: try to avoid redrawing layers twice (in some situations)
13027
- drawLayers();
13035
+ if (redraw !== false) {
13036
+ drawLayers();
13037
+ }
13028
13038
  };
13029
13039
 
13030
13040
  this.pixelCoordsToLngLatCoords = function(x, y) {
@@ -13996,7 +14006,7 @@ GUI and setting the size and crop of SVG output.</p><div><input type="text" clas
13996
14006
  // }
13997
14007
 
13998
14008
  new AlertControl(gui);
13999
- new RepairControl(gui);
14009
+ new IntersectionControl(gui);
14000
14010
  new SimplifyControl(gui);
14001
14011
  new ImportControl(gui, importOpts);
14002
14012
  new ExportControl(gui);