diff --git a/src/components/FormStepSummary/ComponentValueDisplay.jsx b/src/components/FormStepSummary/ComponentValueDisplay.jsx index f6bfc251a..3a7af0997 100644 --- a/src/components/FormStepSummary/ComponentValueDisplay.jsx +++ b/src/components/FormStepSummary/ComponentValueDisplay.jsx @@ -189,7 +189,7 @@ const MapDisplay = ({component, value}) => { return ; } - return ; + return ; }; const CoSignDisplay = ({component, value}) => { diff --git a/src/components/Map/Map.stories.jsx b/src/components/Map/Map.stories.jsx index 3d9c8f100..76b75272d 100644 --- a/src/components/Map/Map.stories.jsx +++ b/src/components/Map/Map.stories.jsx @@ -52,3 +52,10 @@ export const MapReverseGeoEmpty = { }, }, }; + +export const MapWithAerialPhotoBackground = { + args: { + tileLayerUrl: + 'https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/Actueel_orthoHR/EPSG:28992/{z}/{x}/{y}.png', + }, +}; diff --git a/src/components/Map/index.jsx b/src/components/Map/index.jsx index a4beeb141..32dbf1bdc 100644 --- a/src/components/Map/index.jsx +++ b/src/components/Map/index.jsx @@ -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(); @@ -99,7 +100,7 @@ const LeaftletMap = ({ duration: 3000, }} > - + {coordinates ? ( <> @@ -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 diff --git a/src/components/Summary/Summary.stories.jsx b/src/components/Summary/Summary.stories.jsx index 9e23cae68..7986bf9a5 100644 --- a/src/components/Summary/Summary.stories.jsx +++ b/src/components/Summary/Summary.stories.jsx @@ -496,3 +496,37 @@ export const AddressNLSummaryEmpty = { await expect(canvas.getByRole('definition')).toHaveTextContent(''); }, }; + +export const MapSummary = { + render, + args: { + summaryData: [ + { + slug: 'maps', + name: 'Maps', + data: [ + { + name: 'Map with default tile layer', + value: [52.1326332, 5.291266], + component: { + key: 'map', + type: 'map', + label: 'Map with default tile layer', + }, + }, + { + name: 'Map with custom tile layer', + value: [52.1326332, 5.291266], + component: { + key: 'map', + type: 'map', + label: 'Map with custom tile layer', + tileLayerUrl: + 'https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/Actueel_orthoHR/EPSG:28992/{z}/{x}/{y}.png', + }, + }, + ], + }, + ], + }, +}; diff --git a/src/formio/components/Map.jsx b/src/formio/components/Map.jsx index f527ac270..dc81cac93 100644 --- a/src/formio/components/Map.jsx +++ b/src/formio/components/Map.jsx @@ -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} />