-
Hi; Is there a way to reproduce this AwesomeIcon example in Here is the image of the example in the AwesomeIcon: I've tried to replicate this example in my project, using Here is an image of the output I get: Here is the code I'm using to add markers to my Creating Nord Stream 1 Start Marker
Creating Nord Stream 1 End Marker
When I add the first Map marker, it shows up at the right location on the map, but as soon as I add the second one, I lose the first map marker and it only shows the I've tested a modified version of this code to run in Is it possible to do the same thing Thank you, and Merry Christmas! --Igor |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
The default layer name would be 'Untitled'. The later layer with the same name will overwrite the previous. Specify the from ipyleaflet import AwesomeIcon, Marker
from leafmap import Map
center = (38.91342738235981, -77.03912909142674)
icon1 = AwesomeIcon(
name='bus',
marker_color='red',
icon_color='black',
spin=False
)
marker1 = Marker(icon=icon1, location=(center[0], center[1] - 0.05), name='marker1')
icon2 = AwesomeIcon(
name='gear',
marker_color='green',
icon_color='darkgreen',
spin=True
)
marker2 = Marker(icon=icon2, location=(center[0], center[1] + 0.05), name='marker2')
m = Map(center=center, zoom=13)
m.add_layer(marker1)
m.add_layer(marker2)
m |
Beta Was this translation helpful? Give feedback.
-
You might also be interested in this example: https://leafmap.org/notebooks/50_marker_cluster/ |
Beta Was this translation helpful? Give feedback.
The default layer name would be 'Untitled'. The later layer with the same name will overwrite the previous. Specify the
name
parameter should resolve the issue.