In [1]:
import emapy as epy

In [2]:
map = epy.mapCreation(41.388790,2.158990)

In [3]:
map


Out[3]:

In [4]:
epy.mapAddMarker(map, 41.388790,2.158990, 'glyphicon-home', 'blue', 'Prueba simple map')
map


Out[4]:

In [5]:
cluster = epy.mapWithMarkerCluster(map, "Restaurants Barcelona")

In [6]:
locationAreaBoundingBox = (41.3248770036,2.0520401001,41.4829908452,2.2813796997)

In [7]:
data = epy.getDatabaseFromOSM('restaurantes', 'amenity', False, True, locationAreaBoundingBox, 'restaurant')

In [9]:
idNodes = []
for d in data:
    tmp = d["properties"]          
    name = ""
    if 'name' in tmp:
        name = tmp["name"]
    
    idNode = str(d['geometry'][0]) +  str(d['geometry'][1]) + name
    if idNode not in idNodes:
        idNodes.append(idNode)
        epy.mapAddMarkerToCluster(cluster, d["geometry"][0], d["geometry"][1], 'glyphicon-glass', 'green', name)

In [11]:
epy.mapSave(map, '../reports/maps/mapOfRestaurantsBCNWithSimpleMap.html')

In [ ]: