Skip to content
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

Added geojson support for split map #291 #300

Merged
merged 1 commit into from Nov 7, 2022
Merged

Added geojson support for split map #291 #300

merged 1 commit into from Nov 7, 2022

Conversation

giswqs
Copy link
Member

@giswqs giswqs commented Nov 7, 2022

This PR adds GeoJSON support for the split_map() function. Note that ipyleaflet >=0.17.0 has a SplitControl bug. You need to downgrade ipyleaflet to v0.17.0 or older to try out this new feature. Also, the folium plotting backend does not support this feature.

import leafmap
m = leafmap.Map()
url = 'https://raw.githubusercontent.com/telegeography/www.submarinecablemap.com/master/web/public/api/v3/cable/cable-geo.json'
callback = lambda feat: {"color": feat["properties"]["color"]}
layer = leafmap.geojson_layer(url, style_callback=callback)
m.split_map(layer, 'OpenStreetMap')
m

Peek 2022-11-06 21-07

@giswqs giswqs added the Feature Request New feature or request label Nov 7, 2022
@giswqs giswqs added this to In progress in leafmap via automation Nov 7, 2022
@giswqs giswqs linked an issue Nov 7, 2022 that may be closed by this pull request
@giswqs giswqs merged commit 71d1b4d into master Nov 7, 2022
leafmap automation moved this from In progress to Done Nov 7, 2022
@giswqs giswqs deleted the split branch November 7, 2022 02:13
@lgtm-com
Copy link

lgtm-com bot commented Nov 7, 2022

This pull request introduces 22 alerts when merging 9a330e3 into 655f9c4 - view on LGTM.com

new alerts:

  • 22 for Modification of parameter with default

sthagen pushed a commit to sthagen/giswqs-leafmap that referenced this pull request Feb 18, 2023
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
Development

Successfully merging this pull request may close these issues.

More supports for split_map
1 participant