ox-it / maps.ox

Maps for the University of Oxford
http://ox-it.github.io/maps.ox/
Other
1 stars 0 forks source link

Embedded maps sometimes fail to zoom in on loading #73

Closed ahaith closed 9 years ago

ahaith commented 9 years ago

Under some circumstances, an embedded view will show at a default zoom level framing Western Europe. Map content is present upon manually zooming into oxford.

screen shot 2014-11-21 at 14 45 41

This is fairly easily reproduced when viewing the embedding instructions via github.io: http://ox-it.github.io/maps.ox/embedding.html

On my system, using Safari 7.1 panels containing a #?custom path will exhibit this problem on around 25% of refreshes. I've not been able to reproduce it in Chrome or Firefox, nor in Safari while the Dev tools panel is open. It doesn't seem to happen on Martin's Macbook.

When one of the embedded custom map fails in this way, all custom maps embedded in the same page do so.

I've seen this once happening to a search view.

ahaith commented 9 years ago

No solution yet, but a few findings:

I suspect this may a fairly sensitive timing issue where some other system is causing a change/reset of the map's zoom level, which sometimes occurs after the POICollection has set it to the desired value. UpdateBounds() does get called twice via MapView.resetMapContents(): once when the POIcollection is first assigned to the map view, and then a second on sync of the collection.

ahaith commented 9 years ago

Fixed by https://github.com/ox-it/maps.ox/commit/6e5f35051e70113e697a73d5adbd1cd01987acac