示例#1
0
文件: maps.py 项目: rlmv/doc-trips
def embed_map(stops):
    """
    Embed a google map in the page, showing directions
    along the passed stops. The stop[0] is the origin,
    stop[-1] the destination. Intermediate stops are
    waypoints on the route.
    """
    orig, waypoints, dest = _split_stops(stops)

    return loader.get_template("transport/maps/embed.html").render(
        Context({"orig": orig, "waypoints": waypoints, "dest": dest, "key": settings.GOOGLE_MAPS_BROWSER_KEY})
    )
示例#2
0
def embed_map(stops):
    """
    Embed a google map in the page, showing directions
    along the passed stops. The stop[0] is the origin,
    stop[-1] the destination. Intermediate stops are
    waypoints on the route.
    """
    orig, waypoints, dest = _split_stops(stops)

    return loader.get_template('transport/maps/embed.html').render(
        {
            'orig': orig,
            'waypoints': waypoints,
            'dest': dest,
            'key': settings.GOOGLE_MAPS_BROWSER_KEY,
        }
    )