CartoDB / toolkit

JS library to interact with CARTO APIs in a simple way
https://toolkit-wheat.now.sh
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

Add source and style update methods #73

Closed jesusbotella closed 4 years ago

jesusbotella commented 4 years ago

This PR adds .setSource and .setStyle methods to update the current source and style defined in within created layers.

.setSource(source: string) This method accepts a string defining the new CARTO dataset that the layer will render. It creates the new source instance internally and creates a new layer that is passed to Deck.gl to update the map.

.setStyle(style: {}) This method accepts an object defining Deck.gl's accessors that the layer will use to define each feature style. It creates the new style instance internally and creates a new layer that is passed to Deck.gl to update the map.