Skip to content

Commit

Permalink
First working configuration (yay)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimon committed Jan 31, 2024
1 parent f45f162 commit 429fe76
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
5 changes: 4 additions & 1 deletion packages/geospatial/src/components/CoreDataPlace.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { Peripleo, Controls } from '@peripleo/peripleo';
import { Map, MixedGeoJSONLayer, PulsingMarkerLayer, Zoom } from '@peripleo/maplibre';
import { DEFAULT_FILL_STYLE, DEFAULT_POINT_STYLE, DEFAULT_STROKE_STYLE } from './CoreDataPlaceStyles';

import '@peripleo/maplibre/peripleo-maplibre.css';
import '@peripleo/peripleo/default-theme';

type CoreDataPlaceProps = {
mapStyle: string | object;
placeURI: string;
Expand All @@ -28,7 +31,7 @@ export const CoreDataPlace = (props: CoreDataPlaceProps) => {
fillStyle={props.fillStyle}
pointStyle={props.pointStyle}
strokeStyle={props.strokeStyle} />
</Map>x
</Map>
</Peripleo>
)

Expand Down
4 changes: 4 additions & 0 deletions packages/storybook/src/geospatial/CoreDataPlace.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.p6o-map-container {
height: 100%;
width: 100%;
}
29 changes: 26 additions & 3 deletions packages/storybook/src/geospatial/CoreDataPlace.stories.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
import { CoreDataPlace } from '../../../geospatial/src/components/CoreDataPlace';

import './CoreDataPlace.css';

export default {
title: 'Components/Geospatial/CoreDataPlace',
component: CoreDataPlace
};

const style = {
"version": 8,
"sources": {
"osm": {
"type": "raster",
"tiles": ["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png"],
"tileSize": 256,
"attribution": "&copy; OpenStreetMap Contributors",
"maxzoom": 19
}
},
"layers": [
{
"id": "osm",
"type": "raster",
"source": "osm"
}
]
};

export const Default = () => (
<CoreDataPlace
mapStyle={`https://api.maptiler.com/maps/basic-v2/style.json?key=${process.env.REACT_APP_MAP_TILER_KEY}`}
placeURI="https://core-data-cloud-staging-2c51db0617a5.herokuapp.com/core_data/public/places/3aaf97a4-7052-4e2c-9056-4f4146ef0c87?project_ids=10" />
<div style={{ width: '100%', height: '300px' }}>
<CoreDataPlace
mapStyle={style}
placeURI="https://core-data-cloud-staging-2c51db0617a5.herokuapp.com/core_data/public/places/3aaf97a4-7052-4e2c-9056-4f4146ef0c87?project_ids=10" />
</div>
)

0 comments on commit 429fe76

Please sign in to comment.