Skip to content

Commit

Permalink
v0.6.97
Browse files Browse the repository at this point in the history
  • Loading branch information
mbloch committed Jun 5, 2024
1 parent 999d836 commit 2da18a3
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 5 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.97
* [web] Prompt user to project imported files to match selected layer, when relevant.
* [svg] Add fill="none" to unstyled rectangle layers, to prevent map frame rectangles from displaying with SVG default black polygon fill.

v0.6.96
* Bug fix

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.96",
"version": "0.6.97",
"description": "A tool for editing vector datasets for mapping and GIS.",
"keywords": [
"shapefile",
Expand Down
2 changes: 1 addition & 1 deletion src/gui/gui-context-menu.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function ContextMenu() {
addCoords(e.lonlat_coordinates);
}
if (e.projected_coordinates) {
addMenuLabel('easting, northing');
addMenuLabel('x, y');
addCoords(e.projected_coordinates);
}

Expand Down
4 changes: 3 additions & 1 deletion src/gui/gui-edit-labels.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ export function initLabelDragging(gui, ext, hit) {
function updateTextNode(node, d) {
var a = d['text-anchor'];
if (a) node.setAttribute('text-anchor', a);
setMultilineAttribute(node, 'dx', d.dx || 0);
// dx data property is applied to svg x property
// setMultilineAttribute(node, 'dx', d.dx || 0);
setMultilineAttribute(node, 'x', d.dx || 0);
node.setAttribute('y', d.dy || 0);
}

Expand Down
13 changes: 13 additions & 0 deletions src/gui/gui-import-utils.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { showPrompt } from './gui-alert';
import { internal } from './gui-core';

export async function considerReprojecting(gui, dataset, opts) {
var mapCRS = gui.map.getActiveLayerCRS();
var dataCRS = internal.getDatasetCRS(dataset);
if (!dataCRS || !mapCRS || internal.crsAreEqual(mapCRS, dataCRS)) return;
var msg = `The input file ${dataset?.info?.input_files[0] || ''} has a different projection from the current selected layer. Would you like to reproject it to match?`;
var reproject = await showPrompt(msg, 'Reproject file?');
if (reproject) {
internal.projectDataset(dataset, dataCRS, mapCRS, {densify: true});
}
}
1 change: 1 addition & 0 deletions src/gui/gui-svg-labels.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { utils } from './gui-core';
import { internal } from './gui-core';

export function isMultilineLabel(textNode) {
return textNode.childNodes.length > 1;
}
Expand Down

0 comments on commit 2da18a3

Please sign in to comment.