mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-11-01 12:17:18 +00:00
Migration to new Rust-based engine (#401)
* wasm first steps * parsing start * parsing continued * progress * progress * progress * progress * progress * progress * progress * progress * fixes * reorganize * change type * fix * progress * refactoring * progress * progress * progress * keep style info * progress * progress * remove (copy) in name * progress * merge methods into 1 * splice * progress * progress * progress * cleaning * progress * progress * progress * visibility * progress * progress * progress * progress * progress * fixes * progress * fix markers * fix * progress * progress * progress * progress * progress * progress * small fix * use engine info * fix popups * small fix * progress * progress * progress * clean tool * handle self closing elements * reduce data exchanges across boundary * copy on wasm side to avoid any data corruption * speed fix * routing * refactoring * reverse * reverse * crop * split * merge * progress * time tool * fix bounds for waypoints * reduce * fix reactivity * handle corrupt time data * export * progress * remove gpx js package * remove todo * update readme * cleaning * progress * fix link fields * remove unused fields * refactoring and tests * import and export of routes, ref #192 * per-chunk categories storage * cross-tab sync * outdated state * refactoring * reorder methods * refactoring * fix * improve flow * renaming * progress * progress * fix * progress * per file history * keep original flag * use history variant * fix * progress * file explorer * progress * fix * sticky folders * improved sticky folders * fix sortable * fix sortable * fix * fix tab size * no file delete on desktop * fix routing on other file * fix sorting * remember language * open links in browser * commit missing changes * avoid selecting on resize * clarify filename * explorer actions * fix folder styling * drop anywhere in folder * cleaning * fixes * remove focus-ring * full screen * small fix * consistent highlight color * improved preview * performance improvements * sparser data transfers * sparser data transfers * show popup once data is loaded * fix routing control size * fix * sparse desktop build * remove custom ign styles * use new endpoint for openhikingmap * strip native menu * reorder context menu items * route full support * route - track conversion * create route file action * route export, filter out anchors at high zoom level * clarify name handling * move hide & center to view * routes continued * update docs * fix power format, closes #378 * lint fixes * fix display of additional data with gaps, closes #361 * fix linting issues * fix import modules * fix multidrag * change base to resolve * fix type errors * fix layer typings * fix last type error * each keys * improve typings * deploy to cloudflare --------- Co-authored-by: vcoppe <vcoppe@hexaly.com>
This commit is contained in:
1 parent
6a0d434371
commit
8fe7d8d64d
484 files changed
+53949
-41152
No files matched your search
@@ -1,171 +0,0 @@
|
||||
export const surfaceColors: { [key: string]: string } = {
|
||||
missing: '#d1d1d1',
|
||||
paved: '#8c8c8c',
|
||||
unpaved: '#6b443a',
|
||||
asphalt: '#8c8c8c',
|
||||
concrete: '#8c8c8c',
|
||||
cobblestone: '#ffd991',
|
||||
paving_stones: '#8c8c8c',
|
||||
sett: '#ffd991',
|
||||
metal: '#8c8c8c',
|
||||
wood: '#6b443a',
|
||||
compacted: '#ffffa8',
|
||||
fine_gravel: '#ffffa8',
|
||||
gravel: '#ffffa8',
|
||||
pebblestone: '#ffffa8',
|
||||
rock: '#ffd991',
|
||||
dirt: '#ffffa8',
|
||||
ground: '#6b443a',
|
||||
earth: '#6b443a',
|
||||
mud: '#6b443a',
|
||||
sand: '#ffffc4',
|
||||
grass: '#61b55c',
|
||||
grass_paver: '#61b55c',
|
||||
clay: '#6b443a',
|
||||
stone: '#ffd991',
|
||||
};
|
||||
|
||||
export function getSurfaceColor(surface: string): string {
|
||||
return surfaceColors[surface] ? surfaceColors[surface] : surfaceColors.missing;
|
||||
}
|
||||
|
||||
export const highwayColors: { [key: string]: string } = {
|
||||
missing: '#d1d1d1',
|
||||
motorway: '#ff4d33',
|
||||
motorway_link: '#ff4d33',
|
||||
trunk: '#ff5e4d',
|
||||
trunk_link: '#ff947f',
|
||||
primary: '#ff6e5c',
|
||||
primary_link: '#ff6e5c',
|
||||
secondary: '#ff8d7b',
|
||||
secondary_link: '#ff8d7b',
|
||||
tertiary: '#ffd75f',
|
||||
tertiary_link: '#ffd75f',
|
||||
unclassified: '#f1f2a5',
|
||||
road: '#f1f2a5',
|
||||
residential: '#73b2ff',
|
||||
living_street: '#73b2ff',
|
||||
service: '#9c9cd9',
|
||||
track: '#a8e381',
|
||||
footway: '#a8e381',
|
||||
path: '#a8e381',
|
||||
pedestrian: '#a8e381',
|
||||
cycleway: '#9de2ff',
|
||||
construction: '#e09a4a',
|
||||
bridleway: '#946f43',
|
||||
raceway: '#ff0000',
|
||||
rest_area: '#9c9cd9',
|
||||
services: '#9c9cd9',
|
||||
corridor: '#474747',
|
||||
elevator: '#474747',
|
||||
steps: '#474747',
|
||||
bus_stop: '#8545a3',
|
||||
busway: '#8545a3',
|
||||
via_ferrata: '#474747',
|
||||
};
|
||||
|
||||
export const sacScaleColors: { [key: string]: string } = {
|
||||
hiking: '#007700',
|
||||
mountain_hiking: '#1843ad',
|
||||
demanding_mountain_hiking: '#ffff00',
|
||||
alpine_hiking: '#ff9233',
|
||||
demanding_alpine_hiking: '#ff0000',
|
||||
difficult_alpine_hiking: '#000000',
|
||||
};
|
||||
|
||||
export const mtbScaleColors: { [key: string]: string } = {
|
||||
'0-': '#007700',
|
||||
'0': '#007700',
|
||||
'0+': '#007700',
|
||||
'1-': '#1843ad',
|
||||
'1': '#1843ad',
|
||||
'1+': '#1843ad',
|
||||
'2-': '#ffff00',
|
||||
'2': '#ffff00',
|
||||
'2+': '#ffff00',
|
||||
'3': '#ff0000',
|
||||
'4': '#00ff00',
|
||||
'5': '#000000',
|
||||
'6': '#b105eb',
|
||||
};
|
||||
|
||||
function createPattern(
|
||||
backgroundColor: string,
|
||||
sacScaleColor: string | undefined,
|
||||
mtbScaleColor: string | undefined,
|
||||
size: number = 16,
|
||||
lineWidth: number = 4
|
||||
) {
|
||||
let canvas = document.createElement('canvas');
|
||||
canvas.width = size;
|
||||
canvas.height = size;
|
||||
let ctx = canvas.getContext('2d');
|
||||
if (ctx) {
|
||||
ctx.fillStyle = backgroundColor;
|
||||
ctx.fillRect(0, 0, size, size);
|
||||
ctx.lineWidth = lineWidth;
|
||||
|
||||
const halfSize = size / 2;
|
||||
const halfLineWidth = lineWidth / 2;
|
||||
if (sacScaleColor) {
|
||||
ctx.strokeStyle = sacScaleColor;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(halfSize - halfLineWidth, -halfLineWidth);
|
||||
ctx.lineTo(size + halfLineWidth, halfSize + halfLineWidth);
|
||||
ctx.stroke();
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-halfLineWidth, halfSize - halfLineWidth);
|
||||
ctx.lineTo(halfSize + halfLineWidth, size + halfLineWidth);
|
||||
ctx.stroke();
|
||||
}
|
||||
if (mtbScaleColor) {
|
||||
ctx.strokeStyle = mtbScaleColor;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(halfSize - halfLineWidth, size + halfLineWidth);
|
||||
ctx.lineTo(size + halfLineWidth, halfSize - halfLineWidth);
|
||||
ctx.stroke();
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-halfLineWidth, halfSize + halfLineWidth);
|
||||
ctx.lineTo(halfSize + halfLineWidth, -halfLineWidth);
|
||||
ctx.stroke();
|
||||
}
|
||||
}
|
||||
return ctx?.createPattern(canvas, 'repeat') || backgroundColor;
|
||||
}
|
||||
|
||||
const patterns: Record<string, string | CanvasPattern> = {};
|
||||
export function getHighwayColor(
|
||||
highway: string,
|
||||
sacScale: string | undefined,
|
||||
mtbScale: string | undefined
|
||||
) {
|
||||
let backgroundColor = highwayColors[highway] ? highwayColors[highway] : highwayColors.missing;
|
||||
let sacScaleColor = sacScale ? sacScaleColors[sacScale] : undefined;
|
||||
let mtbScaleColor = mtbScale ? mtbScaleColors[mtbScale] : undefined;
|
||||
if (sacScale || mtbScale) {
|
||||
let patternId = `${backgroundColor}-${[sacScale, mtbScale].filter((x) => x).join('-')}`;
|
||||
if (!patterns[patternId]) {
|
||||
patterns[patternId] = createPattern(backgroundColor, sacScaleColor, mtbScaleColor);
|
||||
}
|
||||
return patterns[patternId];
|
||||
}
|
||||
return backgroundColor;
|
||||
}
|
||||
|
||||
const maxSlope = 20;
|
||||
export function getSlopeColor(slope: number): string {
|
||||
if (slope > maxSlope) {
|
||||
slope = maxSlope;
|
||||
} else if (slope < -maxSlope) {
|
||||
slope = -maxSlope;
|
||||
}
|
||||
|
||||
let v = slope / maxSlope;
|
||||
v = 1 / (1 + Math.exp(-6 * v));
|
||||
v = v - 0.5;
|
||||
|
||||
let hue = ((0.5 - v) * 120).toString(10);
|
||||
let lightness = 90 - Math.abs(v) * 70;
|
||||
|
||||
return `hsl(${hue},70%,${lightness}%)`;
|
||||
}
|
||||
@@ -1,863 +0,0 @@
|
||||
{
|
||||
"_info": "Taken from https://github.com/mjaschen/gravel-overlay, with prior authorization from the author (https://github.com/gpxstudio/gpx.studio/issues/32#issuecomment-2320219804).",
|
||||
"version": 8,
|
||||
"name": "Gravel Overlay",
|
||||
"metadata": {
|
||||
"mapbox:autocomposite": false,
|
||||
"mapbox:type": "template",
|
||||
"maputnik:renderer": "mbgljs",
|
||||
"openmaptiles:version": "3.x",
|
||||
"openmaptiles:mapbox:owner": "openmaptiles",
|
||||
"openmaptiles:mapbox:source:url": "mapbox://openmaptiles.4qljc88t"
|
||||
},
|
||||
"sources": {
|
||||
"openmaptiles": {
|
||||
"type": "vector",
|
||||
"url": "https://tiles.bikerouter.de/services/gravel/"
|
||||
}
|
||||
},
|
||||
"sprite": "https://demotiles.maplibre.org/styles/osm-bright-gl-style/sprite",
|
||||
"layers": [
|
||||
{
|
||||
"id": "background",
|
||||
"type": "background",
|
||||
"layout": {
|
||||
"visibility": "none"
|
||||
},
|
||||
"paint": {
|
||||
"background-color": "rgba(145, 211, 164, 1)"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "debug_rail",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"filter": ["all", ["==", "$type", "LineString"], ["in", "class", "rail"]],
|
||||
"layout": {
|
||||
"visibility": "none"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(144, 144, 144, 1)"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "debug_road",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"filter": [
|
||||
"all",
|
||||
["==", "$type", "LineString"],
|
||||
[
|
||||
"in",
|
||||
"class",
|
||||
"motorway",
|
||||
"trunk",
|
||||
"primary",
|
||||
"secondary",
|
||||
"tertiary",
|
||||
"minor",
|
||||
"residential",
|
||||
"track",
|
||||
"path"
|
||||
]
|
||||
],
|
||||
"layout": {
|
||||
"visibility": "none"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(204, 204, 204, 1)",
|
||||
"line-width": {
|
||||
"stops": [
|
||||
[10, 0.5],
|
||||
[12, 1]
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "tr_X_g45-bg",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", ["geometry-type"], "LineString"],
|
||||
["match", ["get", "class"], ["track"], true, false],
|
||||
[
|
||||
"any",
|
||||
["match", ["get", "tracktype"], ["grade5"], true, false],
|
||||
[
|
||||
"all",
|
||||
["match", ["get", "tracktype"], ["grade4"], true, false],
|
||||
["match", ["get", "surface"], ["dirt", "grass", "mud", "sand"], true, false]
|
||||
]
|
||||
]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "square",
|
||||
"line-join": "bevel",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(255, 0, 0, 0.7)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.4],
|
||||
[12, 1.3],
|
||||
[14, 1.7]
|
||||
]
|
||||
},
|
||||
"line-dasharray": [1],
|
||||
"line-offset": {
|
||||
"stops": [
|
||||
[12, 0],
|
||||
[13, 1.8],
|
||||
[15, 3],
|
||||
[16, 4]
|
||||
],
|
||||
"base": 1.55
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "tr_X_g45",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", ["geometry-type"], "LineString"],
|
||||
["match", ["get", "class"], ["track"], true, false],
|
||||
[
|
||||
"any",
|
||||
["match", ["get", "tracktype"], ["grade5"], true, false],
|
||||
[
|
||||
"all",
|
||||
["match", ["get", "tracktype"], ["grade4"], true, false],
|
||||
["match", ["get", "surface"], ["dirt", "grass", "mud", "sand"], true, false]
|
||||
]
|
||||
]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "square",
|
||||
"line-join": "bevel",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(255, 255, 0, 0.7)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.4],
|
||||
[12, 1.3],
|
||||
[14, 1.7]
|
||||
]
|
||||
},
|
||||
"line-dasharray": [2, 2],
|
||||
"line-offset": {
|
||||
"stops": [
|
||||
[12, 0],
|
||||
[13, 1.8],
|
||||
[15, 3],
|
||||
[16, 4]
|
||||
],
|
||||
"base": 1.55
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "tr_B_g3",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", ["geometry-type"], "LineString"],
|
||||
["==", ["get", "class"], "track"],
|
||||
["match", ["get", "tracktype"], ["grade3"], true, false],
|
||||
[
|
||||
"any",
|
||||
["match", ["get", "smoothness"], ["bad", "good", "intermediate"], true, false],
|
||||
[
|
||||
"match",
|
||||
["get", "surface"],
|
||||
["compacted", "fine_gravel", "gravel"],
|
||||
true,
|
||||
false
|
||||
]
|
||||
]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "butt",
|
||||
"line-join": "miter",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(235, 6, 158, 1)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.4],
|
||||
[12, 1.3],
|
||||
[14, 1.7]
|
||||
]
|
||||
},
|
||||
"line-offset": {
|
||||
"stops": [
|
||||
[12, 0],
|
||||
[13, 2],
|
||||
[15, 4],
|
||||
[16, 5]
|
||||
],
|
||||
"base": 1.55
|
||||
},
|
||||
"line-dasharray": [3, 1.5]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "tr_A_g2-plain-case",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", ["geometry-type"], "LineString"],
|
||||
["==", ["get", "class"], "track"],
|
||||
["match", ["get", "tracktype"], ["grade2"], true, false],
|
||||
["!", ["has", "surface"]],
|
||||
["!", ["has", "smoothness"]]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "butt",
|
||||
"line-join": "miter",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(255, 255, 255, 0.6)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.8],
|
||||
[12, 3],
|
||||
[14, 4]
|
||||
]
|
||||
},
|
||||
"line-offset": {
|
||||
"stops": [
|
||||
[12, 0],
|
||||
[13, 1.5],
|
||||
[15, 3],
|
||||
[16, 4]
|
||||
],
|
||||
"base": 1.55
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "tr_A_g2-plain",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", ["geometry-type"], "LineString"],
|
||||
["==", ["get", "class"], "track"],
|
||||
["match", ["get", "tracktype"], ["grade2"], true, false],
|
||||
["!", ["has", "surface"]],
|
||||
["!", ["has", "smoothness"]]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "butt",
|
||||
"line-join": "miter",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(235, 6, 158, 0.6)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.5],
|
||||
[12, 1.5],
|
||||
[14, 2]
|
||||
]
|
||||
},
|
||||
"line-offset": {
|
||||
"stops": [
|
||||
[12, 0],
|
||||
[13, 1.5],
|
||||
[15, 3],
|
||||
[16, 4]
|
||||
],
|
||||
"base": 1.55
|
||||
},
|
||||
"line-dasharray": [5, 1]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "tr_A_g2-case",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", ["geometry-type"], "LineString"],
|
||||
["==", ["get", "class"], "track"],
|
||||
["match", ["get", "tracktype"], ["grade2"], true, false],
|
||||
[
|
||||
"any",
|
||||
[
|
||||
"match",
|
||||
["get", "surface"],
|
||||
["compacted", "fine_gravel", "gravel"],
|
||||
true,
|
||||
false
|
||||
],
|
||||
["match", ["get", "smoothness"], ["bad", "good", "intermediate"], true, false]
|
||||
]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "butt",
|
||||
"line-join": "miter",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(255, 255, 255, 1)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.8],
|
||||
[12, 3],
|
||||
[14, 4]
|
||||
]
|
||||
},
|
||||
"line-offset": {
|
||||
"stops": [
|
||||
[12, 0],
|
||||
[13, 2],
|
||||
[15, 4],
|
||||
[16, 5]
|
||||
],
|
||||
"base": 1.55
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "tr_A_g2",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", ["geometry-type"], "LineString"],
|
||||
["==", ["get", "class"], "track"],
|
||||
["match", ["get", "tracktype"], ["grade2"], true, false],
|
||||
[
|
||||
"any",
|
||||
[
|
||||
"match",
|
||||
["get", "surface"],
|
||||
["compacted", "fine_gravel", "gravel"],
|
||||
true,
|
||||
false
|
||||
],
|
||||
["match", ["get", "smoothness"], ["bad", "good", "intermediate"], true, false]
|
||||
]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "butt",
|
||||
"line-join": "miter",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(235, 6, 158, 1)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.5],
|
||||
[12, 1.5],
|
||||
[14, 2]
|
||||
]
|
||||
},
|
||||
"line-offset": {
|
||||
"stops": [
|
||||
[12, 0],
|
||||
[13, 2],
|
||||
[15, 4],
|
||||
[16, 5]
|
||||
],
|
||||
"base": 1.55
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "p_X-bg",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", "$type", "LineString"],
|
||||
["in", "class", "path"],
|
||||
["in", "smoothness", "very_bad", "horrible", "very_horrible", "impassable"],
|
||||
["!in", "tracktype", "grade5", "grade4"]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "square",
|
||||
"line-join": "bevel",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(255, 0, 0, 0.7)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.4],
|
||||
[12, 1.1],
|
||||
[14, 1.5]
|
||||
]
|
||||
},
|
||||
"line-offset": {
|
||||
"stops": [
|
||||
[12, 0],
|
||||
[13, 1.8],
|
||||
[15, 3],
|
||||
[16, 4]
|
||||
],
|
||||
"base": 1.55
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "p_X",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", "$type", "LineString"],
|
||||
["in", "class", "path"],
|
||||
["in", "smoothness", "very_bad", "horrible", "very_horrible", "impassable"],
|
||||
["!in", "tracktype", "grade5", "grade4"]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "square",
|
||||
"line-join": "bevel",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(255, 255, 0, 0.7)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.4],
|
||||
[12, 1.1],
|
||||
[14, 1.5]
|
||||
]
|
||||
},
|
||||
"line-dasharray": [2, 2],
|
||||
"line-offset": {
|
||||
"stops": [
|
||||
[12, 0],
|
||||
[13, 1.8],
|
||||
[15, 3],
|
||||
[16, 4]
|
||||
],
|
||||
"base": 1.55
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "p_B",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", "$type", "LineString"],
|
||||
["==", "class", "path"],
|
||||
["in", "smoothness", "good", "intermediate", "bad"],
|
||||
[
|
||||
"!in",
|
||||
"surface",
|
||||
"gravel",
|
||||
"fine_gravel",
|
||||
"compacted",
|
||||
"cobblestone",
|
||||
"sett",
|
||||
"unhewn_cobblestone",
|
||||
"paving_stones"
|
||||
],
|
||||
["!in", "bicycle", "no"],
|
||||
["!in", "access", "no"]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "butt",
|
||||
"line-join": "miter",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(235, 6, 158, 1)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.4],
|
||||
[12, 1.1],
|
||||
[14, 1.5]
|
||||
]
|
||||
},
|
||||
"line-offset": {
|
||||
"stops": [
|
||||
[12, 0],
|
||||
[13, 2],
|
||||
[15, 4],
|
||||
[16, 5]
|
||||
],
|
||||
"base": 1.55
|
||||
},
|
||||
"line-dasharray": [1.5, 1]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "p_A-case",
|
||||
"type": "line",
|
||||
"metadata": {
|
||||
"maputnik:comment": "Gravel surface with ok-ish smoothness"
|
||||
},
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", ["geometry-type"], "LineString"],
|
||||
["==", ["get", "class"], "path"],
|
||||
[
|
||||
"any",
|
||||
["match", ["get", "surface"], ["compacted", "fine_gravel"], true, false],
|
||||
[
|
||||
"all",
|
||||
["match", ["get", "surface"], ["gravel"], true, false],
|
||||
[
|
||||
"match",
|
||||
["get", "smoothness"],
|
||||
["bad", "good", "intermediate"],
|
||||
true,
|
||||
false
|
||||
]
|
||||
]
|
||||
],
|
||||
["match", ["get", "bicycle"], ["no"], false, true],
|
||||
["match", ["get", "access"], ["no"], false, true]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "butt",
|
||||
"line-join": "miter",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(255, 255, 255, 1)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.7],
|
||||
[12, 2.5],
|
||||
[14, 3.2]
|
||||
]
|
||||
},
|
||||
"line-offset": {
|
||||
"stops": [
|
||||
[12, 0],
|
||||
[13, 2],
|
||||
[15, 4],
|
||||
[16, 5]
|
||||
],
|
||||
"base": 1.55
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "p_A",
|
||||
"type": "line",
|
||||
"metadata": {
|
||||
"maputnik:comment": "Gravel surface with ok-ish smoothness"
|
||||
},
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", ["geometry-type"], "LineString"],
|
||||
["==", ["get", "class"], "path"],
|
||||
[
|
||||
"any",
|
||||
["match", ["get", "surface"], ["compacted", "fine_gravel"], true, false],
|
||||
[
|
||||
"all",
|
||||
["match", ["get", "surface"], ["gravel"], true, false],
|
||||
[
|
||||
"match",
|
||||
["get", "smoothness"],
|
||||
["bad", "good", "intermediate"],
|
||||
true,
|
||||
false
|
||||
]
|
||||
]
|
||||
],
|
||||
["match", ["get", "bicycle"], ["no"], false, true],
|
||||
["match", ["get", "access"], ["no"], false, true]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "butt",
|
||||
"line-join": "miter",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(235, 6, 158, 1)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.5],
|
||||
[12, 1.5],
|
||||
[14, 2]
|
||||
]
|
||||
},
|
||||
"line-offset": {
|
||||
"stops": [
|
||||
[12, 0],
|
||||
[13, 2],
|
||||
[15, 4],
|
||||
[16, 5]
|
||||
],
|
||||
"base": 1.55
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "r_X_cobbles-case",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", "$type", "LineString"],
|
||||
["in", "class", "minor", "service", "track", "path", "residential"],
|
||||
["in", "surface", "sett", "cobblestone", "unhewn_cobblestone"],
|
||||
["!in", "service", "driveway"]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "butt",
|
||||
"line-join": "miter",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(0, 0, 0, 1)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.5],
|
||||
[12, 1.5],
|
||||
[14, 2]
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "r_X_cobbles",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", "$type", "LineString"],
|
||||
["in", "class", "minor", "service", "track", "path", "residential"],
|
||||
["in", "surface", "sett", "cobblestone", "unhewn_cobblestone"],
|
||||
["!in", "service", "driveway"]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "butt",
|
||||
"line-join": "miter",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(245, 255, 0, 1)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.5],
|
||||
[12, 1.5],
|
||||
[14, 2]
|
||||
]
|
||||
},
|
||||
"line-dasharray": [1.5, 1]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "r_X-bg",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", "$type", "LineString"],
|
||||
["in", "class", "minor"],
|
||||
["in", "smoothness", "very_bad", "horrible", "very_horrible", "impassable"],
|
||||
["!in", "surface", "sett", "cobblestone", "unhewn_cobblestone"]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "square",
|
||||
"line-join": "bevel",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(255, 0, 0, 0.7)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.4],
|
||||
[12, 1.1],
|
||||
[14, 1.5]
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "r_X",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", "$type", "LineString"],
|
||||
["in", "class", "minor"],
|
||||
["in", "smoothness", "very_bad", "horrible", "very_horrible", "impassable"],
|
||||
["!in", "surface", "sett", "cobblestone", "unhewn_cobblestone"]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "square",
|
||||
"line-join": "bevel",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(255, 255, 0, 0.7)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.4],
|
||||
[12, 1.1],
|
||||
[14, 1.5]
|
||||
]
|
||||
},
|
||||
"line-dasharray": [2, 2]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "r_A_case",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", "$type", "LineString"],
|
||||
["in", "class", "minor", "residential", "service"],
|
||||
["in", "surface", "gravel", "compacted", "fine_gravel"],
|
||||
["!in", "service", "driveway", "parking_aisle", "drive-through", "emergency_access"]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "square",
|
||||
"line-join": "bevel",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(255, 255, 255, 1)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.8],
|
||||
[12, 3],
|
||||
[14, 4]
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "r_A",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"minzoom": 10,
|
||||
"filter": [
|
||||
"all",
|
||||
["==", "$type", "LineString"],
|
||||
["in", "class", "minor", "residential", "service"],
|
||||
["in", "surface", "gravel", "compacted", "fine_gravel"],
|
||||
["!in", "service", "driveway", "parking_aisle", "drive-through", "emergency_access"]
|
||||
],
|
||||
"layout": {
|
||||
"line-cap": "square",
|
||||
"line-join": "bevel",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "rgba(235, 6, 158, 1)",
|
||||
"line-width": {
|
||||
"base": 1.55,
|
||||
"stops": [
|
||||
[10, 0.5],
|
||||
[12, 1.5],
|
||||
[14, 2]
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "cemetery",
|
||||
"type": "symbol",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "landuse",
|
||||
"filter": ["all", ["==", "class", "cemetery"]],
|
||||
"layout": {
|
||||
"icon-image": "cemetery_11",
|
||||
"icon-rotation-alignment": "map",
|
||||
"icon-size": 1.5
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "drinking_water",
|
||||
"type": "symbol",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "poi",
|
||||
"minzoom": 9,
|
||||
"maxzoom": 20,
|
||||
"filter": [
|
||||
"any",
|
||||
["==", "class", "drinking_water"],
|
||||
["==", "subclass", "drinking_water"]
|
||||
],
|
||||
"layout": {
|
||||
"icon-image": "drinking_water_11",
|
||||
"visibility": "visible",
|
||||
"icon-rotation-alignment": "map",
|
||||
"icon-size": 1.4
|
||||
}
|
||||
}
|
||||
],
|
||||
"id": "basic",
|
||||
"owner": "Marcus Jaschen"
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,4 +0,0 @@
|
||||
import { parseGPX } from 'gpx';
|
||||
export const exampleGPXFile = parseGPX(
|
||||
`<?xml version="1.0" encoding="UTF-8"?><gpx creator="StravaGPX" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd http://www.garmin.com/xmlschemas/PowerExtension/v1 http://www.garmin.com/xmlschemas/PowerExtensionv1.xsd http://www.topografix.com/GPX/gpx_style/0/2 http://www.topografix.com/GPX/gpx_style/0/2/gpx_style.xsd" version="1.1" xmlns="http://www.topografix.com/GPX/1/1" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:gpxpx="http://www.garmin.com/xmlschemas/PowerExtension/v1" xmlns:gpx_style="http://www.topografix.com/GPX/gpx_style/0/2"><metadata><name>Example</name><author><name>gpx.studio</name><link href="https://gpx.studio"/></author><time>2023-08-20T12:42:07.000Z</time></metadata><trk><name>Example</name><type>cycling</type><trkseg><trkpt lat="48.745764" lon="-66.658624"><ele>290.4</ele><time>2022-12-31T23:00:00.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>18</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.745974" lon="-66.658127"><ele>292.8</ele><time>2022-12-31T23:00:14.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>18</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.746592" lon="-66.658472"><ele>303.6</ele><time>2022-12-31T23:00:46.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>18</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.748063" lon="-66.660451"><ele>331.8</ele><time>2022-12-31T23:02:31.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>19</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.749297" lon="-66.650629"><ele>366</ele><time>2022-12-31T23:05:46.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>22</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.751879" lon="-66.646183"><ele>371.2</ele><time>2022-12-31T23:07:04.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>22</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.754389" lon="-66.646388"><ele>376</ele><time>2022-12-31T23:08:01.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>22</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.755973" lon="-66.642677"><ele>376.6</ele><time>2022-12-31T23:09:01.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>21</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.756134" lon="-66.640854"><ele>377.6</ele><time>2022-12-31T23:09:27.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>20</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.759941" lon="-66.633175"><ele>376.8</ele><time>2022-12-31T23:11:23.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>20</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.765632" lon="-66.635593"><ele>410.6</ele><time>2022-12-31T23:14:38.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>23</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.764883" lon="-66.630508"><ele>390.4</ele><time>2022-12-31T23:15:42.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>23</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.772418" lon="-66.633652"><ele>419.8</ele><time>2022-12-31T23:19:41.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>19</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.775935" lon="-66.633982"><ele>430</ele><time>2022-12-31T23:21:25.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>19</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.779656" lon="-66.636621"><ele>430.2</ele><time>2022-12-31T23:23:04.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>18</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.780914" lon="-66.636833"><ele>431.2</ele><time>2022-12-31T23:23:32.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>18</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.7868" lon="-66.632505"><ele>434</ele><time>2022-12-31T23:26:05.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>17</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions></trkpt><trkpt lat="48.787548" lon="-66.632642"><ele>435.6</ele><time>2022-12-31T23:26:28.024Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:atemp>17</gpxtpx:atemp></gpxtpx:TrackPointExtension></extensions>
Line truncated
|
||||
);
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,139 +0,0 @@
|
||||
import {
|
||||
Landmark,
|
||||
Shell,
|
||||
Bike,
|
||||
Building,
|
||||
Tent,
|
||||
Car,
|
||||
Wrench,
|
||||
ShoppingBasket,
|
||||
Droplet,
|
||||
DoorOpen,
|
||||
Trees,
|
||||
Fuel,
|
||||
House,
|
||||
Info,
|
||||
TreeDeciduous,
|
||||
CircleParking,
|
||||
Cross,
|
||||
Utensils,
|
||||
Construction,
|
||||
BrickWall,
|
||||
ShowerHead,
|
||||
Mountain,
|
||||
Phone,
|
||||
TrainFront,
|
||||
Bed,
|
||||
Binoculars,
|
||||
TriangleAlert,
|
||||
Anchor,
|
||||
Toilet,
|
||||
X,
|
||||
type IconProps,
|
||||
} from '@lucide/svelte';
|
||||
import {
|
||||
Landmark as LandmarkSvg,
|
||||
Shell as ShellSvg,
|
||||
Bike as BikeSvg,
|
||||
Building as BuildingSvg,
|
||||
Tent as TentSvg,
|
||||
Car as CarSvg,
|
||||
Wrench as WrenchSvg,
|
||||
ShoppingBasket as ShoppingBasketSvg,
|
||||
Droplet as DropletSvg,
|
||||
DoorOpen as DoorOpenSvg,
|
||||
Trees as TreesSvg,
|
||||
Fuel as FuelSvg,
|
||||
House as HouseSvg,
|
||||
Info as InfoSvg,
|
||||
TreeDeciduous as TreeDeciduousSvg,
|
||||
CircleParking as CircleParkingSvg,
|
||||
Cross as CrossSvg,
|
||||
Utensils as UtensilsSvg,
|
||||
Construction as ConstructionSvg,
|
||||
BrickWall as BrickWallSvg,
|
||||
ShowerHead as ShowerHeadSvg,
|
||||
Mountain as MountainSvg,
|
||||
Phone as PhoneSvg,
|
||||
TrainFront as TrainFrontSvg,
|
||||
Bed as BedSvg,
|
||||
Binoculars as BinocularsSvg,
|
||||
TriangleAlert as TriangleAlertSvg,
|
||||
Anchor as AnchorSvg,
|
||||
Toilet as ToiletSvg,
|
||||
X as XSvg,
|
||||
} from 'lucide-static';
|
||||
import type { Component } from 'svelte';
|
||||
|
||||
export type Symbol = {
|
||||
value: string;
|
||||
icon?: Component<IconProps>;
|
||||
iconSvg?: string;
|
||||
};
|
||||
|
||||
export const symbols: { [key: string]: Symbol } = {
|
||||
alert: { value: 'Alert', icon: TriangleAlert, iconSvg: TriangleAlertSvg },
|
||||
anchor: { value: 'Anchor', icon: Anchor, iconSvg: AnchorSvg },
|
||||
bank: { value: 'Bank', icon: Landmark, iconSvg: LandmarkSvg },
|
||||
beach: { value: 'Beach', icon: Shell, iconSvg: ShellSvg },
|
||||
bike_trail: { value: 'Bike Trail', icon: Bike, iconSvg: BikeSvg },
|
||||
binoculars: { value: 'Binoculars', icon: Binoculars, iconSvg: BinocularsSvg },
|
||||
bridge: { value: 'Bridge' },
|
||||
building: { value: 'Building', icon: Building, iconSvg: BuildingSvg },
|
||||
campground: { value: 'Campground', icon: Tent, iconSvg: TentSvg },
|
||||
car: { value: 'Car', icon: Car, iconSvg: CarSvg },
|
||||
car_repair: { value: 'Car Repair', icon: Wrench, iconSvg: WrenchSvg },
|
||||
convenience_store: {
|
||||
value: 'Convenience Store',
|
||||
icon: ShoppingBasket,
|
||||
iconSvg: ShoppingBasketSvg,
|
||||
},
|
||||
crossing: {
|
||||
value: 'Crossing',
|
||||
icon: X,
|
||||
iconSvg: XSvg,
|
||||
},
|
||||
department_store: {
|
||||
value: 'Department Store',
|
||||
icon: ShoppingBasket,
|
||||
iconSvg: ShoppingBasketSvg,
|
||||
},
|
||||
drinking_water: { value: 'Drinking Water', icon: Droplet, iconSvg: DropletSvg },
|
||||
exit: { value: 'Exit', icon: DoorOpen, iconSvg: DoorOpenSvg },
|
||||
lodge: { value: 'Lodge', icon: House, iconSvg: HouseSvg },
|
||||
lodging: { value: 'Lodging', icon: Bed, iconSvg: BedSvg },
|
||||
forest: { value: 'Forest', icon: Trees, iconSvg: TreesSvg },
|
||||
gas_station: { value: 'Gas Station', icon: Fuel, iconSvg: FuelSvg },
|
||||
ground_transportation: {
|
||||
value: 'Ground Transportation',
|
||||
icon: TrainFront,
|
||||
iconSvg: TrainFrontSvg,
|
||||
},
|
||||
hotel: { value: 'Hotel', icon: Bed, iconSvg: BedSvg },
|
||||
house: { value: 'House', icon: House, iconSvg: HouseSvg },
|
||||
information: { value: 'Information', icon: Info, iconSvg: InfoSvg },
|
||||
park: { value: 'Park', icon: TreeDeciduous, iconSvg: TreeDeciduousSvg },
|
||||
parking_area: { value: 'Parking Area', icon: CircleParking, iconSvg: CircleParkingSvg },
|
||||
pharmacy: { value: 'Pharmacy', icon: Cross, iconSvg: CrossSvg },
|
||||
picnic_area: { value: 'Picnic Area', icon: Utensils, iconSvg: UtensilsSvg },
|
||||
restaurant: { value: 'Restaurant', icon: Utensils, iconSvg: UtensilsSvg },
|
||||
restricted_area: { value: 'Restricted Area', icon: Construction, iconSvg: ConstructionSvg },
|
||||
restroom: { value: 'Restroom', icon: Toilet, iconSvg: ToiletSvg },
|
||||
road: { value: 'Road', icon: BrickWall, iconSvg: BrickWallSvg },
|
||||
scenic_area: { value: 'Scenic Area', icon: Binoculars, iconSvg: BinocularsSvg },
|
||||
shelter: { value: 'Shelter', icon: Tent, iconSvg: TentSvg },
|
||||
shopping_center: { value: 'Shopping Center', icon: ShoppingBasket },
|
||||
shower: { value: 'Shower', icon: ShowerHead, iconSvg: ShowerHeadSvg },
|
||||
summit: { value: 'Summit', icon: Mountain, iconSvg: MountainSvg },
|
||||
telephone: { value: 'Telephone', icon: Phone, iconSvg: PhoneSvg },
|
||||
tunnel: { value: 'Tunnel' },
|
||||
water_source: { value: 'Water Source', icon: Droplet, iconSvg: DropletSvg },
|
||||
};
|
||||
|
||||
export function getSymbolKey(value: string | undefined): string | undefined {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
} else {
|
||||
return Object.keys(symbols).find((key) => symbols[key].value === value);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user