mapshaper 0.6.12 → 0.6.13

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  (function () {
2
2
 
3
- var VERSION = "0.6.12";
3
+ var VERSION = "0.6.13";
4
4
 
5
5
 
6
6
  var utils = /*#__PURE__*/Object.freeze({
@@ -18545,7 +18545,13 @@ ${svg}
18545
18545
  // (cli.writeFile() now creates directories that don't exist)
18546
18546
  // cli.validateOutputDir(o.directory);
18547
18547
  }
18548
- o.file = pathInfo.filename;
18548
+ if (pathInfo.extension == 'gz') {
18549
+ o.file = pathInfo.basename;
18550
+ o.gzip = true;
18551
+ } else {
18552
+ o.file = pathInfo.filename;
18553
+ }
18554
+
18549
18555
  if (filenameIsUnsupportedOutputType(o.file)) {
18550
18556
  error("Output file looks like an unsupported file type:", o.file);
18551
18557
  }
@@ -42153,6 +42159,7 @@ ${svg}
42153
42159
 
42154
42160
  // Unified function for processing calls to runCommands() and applyCommands()
42155
42161
  function _runCommands(argv, opts, callback) {
42162
+
42156
42163
  var outputArr = opts.output || null,
42157
42164
  inputObj = opts.input,
42158
42165
  commands;
@@ -42199,6 +42206,7 @@ ${svg}
42199
42206
 
42200
42207
  function done(err, job) {
42201
42208
  err = filterError(err);
42209
+ if (err) printError(err);
42202
42210
  callback(err, job);
42203
42211
  }
42204
42212
  }
@@ -42279,8 +42287,8 @@ ${svg}
42279
42287
  }
42280
42288
 
42281
42289
  function filterError(err) {
42282
- if (err) printError(err);
42283
42290
  if (err && err.name == 'NonFatalError') {
42291
+ printError(err);
42284
42292
  return null;
42285
42293
  }
42286
42294
  return err;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mapshaper",
3
- "version": "0.6.12",
3
+ "version": "0.6.13",
4
4
  "description": "A tool for editing vector datasets for mapping and GIS.",
5
5
  "keywords": [
6
6
  "shapefile",
@@ -682,11 +682,10 @@
682
682
  El.setStyle = function(el, name, val) {
683
683
  var jsName = El.toCamelCase(name);
684
684
  if (el.style[jsName] == void 0) {
685
- console.error("[Element.setStyle()] css property:", jsName);
686
685
  return;
687
686
  }
688
687
  var cssVal = val;
689
- if (isFinite(val)) {
688
+ if (isFinite(val) && val !== null) {
690
689
  cssVal = String(val); // problem if converted to scientific notation
691
690
  if (jsName != 'opacity' && jsName != 'zIndex') {
692
691
  cssVal += "px";
@@ -763,16 +762,14 @@
763
762
 
764
763
  // Apply inline css styles to this Element, either as string or object.
765
764
  css: function(css, val) {
766
- if (val != null) {
767
- El.setStyle(this.el, css, val);
768
- }
769
- else if (utils$1.isString(css)) {
770
- addCSS(this.el, css);
771
- }
772
- else if (utils$1.isObject(css)) {
765
+ if (utils$1.isObject(css)) {
773
766
  utils$1.forEachProperty(css, function(val, key) {
774
767
  El.setStyle(this.el, key, val);
775
768
  }, this);
769
+ } else if (val === void 0) {
770
+ addCSS(this.el, css);
771
+ } else {
772
+ El.setStyle(this.el, css, val);
776
773
  }
777
774
  return this;
778
775
  },
@@ -6990,6 +6987,7 @@
6990
6987
  handles.forEach(function(handle) {
6991
6988
  handle.el.on('mousedown', function(e) {
6992
6989
  activeHandle = handle;
6990
+ activeHandle.el.css('background', 'black');
6993
6991
  prevXY = {x: e.pageX, y: e.pageY};
6994
6992
  });
6995
6993
  });
@@ -7017,6 +7015,7 @@
7017
7015
 
7018
7016
  document.addEventListener('mouseup', function() {
7019
7017
  if (activeHandle && _on) {
7018
+ activeHandle.el.css('background', null);
7020
7019
  activeHandle = null;
7021
7020
  prevXY = null;
7022
7021
  box.dispatchEvent('handle_up');
@@ -7059,7 +7058,7 @@
7059
7058
  el.css(props);
7060
7059
  el.show();
7061
7060
  if (handles) {
7062
- showHandles(handles, props);
7061
+ showHandles(handles, props, x2 < x1, y2 < y1);
7063
7062
  }
7064
7063
  };
7065
7064
 
@@ -7124,25 +7123,26 @@
7124
7123
  return handles;
7125
7124
  }
7126
7125
 
7127
- function showHandles(handles, props) {
7128
- var scaledSize = Math.ceil(Math.min(props.width, props.height) / 5);
7126
+ function showHandles(handles, props, xinv, yinv) {
7127
+ var scaledSize = Math.ceil(Math.min(props.width, props.height) / 3) - 1;
7129
7128
  var HANDLE_SIZE = Math.min(scaledSize, 7);
7129
+ var OFFS = Math.floor(HANDLE_SIZE / 2) + 1;
7130
7130
  handles.forEach(function(handle) {
7131
7131
  var top = 0,
7132
7132
  left = 0;
7133
7133
  if (handle.col == 'center') {
7134
7134
  left += props.width / 2 - HANDLE_SIZE / 2;
7135
- } else if (handle.col == 'right') {
7136
- left += props.width - HANDLE_SIZE + 1;
7135
+ } else if (handle.col == 'left' && xinv || handle.col == 'right' && !xinv) {
7136
+ left += props.width - HANDLE_SIZE + OFFS;
7137
7137
  } else {
7138
- left -= 1;
7138
+ left -= OFFS;
7139
7139
  }
7140
7140
  if (handle.row == 'center') {
7141
7141
  top += props.height / 2 - HANDLE_SIZE / 2;
7142
- } else if (handle.row == 'bottom') {
7143
- top += props.height - HANDLE_SIZE + 1;
7142
+ } else if (handle.row == 'top' && yinv || handle.row == 'bottom' && !yinv) {
7143
+ top += props.height - HANDLE_SIZE + OFFS;
7144
7144
  } else {
7145
- top -= 1;
7145
+ top -= OFFS;
7146
7146
  }
7147
7147
 
7148
7148
  handle.el.css({
package/www/mapshaper.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function () {
2
2
 
3
- var VERSION = "0.6.12";
3
+ var VERSION = "0.6.13";
4
4
 
5
5
 
6
6
  var utils = /*#__PURE__*/Object.freeze({
@@ -18545,7 +18545,13 @@ ${svg}
18545
18545
  // (cli.writeFile() now creates directories that don't exist)
18546
18546
  // cli.validateOutputDir(o.directory);
18547
18547
  }
18548
- o.file = pathInfo.filename;
18548
+ if (pathInfo.extension == 'gz') {
18549
+ o.file = pathInfo.basename;
18550
+ o.gzip = true;
18551
+ } else {
18552
+ o.file = pathInfo.filename;
18553
+ }
18554
+
18549
18555
  if (filenameIsUnsupportedOutputType(o.file)) {
18550
18556
  error("Output file looks like an unsupported file type:", o.file);
18551
18557
  }
@@ -42153,6 +42159,7 @@ ${svg}
42153
42159
 
42154
42160
  // Unified function for processing calls to runCommands() and applyCommands()
42155
42161
  function _runCommands(argv, opts, callback) {
42162
+
42156
42163
  var outputArr = opts.output || null,
42157
42164
  inputObj = opts.input,
42158
42165
  commands;
@@ -42199,6 +42206,7 @@ ${svg}
42199
42206
 
42200
42207
  function done(err, job) {
42201
42208
  err = filterError(err);
42209
+ if (err) printError(err);
42202
42210
  callback(err, job);
42203
42211
  }
42204
42212
  }
@@ -42279,8 +42287,8 @@ ${svg}
42279
42287
  }
42280
42288
 
42281
42289
  function filterError(err) {
42282
- if (err) printError(err);
42283
42290
  if (err && err.name == 'NonFatalError') {
42291
+ printError(err);
42284
42292
  return null;
42285
42293
  }
42286
42294
  return err;