mapshaper 0.7.65 → 0.7.67
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/bin/mapshaper-gui +3 -2
- package/mapshaper.js +907 -33
- package/package.json +1 -1
- package/www/index.html +6 -0
- package/www/mapshaper-gui.js +2633 -399
- package/www/mapshaper.js +907 -33
- package/www/page.css +177 -11
package/www/page.css
CHANGED
|
@@ -2021,12 +2021,24 @@ div.basemap-style-btn.active {
|
|
|
2021
2021
|
cursor: default;
|
|
2022
2022
|
}
|
|
2023
2023
|
|
|
2024
|
-
/* Over a label's
|
|
2025
|
-
than placing a label or panning the map. */
|
|
2026
|
-
.map-layers.label-
|
|
2024
|
+
/* Over a selected label's text, where a drag moves the text (or the whole
|
|
2025
|
+
label) rather than placing a label or panning the map. */
|
|
2026
|
+
.map-layers.label-text-drag {
|
|
2027
2027
|
cursor: move;
|
|
2028
2028
|
}
|
|
2029
2029
|
|
|
2030
|
+
/* Over one of a selected label's control points -- a knot, its anchor, or a
|
|
2031
|
+
callout handle -- which a drag moves on its own. Not the text's cursor,
|
|
2032
|
+
because the two are often close together or on top of each other. */
|
|
2033
|
+
.map-layers.label-handle {
|
|
2034
|
+
cursor: pointer;
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
/* Over a selected label's width handle, which only moves sideways. */
|
|
2038
|
+
.map-layers.label-resize {
|
|
2039
|
+
cursor: ew-resize;
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2030
2042
|
.map-layers.ruler-dragging {
|
|
2031
2043
|
cursor: grabbing;
|
|
2032
2044
|
}
|
|
@@ -2259,6 +2271,56 @@ body.pan.panning .map-layers:not(.drawing) {
|
|
|
2259
2271
|
vector-effect: non-scaling-stroke;
|
|
2260
2272
|
}
|
|
2261
2273
|
|
|
2274
|
+
/* A selected text block's column: the width handle's box, drawn fainter than
|
|
2275
|
+
the box around the text, which is the label itself. */
|
|
2276
|
+
.label-cue-column {
|
|
2277
|
+
fill: none;
|
|
2278
|
+
stroke: #3a7ddc;
|
|
2279
|
+
stroke-width: 1px;
|
|
2280
|
+
stroke-dasharray: 3 3;
|
|
2281
|
+
stroke-opacity: 0.6;
|
|
2282
|
+
vector-effect: non-scaling-stroke;
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
/* A selected label's width and callout handles. The callout's end at the text
|
|
2286
|
+
is filled, so that the two ends of the line read differently. */
|
|
2287
|
+
.label-cue-handle {
|
|
2288
|
+
fill: #fff;
|
|
2289
|
+
stroke: #3a7ddc;
|
|
2290
|
+
stroke-width: 1.5px;
|
|
2291
|
+
vector-effect: non-scaling-stroke;
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
.label-cue-attach {
|
|
2295
|
+
fill: #3a7ddc;
|
|
2296
|
+
stroke: #fff;
|
|
2297
|
+
stroke-width: 1px;
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
/* The width being dragged out for a new text block: a line's height, dashed
|
|
2301
|
+
like the other things the tool draws that are not yet a label. */
|
|
2302
|
+
.label-block-guide {
|
|
2303
|
+
fill: none;
|
|
2304
|
+
stroke: #3a7ddc;
|
|
2305
|
+
stroke-width: 1px;
|
|
2306
|
+
stroke-dasharray: 3 2;
|
|
2307
|
+
vector-effect: non-scaling-stroke;
|
|
2308
|
+
pointer-events: none;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
/* The cue for a selection too large to outline label by label -- selecting a
|
|
2312
|
+
whole layer to restyle it. A halo in the selection's own blue, the same
|
|
2313
|
+
treatment the older styling mode uses in yellow: at that size the question
|
|
2314
|
+
is which labels are in the selection, not where each one's anchor is. */
|
|
2315
|
+
.map-layers > svg text.label-cue-marked {
|
|
2316
|
+
stroke: #3a7ddc;
|
|
2317
|
+
stroke-opacity: 0.3;
|
|
2318
|
+
paint-order: stroke fill;
|
|
2319
|
+
stroke-width: 4px;
|
|
2320
|
+
stroke-linecap: round;
|
|
2321
|
+
stroke-linejoin: round;
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2262
2324
|
/* Transparent rather than fill:none / stroke:none, because an unpainted shape
|
|
2263
2325
|
is not hit-testable. */
|
|
2264
2326
|
.label-edit-hit-area {
|
|
@@ -2298,6 +2360,18 @@ body.pan.panning .map-layers:not(.drawing) {
|
|
|
2298
2360
|
vector-effect: non-scaling-stroke;
|
|
2299
2361
|
}
|
|
2300
2362
|
|
|
2363
|
+
/* A text block's column, the width its text wraps to, behind the box around
|
|
2364
|
+
the text itself. Fainter and dashed, because it is a limit rather than the
|
|
2365
|
+
label: the box is what a callout meets. */
|
|
2366
|
+
.label-edit-column {
|
|
2367
|
+
fill: none;
|
|
2368
|
+
stroke: #cc6acc;
|
|
2369
|
+
stroke-width: 1px;
|
|
2370
|
+
stroke-dasharray: 3 3;
|
|
2371
|
+
stroke-opacity: 0.6;
|
|
2372
|
+
vector-effect: non-scaling-stroke;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2301
2375
|
.label-edit-selection {
|
|
2302
2376
|
fill: #cc6acc;
|
|
2303
2377
|
fill-opacity: 0.3;
|
|
@@ -2412,6 +2486,28 @@ body.pan.panning .map-layers:not(.drawing) {
|
|
|
2412
2486
|
fill: white;
|
|
2413
2487
|
}
|
|
2414
2488
|
|
|
2489
|
+
/* Tooltip shown to the left of a nav button on hover. It borrows the type of
|
|
2490
|
+
.nav-menu-item so the strip reads as one family, but stays a flat label --
|
|
2491
|
+
no border, radius or shadow -- so it is not mistaken for the arrow menu.
|
|
2492
|
+
The translucent white wash keeps it legible over dark map content. */
|
|
2493
|
+
.nav-btn[data-tooltip]:hover:not(.disabled)::after {
|
|
2494
|
+
content: attr(data-tooltip);
|
|
2495
|
+
position: absolute;
|
|
2496
|
+
/* Below .nav-sub-menu, which is at -1 and lingers for a moment after the
|
|
2497
|
+
pointer leaves the arrow button: the tooltip must pass behind it. */
|
|
2498
|
+
z-index: -2;
|
|
2499
|
+
top: 50%;
|
|
2500
|
+
right: calc(100% + 2px);
|
|
2501
|
+
transform: translateY(-50%);
|
|
2502
|
+
pointer-events: none;
|
|
2503
|
+
background-color: rgba(255, 255, 255, 0.85);
|
|
2504
|
+
color: var(--colored-text);
|
|
2505
|
+
font-size: 12px;
|
|
2506
|
+
line-height: 12px;
|
|
2507
|
+
padding: 3px 6px 4px 6px;
|
|
2508
|
+
white-space: nowrap;
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2415
2511
|
.nav-btn.preview-toggle {
|
|
2416
2512
|
align-items: center;
|
|
2417
2513
|
box-sizing: border-box;
|
|
@@ -2498,7 +2594,7 @@ body.pan.panning .map-layers:not(.drawing) {
|
|
|
2498
2594
|
and the button beside them are all the same height. */
|
|
2499
2595
|
--label-field-height: 22px;
|
|
2500
2596
|
--label-field-radius: 4px;
|
|
2501
|
-
--label-field-border: #
|
|
2597
|
+
--label-field-border: #c6c6c6;
|
|
2502
2598
|
/* The narrow column of a split row, wide enough for the longest caption
|
|
2503
2599
|
over it -- "Letter spacing", which measures 71px -- and the same in
|
|
2504
2600
|
every row of every panel, so that the field edges line up down the
|
|
@@ -2742,7 +2838,8 @@ body.pan.panning .map-layers:not(.drawing) {
|
|
|
2742
2838
|
|
|
2743
2839
|
.label-style-row {
|
|
2744
2840
|
display: block;
|
|
2745
|
-
margin-top:
|
|
2841
|
+
margin-top: 2px;
|
|
2842
|
+
margin-bottom: 5px;
|
|
2746
2843
|
}
|
|
2747
2844
|
|
|
2748
2845
|
.label-style-row span,
|
|
@@ -3113,6 +3210,13 @@ body.pan.panning .map-layers:not(.drawing) {
|
|
|
3113
3210
|
align-self: center;
|
|
3114
3211
|
}
|
|
3115
3212
|
|
|
3213
|
+
/* A section switched off shows only its heading (see setSectionCollapsed()),
|
|
3214
|
+
including the caption the Icon heading carries over its size column. */
|
|
3215
|
+
.label-style-panel .label-style-section.collapsed > :not(.label-style-section-title),
|
|
3216
|
+
.label-style-panel .label-style-section.collapsed .label-icon-size-caption {
|
|
3217
|
+
display: none;
|
|
3218
|
+
}
|
|
3219
|
+
|
|
3116
3220
|
/* .hidden is one class and the rule above is two, so a heading told to hide
|
|
3117
3221
|
would go on being laid out. The circle panel hides its Circles heading once
|
|
3118
3222
|
the points are circles: the panel's title says so, and the section is the
|
|
@@ -3146,6 +3250,17 @@ body.pan.panning .map-layers:not(.drawing) {
|
|
|
3146
3250
|
overflow: hidden;
|
|
3147
3251
|
}
|
|
3148
3252
|
|
|
3253
|
+
/* Where text blocks are wrapped (gui-label-wrap.mjs), for the same reason. The
|
|
3254
|
+
wrapping <div> sets its own width, which the clipped box does not limit. */
|
|
3255
|
+
.label-wrap-measure {
|
|
3256
|
+
position: absolute;
|
|
3257
|
+
left: -10000px;
|
|
3258
|
+
top: -10000px;
|
|
3259
|
+
width: 1px;
|
|
3260
|
+
height: 1px;
|
|
3261
|
+
overflow: hidden;
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3149
3264
|
/* Closer to the heading above it than a row usually is, because that heading
|
|
3150
3265
|
line carries this row's "Size" caption: the gap between a caption and the
|
|
3151
3266
|
field it names is 2px everywhere else in the panel. */
|
|
@@ -3215,9 +3330,11 @@ body.pan.panning .map-layers:not(.drawing) {
|
|
|
3215
3330
|
|
|
3216
3331
|
/* A switch, because whether the label has a symbol at all is a yes/no that the
|
|
3217
3332
|
four shapes below it then qualify. Off is a pale track with the knob left,
|
|
3218
|
-
on a dark one with the knob right
|
|
3333
|
+
on a dark one with the knob right, and mixed -- some of the selected labels
|
|
3334
|
+
on, some off -- is both halves at once with the knob over the join. */
|
|
3219
3335
|
.label-toggle {
|
|
3220
3336
|
position: relative;
|
|
3337
|
+
top: -1px;
|
|
3221
3338
|
flex: none;
|
|
3222
3339
|
width: 26px;
|
|
3223
3340
|
height: 15px;
|
|
@@ -3248,13 +3365,23 @@ body.pan.panning .map-layers:not(.drawing) {
|
|
|
3248
3365
|
left: 13px;
|
|
3249
3366
|
}
|
|
3250
3367
|
|
|
3368
|
+
/* The hard edge is the point: a gradient stop rather than a blend, so that the
|
|
3369
|
+
track reads as one half on and one half off rather than as a third colour. */
|
|
3370
|
+
.label-toggle.mixed {
|
|
3371
|
+
background: linear-gradient(to right, #333 50%, #ccc 50%);
|
|
3372
|
+
}
|
|
3373
|
+
|
|
3374
|
+
.label-toggle.mixed .label-toggle-knob {
|
|
3375
|
+
left: 7.5px;
|
|
3376
|
+
}
|
|
3377
|
+
|
|
3251
3378
|
.label-toggle.disabled {
|
|
3252
3379
|
opacity: 0.45;
|
|
3253
3380
|
cursor: default;
|
|
3254
3381
|
}
|
|
3255
3382
|
|
|
3256
3383
|
.label-style-section-title {
|
|
3257
|
-
margin-top:
|
|
3384
|
+
margin-top: 8px;
|
|
3258
3385
|
font-weight: 600;
|
|
3259
3386
|
color: #333;
|
|
3260
3387
|
}
|
|
@@ -3349,6 +3476,13 @@ body.pan.panning .map-layers:not(.drawing) {
|
|
|
3349
3476
|
border-radius: 2px;
|
|
3350
3477
|
}
|
|
3351
3478
|
|
|
3479
|
+
/* A swatch for a selection whose colours disagree: split rather than empty,
|
|
3480
|
+
because empty is how the swatch says the colour is unset. Two greys, so that
|
|
3481
|
+
it cannot be read as one of the colours in the selection. */
|
|
3482
|
+
.label-style-panel .label-color-field .label-color-chit.mixed {
|
|
3483
|
+
background-image: linear-gradient(135deg, #d9d9d9 0 50%, #8c8c8c 50% 100%);
|
|
3484
|
+
}
|
|
3485
|
+
|
|
3352
3486
|
.label-style-panel .label-color-field input[type="text"] {
|
|
3353
3487
|
flex: 1;
|
|
3354
3488
|
width: auto;
|
|
@@ -3648,12 +3782,30 @@ body.dragging-color-picker * {
|
|
|
3648
3782
|
transform: scale(1.4);
|
|
3649
3783
|
}
|
|
3650
3784
|
|
|
3651
|
-
.label-align-buttons .label-panel-btn
|
|
3785
|
+
.label-align-buttons .label-panel-btn,
|
|
3786
|
+
.label-callout-buttons .label-panel-btn {
|
|
3652
3787
|
display: flex;
|
|
3653
3788
|
align-items: center;
|
|
3654
3789
|
justify-content: center;
|
|
3655
3790
|
}
|
|
3656
3791
|
|
|
3792
|
+
/* Lines like the alignment glyphs, with the arrowhead and the dot filled. */
|
|
3793
|
+
.label-callout-symbol {
|
|
3794
|
+
display: block;
|
|
3795
|
+
width: 16px;
|
|
3796
|
+
height: 16px;
|
|
3797
|
+
fill: none;
|
|
3798
|
+
stroke: currentColor;
|
|
3799
|
+
stroke-width: 1.4;
|
|
3800
|
+
stroke-linecap: round;
|
|
3801
|
+
stroke-linejoin: round;
|
|
3802
|
+
}
|
|
3803
|
+
|
|
3804
|
+
.label-callout-symbol .fill {
|
|
3805
|
+
fill: currentColor;
|
|
3806
|
+
stroke: none;
|
|
3807
|
+
}
|
|
3808
|
+
|
|
3657
3809
|
/* Drawn larger than the icon symbols above, which share its viewBox but not
|
|
3658
3810
|
its proportions: three rules across the middle are ink over less than half
|
|
3659
3811
|
of the box, where a circle or a square fills most of its own, so at the same
|
|
@@ -3761,21 +3913,35 @@ body.dragging-color-picker * {
|
|
|
3761
3913
|
.contextmenu-item {
|
|
3762
3914
|
background-color: #fff;
|
|
3763
3915
|
white-space: nowrap;
|
|
3764
|
-
padding: 3px 10px 4px 10px;
|
|
3916
|
+
/* padding: 3px 10px 4px 10px; */
|
|
3917
|
+
margin: 1px 10px;
|
|
3918
|
+
padding: 2px 0;
|
|
3765
3919
|
cursor: pointer;
|
|
3766
|
-
font-size:
|
|
3920
|
+
font-size: 12px;
|
|
3767
3921
|
line-height: 13px;
|
|
3768
3922
|
}
|
|
3769
3923
|
|
|
3770
3924
|
.contextmenu-label {
|
|
3771
3925
|
color: #999;
|
|
3772
3926
|
white-space: nowrap;
|
|
3773
|
-
padding:
|
|
3927
|
+
padding: 5px 10px 1px 10px;
|
|
3774
3928
|
font-size: 12px;
|
|
3775
3929
|
line-height: 12px;
|
|
3776
3930
|
margin-top: -2px;
|
|
3777
3931
|
}
|
|
3778
3932
|
|
|
3933
|
+
/* How many labels a "select" item would select. In the grey of a menu heading
|
|
3934
|
+
rather than the item's own colour: it qualifies what the item says rather
|
|
3935
|
+
than being part of it. */
|
|
3936
|
+
.contextmenu-count {
|
|
3937
|
+
font-size: 10px;
|
|
3938
|
+
color: #999;
|
|
3939
|
+
}
|
|
3940
|
+
|
|
3941
|
+
.contextmenu-item:hover .contextmenu-count {
|
|
3942
|
+
color: #777;
|
|
3943
|
+
}
|
|
3944
|
+
|
|
3779
3945
|
/* color tile shown instead of a bullet in the raster color readout */
|
|
3780
3946
|
.contextmenu-swatch {
|
|
3781
3947
|
display: inline-block;
|