equal
deleted
inserted
replaced
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') |