I'm trying to place markers based on the latitude and longitude stored in a 
model on a Google Map using the API and HTML5 geolocation.

The issue is how to loop through the lat/lon info for each object stored in 
the database within JavaScript tags using template keywords, which I'm not 
sure can be done in Django.

I found a similar question which I mildly modified and placed within a 
template – not a separate script file – but it doesn't seem to work:

    function loadMarkers(){
            {% for story in stories %}
            var point = new 
google.maps.LatLng({{story.latitude}},{{story.longitude}});
                var marker = new google.maps.Marker({
                position: point,
                map: map
            });
            {% endfor %}    
        }

Any insight on how to properly loop through items in a stored Django object 
with lat, lon info and place these on a Google Map using the API would be 
very appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/zTEN_VxzQkAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to