<script type="text/javascript">
    function initMap() {
        var myLatLng = {lat: 40.46366700000001, lng: -3.7492200000000366};
        var map = new google.maps.Map(document.getElementById('map'), {
            zoom: 5,
            center: myLatLng
        });

        var markers = [];
        {{

    associa = db.associacions.with_alias("a")
    poblacio = db.poblaciones.with_alias("p")
    rows= 
db(associa).select(associa.nom,poblacio.poblacion,poblacio.latitud,poblacio.longitud,left=[poblacio.on(poblacio.poblacion
 == associa.poblacio)])
    i=1
    for r in rows:
    }}

        var marker{{=i}} = new google.maps.Marker({
            position: new google.maps.LatLng(parseFloat({{=r.p.latitud}}), 
parseFloat({{=r.p.longitud}})),
            map: map,
            title: "{{=r.a.nom.replace("\n","")}}",
        });
        markers.push(marker{{=i}});

    {{

    i+=1
    pass
    }}
        var markerCluster = new MarkerClusterer(map, markers);
    }
</script>

<script async defer
src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY";>
</script>

<body>
    <div style="height: 100%; width: 100%;" id="map"></div>
</body>



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to