Streamlit Maplibre

Display interactive land cover map

What is Streamlit Maplibre ?

Streamlit Maplibre is a Streamlit component designed for displaying interactive land cover maps. It leverages the capabilities of Maplibre GL JS to bring dynamic and customizable mapping features directly into Streamlit applications. This tool is particularly useful for visualizing geospatial data, allowing users to interact with maps in real time.

Features

β€’ Interactive Mapping: Create and display customizable interactive maps with markers, polygons, and other overlays.
β€’ Lightweight: Built to be efficient and fast, ensuring smooth performance in Streamlit apps.
β€’ Customizable: Easily tailor map styles, markers, and other elements to fit your needs.
β€’ Integration with Streamlit: Seamlessly integrate maps into Streamlit workflows for a unified user experience.
β€’ Real-Time Interaction: Supports zooming, panning, and clicking for an engaging user experience.

How to use Streamlit Maplibre ?

  1. Install the Package: Run pip install streamlit-maplibre to install the package.
  2. Import the Module: Add import streamlit_maplibre as st_map to your Streamlit script.
  3. Initialize the Map: Use st_map.map() to create a basic map.
  4. Add Markers or Layers: Customize the map by adding markers, polygons, or other geospatial data.
  5. Display the Map: The map will be rendered automatically in your Streamlit app.
  6. Run the App: Execute your Streamlit script with streamlit run your_script.py.

Frequently Asked Questions

What is the purpose of Streamlit Maplibre?
Streamlit Maplibre is designed to enhance Streamlit applications with interactive mapping capabilities, making it easier to visualize and explore geospatial data.

How do I customize the map style?
You can customize the map style by passing CSS or JSON styles to the map() function. For example, st_map.map(style="mapbox://styles/mapbox/streets-v12").

Is Streamlit Maplibre compatible with all Streamlit versions?
Streamlit Maplibre is compatible with most modern versions of Streamlit. Ensure you have the latest version installed for optimal performance.