Skip to content

setConfigProperty('basemap', 'language', ...) silently fails in v3.18 — docs should reference setLanguage() #13630

@aideedamsyar

Description

@aideedamsyar

Description

setConfigProperty('basemap', 'language', ...) silently does nothing in mapbox-gl v3.18.1 with the Standard style (mapbox://styles/mapbox/standard). The call succeeds without error, but getConfigProperty('basemap', 'language') returns null and the map labels remain in the default language.

The working API is map.setLanguage() (or the language constructor option), but this isn't obvious from the current documentation.

Steps to reproduce

const map = new mapboxgl.Map({
  container: 'map',
  style: 'mapbox://styles/mapbox/standard',
});

map.on('load', () => {
  // This silently does nothing:
  map.setConfigProperty('basemap', 'language', 'ko');

  console.log(map.getConfigProperty('basemap', 'language')); // null
  console.log(map.getStyle().imports[0].schema); // undefined
  console.log(map.getStyle().imports[0].config); // undefined

  // This works:
  map.setLanguage('ko'); // labels switch to Korean
});

Debug findings

API Result
setConfigProperty('basemap', 'language', 'ko') No error, but getConfigProperty returns null. Labels stay English.
new Map({ config: { basemap: { language: 'ko' } } }) Silently ignored.
map.setLanguage('ko') Works. Labels switch to Korean.
map.getStyle().imports[0].schema undefined (basemap has no config schema)

Documentation gap

The following docs reference setConfigProperty or the config constructor option for changing Standard style language, which doesn't work:

The working APIs (map.setLanguage() / new Map({ language: 'ko' })) were noted in #12950 but aren't prominent in the main docs.

Expected behavior

Either:

  1. setConfigProperty('basemap', 'language', ...) should work as documented, or
  2. The docs should clearly reference map.setLanguage() as the correct API for Standard style

Environment

  • mapbox-gl: 3.18.1
  • Style: mapbox://styles/mapbox/standard
  • Browser: Chrome (macOS)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions