heremaps / here-map-widget-for-jupyter

Use HERE Maps API for JavaScript in your Jupyter Notebook.
https://here-map-widget-for-jupyter.readthedocs.io/en/latest/
MIT License
36 stars 9 forks source link

Adding/removing controls/layers with += and -= #4

Closed deeplook closed 3 years ago

deeplook commented 3 years ago

I can add controls and layers only with map.add_control() and add_layer() but I would also like to use += on the map as this shortens the code considerably when putting many things onto the map. In Ipyleaflet this is perfectly possible. It would be nice to have it here, too (no pun intended).

import os
from here_map_widget import Map, DefaultLayers, DefaultLayerNames, ZoomControl

api_key = os.getenv("HEREMAPS_API_KEY")
basemap = DefaultLayers(layer_name=DefaultLayerNames.raster.normal.map)
m = Map(center=[52, 13], zoom=6, basemap=basemap, api_key=api_key) 
m.add_control(ZoomControl(alignment="LEFT_TOP"))  # preferred: m += ZoomControl(...)
sackh commented 3 years ago

resolved in #5

deeplook commented 3 years ago

I still get this for a newly installed version 1.0.0.

Screenshot 2021-03-01 at 10 12 13
sackh commented 3 years ago

This change is not part of 1.0.0. Please check the changelog.