-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal 'CoreDataPlace' Widget Example #247
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! I might actually poach a couple of the components/styles for a backend Core Data feature I'm working on. A couple of questions/notes:
- We're using FlowJS as a static type checker and ESLint for syntax. Could we make sure the code style is conforming to the rules we've setup?
- Would it make sense to export the
CoreDataPlaceLayer
component? And add what is essentially theCoreDataPlace
component (Peripleo, Map, etc) to the.stories
file?
packages/storybook/package.json
Outdated
@@ -14,6 +14,8 @@ | |||
"@babel/preset-flow": "^7.22.5", | |||
"@babel/preset-react": "^7.22.5", | |||
"@faker-js/faker": "^8.0.2", | |||
"@peripleo/maplibre": "^0.3.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also add these dependencies to the geospatial
package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course - done!
I made a few amendments:
I made a few tweaks to adapt the code style. I also ran Regarding the Is there anything we can change about the configuration to make Storybook recognize interfaces? Otherwise, I'll change all the interfaces defined in @peripleo to types. |
packages/geospatial/package.json
Outdated
@@ -22,6 +22,8 @@ | |||
}, | |||
"devDependencies": { | |||
"@performant-software/webpack-config": "^1.0.0", | |||
"@peripleo/maplibre": "^0.3.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be in dependencies
instead of devDependencies
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
@@ -0,0 +1,80 @@ | |||
import React, { useEffect, useState } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if you add the // @flow
annotation to the top of this file, it will like the syntax a lot more. There's also a few ESLint errors on the formatting, but less concerned about those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, but even with Flow enabled, I'm still getting red squiggles under every TypeScript statement, and Flow shows all the TS stuff as "uncovered area". I'll enquire with Camden.
Closing in favor of #252. |
In this PR
This PR adds a new component to the
geospatial
package:<CoreDataPlace>
. This component retrieves a Place resource from the Core Data API, and renders it's GeoJSON geometry on a mapLibre map.CoreDataPlace takes the following input props:
fillStyle
,strokeStyle
andpointStyle
Note: for now, this component is minimal, and supposed to serve as an example only!