mapshaper 0.6.76 → 0.6.77
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 +17 -9
- package/package.json +1 -1
- package/www/index.html +35 -48
- package/www/mapshaper-gui.js +1097 -987
- package/www/mapshaper.js +17 -9
- package/www/page.css +60 -108
package/mapshaper.js
CHANGED
|
@@ -1537,7 +1537,6 @@
|
|
|
1537
1537
|
this.xmax = c;
|
|
1538
1538
|
this.ymax = d;
|
|
1539
1539
|
if (a > c || b > d) this.update();
|
|
1540
|
-
// error("Bounds#setBounds() min/max reversed:", a, b, c, d);
|
|
1541
1540
|
return this;
|
|
1542
1541
|
};
|
|
1543
1542
|
|
|
@@ -5123,10 +5122,12 @@
|
|
|
5123
5122
|
if (!P && info.prj) {
|
|
5124
5123
|
P = parseCrsString(translatePrj(info.prj));
|
|
5125
5124
|
}
|
|
5126
|
-
if (!P
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5125
|
+
if (!P) {
|
|
5126
|
+
if (probablyDecimalDegreeBounds(getDatasetBounds(dataset))) {
|
|
5127
|
+
// use wgs84 for probable latlong datasets with unknown datums
|
|
5128
|
+
str = 'wgs84';
|
|
5129
|
+
P = parseCrsString(str);
|
|
5130
|
+
}
|
|
5130
5131
|
}
|
|
5131
5132
|
return {
|
|
5132
5133
|
crs: P || null,
|
|
@@ -7202,6 +7203,12 @@
|
|
|
7202
7203
|
return bounds;
|
|
7203
7204
|
}
|
|
7204
7205
|
|
|
7206
|
+
function datasetIsEmpty(dataset) {
|
|
7207
|
+
return dataset.layers.every(function(lyr) {
|
|
7208
|
+
return layerIsEmpty(lyr);
|
|
7209
|
+
});
|
|
7210
|
+
}
|
|
7211
|
+
|
|
7205
7212
|
function datasetHasGeometry(dataset) {
|
|
7206
7213
|
return utils.some(dataset.layers, function(lyr) {
|
|
7207
7214
|
return layerHasGeometry(lyr);
|
|
@@ -7315,6 +7322,7 @@
|
|
|
7315
7322
|
copyDatasetForExport: copyDatasetForExport,
|
|
7316
7323
|
copyDatasetForRenaming: copyDatasetForRenaming,
|
|
7317
7324
|
getDatasetBounds: getDatasetBounds,
|
|
7325
|
+
datasetIsEmpty: datasetIsEmpty,
|
|
7318
7326
|
datasetHasGeometry: datasetHasGeometry,
|
|
7319
7327
|
datasetHasPaths: datasetHasPaths,
|
|
7320
7328
|
cleanupArcs: cleanupArcs,
|
|
@@ -13449,7 +13457,7 @@
|
|
|
13449
13457
|
// range = Math.min(w, h) + 1e-8,
|
|
13450
13458
|
range = Math.max(w, h) + 1e-8,
|
|
13451
13459
|
digits = 0;
|
|
13452
|
-
while (range < 2000) {
|
|
13460
|
+
while (range < 2000 && digits < 1) {
|
|
13453
13461
|
range *= 10;
|
|
13454
13462
|
digits++;
|
|
13455
13463
|
}
|
|
@@ -29352,7 +29360,7 @@ ${svg}
|
|
|
29352
29360
|
// * In TopoJSON input, it makes sense to think of the last object/layer
|
|
29353
29361
|
// as the topmost one -- it corresponds to the painter's algorithm and
|
|
29354
29362
|
// the way that objects are ordered in SVG.
|
|
29355
|
-
var lyr = targ
|
|
29363
|
+
var lyr = targ?.layers[targ.layers.length - 1];
|
|
29356
29364
|
return targ ? {layer: lyr, dataset: targ.dataset} : null;
|
|
29357
29365
|
};
|
|
29358
29366
|
|
|
@@ -45136,7 +45144,7 @@ ${svg}
|
|
|
45136
45144
|
opts.target, getFormattedLayerList(job.catalog)));
|
|
45137
45145
|
}
|
|
45138
45146
|
if (!commandAcceptsEmptyTarget(name)) {
|
|
45139
|
-
|
|
45147
|
+
stop("No data is available");
|
|
45140
45148
|
}
|
|
45141
45149
|
}
|
|
45142
45150
|
|
|
@@ -45522,7 +45530,7 @@ ${svg}
|
|
|
45522
45530
|
});
|
|
45523
45531
|
}
|
|
45524
45532
|
|
|
45525
|
-
var version = "0.6.
|
|
45533
|
+
var version = "0.6.77";
|
|
45526
45534
|
|
|
45527
45535
|
// Parse command line args into commands and run them
|
|
45528
45536
|
// Function takes an optional Node-style callback. A Promise is returned if no callback is given.
|
package/package.json
CHANGED
package/www/index.html
CHANGED
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
<input type="text" value="label" class="clicktext" />
|
|
77
77
|
</div></div>
|
|
78
78
|
<div id="mode-buttons" class="page-header-buttons">
|
|
79
|
-
<span class="
|
|
79
|
+
<span class="console-btn header-btn btn">Console</span><span class="basemap-btn header-btn btn">Basemap</span><span class="separator"></span><span class="separator"></span><span class="simplify-btn header-btn btn">Simplify</span><span class="separator"></span><span class="export-btn header-btn btn">Export</span>
|
|
80
80
|
</div>
|
|
81
81
|
<div id="splash-buttons" class="page-header-buttons">
|
|
82
82
|
<a href="https://github.com/mbloch/mapshaper/wiki"><span id="wiki-btn" class="header-btn btn">Wiki</span></a><span class="separator"></span><a href="https://github.com/mbloch/mapshaper"><span id="github-btn" class="header-btn btn">GitHub</span></a>
|
|
@@ -98,11 +98,14 @@
|
|
|
98
98
|
<div class="pin-all pinnable">
|
|
99
99
|
<img class="eye-btn black-eye" src="images/eye.png">
|
|
100
100
|
<img class="eye-btn green-eye" src="images/eye2.png">
|
|
101
|
-
|
|
101
|
+
</div>
|
|
102
102
|
<div class="layer-list"></div>
|
|
103
103
|
<!-- <h4>Sources</h4> -->
|
|
104
|
-
<
|
|
105
|
-
<div class="file-
|
|
104
|
+
<div class="no-layer-note">No data has been added</div>
|
|
105
|
+
<div class="source-file-section">
|
|
106
|
+
<h4>Source files</h4>
|
|
107
|
+
<div class="file-list"></div>
|
|
108
|
+
</div>
|
|
106
109
|
<div>
|
|
107
110
|
<div id="add-file-btn" class="dialog-btn btn">Add files</div>
|
|
108
111
|
<div id="add-empty-btn" class="dialog-btn btn">Add empty layer</div>
|
|
@@ -143,14 +146,13 @@
|
|
|
143
146
|
<div class="info-box">
|
|
144
147
|
<div class="close2-btn"></div>
|
|
145
148
|
<h3>Export options</h3>
|
|
146
|
-
<div style="height:3px"></div>
|
|
147
149
|
<div class=export-layers>
|
|
148
150
|
<h4 class="menu-title">Layers</h4>
|
|
149
151
|
<div class="export-layer-list option-menu"></div>
|
|
150
152
|
</div>
|
|
151
153
|
<div class="export-zip-option option-menu">
|
|
152
154
|
|
|
153
|
-
<div style="height:
|
|
155
|
+
<div style="height:6px"></div>
|
|
154
156
|
|
|
155
157
|
</div>
|
|
156
158
|
<h4>File format</h4>
|
|
@@ -166,7 +168,6 @@
|
|
|
166
168
|
the -o command. Examples: bbox no-quantization
|
|
167
169
|
precision=0.001. Click to see all options.</div></div></div></a>
|
|
168
170
|
|
|
169
|
-
|
|
170
171
|
<!-- <div class="option-menu">
|
|
171
172
|
<input id="ofile-name" class="text-input" type="text" placeholder="output file name" />
|
|
172
173
|
</div> -->
|
|
@@ -246,55 +247,41 @@ a smoother appearance.</div></div></div></div>
|
|
|
246
247
|
</div> <!-- .info-box -->
|
|
247
248
|
</div> <!-- simplify-options -->
|
|
248
249
|
|
|
249
|
-
<div id="splash-screen" class="main-area">
|
|
250
|
-
<div>
|
|
251
|
-
<h3 id="splash-screen-blurb">Mapshaper is an editor for map data</h3>
|
|
252
|
-
</div>
|
|
253
|
-
<div id="drop-areas" class="drop-area-wrapper main-area">
|
|
254
|
-
|
|
255
|
-
<div class="file-catalog catalog-area">
|
|
256
|
-
</div>
|
|
257
|
-
<div class="file-catalog-spacer spacer"></div>
|
|
258
|
-
|
|
259
|
-
<div id="import-drop" class="drop-area">
|
|
260
|
-
<h4>Drop or paste files here or <span class="inline-btn btn" id="file-selection-btn"><span class="label-text">select</span></span> from a folder</h4>
|
|
261
|
-
<div class="subtitle">Shapefile, GeoJSON, TopoJSON, KML and CSV files are supported</div>
|
|
262
|
-
<div class="subtitle">Files can be gzipped or in a zip archive</div>
|
|
263
|
-
</div>
|
|
264
|
-
<div class="spacer"></div>
|
|
265
|
-
<div id="import-quick-drop" class="drop-area">
|
|
266
|
-
<h4>Quick import</h4>
|
|
267
|
-
<div class="subtitle">Drop or paste files here to import with default settings</div>
|
|
268
|
-
</div>
|
|
269
|
-
</div>
|
|
270
|
-
</div>
|
|
271
|
-
|
|
272
250
|
<div id="import-options" class="main-area popup-dialog">
|
|
273
251
|
<div class="info-box">
|
|
274
|
-
<
|
|
275
|
-
|
|
276
|
-
<div class="
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
252
|
+
<div class="cancel-btn close2-btn"></div>
|
|
253
|
+
<h3 class="list-header">Import files</h3>
|
|
254
|
+
<div class="import-instructions">
|
|
255
|
+
<span><input type="checkbox" class="advanced-import-options" />with advanced options</span>
|
|
256
|
+
<div class="mini-drop-area">
|
|
257
|
+
<div class="subtitle">Drop, paste or <span class="add-btn inline-btn btn"><span class="label-text">select</span></span> files to import.</div>
|
|
258
|
+
<div class="subtitle">Shapefile, GeoJSON, TopoJSON, KML and CSV formats are supported. Files can be zipped or gzipped.</div>
|
|
259
|
+
</div>
|
|
282
260
|
</div>
|
|
261
|
+
<div class="queued-file-section">
|
|
262
|
+
<!-- <h4>Files</h4> -->
|
|
263
|
+
<div class="dropped-file-list"></div>
|
|
264
|
+
|
|
265
|
+
<div class="option-menu">
|
|
283
266
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
267
|
+
<div id="path-import-options">
|
|
268
|
+
<!-- <h4>Options</h4> -->
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<div style="margin-top: 10px"><input type="text" class="text-input advanced-options" placeholder="import options" />
|
|
272
|
+
<a href="https://github.com/mbloch/mapshaper/wiki/Command-Reference#-i-input" target="_mapshaper_import_docs">
|
|
273
|
+
<div class="tip-button">?<div class="tip-anchor">
|
|
274
|
+
<div class="tip">Enter options from the command line
|
|
288
275
|
interface. Examples: <span id="import-option-examples">snap no-topology
|
|
289
276
|
encoding=big5</span>. Click to see all options.</div></div></div></div>
|
|
290
|
-
|
|
277
|
+
</a>
|
|
291
278
|
|
|
292
|
-
|
|
279
|
+
</div>
|
|
280
|
+
|
|
281
|
+
<!-- <div class="cancel-btn btn dialog-btn">Cancel</div>
|
|
282
|
+
<div class="add-btn btn dialog-btn">Select</div> -->
|
|
283
|
+
<div class="submit-btn btn dialog-btn default-btn disabled">Submit</div>
|
|
293
284
|
|
|
294
|
-
<div id="import-buttons">
|
|
295
|
-
<div class="cancel-btn btn dialog-btn">Cancel</div>
|
|
296
|
-
<div class="add-btn btn dialog-btn">Select</div>
|
|
297
|
-
<div class="submit-btn btn dialog-btn default-btn">Import</div>
|
|
298
285
|
</div>
|
|
299
286
|
|
|
300
287
|
</div> <!-- .info-box -->
|