Julien
Julien
SSolara
Created by Julien on 1/26/2024 in #questions-issues
What is ipyleaflet.Map.element() ?
Hi, I hope this is not a silly question, but in the two Solara examples using ipyleaflet, it is called with ipyleaflet.Map.element(...), for example:
ipyleaflet.Map.element( # type: ignore
zoom=zoom.value,
on_zoom=zoom.set,
center=center.value,
on_center=center.set,
scroll_wheel_zoom=True,
layers=[
ipyleaflet.TileLayer.element(url=url),
ipyleaflet.Marker.element(location=marker_location.value, draggable=True, on_location=location_changed),
],
)
ipyleaflet.Map.element( # type: ignore
zoom=zoom.value,
on_zoom=zoom.set,
center=center.value,
on_center=center.set,
scroll_wheel_zoom=True,
layers=[
ipyleaflet.TileLayer.element(url=url),
ipyleaflet.Marker.element(location=marker_location.value, draggable=True, on_location=location_changed),
],
)
But there doesn't seem to be any element attribute to ipyleaflet.Map, and if I try to call it directly in Python I get an error:
>>> ipyleaflet.Map.element()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: type object 'Map' has no attribute 'element'
>>> ipyleaflet.Map.element()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: type object 'Map' has no attribute 'element'
So is this element attribute Solara-related ? Or is there something simpler I don't understand ? Thanks in advance for your help !
3 replies