web/views/igeocodable.py
branchstable
changeset 3918 0b7390acca7f
parent 3094 978ed8c2c0e4
child 3998 94cc7cad3d2d
child 4212 ab6573088b4a
equal deleted inserted replaced
3917:0f912c1cde28 3918:0b7390acca7f
    75 
    75 
    76     def call(self, gmap_key, width=400, height=400, uselabel=True, urlparams=None):
    76     def call(self, gmap_key, width=400, height=400, uselabel=True, urlparams=None):
    77         self.req.demote_to_html()
    77         self.req.demote_to_html()
    78         # remove entities that don't define latitude and longitude
    78         # remove entities that don't define latitude and longitude
    79         self.rset = self.rset.filtered_rset(lambda e: e.latitude and e.longitude)
    79         self.rset = self.rset.filtered_rset(lambda e: e.latitude and e.longitude)
    80         self.req.add_js('http://maps.google.com/maps?sensor=false&file=api&v=2&key=%s' % gmap_key,
    80         self.req.add_js('http://maps.google.com/maps?sensor=false&file=api&v=2&key=%s' % gmap_key,
    81                         localfile=False)
    81                         localfile=False)
    82         self.req.add_js( ('cubicweb.widgets.js', 'cubicweb.gmap.js', 'gmap.utility.labeledmarker.js') )
    82         self.req.add_js( ('cubicweb.widgets.js', 'cubicweb.gmap.js', 'gmap.utility.labeledmarker.js') )
    83         rql = self.rset.printable_rql()
    83         rql = self.rset.printable_rql()
    84         if urlparams is None:
    84         if urlparams is None:
    85             loadurl = self.build_url(rql=rql, vid='geocoding-json')
    85             loadurl = self.build_url(rql=rql, vid='geocoding-json')