GoogleMap issues loading

I followed https://github.com/openhab/openhab/wiki/GoogleMap page and made one for my site. It works 1 out of 20 times I view it, I think the issue has to do with timing. I found a page that talks about the issue, but I don’t know how to modify the script to be event based.

My map.html
http://maggie.robotics.net:8082/static/map.html

Hi Nathan,

the I’ve seen the problem here as well and did remove the auto-zoom functionality. But the link you found might be the answer …

1st just remove the calls to “updateZoom” (but keep the function) - then the page should load (w/o auto zoom).

If that works ok we can try to re-enable auto zoom via event handler:

google.maps.event.addListener(map, ‘tilesloaded’, function(evt) { updateZoom(); });

See line #61 in file:
https://dl.dropboxusercontent.com/u/1781347/GoogleMap.html

Let me know if this helped (then I’ll update the wiki).

with kind regards,
Patrik

Yep, that fixed it. I can load static/map.html every time now correctly, however when I reference that map.html in my sitemap I still only get House location.

P.S. Also no longer need “sensor=false”, it will still work, but there is a warning in console.

thank you for the feedback; I’ll update the wiki with the new info.

Unfortunately I do not know why it does not work in the sitemap; however - I noticed that after .html updates I’ve to wipe the cache (android) - or even use a different name for the file to make sure it does not use an outdated version. But not sure if that’s the problem or not.

With kind regards,
Patrik

one thing I do to make the map run a little easier is use from any address ie localhost, 192.168.2.15, or my public address

              url     : "../rest/items/mqttDavidLatitude/state",

Instead of defining the exact IP address.
The “…/” works like DOS “CD…” going up one directory out of /static/ to the base address in use.

              url     : "http://192.168.10.100:8080/rest/items/mqttPatrikLatitude/state",

I see mine in the sitemap when I am accessing it with a webpage but not when I try to use the app.

in the app I get

HTTP ERROR 500
Problem accessing /proxy. Reason:
    host parameter is null

Caused by:
java.lang.IllegalArgumentException: host parameter is null

This is because the IOS app tunnels all connections to your local LAN through the APP. It means it cannot find the address “host is null” use the …/rest… or a FQDN… The webview also dont like SSL hence the 500 crashes…