Exemple #1
0
def show_all_stations():
    """
    this view will show the all the stations available in Dublin
    :return: HTML template
    """
    markers = all_stations()
    db_map = Map(
        identifier="db_map",
        lat=53.234,
        lng=-6.239999,
        markers=markers,
        fit_markers_to_bounds=True
    )
    db_map.style = 'height:95vh;width:98.5vw;margin:0;'
    return render_template('stations.html', db_map=db_map)
Exemple #2
0
def nearer_stations():
    """
    this view will show all the nearer bike station of a given address
    :return: HTML template
    """
    if request.method == 'GET':
        return render_template('search.html', sl_map='')

    elif request.method == 'POST':
        address = request.form.get('searched_address')
        markers = get_nearer_stations(address)
        sl_map = Map(
            identifier="db_map",
            lat=53.234,
            lng=-6.239999,
            markers=markers,
            fit_markers_to_bounds=True
        )
        sl_map.style = 'height:95vh;width:98.5vw;margin:0;'
        return render_template('search.html', sl_map=sl_map)