Skip to content
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

feat: added Mapbox component #255

Merged
merged 7 commits into from
Feb 26, 2024
Merged

Conversation

raaymax
Copy link
Collaborator

@raaymax raaymax commented Feb 20, 2024

The same as in google maps. In fact we could name events for gmap and mapbox the same because they have same payload.
For Mapbox I see potential in displaying GeoJSON this could be really nice feature but this needs more discussion.

@raaymax raaymax requested a review from ramedina86 February 20, 2024 14:10
Copy link
Collaborator

@ramedina86 ramedina86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two important issues that need to be addressed:

  • Static import of whole library (while also importing dynamically)
  • Use of "gmap-click" event

Rest is questions / ramblings / style suggestions / etc.

ui/src/core_components/embed/CoreMapbox.vue Show resolved Hide resolved
const initMap = async () => {
if (!mapEl.value) return;
if (!fields.accessToken.value) return;
const mapboxgl = await import("mapbox-gl");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome to see it being dynamically imported, makes a huge performance difference. 🚀

Have you tried building the docs (Vitepress) to see how that goes, for this one and Google Maps? I think you don't need the SSR flag (because you're not rendering on mount, only after access token is entered), but just to confirm.

Not sure if you're aware, but the docs when built basically scan every component get the streamsync export and collect the fields and events. I've had problems with memory consumption. These type of components that rely on external libraries were more prone to cause issues.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used only npm run docs:dev and it was working fine but now when i ran docs:build it failed because in quickstart-tutorial I had link to localhost.
To quickly solve it I added following line to vitepress config

 ignoreDeadLinks: 'localhostLinks',

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add docs build to CI

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use Netlify for docs, I think it can be easily hooked up to Github to build automatically. We're also on a Pro plan so the build allowance is quite generous.

I'm not sure if you had other idea in mind with CI for docs, keen to hear.

ui/src/core_components/embed/CoreMapbox.vue Outdated Show resolved Hide resolved
ui/src/core_components/embed/CoreMapbox.vue Show resolved Hide resolved
ui/src/core_components/embed/CoreMapbox.vue Outdated Show resolved Hide resolved
ui/src/core_components/embed/CoreMapbox.vue Outdated Show resolved Hide resolved
ui/src/core_components/embed/CoreMapbox.vue Outdated Show resolved Hide resolved
width: 100%;
height: 100%;
}
.CoreMapbox .mask {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mask thing you came up with is great and you've been using it across components. It's also expected we'll have to use it in other ones. What do you think about reutilising this across all components? I think no component would break if it had a mask, but some would if they didn't.

Rather than CSS, I'd probably go for a layer with a v-if that only appears if IsBeingEdited && !isSelected.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to my TODO list. Lets do it in separate PR.

ui/src/core_components/embed/CoreMapbox.vue Outdated Show resolved Hide resolved
@raaymax raaymax requested a review from ramedina86 February 23, 2024 11:46
@ramedina86 ramedina86 merged commit 83b8c0b into writer:dev Feb 26, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants