import json
from ipyleaflet import AwesomeIcon, Marker, Map
markers = []
with open('./bars.json', 'r') as fobj:
bars = json.load(fobj)
for feature in bars['features']:
symbol = feature['properties']['marker-symbol']
coords = feature['geometry']['coordinates']
icon = AwesomeIcon(
name=symbol,
marker_color='red' if symbol == 'bus' else 'blue'
)
markers.append(Marker(icon=icon, location=(coords[1], coords[0])))
m = Map(center=(38.91342738235981, -77.03912909142674), zoom=13)
for marker in markers:
m += marker
m
markers[0].icon = AwesomeIcon(name='spinner', marker_color='green', icon_color='darkgreen', spin=True)