fix build examples workflow

This commit is contained in:
Anton Tranelis 2025-07-02 20:08:49 +02:00
parent 8836f040e7
commit 25e9c0a1b9
4 changed files with 44 additions and 4 deletions

View File

@ -56,6 +56,8 @@ function UtopiaMap({
defaultTheme,
donationWidget,
expandLayerControl,
tileServerUrl,
tileServerAttribution,
}: {
/** height of the map (default '500px') */
height?: string
@ -85,6 +87,10 @@ function UtopiaMap({
donationWidget?: boolean
/** open layer control on map initialisation */
expandLayerControl?: boolean
/** configure a custom tile server */
tileServerUrl?: string
/** configure a custom tile server attribution */
tileServerAttribution?: string
}) {
return (
<ContextWrapper>
@ -104,6 +110,8 @@ function UtopiaMap({
showThemeControl={showThemeControl}
defaultTheme={defaultTheme}
expandLayerControl={expandLayerControl}
tileServerUrl={tileServerUrl}
tileServerAttribution={tileServerAttribution}
>
{children}
</UtopiaMapInner>

View File

@ -55,6 +55,8 @@ export function UtopiaMapInner({
defaultTheme = '',
donationWidget,
expandLayerControl,
tileServerUrl,
tileServerAttribution,
}: {
children?: React.ReactNode
geo?: GeoJsonObject
@ -65,6 +67,8 @@ export function UtopiaMapInner({
showThemeControl?: boolean
defaultTheme?: string
expandLayerControl?: boolean
tileServerUrl?: string
tileServerAttribution?: string
}) {
const selectNewItemPosition = useSelectPosition()
const setSelectNewItemPosition = useSetSelectPosition()
@ -278,8 +282,11 @@ export function UtopiaMapInner({
</Control>
<TileLayer
maxZoom={19}
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
url='https://tile.osmand.net/hd/{z}/{x}/{y}.png'
attribution={
tileServerAttribution ??
'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}
url={tileServerUrl ?? 'https://tile.osmand.net/hd/{z}/{x}/{y}.png'}
/>
<MarkerClusterGroup
ref={(r) => setClusterRef(r as any)}

View File

@ -1,6 +1,29 @@
.leaflet-control-attribution {
display: none;
.leaflet-control-attribution{
color: #000 !important;
background-color: white/50 !important;
border-radius: 4px;
padding: 0 4px;
z-index: 400 !important;
font-size: 10px;
opacity: 0.5;
}
.leaflet-control-attribution a{
color: #000 !important;
}
.leaflet-attribution-flag {
display: none !important;
}
.leaflet-control-attribution a:not([href*="openstreetmap"]) {
display: none !important;
}
/* 2) Entfernt den Trenner “|” (liegt im span[aria-hidden]) */
.leaflet-control-attribution span[aria-hidden="true"] {
display: none !important;
}
.leaflet-control-locate {
display: none;

View File

@ -18,4 +18,6 @@ export interface UtopiaMapProps {
donationWidget?: boolean
defaultTheme?: string
expandLayerControl?: boolean
tileServerUrl?: string
tileServerAttribution?: string
}