Skip to content

Added support for changing geojson layer opacity #1135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2022
Merged

Added support for changing geojson layer opacity #1135

merged 1 commit into from
Jul 8, 2022

Conversation

giswqs
Copy link
Member

@giswqs giswqs commented Jul 8, 2022

Thanks to ipyleaflet v0.17.0, leafmap now supports changing GeoJSON layer visibility and opacity interactively.

import geemap
m = geemap.Map()
m.add_basemap("CartoDB.DarkMatter")
in_geojson = 'https://raw.githubusercontent.com/giswqs/geemap/master/examples/data/cable-geo.geojson'
callback = lambda feat: {"color": "#" + feat["properties"]["color"], "weight": 2}
m.add_geojson(in_geojson, layer_name="Cable lines", style_callback=callback, info_mode=None)
m

Peek 2022-07-08 14-57

@giswqs giswqs added the Feature Request New feature or request label Jul 8, 2022
@giswqs giswqs self-assigned this Jul 8, 2022
@giswqs giswqs merged commit 96008e7 into master Jul 8, 2022
@giswqs giswqs deleted the geojson branch July 8, 2022 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant