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

Add maplibregl module #719

Merged
merged 7 commits into from
May 7, 2024
Merged

Add maplibregl module #719

merged 7 commits into from
May 7, 2024

Conversation

giswqs
Copy link
Member

@giswqs giswqs commented Apr 14, 2024

import leafmap.maplibregl as leafmap
from maplibre.sources import GeoJSONSource

m = leafmap.Map(center=[49.24658, -123.1256], zoom=12, height="600px")

vancouver_blocks = GeoJSONSource(
    data="https://raw.githubusercontent.com/visgl/deck.gl-data/master/examples/geojson/vancouver-blocks.json",
)

layer = Layer(
        type=LayerType.LINE,
        source=vancouver_blocks,
        paint={"line-color": "white"},
    )

m.add_layer(layer)
m

image

@giswqs
Copy link
Member Author

giswqs commented Apr 15, 2024

import leafmap.maplibregl as leafmap

m = leafmap.Map()
m.add_control("scale", position='bottom-left')
m.add_basemap("OpenTopoMap", show=True)
data="https://raw.githubusercontent.com/visgl/deck.gl-data/master/examples/geojson/vancouver-blocks.json"
m.add_geojson(data, layer_name="Vancouver Blocks", paint={"line-color": "red"})
m.set_center(-123.1256, 49.24658, zoom=12)
m

image

@cboettig
Copy link

this looks really promising! I was just trying testing out if we could do pmtiles formats, or any of the other types of sources recognized by maplibre. It looks like to maplibre pmtiles merely uses the generic "vector" format. It looks like there's acknowledgement of each of these source types in the maplibre python module, but can't figure out how they are used... Have you had a chance to look at that?

@giswqs
Copy link
Member Author

giswqs commented Apr 26, 2024

I have not looked into pmtiles with py-maplibre yet. Currently, there is a blocker the prevents this PR from being merged due to the outdated anywidget version used by py-maplibre, which is incompatible with lonboard. I subbmitted the PR last week, but the maintainer has not responded yet.

@crazycapivara
Copy link

I have not looked into pmtiles with py-maplibre yet. Currently, there is a blocker the prevents this PR from being merged due to the outdated anywidget version used by py-maplibre, which is incompatible with lonboard. I subbmitted the PR last week, but the maintainer has not responded yet.

It is merged setting anywidget to >=0.9.0

Copy link

github-actions bot commented May 4, 2024

🚀 Deployed on https://66363156d79e9ef1d351f114--opengeos.netlify.app

@github-actions github-actions bot temporarily deployed to pull request May 4, 2024 13:00 Inactive
@giswqs giswqs merged commit c5f63b7 into master May 7, 2024
15 checks passed
@giswqs giswqs deleted the maplibre branch May 7, 2024 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants