Add tile overlay definitions and LayersControl entries
- layers.ts: overlayLayers with hillshading, Waymarked Cycling/Hiking/MTB - PlannerMap: LayersControl.Overlay entries for each overlay tile layer - Leaflet handles attribution updates natively on toggle Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a1b231c54c
commit
0e399e5174
4 changed files with 48 additions and 6 deletions
|
|
@ -2,5 +2,5 @@ export { MapView } from "./MapView.tsx";
|
|||
export type { MapViewProps } from "./MapView.tsx";
|
||||
export { RouteLayer } from "./RouteLayer.tsx";
|
||||
export type { RouteLayerProps } from "./RouteLayer.tsx";
|
||||
export { baseLayers } from "./layers.ts";
|
||||
export type { TileLayerConfig } from "./layers.ts";
|
||||
export { baseLayers, overlayLayers } from "./layers.ts";
|
||||
export type { TileLayerConfig, OverlayLayerConfig } from "./layers.ts";
|
||||
|
|
|
|||
|
|
@ -5,6 +5,43 @@ export interface TileLayerConfig {
|
|||
maxZoom?: number;
|
||||
}
|
||||
|
||||
export interface OverlayLayerConfig extends TileLayerConfig {
|
||||
id: string;
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
export const overlayLayers: OverlayLayerConfig[] = [
|
||||
{
|
||||
id: "hillshading",
|
||||
name: "Hillshading",
|
||||
url: "https://tiles.wmflabs.org/hillshading/{z}/{x}/{y}.png",
|
||||
attribution: "Hillshading: SRTM/Mapzen",
|
||||
maxZoom: 17,
|
||||
opacity: 0.5,
|
||||
},
|
||||
{
|
||||
id: "waymarked-cycling",
|
||||
name: "Cycling Routes",
|
||||
url: "https://tile.waymarkedtrails.org/cycling/{z}/{x}/{y}.png",
|
||||
attribution: '© <a href="https://waymarkedtrails.org">Waymarked Trails</a> (CC-BY-SA)',
|
||||
maxZoom: 18,
|
||||
},
|
||||
{
|
||||
id: "waymarked-hiking",
|
||||
name: "Hiking Routes",
|
||||
url: "https://tile.waymarkedtrails.org/hiking/{z}/{x}/{y}.png",
|
||||
attribution: '© <a href="https://waymarkedtrails.org">Waymarked Trails</a> (CC-BY-SA)',
|
||||
maxZoom: 18,
|
||||
},
|
||||
{
|
||||
id: "waymarked-mtb",
|
||||
name: "MTB Routes",
|
||||
url: "https://tile.waymarkedtrails.org/mtb/{z}/{x}/{y}.png",
|
||||
attribution: '© <a href="https://waymarkedtrails.org">Waymarked Trails</a> (CC-BY-SA)',
|
||||
maxZoom: 18,
|
||||
},
|
||||
];
|
||||
|
||||
export const baseLayers: TileLayerConfig[] = [
|
||||
{
|
||||
name: "OpenStreetMap",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue