windrobin / timemap

Automatically exported from code.google.com/p/timemap
MIT License
0 stars 0 forks source link

Polygons don't hide on first map filter #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
- normally, the sequence of loading and hiding goes like this:
1. items load, creating placemarks and adding them to the map
2. once all items are loaded, the map is filtered, hiding those not visible
on the timeline

- with polygons (and probably polylines), the sequence goes like this, as
far as I can tell:
1. items load, creating polygons and adding them to the map, but drawing
them takes time
2. once all items are loaded, the map is filtered. All polygons are told to
hide(). At this point, timemap.js thinks the polygons are hidden, AND the
polygons think they're hidden, but they aren't actually visible on the map yet.
3. the polygons finish drawing are are displayed on the map. Most of them
think they're hidden, but they get drawn anyway.

The issue here is that I don't think there's any way to know when the
polygons have finished drawing. This appears to be an asynchronous
operation, but I can't see anything in the GMaps API that can tell you (by
triggering an event) when it completes. The ideal would be to wait to
filter the map until after all the polygons are drawn (a fix to
TimeMap.init()); the less-than-ideal is to catch the "drawn" event outside
of TimeMap.init() and then show all items and filter them - but this still
requires knowing when the polygons have been drawn.

Original issue reported on code.google.com by nick.rab...@gmail.com on 22 May 2009 at 5:16

GoogleCodeExporter commented 9 years ago
This is a Google Maps bug, and they just fixed it (see
http://code.google.com/p/gmaps-api-issues/issues/detail?id=1264)

Basically, creating polygons and then calling hide() right away wasn't working
properly. This is fixed in the latest version of Google Maps, 2.159. To use this
version, use the URL:

http://maps.google.com/maps?file=api&v=2.159&key=[API key]

Original comment by nick.rab...@gmail.com on 25 May 2009 at 4:14