Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #10072 -- `GMarker` overlays now have `draggable` option. Thank…

…s to prairiedogg for ticket and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10002 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit cee31735f768322e2239857195cdb36e1fecc850 1 parent 392f81c
@jbronn jbronn authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 django/contrib/gis/maps/google/overlays.py
View
9 django/contrib/gis/maps/google/overlays.py
@@ -184,7 +184,7 @@ def sample_request(request):
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 @@ def __init__(self, geom, title=None):
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 @@ def __init__(self, geom, title=None):
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 latlng_from_coords(self, coords):
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

0 comments on commit cee3173

Please sign in to comment.
Something went wrong with that request. Please try again.