A powerful QGIS plugin for interactive layer visualization and comparison, inspired by the leafmap Python package.
- Layer Transparency Control: Interactive slider to adjust layer transparency in real-time for all loaded layers
- Layer Swipe Tool: Compare two layers side-by-side with a draggable divider (similar to ipyleaflet split control)
- Dockable Panels: All tools are available as dockable panels that can be positioned anywhere in the QGIS interface
- Plugin Update Checker: Check for updates from GitHub and install them automatically
- Settings Panel: Configure plugin options with persistent storage
Control the transparency of all layers with individual sliders. Filter by layer type (raster/vector) and visibility.
Compare two layers by swiping between them. Select left and right layers, choose vertical or horizontal orientation, and drag the divider on the map.
π Compare Layers Visually in QGIS β New Leafmap Plugin Demo!
- QGIS 3.28 or later
- Python 3.10+
- Open QGIS
- Go to Plugins β Manage and Install Plugins...
- Go to the Settings tab
- Click Add... under "Plugin Repositories"
- Give a name for the repository, e.g., "OpenGeos"
- Enter the URL of the repository: https://qgis.gishub.org/plugins.xml
- Click OK
- Go to the All tab
- Search for "Leafmap"
- Select the plugin and click Install Plugin
Using Python:
# Clone the repository
git clone https://github.com/opengeos/qgis-leafmap-plugin.git
cd qgis-leafmap-plugin
# Install
python install.py
# Or remove
python install.py --removeUsing Bash:
# Make executable (first time only)
chmod +x install.sh
# Install
./install.sh
# Or remove
./install.sh --removeCopy the qgis_leafmap folder to your QGIS plugins directory:
- Linux:
~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ - macOS:
~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ - Windows:
%APPDATA%\QGIS\QGIS3\profiles\default\python\plugins\
- Click the Layer Transparency button in the toolbar or go to Leafmap β Layer Transparency
- A dockable panel will appear with sliders for each layer
- Drag the slider to adjust transparency (0% = opaque, 100% = transparent)
- Use the filter options to show only raster or vector layers
- Use "Reset All" to restore all layers to 0% transparency
- Click the Layer Swipe button in the toolbar or go to Leafmap β Layer Swipe
- Select the Left Layer (shown on left side of divider)
- Select the Right Layer (shown on right side of divider)
- Choose Vertical or Horizontal orientation
- Click Activate Swipe
- Drag the divider on the map to compare layers
- Use the slider or quick buttons to adjust the divider position
- Click Deactivate Swipe when done
- Go to Leafmap β Settings
- Adjust general, transparency, and swipe tool options
- Click Save Settings to persist changes
- Go to Leafmap β Check for Updates...
- Click Check for Updates to see if a new version is available
- If an update is available, click Download and Install Update
- Restart QGIS to apply the update
qgis-leafmap-plugin/
βββ qgis_leafmap/
β βββ __init__.py # Plugin entry point
β βββ qgis_leafmap.py # Main plugin class
β βββ metadata.txt # Plugin metadata for QGIS
β βββ LICENSE # Plugin license
β βββ dialogs/
β β βββ __init__.py
β β βββ transparency_dock.py # Layer transparency panel
β β βββ swipe_dock.py # Layer swipe/comparison tool
β β βββ settings_dock.py # Settings panel
β β βββ update_checker.py # Update checker dialog
β βββ icons/
β βββ icon.svg # Main plugin icon
β βββ transparency.svg # Transparency tool icon
β βββ swipe.svg # Swipe tool icon
β βββ settings.svg # Settings icon
β βββ about.svg # About icon
βββ package_plugin.py # Python packaging script
βββ package_plugin.sh # Bash packaging script
βββ install.py # Python installation script
βββ install.sh # Bash installation script
βββ README.md # This file
βββ LICENSE # Repository license
For testing with the geo conda environment:
# Activate the geo environment
conda activate geo
# Install the plugin
python install.py
# Start QGIS from the terminal to see any error messages
qgis- Create new dock widgets in the
dialogs/folder - Add corresponding toggle methods in
qgis_leafmap.py - Create icons in the
icons/folder - Update
dialogs/__init__.pywith new imports
# Default packaging
python package_plugin.py
# Custom output path
python package_plugin.py --output /path/to/qgis_leafmap.zip
# Without version in filename
python package_plugin.py --no-version# Make executable (first time only)
chmod +x package_plugin.sh
# Default packaging
./package_plugin.sh
# Custom output directory
./package_plugin.sh --output /path/to/output- Create an account at plugins.qgis.org
- Go to "My plugins" and click "Add a new plugin"
- Upload the generated zip file
- Fill in the required information
- Submit for review
- leafmap - A Python package for interactive mapping and geospatial analysis
- ipyleaflet - A Jupyter widget for Leaflet.js interactive maps
- geemap - A Python package for interactive mapping with Google Earth Engine
This plugin is released under the MIT License. See LICENSE for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request



