Giter VIP home page Giter VIP logo

here-map-widget-for-jupyter's People

Contributors

deeplook avatar sackh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

here-map-widget-for-jupyter's Issues

Map doesn't trigger bounds change events

The Map seems not to trigger a bounds name change event like ipyleaflet does. I see a zoom and center one, but it would be much easier to not have to calculate the bounds from that.

MapSettingsControl does not update

After creating/showing a MapSettingsControl it seems impossible to add layers to it such that they appear in the control. It would be nice to see that happen like in ipyleaflet.LeayersControl.

import os
from here_map_widget import (Map, DefaultLayers, DefaultLayerNames,
    GeoJSON, MapSettingsControl, ZoomControl)

api_key = os.getenv("HEREMAPS_API_KEY")
basemap = DefaultLayers(layer_name=DefaultLayerNames.raster.normal.map)
m = Map(center=[52.5, 13.4], zoom=10, basemap=basemap, api_key=api_key) 
m.add_control(ZoomControl(alignment="LEFT_TOP"))
basemaps = [DefaultLayerNames.raster.normal.map, DefaultLayerNames.raster.normal.transit]
url = "https://raw.githubusercontent.com/johan/world.geo.json/master/countries.geo.json"
layers = [GeoJSON(url=url)]
layers = [{"label": "countries", "layer": GeoJSON(url=url)}]
msc = MapSettingsControl(basemaps=basemaps, layers=layers)

# does not add second layer
msc.layers.append({"label": "countries2", "layer": GeoJSON(url=url)})

m.add_control(msc)

# does not add second layer
msc.layers.append({"label": "countries2", "layer": GeoJSON(url=url)})

m

Make fully installable on Pyodide/JupyterLite?

It seems one can install this package on Pyodide and hence JupyterLite using micropip, but the maps don't show, yet, indicating there is some issue with the JupyterLab extension. You can try on JupyterLite. Maybe worth giving a thought?

import micropip
await micropip.install(
    "https://opencomputinglab.github.io/vce-wheelhouse/wheelhouse/"
    "MarkupSafe-2.0.1-py2.py3-none-any.whl"
)
await micropip.install("here-map-widget-for-jupyter")
from here_map_widget import Map

api_key = "******"
m = Map(api_key=api_key, center=[52.51, 13.39], zoom=4)
m  # gives: Loading widget...

Outdated

This widget definitely needs an update...

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

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(...)

Support for XYZ and WMS tile layers?

Thank you for developing this awesome package. I particularly like the 3D feature, which ipyleaflet is lacking.

Do you plan to support XYZ and WMS tile layers? I would love to incorporate this package into geemap if it can support XYZ and WMS tile layers. Thanks.

3D shapes with extrusion values > 2047 are not rendered

I want to display really big geometric shapes on the surface of a map, think boxes of arbitrary height using the extrusion parameter of a Rectangle, say. But in code like below, similar to this the rectangle is rendered only for values up to a maximum of 2047 (meters?). Above this number no rectangle is rendered.

The official documentation mentions map.Polygon.MAX_EXTRUDE_HEIGHT, but it seems not to be supported in Python. Can it be set higher than 2047 and can it be exposed in Python?

import os
from here_map_widget import Bbox, Map, Rectangle

api_key = os.environ["LS_API_KEY"]
lon, lat = [50, 13]
m = Map(api_key=api_key, center=[lon, lat], zoom=8)
style = {"strokeColor": "#829", "lineWidth": 4}
bbox = Bbox(top=lon + 0.5, left=lat - 0.5, bottom=lon - 0.5, right=lat + 0.5)
rectangle = Rectangle(bbox=bbox, style=style, elevation=0, extrusion=2047)
m.add_object(rectangle)
m

screenshot

Support ipywidgets >=8

This project currently requires ipywidgets <8. However, versions 8.0.0 - 8.0.2 are available.

Layout for ipywidgets seems to be ignored

It looks like the layout for ipywidgets is not properly handled. I've seen this for buttons (should be square in the example below), but it might happen with other elements, too.

import os
from ipywidgets import Button, Layout
from here_map_widget import Map, DefaultLayers, DefaultLayerNames, WidgetControl

api_key = os.getenv("HEREMAPS_API_KEY")
basemap = DefaultLayers(layer_name=DefaultLayerNames.raster.normal.map)
m = Map(center=[52.5, 13.4], zoom=10, basemap=basemap, api_key=api_key) 
layout = Layout(width="28px", height="28px")
btn = Button(icon="globe", layout=layout)
m.add_control(WidgetControl(widget=btn, alignment="LEFT_TOP"))
m

Screenshot 2021-03-04 at 09 54 14

Support Python 3.10?

Maybe support the recently released Python 3.10 with according tests in GitHub actions. Just an idea.

widget not loading after following installation instructions

Instructions
$ npm config set @here:registry https://repo.platform.here.com/artifactory/api/npm/here-node/
$ pip install here-map-widget-for-jupyter
$ jupyter nbextension install –py –sys-prefix here_map_widget
$ jupyter nbextension enable here_map_widget –py –sys-prefix

Code
from here_location_services import LS
from here_map_widget import Map, GeoJSON
ls = LS(api_key=my_key)

address = "Invalidenstr 116, 10115 Berlin, Germany"
gc_response = ls.geocode(query=address)

data = gc_response.to_geojson()
geo_layer = GeoJSON(data=data)

m = Map(api_key=my_key, center=[52.53086, 13.38469], zoom=12)
m.add_layer(geo_layer)
m

does not display map widget

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.