<jupyter_start><jupyter_text>Warning: Before running below cells please make sure you have API key.                 Please see README.md for more info on API key.<jupyter_code>import os

os.environ["LS_API_KEY"] = "MY-API-KEY"  # replace your API key here.
from here_map_widget import WidgetControl, Map
from ipywidgets import IntSlider, ColorPicker, jslink
import os

m = Map(api_key=os.environ["LS_API_KEY"])

zoom_slider = IntSlider(description="Zoom level:", min=0, max=15, value=7)
jslink((zoom_slider, "value"), (m, "zoom"))
widget_control1 = WidgetControl(widget=zoom_slider, alignment="TOP_RIGHT", name="IntSlider")

color_picker = ColorPicker(description="Pick a color:")
widget_control2 = WidgetControl(widget=color_picker, alignment="BOTTOM_RIGHT", name="ColorPicker")

m.add_control(widget_control1)
m.add_control(widget_control2)
m
from here_map_widget import WidgetControl, Map
from ipywidgets import FloatSlider, ColorPicker, jslink
import os

m = Map(api_key=os.environ["LS_API_KEY"])

zoom_slider = FloatSlider(description="Tilt level:", min=0, max=90, value=0)
jslink((zoom_slider, "value"), (m, "tilt"))
widget_control1 = WidgetControl(widget=zoom_slider, alignment="TOP_RIGHT", name="FloatSlider")

m.add_control(widget_control1)
m
# Camera rotate example

import os

from here_map_widget import Map, WidgetControl
from ipywidgets import IntSlider, jslink

m = Map(api_key=os.environ["LS_API_KEY"], center=[40.70808, -74.01426], zoom=16, tilt=45)

rotate_slider = IntSlider(description="Rotate:", min=0, max=360, value=0)
jslink((rotate_slider, "value"), (m, "heading"))
widget_control = WidgetControl(widget=rotate_slider, alignment="TOP_RIGHT", name="RotateSlider")

m.add_control(widget_control)
m<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12514285714285714, 'fraction_numerical': 0.021142857142857144, 'mean_word_length': 7.888324873096447, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '116116', 'license': 'MIT', 'n_tokens_mistral': 599, 'n_tokens_neox': 598, 'n_words': 136, 'path': 'examples/add_ipywidgets.ipynb', 'repo_name': 'heremaps/here-map-widget-for-jupyter', 'size': '1750'}