omeka / plugin-Geolocation

Allows administrative users to save geolocation data for an individual item. The plugin generates a Google map containing items with geolocation data and a web page for displaying the map.
http://omeka.org/codex/Plugins/Geolocation
12 stars 20 forks source link

Using shortcode inside jQuery UI tabs #44

Closed adehner closed 1 year ago

adehner commented 7 years ago

I'm using jQuery tabs in the items/browse template to browse Omeka items in specific collections. One tab displays a list of Omeka items and the 2nd tab displays geocoded items on a map. I'm using the geolocation shortcode to accomplish this.

Because Google maps don't display in hidden divs (tabs, accordions, etc.), I'm getting a blank grey box instead of my map. I've read several hacky solutions to initialize or resize the map when the map tab is clicked. And my question is this... Where do I put a script to initialize/resize the map when the tab is clicked?

I would greatly appreciate any pointers you can give me.

Thanks!

zerocrates commented 1 year ago

Obviously it's a little late for any action on our end on this issue.

Just for completion, I think you were already working with the idea of using Google's "resize" event (today, this would be done with Leaflet's "invalidateSize" function as we now use Leaflet in this plugin), triggered from the "tab changed" events provided by the tab library. This is still how this is done, for example we do this in the code for the "form" map since it's presented in a tab.

The only issue for a shortcode map would be getting hold of the Leaflet object, but Geolocation helpfully just sets a variable on the window with its map wrapper object.