mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
fix(lib): base layer config (#276)
* add close button to custom info modal * added attribution * fix build examples workflow * fix pending tests * Revert "add close button to custom info modal" This reverts commit 835c661009abbdc5c095a6bc86bbd6890e080e5f.
This commit is contained in:
parent
12aba6a67e
commit
855ef3de29
2
.github/workflows/test.build.lib.yml
vendored
2
.github/workflows/test.build.lib.yml
vendored
@ -37,7 +37,7 @@ jobs:
|
|||||||
build-examples:
|
build-examples:
|
||||||
if: needs.files-changed.outputs.build == 'true'
|
if: needs.files-changed.outputs.build == 'true'
|
||||||
name: Test Example Apps
|
name: Test Example Apps
|
||||||
needs: [build, files-changed]
|
needs: [files-changed, build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
@ -84,6 +84,8 @@ function MapContainer({ layers, map }: { layers: LayerProps[]; map: any }) {
|
|||||||
defaultTheme={map.default_theme}
|
defaultTheme={map.default_theme}
|
||||||
showZoomControl={map.show_zoom_control}
|
showZoomControl={map.show_zoom_control}
|
||||||
expandLayerControl={map.expand_layer_control}
|
expandLayerControl={map.expand_layer_control}
|
||||||
|
tileServerUrl={map.tile_server_url}
|
||||||
|
tileServerAttribution={map.tile_server_attribution}
|
||||||
>
|
>
|
||||||
{layers &&
|
{layers &&
|
||||||
apis &&
|
apis &&
|
||||||
|
|||||||
@ -56,6 +56,8 @@ function UtopiaMap({
|
|||||||
defaultTheme,
|
defaultTheme,
|
||||||
donationWidget,
|
donationWidget,
|
||||||
expandLayerControl,
|
expandLayerControl,
|
||||||
|
tileServerUrl,
|
||||||
|
tileServerAttribution,
|
||||||
}: {
|
}: {
|
||||||
/** height of the map (default '500px') */
|
/** height of the map (default '500px') */
|
||||||
height?: string
|
height?: string
|
||||||
@ -85,6 +87,10 @@ function UtopiaMap({
|
|||||||
donationWidget?: boolean
|
donationWidget?: boolean
|
||||||
/** open layer control on map initialisation */
|
/** open layer control on map initialisation */
|
||||||
expandLayerControl?: boolean
|
expandLayerControl?: boolean
|
||||||
|
/** configure a custom tile server */
|
||||||
|
tileServerUrl?: string
|
||||||
|
/** configure a custom tile server attribution */
|
||||||
|
tileServerAttribution?: string
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<ContextWrapper>
|
<ContextWrapper>
|
||||||
@ -104,6 +110,8 @@ function UtopiaMap({
|
|||||||
showThemeControl={showThemeControl}
|
showThemeControl={showThemeControl}
|
||||||
defaultTheme={defaultTheme}
|
defaultTheme={defaultTheme}
|
||||||
expandLayerControl={expandLayerControl}
|
expandLayerControl={expandLayerControl}
|
||||||
|
tileServerUrl={tileServerUrl}
|
||||||
|
tileServerAttribution={tileServerAttribution}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</UtopiaMapInner>
|
</UtopiaMapInner>
|
||||||
|
|||||||
@ -55,6 +55,8 @@ export function UtopiaMapInner({
|
|||||||
defaultTheme = '',
|
defaultTheme = '',
|
||||||
donationWidget,
|
donationWidget,
|
||||||
expandLayerControl,
|
expandLayerControl,
|
||||||
|
tileServerUrl,
|
||||||
|
tileServerAttribution,
|
||||||
}: {
|
}: {
|
||||||
children?: React.ReactNode
|
children?: React.ReactNode
|
||||||
geo?: GeoJsonObject
|
geo?: GeoJsonObject
|
||||||
@ -65,6 +67,8 @@ export function UtopiaMapInner({
|
|||||||
showThemeControl?: boolean
|
showThemeControl?: boolean
|
||||||
defaultTheme?: string
|
defaultTheme?: string
|
||||||
expandLayerControl?: boolean
|
expandLayerControl?: boolean
|
||||||
|
tileServerUrl?: string
|
||||||
|
tileServerAttribution?: string
|
||||||
}) {
|
}) {
|
||||||
const selectNewItemPosition = useSelectPosition()
|
const selectNewItemPosition = useSelectPosition()
|
||||||
const setSelectNewItemPosition = useSetSelectPosition()
|
const setSelectNewItemPosition = useSetSelectPosition()
|
||||||
@ -278,8 +282,11 @@ export function UtopiaMapInner({
|
|||||||
</Control>
|
</Control>
|
||||||
<TileLayer
|
<TileLayer
|
||||||
maxZoom={19}
|
maxZoom={19}
|
||||||
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
attribution={
|
||||||
url='https://tile.osmand.net/hd/{z}/{x}/{y}.png'
|
tileServerAttribution ??
|
||||||
|
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||||||
|
}
|
||||||
|
url={tileServerUrl ?? 'https://tile.osmand.net/hd/{z}/{x}/{y}.png'}
|
||||||
/>
|
/>
|
||||||
<MarkerClusterGroup
|
<MarkerClusterGroup
|
||||||
ref={(r) => setClusterRef(r as any)}
|
ref={(r) => setClusterRef(r as any)}
|
||||||
|
|||||||
@ -1,7 +1,30 @@
|
|||||||
.leaflet-control-attribution {
|
.leaflet-control-attribution{
|
||||||
display: none;
|
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 {
|
.leaflet-control-locate {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
2
lib/src/types/UtopiaMapProps.d.ts
vendored
2
lib/src/types/UtopiaMapProps.d.ts
vendored
@ -18,4 +18,6 @@ export interface UtopiaMapProps {
|
|||||||
donationWidget?: boolean
|
donationWidget?: boolean
|
||||||
defaultTheme?: string
|
defaultTheme?: string
|
||||||
expandLayerControl?: boolean
|
expandLayerControl?: boolean
|
||||||
|
tileServerUrl?: string
|
||||||
|
tileServerAttribution?: string
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user