Ticket #9204: overlays.patch
File overlays.patch, 1.1 KB (added by , 16 years ago) |
---|
-
overlays.py
184 184 return render_to_response('mytemplate.html', 185 185 {'google' : GoogleMap(markers=[marker])}) 186 186 """ 187 def __init__(self, geom, title=None ):187 def __init__(self, geom, title=None, icon=None): 188 188 """ 189 189 The GMarker object may initialize on GEOS Points or a parameter 190 190 that may be instantiated into a GEOS point. Keyword options map to … … 205 205 self.envelope = geom.envelope 206 206 # TODO: Add support for more GMarkerOptions 207 207 self.title = title 208 self.icon = icon 208 209 super(GMarker, self).__init__() 209 210 210 211 def latlng_from_coords(self, coords): … … 213 214 def options(self): 214 215 result = [] 215 216 if self.title: result.append('title: "%s"' % self.title) 217 if self.icon: result.append('''icon: eval("icon=new GIcon(G_DEFAULT_ICON);icon.image='%s';icon")''' % self.icon) 216 218 return '{%s}' % ','.join(result) 217 219 218 220 @property