mapshaper 0.6.24 → 0.6.26

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.24",
3
+ "version": "0.6.26",
4
4
  "description": "A tool for editing vector datasets for mapping and GIS.",
5
5
  "keywords": [
6
6
  "shapefile",
@@ -44,7 +44,6 @@
44
44
  "@tmcw/togeojson": "^5.6.0",
45
45
  "@xmldom/xmldom": "^0.8.6",
46
46
  "adm-zip": "^0.5.9",
47
- "bson": "^4.7.0",
48
47
  "commander": "7.0.0",
49
48
  "cookies": "^0.8.0",
50
49
  "d3-color": "3.1.0",
@@ -57,8 +56,8 @@
57
56
  "iconv-lite": "^0.6.3",
58
57
  "idb-keyval": "^6.2.0",
59
58
  "kdbush": "^3.0.0",
60
- "mproj": "0.0.35",
61
- "msgpackr": "^1.8.1",
59
+ "mproj": "0.0.36",
60
+ "msgpackr": "^1.8.5",
62
61
  "opn": "^5.3.0",
63
62
  "rw": "~1.3.3",
64
63
  "sync-request": "5.0.0",
package/www/index.html CHANGED
@@ -8,9 +8,7 @@
8
8
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
9
9
  <link rel="stylesheet" href="page.css">
10
10
  <link rel="stylesheet" href="elements.css">
11
- <link rel="icon"
12
- type="image/png"
13
- href="images/icon.png">
11
+ <link rel="icon" type="image/png" href="images/icon.png">
14
12
  </head>
15
13
  <body>
16
14
  <div class="hidden">
@@ -99,8 +97,8 @@
99
97
  <h3>Layers</h3>
100
98
  <div class="pin-all pinnable">
101
99
  <img class="pin-btn unpinned" src="images/eye.png">
102
- <img class="pin-btn pinned" src="images/eye2.png">
103
- </div>
100
+ <img class="pin-btn pinned" src="images/eye2.png">
101
+ </div>
104
102
  <div class="layer-list"></div>
105
103
  <h4>Sources</h4>
106
104
  <div class="file-list"></div>
@@ -118,9 +116,10 @@
118
116
  <div>
119
117
  <div class="select-btn btn dialog-btn">Select</div>
120
118
  <div class="clip-btn btn dialog-btn">Clip</div>
121
- <div class="info-btn btn dialog-btn">Info</div>
122
- <!-- <div class="zoom-btn btn dialog-btn">Zoom In</div>
123
- <div class="rectangle-btn btn dialog-btn">Rectangle</div> -->
119
+ <div class="erase-btn btn dialog-btn">Erase</div>
120
+ <div class="rect-btn btn dialog-btn">Rectangle</div>
121
+ <div class="info-btn btn dialog-btn">Coords</div>
122
+ <!-- <div class="zoom-btn btn dialog-btn">Zoom In</div> -->
124
123
  <div class="cancel-btn btn dialog-btn">Cancel</div>
125
124
  </div>
126
125
  <div class="box-coords selectable"></div>
@@ -3050,7 +3050,9 @@
3050
3050
 
3051
3051
  function saveHistory() {
3052
3052
  history = history.filter(Boolean); // TODO: fix condition that leaves a blank line on the history
3053
- GUI.setSavedValue('console_history', history.slice(-100));
3053
+ if (history.length > 0) {
3054
+ GUI.setSavedValue('console_history', history.slice(-100));
3055
+ }
3054
3056
  }
3055
3057
 
3056
3058
  function toLog(str, cname) {
@@ -3679,7 +3681,7 @@
3679
3681
  .on('change', function() {
3680
3682
  GUI.setSavedValue('choose-save-dir', this.checked);
3681
3683
  })
3682
- .attr('checked', GUI.getSavedValue('choose-save-dir') || false);
3684
+ .attr('checked', GUI.getSavedValue('choose-save-dir') || null);
3683
3685
  }
3684
3686
 
3685
3687
  function turnOn() {
@@ -8053,8 +8055,14 @@
8053
8055
  }
8054
8056
  });
8055
8057
 
8058
+ // add new field form
8059
+ if (editable) {
8060
+ renderNewRow(tableEl, rec, table);
8061
+ }
8062
+
8063
+ tableEl.appendTo(el);
8056
8064
  if (rows > 0) {
8057
- tableEl.appendTo(el);
8065
+ // tableEl.appendTo(el);
8058
8066
 
8059
8067
  tableEl.on('copy', function(e) {
8060
8068
  // remove leading or trailing tabs that sometimes get copied when
@@ -8074,15 +8082,26 @@
8074
8082
  el.html(utils$1.format('<div class="note">This %s is missing attribute data.</div>',
8075
8083
  table && table.getFields().length > 0 ? 'feature': 'layer'));
8076
8084
  }
8085
+
8086
+ if (editable) {
8087
+ var line = El('div').appendTo(el);
8088
+ El('span').addClass('save-menu-btn').appendTo(line).on('click', async function(e) {
8089
+
8090
+ }).text('add field');
8091
+ }
8092
+ }
8093
+
8094
+ function renderNewRow(el, rec, table) {
8095
+
8077
8096
  }
8078
8097
 
8079
8098
  function renderRow(table, rec, key, type, editable) {
8080
- var rowHtml = '<td class="field-name">%s</td><td><span class="value">%s</span> </td>';
8081
8099
  var val = rec[key];
8082
8100
  var str = formatInspectorValue(val, type);
8101
+ var rowHtml = `<td class="field-name">${key}</td><td><span class="value">${utils$1.htmlEscape(str)}</span> </td>`;
8083
8102
  var cell = El('tr')
8084
8103
  .appendTo(table)
8085
- .html(utils$1.format(rowHtml, key, utils$1.htmlEscape(str)))
8104
+ .html(rowHtml)
8086
8105
  .findChild('.value');
8087
8106
  setFieldClass(cell, val, type);
8088
8107
  if (editable) {
@@ -10193,6 +10212,14 @@
10193
10212
  runCommand('-clip bbox=' + box.getDataCoords().join(','));
10194
10213
  });
10195
10214
 
10215
+ new SimpleButton(popup.findChild('.erase-btn')).on('click', function() {
10216
+ runCommand('-erase bbox=' + box.getDataCoords().join(','));
10217
+ });
10218
+
10219
+ new SimpleButton(popup.findChild('.rect-btn')).on('click', function() {
10220
+ runCommand('-rectangle + bbox=' + box.getDataCoords().join(','));
10221
+ });
10222
+
10196
10223
  gui.addMode('box_tool', turnOn, turnOff);
10197
10224
 
10198
10225
  gui.on('interaction_mode_change', function(e) {