Geolocation incompatibilities with jQueryMobile/AJAX

Hi, I'm working on a mobile theme for Omeka and everything is pretty much working save for one annoying bug. I'm using the jQueryMobile framework, which uses AJAX hash navigation to load pages. This works fine, more or less, except for on item/show pages displaying the item map (generated by the Geolocation plugin).

So this works:

But this DOES NOT:

To get the URL that works, I need to disable AJAX (by adding a target= or rel= attribute to the link element leading to items/show pages). This doesn't pose much of a problem, really, unless the user has "installed" the site as a (web)app, in which case those links will open into the browser, rather than loading internally as might be expected.

I'm using the geolocation_public_show_item_map() function to load the item map and have experimented with breaking it out so that the geolocation_scripts() can be loaded in some other order (assuming there is some conflict), but haven't had much luck so far. It seems that as long as I'm using a hash (#) in the URL, the map is not going to load properly.

Any advice?

My initial suspicion is that the Geolocation plugin contains some code that behaves differently if it detects that the page is loaded through AJAX.

The URL itself shouldn't really matter.

I'll do a little more checking around to see if this is the case.

Ignore the above, it does seem like it's a somewhat tricky issue with however the page is being loaded: the external javascripts don't appear to be loading before the inline javascript code does. (The error on item/show pages is google is not defined, meaning that the Google Maps API isn't loaded.)

It appears that the page #/geolocation/map/browse is a problem one also (I was thinking it might be different because the scripts on that page are loaded in the <head>.

It looks like you'll have to manually add the Geolocation scripts to the "main" AJAX page if you want to keep the AJAX loading but also have the maps work.

No idea what kind of caching you are using or if this is just a red herring, but I came across this that mentions a gotcha about downloading files.