Skip to content

Commit

Permalink
Make do-catalog compatible with deck.gl > 9
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgaya committed Jun 19, 2024
1 parent 738d147 commit 7a70f0e
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import { mapState } from 'vuex';
import mapboxgl from 'mapbox-gl';
import { Deck } from '@deck.gl/core';
import { CartoLayer, BASEMAP, MAP_TYPES, API_VERSIONS } from '@deck.gl/carto';
import { VectorTileLayer, vectorTilesetSource, BASEMAP } from '@deck.gl/carto';
import { generateColorStyleProps, resetColorStyleProps } from './map-styles/colorStyles';
import { getQuantiles, formatNumber, capitalize, compare } from './map-styles/utils';
Expand Down Expand Up @@ -170,6 +170,12 @@ export default {
getTooltip: this.getTooltip
});
this.tilesetSource = vectorTilesetSource({
accessToken: window.accessToken,
connectionName: 'carto_dw',
tableName: this.tilesetSampleId
});
this.renderLayer();
},
methods: {
Expand Down Expand Up @@ -201,15 +207,8 @@ export default {
},
renderLayer () {
const layers = [
new CartoLayer({
data: this.tilesetSampleId,
type: MAP_TYPES.TILESET,
credentials: {
apiVersion: API_VERSIONS.V2,
username: this.username || 'public',
apiKey: 'default_public',
...(this.mapUrl && { mapsUrl: this.mapUrl })
},
new VectorTileLayer({
data: this.tilesetSource,
...styleProps.deck,
lineWidthUnits: 'pixels',
pointRadiusUnits: 'pixels',
Expand All @@ -228,7 +227,6 @@ export default {
this.setGeomType(tilestats);
this.setVariable(tilestats);
this.setStyleProps();
this.renderLayer();
this.showMap = true;
}
})
Expand Down

0 comments on commit 7a70f0e

Please sign in to comment.