mapshaper 0.6.47 → 0.6.48

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.47";
3
+ var VERSION = "0.6.48";
4
4
 
5
5
 
6
6
  var utils = /*#__PURE__*/Object.freeze({
@@ -41503,11 +41503,26 @@ ${svg}
41503
41503
  parseConsoleCommands: parseConsoleCommands
41504
41504
  });
41505
41505
 
41506
+ // import { importGeoJSON } from '../geojson/geojson-import';
41507
+
41506
41508
  function getTargetProxy(target) {
41507
41509
  var lyr = target.layers[0];
41508
- var data = getLayerInfo(lyr, target.dataset);
41510
+ var data = getLayerInfo(lyr, target.dataset); // layer_name, feature_count etc
41509
41511
  data.layer = lyr;
41510
41512
  data.dataset = target.dataset;
41513
+ addGetters(data, {
41514
+ // export as an object, not a string or buffer
41515
+ geojson: getGeoJSON
41516
+ });
41517
+
41518
+ function getGeoJSON() {
41519
+ var features = exportLayerAsGeoJSON(lyr, target.dataset, {}, true);
41520
+ return {
41521
+ type: 'FeatureCollection',
41522
+ features: features
41523
+ };
41524
+ }
41525
+
41511
41526
  return data;
41512
41527
  }
41513
41528
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mapshaper",
3
- "version": "0.6.47",
3
+ "version": "0.6.48",
4
4
  "description": "A tool for editing vector datasets for mapping and GIS.",
5
5
  "keywords": [
6
6
  "shapefile",
package/www/mapshaper.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function () {
2
2
 
3
- var VERSION = "0.6.47";
3
+ var VERSION = "0.6.48";
4
4
 
5
5
 
6
6
  var utils = /*#__PURE__*/Object.freeze({
@@ -41503,11 +41503,26 @@ ${svg}
41503
41503
  parseConsoleCommands: parseConsoleCommands
41504
41504
  });
41505
41505
 
41506
+ // import { importGeoJSON } from '../geojson/geojson-import';
41507
+
41506
41508
  function getTargetProxy(target) {
41507
41509
  var lyr = target.layers[0];
41508
- var data = getLayerInfo(lyr, target.dataset);
41510
+ var data = getLayerInfo(lyr, target.dataset); // layer_name, feature_count etc
41509
41511
  data.layer = lyr;
41510
41512
  data.dataset = target.dataset;
41513
+ addGetters(data, {
41514
+ // export as an object, not a string or buffer
41515
+ geojson: getGeoJSON
41516
+ });
41517
+
41518
+ function getGeoJSON() {
41519
+ var features = exportLayerAsGeoJSON(lyr, target.dataset, {}, true);
41520
+ return {
41521
+ type: 'FeatureCollection',
41522
+ features: features
41523
+ };
41524
+ }
41525
+
41511
41526
  return data;
41512
41527
  }
41513
41528