Skip to content

Commit

Permalink
v0.6.68
Browse files Browse the repository at this point in the history
  • Loading branch information
mbloch committed Mar 7, 2024
1 parent d7afd0d commit 4e1f3ae
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v0.6.68
* [scalebar] giving a pair of distances creates a dual-unit scale bar (style b only).
* [web] minor bug fixes and improvements.

v0.6.67
* -rectangle command with width=<size> option creates a "frame" layer to use as the extent of an SVG map by setting the size of the SVG viewport (an alternative to using -o fit-extent=<size> option).
* [web] Map symbols scale as the map zooms when a frame layer is visible.
Expand Down
4 changes: 2 additions & 2 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ Polyline layers
Polygon, polyline and point layers
- `this.partCount` 1 for single-part features, >1 for multi-part features, 0 for null features
- `this.isNull` True if feature has null geometry
- `this.bounds` Bounding box as array [xmin, ymin, xmax, ymax]
- `this.bbox` Bounding box as array [xmin, ymin, xmax, ymax]
- `this.width` Width of bounding box
- `this.height` Height of bounding box

Expand Down Expand Up @@ -1142,7 +1142,7 @@ Add a scale bar to an SVG map. The command creates a data-only layer containing

The length of the scale bar reflects the scale in the center of the map's rectangular frame.

`<label>` or `label=` Optional label giving the size and units of the scalebar, e.g. `"25 k.m."`. If only units are given, a length will be assigned. If the `label` property is missing, scale bar properties will be auto-generated.
`<label>` or `label=` Optional label giving the size and units of the scalebar, e.g. `"25 k.m."`. If only units are given, a length will be assigned. If the `label` property is missing, scale bar properties will be auto-generated. If two lengths are given (e.g. `1000 km,500 miles`), a dual-unit bar will be generated, if the scale bar style supports it.

`style=` Scalebar style, `a` or `b`. Style `b` has tic marks.

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mapshaper",
"version": "0.6.67",
"version": "0.6.68",
"description": "A tool for editing vector datasets for mapping and GIS.",
"keywords": [
"shapefile",
Expand Down
6 changes: 5 additions & 1 deletion src/cli/mapshaper-options.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2018,7 +2018,11 @@ export function getOptionParser() {
describe: 'e.g. bottom-right (default is top-left)'
})
.option('label-position', {
describe: 'top or bottom'
describe: 'top, bottom, top-center (style a), etc'
})
.option('dual-units', {
// describe: 'display both metric and imperial units',
type: 'flag'
})
.option('margin', {
describe: 'offset in pixels from edge of map',
Expand Down
5 changes: 3 additions & 2 deletions src/dissolve/mapshaper-polygon-dissolve2.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ function groupPolygons2(lyr, getGroupId) {

function getGapRemovalMessage(removed, retained, areaLabel) {
var msg;
var tot = removed + retained;
if (removed > 0 === false) return '';
return utils.format('Removed %,d / %,d sliver%s using %s',
removed, removed + retained, utils.pluralSuffix(removed), areaLabel);
return utils.format('Removed %,d of %,d sliver%s using %s',
removed, tot, utils.pluralSuffix(tot), areaLabel);
}

export function dissolvePolygonGroups2(groups, lyr, dataset, opts) {
Expand Down
4 changes: 2 additions & 2 deletions test/each-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,12 @@ describe('mapshaper-each.js', function () {
assert.deepEqual(lyr.data.getRecords(), [{parts: 2}, {parts: 0}]);
})

it('point this.bounds this.height this.width', function() {
it('point this.bbox this.height this.width', function() {
var lyr = {
geometry_type: 'point',
shapes: [[[0, 2], [0, -2]], null]
};
evaluateEachFeature(lyr, nullArcs, "bbox = this.bounds, h = this.height, w = this.width");
evaluateEachFeature(lyr, nullArcs, "bbox = this.bbox, h = this.height, w = this.width");
assert.deepStrictEqual(lyr.data.getRecords(), [{bbox: [0,-2,0,2], h: 4, w: 0}, {bbox: [], h: 0, w: 0}]);

});
Expand Down

0 comments on commit 4e1f3ae

Please sign in to comment.