3 Commits

Author SHA1 Message Date
vcoppe 0b4aa6e90d New translations elevation.mdx (Chinese Simplified)
[ci skip]
2026-06-01 04:25:51 +02:00
vcoppe 3b59b0bada New translations en.json (Chinese Simplified)
[ci skip]
2026-06-01 04:25:49 +02:00
vcoppe 604faff238 New translations map-controls.mdx (Chinese Simplified)
[ci skip]
2026-06-01 04:25:48 +02:00
6 changed files with 25 additions and 34 deletions
@@ -45,6 +45,26 @@
settings.initialize(); settings.initialize();
function applyOptions() { function applyOptions() {
let downloads: Promise<GPXFile | null>[] = getFilesFromEmbeddingOptions(options).map(
(url) => {
return fetch(url)
.then((response) => response.blob())
.then((blob) => new File([blob], url.split('/').pop() ?? url))
.then(loadFile);
}
);
Promise.all(downloads).then((answers) => {
const files = answers.filter((file) => file !== null) as GPXFile[];
let ids: string[] = [];
files.forEach((file, index) => {
let id = `gpx-${index}-embed`;
file._data.id = id;
ids.push(id);
});
fileStateCollection.setEmbeddedFiles(files);
$fileOrder = ids;
selection.selectAll();
});
if (allowedEmbeddingBasemaps.includes(options.basemap)) { if (allowedEmbeddingBasemaps.includes(options.basemap)) {
$currentBasemap = options.basemap; $currentBasemap = options.basemap;
} }
@@ -70,27 +90,6 @@
].filter((dataset) => dataset !== null) ].filter((dataset) => dataset !== null)
); );
elevationFill.set(options.elevation.fill == 'none' ? undefined : options.elevation.fill); elevationFill.set(options.elevation.fill == 'none' ? undefined : options.elevation.fill);
let downloads: Promise<GPXFile | null>[] = getFilesFromEmbeddingOptions(options).map(
(url) => {
return fetch(url)
.then((response) => response.blob())
.then((blob) => new File([blob], url.split('/').pop() ?? url))
.then(loadFile);
}
);
Promise.all(downloads).then((answers) => {
const files = answers.filter((file) => file !== null) as GPXFile[];
let ids: string[] = [];
files.forEach((file, index) => {
let id = `gpx-${index}-embed`;
file._data.id = id;
ids.push(id);
});
fileStateCollection.setEmbeddedFiles(files);
$fileOrder = ids;
selection.selectAll();
});
} }
$effect(() => { $effect(() => {
@@ -88,14 +88,6 @@
<span class="font-mono">{key}</span> <span class="font-mono">{key}</span>
{#if key === 'website' || key.startsWith('website:') || key.endsWith(':website') || key === 'contact:facebook' || key === 'contact:instagram' || key === 'contact:twitter'} {#if key === 'website' || key.startsWith('website:') || key.endsWith(':website') || key === 'contact:facebook' || key === 'contact:instagram' || key === 'contact:twitter'}
<a href={value} target="_blank" class="text-link underline">{value}</a> <a href={value} target="_blank" class="text-link underline">{value}</a>
{:else if key === 'wikipedia' || key.startsWith('wikipedia:') || key.endsWith(':wikipedia')}
<a
href="https://wikipedia.org/wiki/{value}"
target="_blank"
class="text-link underline"
>
{value}
</a>
{:else if key === 'phone' || key === 'contact:phone'} {:else if key === 'phone' || key === 'contact:phone'}
<a href={'tel:' + value} class="text-link underline">{value}</a> <a href={'tel:' + value} class="text-link underline">{value}</a>
{:else if key === 'email' || key === 'contact:email'} {:else if key === 'email' || key === 'contact:email'}
+1 -1
View File
@@ -59,7 +59,7 @@ title: 地图控件
<DocsLayers /> <DocsLayers />
<span class="text-sm text-center mt-2"> <span class="text-sm text-center mt-2">
Hover over the map to show the <a href="https://hiking.waymarkedtrails.org" target="_blank">Waymarked Trails hiking</a> overlay on top of the topographic basemap. 鼠标悬停在地图上,可在地形图底图上方显示 <a href="https://hiking.waymarkedtrails.org" target="_blank">Waymarked Trails 徒步路线</a> 叠加层。
</span> </span>
</div> </div>
@@ -18,7 +18,7 @@ title: 请求海拔数据
<DocsNote> <DocsNote>
Elevation data is provided by <a href="https://mapterhorn.com" target="_blank">Mapterhorn</a>. 海拔数据来自 <a href="https://mapterhorn.com" target="_blank">Mapterhorn</a>
You can learn more about its origin and accuracy in the <a href="https://mapterhorn.com/attribution/" target="_blank">documentation</a>. 查阅 <a href="https://mapterhorn.com/attribution/" target="_blank">官方文档</a> 以了解海拔数据来源及其准确度。
</DocsNote> </DocsNote>
+1 -1
View File
@@ -75,7 +75,7 @@ export class BoundsManager {
this._unsubscribes.push( this._unsubscribes.push(
map.subscribe((map_) => { map.subscribe((map_) => {
if (!map_) return; if (!map_) return;
map_.fitBounds(this._bounds, { padding: 80, linear: true, animate: false }); map_.fitBounds(this._bounds, { padding: 80, linear: true, easing: () => 1 });
this.reset(); this.reset();
}) })
); );
+1 -1
View File
@@ -235,7 +235,7 @@
}, },
"elevation": { "elevation": {
"button": "请求海拔数据", "button": "请求海拔数据",
"help": "Requesting elevation data will erase the existing elevation data, if any, and replace it with data from Mapterhorn.", "help": "请求成功后将移除原有的海拔数据,并使用 Mapterhorn 的海拔数据替换原有数据。",
"help_no_selection": "选择要请求海拔数据的文件。" "help_no_selection": "选择要请求海拔数据的文件。"
}, },
"waypoint": { "waypoint": {