Ticket #9204: overlays.patch

File overlays.patch, 1.1 KB (added by QingFeng, 16 years ago)
  • overlays.py

     
    184184          return render_to_response('mytemplate.html',
    185185                 {'google' : GoogleMap(markers=[marker])})
    186186    """
    187     def __init__(self, geom, title=None):
     187    def __init__(self, geom, title=None, icon=None):
    188188        """
    189189        The GMarker object may initialize on GEOS Points or a parameter
    190190        that may be instantiated into a GEOS point.  Keyword options map to
     
    205205        self.envelope = geom.envelope
    206206        # TODO: Add support for more GMarkerOptions
    207207        self.title = title
     208        self.icon = icon
    208209        super(GMarker, self).__init__()
    209210
    210211    def latlng_from_coords(self, coords):
     
    213214    def options(self):
    214215        result = []
    215216        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)
    216218        return '{%s}' % ','.join(result)
    217219
    218220    @property
Back to Top