Rounded, after the Design canvas' GridRounded: drive mode's cells and keys with 12 px corners on a black ground, the gaps (3 px a side) out of them, the map keeping its area with corners of its own; the map's points one frame, the NPS rounded square — the trip's stops, the search pins, the clusters and the points with no pictogram (badges like the p4n/OsmAnd ones) instead of circles
This commit is contained in:
1 parent
87d7bd2463
commit
bf90f4cf23
2 files changed
+44
-17
No files matched your search
+26
-2
@@ -3019,7 +3019,7 @@ button.basemap-panel__link[hidden] { display: none; }
|
|||||||
.route-marker {
|
.route-marker {
|
||||||
width: 22px;
|
width: 22px;
|
||||||
height: 22px;
|
height: 22px;
|
||||||
border-radius: 50%;
|
border-radius: 5px; /* the NPS rounded square, like the points' badges */
|
||||||
background: #1d6fdc;
|
background: #1d6fdc;
|
||||||
border: 2px solid #fff;
|
border: 2px solid #fff;
|
||||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
|
||||||
@@ -3800,7 +3800,7 @@ html.driving .drive-panel { grid-area: var(--drive-menu, 2 / 10 / 10 / 17); }
|
|||||||
.drive-trip[data-mode="search"] .drive-trip__search { grid-row: 2 / 3; }
|
.drive-trip[data-mode="search"] .drive-trip__search { grid-row: 2 / 3; }
|
||||||
.drive-trip[data-mode="search"] .drive-trip__search input { border: 2px solid var(--drive-key-on); }
|
.drive-trip[data-mode="search"] .drive-trip__search input { border: 2px solid var(--drive-key-on); }
|
||||||
/* the search's results on the map and in the list: saved points cyan, places amber */
|
/* the search's results on the map and in the list: saved points cyan, places amber */
|
||||||
.drive-pin { width: calc(14px * var(--s, 1)); height: calc(14px * var(--s, 1)); flex: none; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
|
.drive-pin { width: calc(14px * var(--s, 1)); height: calc(14px * var(--s, 1)); flex: none; border-radius: 3px; box-shadow: 0 0 0 2px #fff; }
|
||||||
.maplibregl-marker.drive-pin { width: calc(18px * var(--s, 1)); height: calc(18px * var(--s, 1)); box-shadow: 0 0 0 2.5px #fff, 0 1px 4px rgb(0 0 0 / 0.4); }
|
.maplibregl-marker.drive-pin { width: calc(18px * var(--s, 1)); height: calc(18px * var(--s, 1)); box-shadow: 0 0 0 2.5px #fff, 0 1px 4px rgb(0 0 0 / 0.4); }
|
||||||
.drive-pin--saved { background: #12bedf; }
|
.drive-pin--saved { background: #12bedf; }
|
||||||
.drive-pin--place { background: #e8a200; }
|
.drive-pin--place { background: #e8a200; }
|
||||||
@@ -4923,6 +4923,30 @@ html.driving .drive-cell--field { position: relative; }
|
|||||||
.drive-rec__tick input { width: 30px; height: 30px; accent-color: var(--drive-key-on); }
|
.drive-rec__tick input { width: 30px; height: 30px; accent-color: var(--drive-key-on); }
|
||||||
.drive-rec__day .drive-panel__text { flex: 1; justify-content: center; padding: 0 12px; }
|
.drive-rec__day .drive-panel__text { flex: 1; justify-content: center; padding: 0 12px; }
|
||||||
.drive-rec__day .drive-panel__look { width: var(--cell, 80px); flex: none; background: none; }
|
.drive-rec__day .drive-panel__look { width: var(--cell, 80px); flex: none; background: none; }
|
||||||
|
|
||||||
|
/* Rounded (the Design canvas' GridRounded): the cells and keys with soft
|
||||||
|
corners on a black ground, the gaps taken out of them (3 px a side) — the
|
||||||
|
map keeps its area, framed with corners of its own. Overrides the 1 px
|
||||||
|
lines of the grid and its menus above. */
|
||||||
|
:root { --drive-ground: #000; --drive-radius: 12px; --drive-half-gap: 3px; }
|
||||||
|
html.driving #app,
|
||||||
|
.drive-panel,
|
||||||
|
.drive-trip__stops,
|
||||||
|
.drive-trip__results,
|
||||||
|
.drive-panel__list,
|
||||||
|
.drive-points__bar,
|
||||||
|
.drive-layers__presets,
|
||||||
|
.drive-layers__source,
|
||||||
|
.drive-rec__days { gap: 0; background: var(--drive-ground); }
|
||||||
|
.drive-cell,
|
||||||
|
.drive-panel__cell,
|
||||||
|
.drive-panel__empty,
|
||||||
|
.drive-rec__day,
|
||||||
|
.drive-panel > :not(.drive-trip__stops, .drive-trip__results, .drive-panel__list, .drive-points__bar, .drive-layers__presets, .drive-layers__source, .drive-rec__days) {
|
||||||
|
margin: var(--drive-half-gap);
|
||||||
|
border-radius: var(--drive-radius);
|
||||||
|
}
|
||||||
|
html.driving .app-body { border-radius: calc(var(--drive-radius) + 2px); overflow: hidden; }
|
||||||
.drive-rec__cutrow { flex: none; height: calc(var(--cell, 80px) / 2); display: flex; align-items: center; gap: 10px; padding-left: 28px; background: var(--band); color: var(--drive-muted); font-size: calc(14px * var(--s, 1)); }
|
.drive-rec__cutrow { flex: none; height: calc(var(--cell, 80px) / 2); display: flex; align-items: center; gap: 10px; padding-left: 28px; background: var(--band); color: var(--drive-muted); font-size: calc(14px * var(--s, 1)); }
|
||||||
.drive-rec__cutrow span:nth-child(2) { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
.drive-rec__cutrow span:nth-child(2) { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||||
.drive-panel .drive-rec__cutrow button { height: 100%; padding: 0 16px; background: none; border-left: 1px solid var(--drive-line); font-size: calc(14px * var(--s, 1)); font-weight: 700; }
|
.drive-panel .drive-rec__cutrow button { height: 100%; padding: 0 16px; background: none; border-left: 1px solid var(--drive-line); font-size: calc(14px * var(--s, 1)); font-weight: 700; }
|
||||||
|
|||||||
+18
-15
@@ -28,6 +28,9 @@ const POI_ICON_KEYS = Object.keys(POI_ICONS);
|
|||||||
const POI_ICON_IMAGE_SIZE = 48; // rasterized once at this size, rendered much smaller by icon-size below
|
const POI_ICON_IMAGE_SIZE = 48; // rasterized once at this size, rendered much smaller by icon-size below
|
||||||
const POI_ICON_SIZE = 0.3; // 48 * 0.3 = ~14px, sized to sit inside the marker badge below
|
const POI_ICON_SIZE = 0.3; // 48 * 0.3 = ~14px, sized to sit inside the marker badge below
|
||||||
const MAP_MARKER_SIZE = 0.55;
|
const MAP_MARKER_SIZE = 0.55;
|
||||||
|
// The clusters as the same rounded-square badge, light -> dark by count
|
||||||
|
// (16 / 20 / 26 px "radius" before, now that half the side).
|
||||||
|
const CLUSTER_COLORS = ["#a8c8ea", "#5b9bd5", "#2e6da4"];
|
||||||
const BADGE_IMAGE_PREFIX = "badge-"; // one registered image per distinct badge color actually seen, see _registerBadgeColors
|
const BADGE_IMAGE_PREFIX = "badge-"; // one registered image per distinct badge color actually seen, see _registerBadgeColors
|
||||||
|
|
||||||
// Custom drag payload MIME type for moving an already-uploaded file between
|
// Custom drag payload MIME type for moving an already-uploaded file between
|
||||||
@@ -897,7 +900,7 @@ export class GpxPanelControl {
|
|||||||
// clusterRadius/clusterMaxZoom are harmless when there's nothing dense
|
// clusterRadius/clusterMaxZoom are harmless when there's nothing dense
|
||||||
// enough to cluster (a handful of waypoints just render individually).
|
// enough to cluster (a handful of waypoints just render individually).
|
||||||
this._map.addSource(pointsId, { type: "geojson", data: points, cluster: true, clusterRadius: 50, clusterMaxZoom: 14 });
|
this._map.addSource(pointsId, { type: "geojson", data: points, cluster: true, clusterRadius: 50, clusterMaxZoom: 14 });
|
||||||
const badgeColors = new Set(points.features.map((f) => f.properties.color));
|
const badgeColors = new Set([...points.features.map((f) => f.properties.color), ...CLUSTER_COLORS]);
|
||||||
await Promise.all([this._registerCategoryGlyphs(new Set(points.features.map((f) => f.properties.icon))), this._registerBadgeColors(badgeColors)]);
|
await Promise.all([this._registerCategoryGlyphs(new Set(points.features.map((f) => f.properties.icon))), this._registerBadgeColors(badgeColors)]);
|
||||||
if (!this._map.getSource(pointsId)) return true; // a style.load (basemap switch) tore it down while icons were loading
|
if (!this._map.getSource(pointsId)) return true; // a style.load (basemap switch) tore it down while icons were loading
|
||||||
|
|
||||||
@@ -912,21 +915,21 @@ export class GpxPanelControl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// A single-hue, light->dark ramp keyed on point_count (magnitude, not
|
// A single-hue, light->dark ramp keyed on point_count (magnitude, not
|
||||||
// category) for the clustered circles; individual points below that use
|
// category) for the cluster badges; individual points below that use
|
||||||
// each waypoint's own category color (see Maptool::Gpx#waypoint_color),
|
// each waypoint's own category color (see Maptool::Gpx#waypoint_color),
|
||||||
// falling back to the plain track color for waypoints with no category
|
// falling back to the plain track color for waypoints with no category
|
||||||
// (e.g. a hand-placed GNSS pin, not from a POI export).
|
// (e.g. a hand-placed GNSS pin, not from a POI export).
|
||||||
_addClusterLayers(pointsId, path) {
|
_addClusterLayers(pointsId, path) {
|
||||||
this._map.addLayer({
|
this._map.addLayer({
|
||||||
id: `${pointsId}-clusters`,
|
id: `${pointsId}-clusters`,
|
||||||
type: "circle",
|
type: "symbol",
|
||||||
source: pointsId,
|
source: pointsId,
|
||||||
filter: ["has", "point_count"],
|
filter: ["has", "point_count"],
|
||||||
paint: {
|
layout: {
|
||||||
"circle-radius": ["step", ["get", "point_count"], 16, 25, 20, 100, 26],
|
"icon-image": ["step", ["get", "point_count"], badgeImageId(CLUSTER_COLORS[0]), 25, badgeImageId(CLUSTER_COLORS[1]), 100, badgeImageId(CLUSTER_COLORS[2])],
|
||||||
"circle-color": ["step", ["get", "point_count"], "#a8c8ea", 25, "#5b9bd5", 100, "#2e6da4"],
|
"icon-size": ["step", ["get", "point_count"], 32 / POI_ICON_IMAGE_SIZE, 25, 40 / POI_ICON_IMAGE_SIZE, 100, 52 / POI_ICON_IMAGE_SIZE],
|
||||||
"circle-stroke-color": "#fff",
|
"icon-allow-overlap": true,
|
||||||
"circle-stroke-width": 1.5,
|
"icon-ignore-placement": true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this._map.addLayer({
|
this._map.addLayer({
|
||||||
@@ -947,20 +950,20 @@ export class GpxPanelControl {
|
|||||||
// default center anchoring is simplest and also means the glyph layer
|
// default center anchoring is simplest and also means the glyph layer
|
||||||
// below needs no offset, just the same center anchor.
|
// below needs no offset, just the same center anchor.
|
||||||
// A point with no NPS symbol (a Google saved place, a bare GPX
|
// A point with no NPS symbol (a Google saved place, a bare GPX
|
||||||
// waypoint) is a small dot instead, like a place on an NPS map — an
|
// waypoint) is a small badge instead, about half the size — a full-size
|
||||||
// empty badge read as a big red square.
|
// empty badge read as a big red square.
|
||||||
const single = ["!", ["has", "point_count"]];
|
const single = ["!", ["has", "point_count"]];
|
||||||
const hasSymbol = ["in", ["get", "icon"], ["literal", POI_ICON_KEYS]];
|
const hasSymbol = ["in", ["get", "icon"], ["literal", POI_ICON_KEYS]];
|
||||||
this._map.addLayer({
|
this._map.addLayer({
|
||||||
id: `${pointsId}-dot`,
|
id: `${pointsId}-dot`,
|
||||||
type: "circle",
|
type: "symbol",
|
||||||
source: pointsId,
|
source: pointsId,
|
||||||
filter: ["all", single, ["!", hasSymbol]],
|
filter: ["all", single, ["!", hasSymbol]],
|
||||||
paint: {
|
layout: {
|
||||||
"circle-radius": ["interpolate", ["linear"], ["zoom"], 6, 3.5, 14, 6],
|
"icon-image": ["concat", BADGE_IMAGE_PREFIX, ["get", "color"]],
|
||||||
"circle-color": ["get", "color"],
|
"icon-size": ["interpolate", ["linear"], ["zoom"], 6, 8 / POI_ICON_IMAGE_SIZE, 14, 13 / POI_ICON_IMAGE_SIZE],
|
||||||
"circle-stroke-color": "#fff",
|
"icon-allow-overlap": true,
|
||||||
"circle-stroke-width": 1.5,
|
"icon-ignore-placement": true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this._map.addLayer({
|
this._map.addLayer({
|
||||||
|
|||||||
Reference in new issue
Block a user