Skip to content

Commit

Permalink
✨ [open-formulieren/open-forms#2173] Using the component defined tile…
Browse files Browse the repository at this point in the history
… layer url

Allowing the component to determine the background used for the map
  • Loading branch information
robinmolen committed Dec 9, 2024
1 parent 81cacca commit 51db3c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Map/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const LeaftletMap = ({
defaultCenter = DEFAULT_LAT_LNG,
defaultZoomLevel = DEFAULT_ZOOM,
disabled = false,
tileLayerUrl = TILE_LAYER_RD.url,
}) => {
const intl = useIntl();
const defaultCoordinates = useDefaultCoordinates();
Expand Down Expand Up @@ -99,7 +100,7 @@ const LeaftletMap = ({
duration: 3000,
}}
>
<TileLayer {...TILE_LAYER_RD} />
<TileLayer {...TILE_LAYER_RD} url={tileLayerUrl} />
{coordinates ? (
<>
<MapView coordinates={coordinates} />
Expand Down Expand Up @@ -133,6 +134,7 @@ LeaftletMap.propTypes = {
markerCoordinates: PropTypes.arrayOf(PropTypes.number),
onMarkerSet: PropTypes.func,
disabled: PropTypes.bool,
tileLayerUrl: PropTypes.string,
};

// Set the map view if coordinates are provided
Expand Down
1 change: 1 addition & 0 deletions src/formio/components/Map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export default class Map extends Field {
onMarkerSet={this.onMarkerSet.bind(this)}
defaultCenter={defaultCenter}
defaultZoomLevel={zoom || DEFAULT_ZOOM}
tileLayerUrl={this.component.tileLayerUrl}
/>
</ConfigContext.Provider>
</IntlProvider>
Expand Down

0 comments on commit 51db3c4

Please sign in to comment.