datadavev / DwC_views

Implements viewers for Darwin Core record repositories
1 stars 0 forks source link

DwC JQuery Client - Map View - Map Resize Not Working #56

Closed coreyo closed 13 years ago

coreyo commented 13 years ago

The DwCMapView is not properly resizing itself to fit the parent container. It now only appears as a very small portion of a map on the parent container.

coreyo commented 13 years ago

The ultimate problem is that the resize event in the google maps API is an asynchronous call. Because there is no public way to determine the actual current size of the google map element, this makes it impossible to know if/when the map has been properly sized to the container element after unhiding the map view. We will have to call a map resize every time that the map view is shown/unhidden. Since the resize event generates an additional idle event, the idle callback function will need to be smart enough to know when, and when not to refresh its dynamic marker set. For now, I suggest making sure that the idle callback function saves its current map bounds and only resizes if those bounds have changed.

coreyo commented 13 years ago

Above solution appears to be working sufficiently. Closing the ticket unless there are any further objections.