Skip to content

Commit

Permalink
add attribution in test
Browse files Browse the repository at this point in the history
  • Loading branch information
zbigg committed Apr 30, 2024
1 parent e683c7b commit ec279e9
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions test/apps/carto-map/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,20 @@ async function createMap(cartoMapId: string) {
}

// Get map info from CARTO and update deck
const {initialViewState, mapStyle, basemap, layers} = await fetchMap(options);
const {initialViewState, basemap, layers} = await fetchMap(options);
deck.setProps({initialViewState, layers});

// Mapbox basemap (optional)
// const {label} = mapStyle.visibleLayerGroups;
// const MAP_STYLE = `https://basemaps.cartocdn.com/gl/${mapStyle.styleType}${
// label ? '' : '-nolabels'
// }-gl-style/style.json`;
const map = new mapboxgl.Map({container: 'map', style: basemap?.styleUrl, interactive: false});
const map = new mapboxgl.Map({
container: 'map',
style: basemap?.styleUrl,
interactive: false,
attributionControl: false
}).addControl(
new mapboxgl.AttributionControl({
customAttribution: basemap?.attribution
})
);
deck.setProps({
controller: true,
onViewStateChange: ({viewState}) => {
Expand Down

0 comments on commit ec279e9

Please sign in to comment.