Ticket #10072: overlays.py.diff
File overlays.py.diff, 1.5 KB (added by , 16 years ago) |
---|
-
overlays.py
184 184 return render_to_response('mytemplate.html', 185 185 {'google' : GoogleMap(markers=[marker])}) 186 186 """ 187 def __init__(self, geom, title=None ):187 def __init__(self, geom, title=None, draggable=False): 188 188 """ 189 189 The GMarker object may initialize on GEOS Points or a parameter 190 190 that may be instantiated into a GEOS point. Keyword options map to … … 193 193 Keyword Options: 194 194 title: 195 195 Title option for GMarker, will be displayed as a tooltip. 196 197 draggable: 198 Draggable option for GMarker, disabled by default 199 196 200 """ 197 201 # If a GEOS geometry isn't passed in, try to construct one. 198 202 if isinstance(geom, basestring): geom = fromstr(geom) … … 205 209 self.envelope = geom.envelope 206 210 # TODO: Add support for more GMarkerOptions 207 211 self.title = title 212 self.draggable = draggable 208 213 super(GMarker, self).__init__() 209 214 210 215 def latlng_from_coords(self, coords): … … 212 217 213 218 def options(self): 214 219 result = [] 215 if self.title: result.append('title: "%s"' % self.title) 220 if self.title: result.append('title: "%s"' % self.title) 221 if self.draggable: result.append('draggable: true') 216 222 return '{%s}' % ','.join(result) 217 223 218 224 @property