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

Updates for maplibre maps #4706

Merged
merged 45 commits into from
Aug 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
a4a785e
remove mapbox reference
LiamConnors Jul 26, 2024
a913463
update to new map types
LiamConnors Jul 26, 2024
76f6756
fix typo
LiamConnors Jul 26, 2024
608d114
update choropleth for maplibre changes
LiamConnors Jul 26, 2024
9dc8202
add new map types
LiamConnors Jul 26, 2024
4a70af6
update density heatmaps + fix typo
LiamConnors Jul 26, 2024
2e0f184
Update scattermapbox.md
LiamConnors Jul 26, 2024
3b581e6
various updates for new map traces
LiamConnors Jul 30, 2024
b90f6ea
small edits
LiamConnors Aug 1, 2024
8e2538d
update map layers doc
LiamConnors Aug 3, 2024
671c80d
add stamen example
LiamConnors Aug 3, 2024
4b382e3
updates for new maps
LiamConnors Aug 3, 2024
b849b38
add deprecation notice
LiamConnors Aug 6, 2024
58b3e61
Update doc/python/scattermapbox.md
LiamConnors Aug 6, 2024
bce8097
fix code errors
LiamConnors Aug 7, 2024
fdae821
Update datashader.md
LiamConnors Aug 7, 2024
022b995
Update filled-area-on-mapbox.md
LiamConnors Aug 7, 2024
7983874
Update line-charts.md
LiamConnors Aug 7, 2024
614e37e
Update doc/python/map-configuration.md
LiamConnors Aug 7, 2024
31fde09
update symbol
LiamConnors Aug 7, 2024
ef80408
Update heatmaps.md
LiamConnors Aug 7, 2024
8fcb2bf
Update hover-text-and-formatting.md
LiamConnors Aug 7, 2024
fa931e4
Update hover-text-and-formatting.md
LiamConnors Aug 7, 2024
1ffb776
add links
LiamConnors Aug 7, 2024
10c5104
Merge branch 'master' into maplibre-tests
LiamConnors Aug 8, 2024
155f434
add map to doc/apidoc/plotly.express.rst
archmoj Aug 6, 2024
72bacb5
new map subplots & traces to px, etc.
archmoj Aug 6, 2024
ba9c413
update plotly.js v2.34.0-327-g056799dfc
archmoj Aug 23, 2024
e994f13
Update doc/python/mapbox-density-heatmaps.md
LiamConnors Aug 27, 2024
b7aff21
Update doc/python/mapbox-density-heatmaps.md
LiamConnors Aug 27, 2024
b0c45b3
Add migration guide
ndrezn Aug 27, 2024
e243e6d
Update packages/python/plotly/plotly/express/_doc.py
archmoj Aug 27, 2024
7e2eefc
update descriptions
archmoj Aug 28, 2024
8872f0b
Update doc/python/figure-structure.md
LiamConnors Aug 28, 2024
792a5e9
Update doc/python/migrate-to-maplibre.md
ndrezn Aug 28, 2024
af83303
Update doc/python/migrate-to-maplibre.md
ndrezn Aug 28, 2024
376c6db
Remove redirect
ndrezn Aug 28, 2024
fd12157
Update doc/python/axes.md
LiamConnors Aug 29, 2024
2bd7dc6
Add perma links for style comparisons
ndrezn Aug 29, 2024
4fc6d81
Revert "update plotly.js v2.34.0-327-g056799dfc"
LiamConnors Aug 29, 2024
24730c3
Merge pull request #4726 from plotly/maplibre-tests_with-px
LiamConnors Aug 29, 2024
38afbf0
Merge branch 'master' into maplibre-tests
LiamConnors Aug 29, 2024
a1c7f88
Merge branch 'master' into maplibre-tests
LiamConnors Aug 29, 2024
f34d599
fix metadata
LiamConnors Aug 29, 2024
65d97a0
Merge branch 'maplibre-tests' of https://github.com/plotly/plotly.py …
LiamConnors Aug 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions doc/python/migrate-to-maplibre.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
jupyter:
jupytext:
notebook_metadata_filter: all
text_representation:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.16.1
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
language_info:
codemirror_mode:
name: ipython
version: 3
file_extension: .py
mimetype: text/x-python
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.10.11
plotly:
description: Migrating from Mapbox traces to MapLibre traces.
display_as: basic
language: python
layout: base
name: MapLibre Migration
order: 1
page_type: example_index
permalink: python/mapbox-to-maplibre/
redirect_from: python/mapbox-migration/
thumbnail: thumbnail/line-and-scatter.jpg
---

## Migrating from Mapbox traces to MapLibre traces

With the release of Plotly.py v5.24.0, we are introducing a new set of trace types for maps with tile underlays, including from Plotly Express:
- `px.scatter_map`
- `px.line_map`
- `px.choropleth_map`
- `px.density_map`

as well as Plotly Graph Objects:
- `go.Choroplethmap`
- `go.Scattermap`
- `go.Densitymap`

These traces replace the existing Mapbox traces, `px.scatter_mapbox`, `px.line_mapbox`, etc., but use [MapLibre](https://maplibre.org) as the map renderer rather than Mapbox.

When switching to the new traces, keep an eye out for improved rendering performance, WebGL2 support, and over time, improved features in the Plotly map traces inherited from the MapLibre renderer, including projection support, globe views, terrain support, and support for modern mapping standards.

You can learn more about the motivations for this change in our [announcement post](https://plotly.com/blog/plotly-is-switching-to-maplibre/).

As a result of removing Mapbox as the rendering engine, we're also removing the Mapbox branding from these trace names. This means that migrating from Mapbox traces to MapLibre traces will require some code changes in your projects.

1. Change trace names from `*mapbox` to `*map`. For any existing trace name ending in `*mapbox`, ensure you've removed the "`box`" suffix.
2. If in use, update `layout.mapbox` argument in your layout configuration to `layout.map`. The nested properties are identical in the new map traces, so no other changes should be required.
3. If in use, update `mapbox_style` to `map_style`.
4. Verify your `map_style` settings. With `mapbox` traces, we bundle `basic`, `streets`, `outdoors`, `light`, `dark`, `satellite`, and `satellite-streets` styles, using Mapbox styling. These style names are still available, but they now reference slightly different styles provided by other tools.

Note that Mapbox API keys are no longer required for Plotly-provided styles, but using external styles in your Plotly maps, remains supported with the existing API.

### Style changes
Built-in styles in map traces are free styles from [Carto](https://carto.com) and [ESRI](https://www.esri.com/en-us/home). Several names are re-used from the previous Mapbox styles.
<p align="center">
<img src="https://raw.githubusercontent.com/plotly/plotly.js/master/test/image/baselines/map_predefined-styles1.png" alt="Style comparison part 1" width="45%" />
<img src="https://raw.githubusercontent.com/plotly/plotly.js/master/test/image/baselines/map_predefined-styles2.png" alt="Style comparison part 2" width="45%" />
</p>