yourcelf / olwidget

Javascript library to replace textareas that contain WKT data with editable OpenLayers maps, and a django app using it for django forms and admin.
Other
91 stars 44 forks source link

Firefox isn't able to display Bing maps anymore #97

Closed RobertoMaurizzi closed 12 years ago

RobertoMaurizzi commented 12 years ago

One of my user today reported that she's not able to display Bing maps anymore.

I created a new db for the test_project, synced it and started the test server with ./manage.py runserver Going to http://localhost:8000/admin/testolwidget/alienactivity/4/ and selecting any Bing maps, you get this error in Firefox Console:

[12:48:44.581] container is undefined @ http://openlayers.org/api/2.11/OpenLayers.js:2249

And the map background layer is empty. Switching map type after that gives you:

[12:48:52.459] mapInstance.GetCurrentMode() is null @ http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&s=1:149

I get this in FF 10.0.2 and 4.0.1.

Chrome and even IE8 are working correctly. Some change in Bing likely broke something... :-/

TIA, Roberto

yourcelf commented 12 years ago

Hmmm... they're working fine for me here, for FF 11 and Chromium 17: http://docs.olwidget.org/en/latest/_static/examples/other_providers.html

Can you provide any more info as to your setup, and whether the 'other providers' example is working for you?

RobertoMaurizzi commented 12 years ago

Sorry for the delay, first I was on vacation and then got a very bad cold :-/

I tried to run the other providers example but right now the HTML from that page tries to load olwidget.js from http://127.0.0.1:8000/static/olwidget/js/olwidget.js and it doesn't work (even if I change the test_project to serve it from there).

I also run some additional tests on my code, finding out that I was serving an older version of olwidget.js due to some mistakes in my deployment scripts... the problem is, even with the latest olwidget.js I still have the same problem with Firefox 11 (I tested it with package 11.0+build1-0ubuntu0.11.10.1).

To summarize, right now my situation is that If I use my application (Intranet only sadly...) I can load maps without problems in Chrome (Linux and Windows) and IE8, but not in FF 11 where I get mapInstance.GetCurrentMode() is null as before.

If/when you can fix the "other providers" example I can test again to see if I can find my problem.

TIA, Roberto

yourcelf commented 12 years ago

The "other providers" example is working for me as of the latest master. Is it not working for you still? Can you tell me what errors you see, or any other info to track it down?

RobertoMaurizzi commented 12 years ago

I get a page without the map and if I check the browser's console I see a:

[17:13:00.612] GET http://127.0.0.1:8000/static/olwidget/js/olwidget.js [undefined 0ms] followed by an "olwidget is not defined" (from FF... I suppose it's its way to tell it got a 'connection refused' error).

Just to be sure some proxy isn't playing funny jokes on me, can you confirm that in http://docs.olwidget.org/en/latest/_static/examples/other_providers.html line 19 contains:

I tried to clean caches and shift-reload everything, but there are too many proxies between my PC and the 'net, including some would-be-transparent national 'censorship' proxy... >___>

RobertoMaurizzi commented 12 years ago

sorry, I left out a part: do line 19 of your html page really contains a script link to localhost:8000? ^_^;

yourcelf commented 12 years ago

Thanks, that was indeed a bug. A pull request that added a custom map feature that I didn't audit sufficiently introduced a couple problems.

I've removed the offending example code; the example should work right now. Bing maps are functioning fine for me on that page.

-charlie

On 04/15/2012 09:28 AM, Roberto Maurizzi wrote:

I get a page without the map and if I check the browser's console I see a:

[17:13:00.612] GET http://127.0.0.1:8000/static/olwidget/js/olwidget.js [undefined 0ms] followed by an "olwidget is not defined" (from FF... I suppose it's its way to tell it got a 'connection refused' error).

Just to be sure some proxy isn't playing funny jokes on me, can you confirm that in http://docs.olwidget.org/en/latest/_static/examples/other_providers.html line 19 contains:

I tried to clean caches and shift-reload everything, but there are too many proxies between my PC and the 'net, including some would-be-transparent national 'censorship' proxy... >___>


Reply to this email directly or view it on GitHub: https://github.com/yourcelf/olwidget/issues/97#issuecomment-5139212

RobertoMaurizzi commented 12 years ago

Your example for multiple providers works without problem in my foxes... but my page continue to give me the same error, even after trying some direct substitution of the automatically generated script tags with your exact URLS.

In the end I did what I should have done from the beginning: search for the error on Google ^_^; and found this ticket for OpenLayers http://trac.osgeo.org/openlayers/ticket/3518 that tells all the story... with some bad news: OpenLayers.Layer.VirtualEarth is now deprecated and we should use OpenLayers.Layer.Bing that doesn't show the problem... but it requires the 'usual' API key :-/

Suggestions? :-(

RobertoMaurizzi commented 12 years ago

I was able to avoid the problem defining a global window.attachEvent if it doesn't exist and keeping it around forever for pages that display maps. I close this because we found the reason and the problem isn't strictly related to olwidget, even if maybe you/we should start thinking about the deprecation of VirtualEarth in OpenLayers.

Thank you :-)