openearth / vue2mapbox-gl

Vue components for mapbox-gl. Api follows the approach of Vue2Leaflet so it's easy to port code back and forth between the two map components.
GNU General Public License v3.0
19 stars 8 forks source link

Feat/dynamic layers #14

Closed sjoerdbeentjes closed 4 years ago

sjoerdbeentjes commented 4 years ago

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 usesmounted, otherwise deferredMountedTo.

SiggyF commented 4 years ago

Looks good. Can you also add a test in the .storybook?