I'm trying to pass in a list from a database from Flask, into Javascript to make Google Maps api markers. For example, from Flask, I'm passing to home.html a list of cars and their longitude and latitude. I then want to loop over this list, and create a google map marker for each location and put it on the map.
function placeCars() {
{% for cars in car_locations %}
var position = {
lat: cars.Location.Latitude,
lng: cars.Location.Longitude
};
new google.maps.Marker({
position: position,
map: map
});
{% endfor %}
}