let say i have a table definition with latitude and longitude as double, 
and want to show it in SQLFORM.grid view. is it possible to achieve it 
using web2py?
i've tested it before and an error occured said :

Traceback (most recent call last):
  File "/Users/MacBookPro/site/web2py/gluon/restricted.py", line 227, in 
restricted
    exec ccode in environment
  File 
"/Users/MacBookPro/site/web2py/applications/op/views/report/report_check_point.html",
 line 77, in <module>
NameError: name 'row' is not defined


e.g.
*views/report/report_check_point.html*
{{extend 'layout.html'}}

{{=grid}}

<style>
#map {
width: 500px;
height: 400px;
}
</style>

<div id="map"></div>

<script>
function initMap() {
var mapDiv = document.getElementById('map');

var latlon = new google.maps.LatLng( *{{=row.id.lat}}, {{=row.id.lon}}* );

var mapOptions = {
        center: latlon,
        zoom: 15
        };

        var map = new google.maps.Map(mapDiv, mapOptions);

        var marker = new google.maps.Marker({
   position: latlon, 
   map: map
  });
}
</script>

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

thanks and best regards,
stifan

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to