#9204: Google Maps Marker to change the Icon
-------------------------------+--------------------------------------------
          Reporter:  qingfeng  |         Owner:  jbronn                         
            Status:  reopened  |     Milestone:  1.1                            
         Component:  GIS       |       Version:  1.0                            
        Resolution:            |      Keywords:  geodjango google map icon gicon
             Stage:  Accepted  |     Has_patch:  1                              
        Needs_docs:  0         |   Needs_tests:  0                              
Needs_better_patch:  0         |  
-------------------------------+--------------------------------------------
Changes (by prairiedogg):

  * status:  closed => reopened
  * resolution:  fixed =>

Comment:

 The last minute changes that jbronn did on this patch were correct,
 removing the icons declaration from the GMap object reduced redundancy,
 but it broke some of my code because I have cases where I add markers to a
 GMap instance after instantiation.  Since jbronn's patch sets self.icons
 with a statement in __init__, any markers with new icons after the Gmap's
 instantiation won't show up when Gmap.render() is called.

 To solve this issue I made a small patch that generates a map instance's
 icon list twice.  Once at instantiation and again at "runtime" (in
 Gmap.render() ) when the icons are written into js variables on the
 template (or called at any time manually in client code).  It may be
 possible to remove the method call from __init__ altogether and just
 calculate which icons belong in the Gmap instance when the instance is
 rendered.  I'll let another pair of eyes go over this one.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9204#comment:17>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
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