OK, I have decided I want to try to synchronize two maps. The reason I want to do this has to do with having a map print well when it's sized in ems or %, resulting in a different sized div on print. All that's not important, but I can do it with two synchronized maps, one of which is sized in pixels. I can then hide one or the other in CSS.
OK so here's the question: I managed to make the maps and synchronize them for everything except the infoWindows. How can I get a marker and infoWindow to show up on a second map when it's opened on the first map? I started by looking at: http://maps.forum.nu/gm_maps_in_sync.html and used some ideas there, but didn't see infoWindows used for this kind of thing anywhere. This is what I tried: GEvent.addListener(map, "infowindowopen", function() { var iw = map.getInfoWindow(); m = new GMarker(iw.getPoint()); map2.addOverlay(m); m.openInfoWindowTabs(iw.getTabs()); }); Where map is the first map that people interact with, and map2 is the second map that will be printed. The var m is declared outside the function so I can remove it with the "infowindowclose" event listener. And this is the most working thing I could get. Unfortunately, the infoWindow on the first map is blank, while the content _does_ get placed correctly on the second map. It seems the content just gets ripped out of the first infoWindow! The size of the infoWindow seems correct for the content, but there's nothing there. This can all be found at http://www.healthypetmobilevet.com/testarea.shtml but the script is at http://www.healthypetmobilevet.com/testmap.js Unfortunately I haven't put together a demo map yet. However, there are no errors in the error console in FF3. You can see the behavior if you click on a marker or search for a location. I tried using getInfoWindow().getContentContainers() instead of getTabs () but that didn't work. (like this): GEvent.addListener(map, "infowindowopen", function() { var iw = map.getInfoWindow(); var html = iw.getContentContainers(); m = new GMarker(iw.getPoint()); map2.addOverlay(m); m.openInfoWindow(html[0]); }); That had the same problem, but also it didn't properly re-size the infoWindow opened on the second map, and the content spilled out. I guess I'm wondering why the content gets removed from the first infoWindow. Any ideas? If I get some time I'll put together a simpler demo page. -Brian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" 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/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
