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 25, 2024
1 parent 0f44ed9 commit 71ab5bc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 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,29 @@ 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:
try:
from bqplot_gl import ScatterGL as Scatter
except ImportError:
raise ImportError(
"Please install bqplot_gl using 'pip install --pre bqplot-gl'"
)
else:
from bqplot import Scatter

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

Expand Down

0 comments on commit 71ab5bc

Please sign in to comment.