Ticket #9204: stand_alone_icon_generation.diff
File stand_alone_icon_generation.diff, 1.5 KB (added by , 16 years ago) |
---|
-
django/contrib/gis/maps/google/gmap.py
71 71 else: 72 72 getattr(self, varname).append(overlay_class(overlay)) 73 73 74 # Pull ingany icons from the markers.75 self. icons = [marker.icon for marker in self.markers if marker.icon]74 # Pull any icons from the markers. 75 self._generate_icon_list() 76 76 77 77 # If GMarker, GPolygons, and/or GPolylines are used the zoom will be 78 78 # automatically calculated via the Google Maps API. If both a zoom … … 90 90 if center is None: center = (0, 0) 91 91 self.center = center 92 92 93 def _generate_icon_list(self): 94 """ 95 Sets the icon list for this map in 96 ``self.icons`` 97 98 This method is a stand alone so that it may be called again after the map 99 object created (in case new markers are added to the map after its 100 instantiation). 101 102 """ 103 self.icons = [marker.icon for marker in self.markers if marker.icon] 104 return None 105 93 106 def render(self): 94 107 """ 95 108 Generates the JavaScript necessary for displaying this Google Map. 96 109 """ 110 self._generate_icon_list() 97 111 params = {'calc_zoom' : self.calc_zoom, 98 112 'center' : self.center, 99 113 'dom_id' : self.dom_id,