Skip to content

Dropping Custom Map Markers #333

Answered by giswqs
iacisme asked this question in Q&A
Dec 23, 2022 · 2 comments · 6 replies
Discussion options

You must be logged in to vote

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.

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.a…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@iacisme
Comment options

Answer selected by giswqs
Comment options

You must be logged in to vote
5 replies
@rh-afk
Comment options

@giswqs
Comment options

@rh-afk
Comment options

@giswqs
Comment options

@rh-afk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants