Skip to content

mapbox module

leafmap.mapbox

Map

Bases: AnyWidget

Create a Mapbox map widget.

set_css(css, container='map')

Set css attribute. Can be a string, a file path, or a url. See examples at https://docs.mapbox.com/mapbox-gl-js/example/ Open an example and click on the 'Edit in CodePen' button. Then copy the code from the 'CSS' tab, and assign it to the css parameter. Args: css (str): The css string, file path, or url.

Raises:

Type Description
TypeError

If css is not a string.

set_esm(esm, container='map')

Set esm attribute. Can be a string, a file path, or a url. See examples at https://docs.mapbox.com/mapbox-gl-js/example/ Open an example and click on the 'Edit in CodePen' button. Then copy the code from the 'JS' tab, and assign it to the esm parameter.

Parameters:

Name Type Description Default
esm str

The esm string, file path, or url.

required
container str

The container name. Defaults to 'map'.

'map'

Raises:

Type Description
TypeError

If esm is not a string.