Ticket #11211: django_overlays_with_zindex.patch

File django_overlays_with_zindex.patch, 3.1 KB (added by Ubercore, 15 years ago)
  • django/contrib/gis/maps/google/overlays.py

     
    258258          return render_to_response('mytemplate.html',
    259259                 {'google' : GoogleMap(markers=[marker])})
    260260    """
    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):
    262264        """
    263265        The GMarker object may initialize on GEOS Points or a parameter
    264266        that may be instantiated into a GEOS point.  Keyword options map to
     
    270272
    271273         draggable:
    272274           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.
    273299        """
    274300        # If a GEOS geometry isn't passed in, try to construct one.
    275301        if isinstance(geom, basestring): geom = fromstr(geom)
     
    281307        # Getting the envelope for automatic zoom determination.
    282308        self.envelope = geom.envelope
    283309        # TODO: Add support for more GMarkerOptions
     310        # TODO: zIndexProcess is all that is left currently (05-27-2009)
    284311        self.title = title
    285312        self.draggable = draggable
    286313        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
    287320        super(GMarker, self).__init__()
    288321
    289322    def latlng_from_coords(self, coords):
     
    294327        if self.title: result.append('title: "%s"' % self.title)
    295328        if self.icon: result.append('icon: %s' % self.icon.varname)
    296329        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)
    297337        return '{%s}' % ','.join(result)
    298338
    299339    @property
Back to Top