我想花一本字典来做模板网页.py

2024-10-01 02:19:10 发布

您现在位置:Python中文网/ 问答频道 /正文

我想花一本字典来做模板,但是打印出来的东西对我来说什么都没有,如果我在打印之前通过字典访问坐标。你知道吗

tweets = tweetCol.find({"contenido" : contenido, "direccion" : direccion,"radio" : radio} )
    for t in tweets:
        print t['CoordenadasTweet']
    return render.app(form, centro,tweets)

此打印:

这张照片是我想在模板上做的。你知道吗

    <script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyB4_8JwKM_0AkAM0YJouBBg0wYhWs8dHpY&sensor=false"></script>
<script>
var map;
function initialize() {
  var mapOptions = {
    zoom: 8,
    center: new google.maps.LatLng($direccion)
  };
  map = new google.maps.Map(document.getElementById('map-canvas'),
      mapOptions);

    $for t in tweets :
        var myLatlng = new google.maps.LatLng($t['CoordenadasTweet'][0], $t['CoordenadasTweet'][1]);
        var marker = new google.maps.Marker({
            position: myLatlng,
            map: map,
            title:"$t["ciudadUsuario"]"     
            });
    }

google.maps.event.addDomListener(window, 'load', initialize);

</script>

Tags: in模板mapnewfor字典vargoogle