#9955: GoogleMap support for multiple maps ---------------------------------+------------------------------------------ Reporter: mandric | Owner: nobody Status: new | Milestone: Component: GIS | Version: 1.0 Resolution: | Keywords: maps gmaps gis javascript Stage: Unreviewed | Has_patch: 1 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | ---------------------------------+------------------------------------------ Changes (by aromano):
* needs_better_patch: => 0 * has_patch: 0 => 1 * needs_tests: => 0 * needs_docs: => 0 Comment: I have had the same exact problem these days, so I decided to make a patch for this. I have created a new GoogleMapSet object, which works the following way: gmaps = GoogleMapSet(key=api_key, maps=gmap_objects) where gmap_objects is a vector of (traditional) GoogleMap instances. When a DOM name is not specified, unique ones are generated. In the templating system, the way to access the GMaps changes as follows: <div id="{{ gmaps.maps.0.dom_id }}"></div> <!-- But also maps.1, maps.2 ... (in the order specified in gmaps_objects) --> In JS code, map is then being replaced by a maps[] array. This patch also includes the GMarker advanced features in #9440, and does not aim to be the best one, it is just a way to fix the solution. Feel free to change it and improve it. -- Ticket URL: <http://code.djangoproject.com/ticket/9955#comment:1> 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 django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---