Skip to content

Commit

Permalink
feat: configure osmmap to be used as view widget for geolocation in d…
Browse files Browse the repository at this point in the history
…efault view
  • Loading branch information
pnicolli committed Apr 30, 2024
1 parent e999e76 commit 387da60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/components/OSMMap/OSMMap.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
height: 300px;
}

.view-defaultview .ui.basic.segment:has(#geocoded-result) {
width: 100%;
}

.marker-cluster {
background-color: #ff8d00;
border-radius: 100%;
Expand Down
13 changes: 8 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { GeoLocationWidget } from 'volto-venue/components';
import { OSMMap } from 'volto-venue/components';
export { GeoLocationWidget, OSMMap };

export { OSMMap } from 'volto-venue/components';
export { GeoLocationWidget };

export default (config) => {
export default function applyConfig(config) {
config.widgets.id = {
...config.widgets.id,
geolocation: GeoLocationWidget,
};

config.widgets.views.id.geolocation = ({ value }) => (
<OSMMap markers={[{ ...value, title: '' }]} />
);

return config;
};
}

0 comments on commit 387da60

Please sign in to comment.