Author: jbronn
Date: 2009-03-08 13:34:24 -0500 (Sun, 08 Mar 2009)
New Revision: 10002

Modified:
   django/trunk/django/contrib/gis/maps/google/overlays.py
Log:
Fixed #10072 -- `GMarker` overlays now have `draggable` option.  Thanks to 
prairiedogg for ticket and patch.


Modified: django/trunk/django/contrib/gis/maps/google/overlays.py
===================================================================
--- django/trunk/django/contrib/gis/maps/google/overlays.py     2009-03-08 
10:02:23 UTC (rev 10001)
+++ django/trunk/django/contrib/gis/maps/google/overlays.py     2009-03-08 
18:34:24 UTC (rev 10002)
@@ -184,7 +184,7 @@
           return render_to_response('mytemplate.html', 
                  {'google' : GoogleMap(markers=[marker])})
     """
-    def __init__(self, geom, title=None):
+    def __init__(self, geom, title=None, draggable=False):
         """
         The GMarker object may initialize on GEOS Points or a parameter
         that may be instantiated into a GEOS point.  Keyword options map to
@@ -193,6 +193,9 @@
         Keyword Options:
          title: 
            Title option for GMarker, will be displayed as a tooltip.
+         
+         draggable:
+           Draggable option for GMarker, disabled by default.
         """
         # If a GEOS geometry isn't passed in, try to construct one.
         if isinstance(geom, basestring): geom = fromstr(geom)
@@ -205,6 +208,7 @@
         self.envelope = geom.envelope
         # TODO: Add support for more GMarkerOptions
         self.title = title
+        self.draggable = draggable
         super(GMarker, self).__init__()
 
     def latlng_from_coords(self, coords):
@@ -212,7 +216,8 @@
     
     def options(self):
         result = []
-        if self.title: result.append('title: "%s"' % self.title) 
+        if self.title: result.append('title: "%s"' % self.title)
+        if self.draggable: result.append('draggable: true') 
         return '{%s}' % ','.join(result)
 
     @property


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to