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

[MAP] Create helper functions for basemaps #75

Closed VictorVelarde closed 4 years ago

VictorVelarde commented 4 years ago

[ch64278]

VictorVelarde commented 4 years ago

@jesusbotella I have applied the suggestions and I made a refactor, which lead to clearer helper functions. Have a look at it before we move on

     const deckMap = carto.viz.createMap();
     const deckMap = carto.viz.createMap({ basemap: 'voyager'});
     const deckMap = carto.viz.createMap({ basemap: 'voyager', view: { zoom: 4 } });
     const deckMap = carto.viz.createMap({ basemap: 'positron', view: { zoom: 4, longitude: 3, latitude: 40, pitch: 45, bearing: 30 }, container: 'map' });

and

     const deckMap = carto.viz.createGoogleMap();
     const deckMap = carto.viz.createGoogleMap('map', { mapTypeId: 'satellite'});
     const deckMap = carto.viz.createGoogleMap('map', { mapTypeId: 'hybrid', zoom: 4 });
     const deckMap = carto.viz.createGoogleMap('map', { mapTypeId: 'terrain', zoom: 4, center: { lng: 3, lat: 40 } });

I updated also the viz examples (which use createMap option)

VictorVelarde commented 4 years ago

Finally ready @jesusbotella !

VictorVelarde commented 4 years ago

Would you please @jesusbotella approve this one? That way we can unlock the other PR and move on