Ticket #11211: django_overlays_with_zindex.patch
File django_overlays_with_zindex.patch, 3.1 KB (added by , 15 years ago) |
---|
-
django/contrib/gis/maps/google/overlays.py
258 258 return render_to_response('mytemplate.html', 259 259 {'google' : GoogleMap(markers=[marker])}) 260 260 """ 261 def __init__(self, geom, title=None, draggable=False, icon=None): 261 def __init__(self, geom, title=None, draggable=False, clickable=False, 262 bouncy=False, dragCrossMove=False, bounceGravity=1, 263 autoPan=True, hide=False, icon=None, zIndexProcess=None): 262 264 """ 263 265 The GMarker object may initialize on GEOS Points or a parameter 264 266 that may be instantiated into a GEOS point. Keyword options map to … … 270 272 271 273 draggable: 272 274 Draggable option for GMarker, disabled by default. 275 276 clickable: 277 Clickable option for GMarker, disabled by default. 278 279 bouncy: 280 Bouncy option for GMarker, disabled by default. 281 282 dragCrossMove: 283 Drag cross move option for GMarker, disabled by default. 284 285 bounceGravity: 286 Bounce gravity option for GMarker, 1 by default. 287 288 autoPan: 289 Auto pan option for GMarker, enabled by default. 290 291 hide: 292 Hide option for GMarker, disabled by default. 293 294 icon: 295 Icon option for GMarker, disabled by default. 296 297 zIndexProcess: 298 Function that will determine the z-Index of this marker. 273 299 """ 274 300 # If a GEOS geometry isn't passed in, try to construct one. 275 301 if isinstance(geom, basestring): geom = fromstr(geom) … … 281 307 # Getting the envelope for automatic zoom determination. 282 308 self.envelope = geom.envelope 283 309 # TODO: Add support for more GMarkerOptions 310 # TODO: zIndexProcess is all that is left currently (05-27-2009) 284 311 self.title = title 285 312 self.draggable = draggable 286 313 self.icon = icon 314 self.clickable = clickable 315 self.bouncy = bouncy 316 self.dragCrossMove = dragCrossMove 317 self.bounceGravity = bounceGravity 318 self.autoPan = autoPan 319 self.zIndexProcess = zIndexProcess 287 320 super(GMarker, self).__init__() 288 321 289 322 def latlng_from_coords(self, coords): … … 294 327 if self.title: result.append('title: "%s"' % self.title) 295 328 if self.icon: result.append('icon: %s' % self.icon.varname) 296 329 if self.draggable: result.append('draggable: true') 330 if self.clickable: result.append('clickable: true') 331 if self.bouncy: result.append('bouncy: true') 332 if self.dragCrossMove: result.append('dragCrossMove: true') 333 if self.bounceGravity: result.append('bounceGravity: %s' % 334 self.bounceGravity) 335 if not self.autoPan: result.append('autoPan: false') 336 if self.zIndexProcess: result.append('zIndexProcess: %s' % self.zIndexProcess) 297 337 return '{%s}' % ','.join(result) 298 338 299 339 @property