[Answer]-Passing Django variables into Google Maps javascript

1👍

You can create a location_json var in the view containing the desired data.

import json

location_json = json.dumps([
    [running.event.name, running.coords.latitude, running.coords.longitude] for running in running_list
])

Then in the Template:

var locations = {{ location_json|safe }};
👤Todor

Leave a comment