Ticket #11211: django_overlays.patch
File django_overlays.patch, 2.9 KB (added by , 15 years ago) |
---|
-
django/contrib/gis/maps/google/overlays.py
250 250 return render_to_response('mytemplate.html', 251 251 {'google' : GoogleMap(markers=[marker])}) 252 252 """ 253 def __init__(self, geom, title=None, draggable=False, icon=None): 253 def __init__(self, geom, title=None, draggable=False, clickable=False, 254 bouncy=False, dragCrossMove=False, bounceGravity=1, 255 autoPan=True, hide=False, icon=None): 254 256 """ 255 257 The GMarker object may initialize on GEOS Points or a parameter 256 258 that may be instantiated into a GEOS point. Keyword options map to … … 262 264 263 265 draggable: 264 266 Draggable option for GMarker, disabled by default. 267 268 clickable: 269 Clickable option for GMarker, disabled by default. 270 271 bouncy: 272 Bouncy option for GMarker, disabled by default. 273 274 dragCrossMove: 275 Drag cross move option for GMarker, disabled by default. 276 277 bounceGravity: 278 Bounce gravity option for GMarker, 1 by default. 279 280 autoPan: 281 Auto pan option for GMarker, enabled by default. 282 283 hide: 284 Hide option for GMarker, disabled by default. 285 286 icon: 287 Icon option for GMarker, disabled by default. 265 288 """ 266 289 # If a GEOS geometry isn't passed in, try to construct one. 267 290 if isinstance(geom, basestring): geom = fromstr(geom) … … 273 296 # Getting the envelope for automatic zoom determination. 274 297 self.envelope = geom.envelope 275 298 # TODO: Add support for more GMarkerOptions 299 # TODO: zIndexProcess is all that is left currently (05-27-2009) 276 300 self.title = title 277 301 self.draggable = draggable 278 302 self.icon = icon 303 self.clickable = clickable 304 self.bouncy = bouncy 305 self.dragCrossMove = dragCrossMove 306 self.bounceGravity = bounceGravity 307 self.autoPan = autoPan 279 308 super(GMarker, self).__init__() 280 309 281 310 def latlng_from_coords(self, coords): … … 286 315 if self.title: result.append('title: "%s"' % self.title) 287 316 if self.icon: result.append('icon: %s' % self.icon.varname) 288 317 if self.draggable: result.append('draggable: true') 318 if self.clickable: result.append('clickable: true') 319 if self.bouncy: result.append('bouncy: true') 320 if self.dragCrossMove: result.append('dragCrossMove: true') 321 if self.bounceGravity: result.append('bounceGravity: %s' % 322 self.bounceGravity) 323 if not self.autoPan: result.append('autoPan: false') 289 324 return '{%s}' % ','.join(result) 290 325 291 326 @property