Skip to content

Conversation

@bob-voorhoede
Copy link
Contributor

This is essentially an improved version of #14.
It has the same functionality:
"Currently it is not possible to add layers dynamically, because deferredMountedTo only gets called on initialisation of the map. In this PR the (re)rendering is handled internaly in the v-mapbox-layer component, by either calling mounted or deferredMountedTo. When the layer is loaded later than the map is initialised, it uses mounted, otherwise deferredMountedTo."
This PR also comes with a storybook story.

Copy link
Contributor

@CindyvdVries CindyvdVries left a comment

Choose a reason for hiding this comment

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

Looks good! thanks!

import { action } from '@storybook/addon-actions';
import { withKnobs, text, number, boolean, array, select, color, date, button } from '@storybook/addon-knobs';
import { linkTo } from '@storybook/addon-links';
import { storiesOf } from '@storybook/vue';
Copy link
Contributor

Choose a reason for hiding this comment

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

more general thing, with or without ; ?

return {
template: dynamicLayersTemplate,
data: () => ({
style: 'mapbox://styles/global-data-viewer/cjtss3jfb05w71fmra13u4qqm',
Copy link
Contributor

Choose a reason for hiding this comment

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

this is from a specific project? is it useful to relate that to this general package, even if only in a story?

@bob-voorhoede bob-voorhoede merged commit 1e80b23 into master Nov 18, 2020
@bob-voorhoede bob-voorhoede deleted the feat/dynamic-layers-v2 branch November 18, 2020 07:58
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.

4 participants