Closed enigmista91 closed 8 years ago
Use a list-comprehension
map = Map(
...
markers=[
{
'icon': icons.dots.green,
'lat': item['lat'],
'lng': item['lng'],
'infobox': "This is the box for item %s" % item
} for item in lista_co
]
...
)
or
map = Map(...)
map.build_markers(markers)
or
map = Map(...)
for m in lista_co:
map.add_marker(m['lat'], m['lng'])
many thanks
Hi,
in fullmap I want pass a series of markers lat long extract from mydatabase, but I don't understand How can I pass the list of dict.
like for m in lista_co: appo=[ { 'icon': '//maps.google.com/mapfiles/ms/icons/green-dot.png', 'lat': m['lat'], 'lng': m['long'], 'infobox': "Questo e' un marker di prova" }] markers.append(appo) I want pass markers to Map ()...