Skip to content

Commit

Permalink
Add webGL option for rendering GPS traces
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Nov 24, 2024
1 parent 0f44ed9 commit 7dddd22
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion leafmap/maplibregl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3953,6 +3953,7 @@ def edit_gps_trace(
fig_width: str = "1550px",
fig_height: str = "300px",
time_format: str = "%Y-%m-%d %H:%M:%S",
webGL: bool = False,
**kwargs,
) -> Any:
"""
Expand All @@ -3969,18 +3970,24 @@ def edit_gps_trace(
fig_width (str, optional): The width of the figure. Defaults to "1550px".
fig_height (str, optional): The height of the figure. Defaults to "300px".
time_format (str, optional): The time format for the timestamp. Defaults to "%Y-%m-%d %H:%M:%S".
webGL (bool, optional): Whether to use WebGL (bqplot-gl) for rendering. Defaults to False.
**kwargs: Additional keyword arguments.
Returns:
Any: The main widget containing the map and the editing interface.
"""

from datetime import datetime
from bqplot import LinearScale, Scatter, Figure, PanZoom
from bqplot import LinearScale, Figure, PanZoom
import bqplot as bq
from ipywidgets import VBox, Button
import ipywidgets as widgets

if webGL:
from bqplot_gl import ScatterGL as Scatter
else:
from bqplot import Scatter

output = widgets.Output()
download_widget = widgets.Output()

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ apps = ["streamlit-folium", "voila", "solara"]
vector = ["geopandas", "osmnx", "pmtiles", "flask", "flask-cors", "lonboard", "mapclassify"]
pmtiles = ["pmtiles", "flask", "flask-cors"]
ai = ["geopandas", "osmnx", "localtileserver>=0.10.4", "rastervision", "pytorch-lightning", "torchgeo"]
maplibre = ["geopandas", "h3", "ipyvuetify", "localtileserver", "mapclassify", "maplibre", "pmtiles", "rioxarray", "xarray"]
maplibre = ["geopandas", "h3", "ipyvuetify", "localtileserver", "mapclassify", "maplibre", "pmtiles", "rioxarray", "xarray", "bqplot-gl>=0.1.0a0"]
gdal = ["gdal", "pyproj"]

[tool]
Expand Down

0 comments on commit 7dddd22

Please sign in to comment.