File tree Expand file tree Collapse file tree
utils/src/map-style-utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -560,10 +560,10 @@ export default function MapContainerFactory(
560560 this . _updateMapboxLayers ( ) ;
561561
562562 if ( update && update . style ) {
563- // No attributions are needed if the style doesn't reference Mapbox sources
563+ // Show attributions if the style uses Mapbox or OpenStreetMap sources
564564 this . setState ( {
565565 showBaseMapAttribution :
566- isStyleUsingMapboxTiles ( update . style ) || ! isStyleUsingOpenStreetMapTiles ( update . style )
566+ isStyleUsingMapboxTiles ( update . style ) || isStyleUsingOpenStreetMapTiles ( update . style )
567567 } ) ;
568568 }
569569
Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ export function isStyleUsingOpenStreetMapTiles(mapStyle: any) {
3232 const sources = mapStyle ?. stylesheet ?. sources || { } ;
3333 return Object . keys ( sources ) . some ( sourceId => {
3434 const { attribution} = sources [ sourceId ] || { } ;
35- if ( typeof attribution ?. attribution === 'string' ) {
36- return attribution . attribution . includes ( 'openstreetmap.org' ) ;
35+ if ( typeof attribution === 'string' ) {
36+ return attribution . includes ( 'openstreetmap.org' ) ;
3737 }
3838 return false ;
3939 } ) ;
You can’t perform that action at this time.
0 commit comments