OpenStreetMap.js error: OpenLayers.Layer.OSM is undefined

382 views
Skip to first unread message

Jeremy Epstein

unread,
Jun 29, 2009, 4:09:41 AM6/29/09
to geod...@googlegroups.com
Hi,

(cross-posting from django-users list)

I'm working on a Django hobby project on-and-off, and it makes heavy
use of GIS and OSM. The last time I worked on the project was several
weeks ago. Today, I fired up Django again to do some more work on it.
However, it seems that the display of OSM widgets in admin screens is
now broken. On pages that are supposed to display a widget, only the
navigation control buttons (pan/zoom) show, and there's just white
space where the map should get rendered. The checkboxes to toggle
layers is also not getting rendered.

Firebug is giving me this error:

OpenLayers.Layer.OSM is undefined
http://www.openstreetmap.org/openlayers/OpenStreetMap.js
Line 56

See screenshot also:
http://basement.greenash.net.au/screenshots/django_osm_error.png

I'm not aware of any changes I've made to my code, that could have
caused this behavior. I'm also not sure if this is a problem with the
code on the OSM side, or with the code on the Django side - I'm pretty
new to it all. I'm hoping that other people can reproduce this bug.

I was going to submit this straight to the Django core issue queue,
but I thought I should go through this mailing list first, in case
this is all a silly mistake on my part. But if it is a bug, then I'll
go ahead and submit it to the queue, and it would be great to get it
fixed.

Thanks,
Jeremy.

cka...@googlemail.com

unread,
Jun 29, 2009, 6:11:36 AM6/29/09
to geodjango
I have heavy problems runing the OSM/OpenLayers-Javascript-Libraries
with Internet-Explorer. It works fine with Firefox. Thats maybe your
problem.

On Jun 29, 10:09 am, Jeremy Epstein <jazepst...@gmail.com> wrote:
> Hi,
>
> (cross-posting from django-users list)
>
> I'm working on a Django hobby project on-and-off, and it makes heavy
> use of GIS and OSM. The last time I worked on the project was several
> weeks ago. Today, I fired up Django again to do some more work on it.
> However, it seems that the display of OSM widgets in admin screens is
> now broken. On pages that are supposed to display a widget, only the
> navigation control buttons (pan/zoom) show, and there's just white
> space where the map should get rendered. The checkboxes to toggle
> layers is also not getting rendered.
>
> Firebug is giving me this error:
>
> OpenLayers.Layer.OSM is undefinedhttp://www.openstreetmap.org/openlayers/OpenStreetMap.js

Ariel Nunez

unread,
Jun 29, 2009, 11:09:54 AM6/29/09
to geod...@googlegroups.com
I am having the same issue in one of my sites (saw that happening yesterday) and was able to reproduce just now with django r11122
http://skitch.com/ariel/bih4r/selectionnez-l-objet-parc-a-changer-agrimap-site-d-administration

BTW, OpenStreetMap.js issues a 301, maybe that file has been changed by them and is now incompatible with GeoDjango.

Ariel.

On Sun, Jun 28, 2009 at 9:48 PM, Jeremy Epstein <jazep...@gmail.com> wrote:

Hi,

Charlie DeTar

unread,
Jun 29, 2009, 11:58:57 AM6/29/09
to geod...@googlegroups.com
I can confirm the same problem here. It looks as though OpenLayers has
updated their API to a new version (2.8 instead of 2.7). I haven't
explored why, but using the newer OpenLayers version 2.8 instead of 2.7
seems to fix the issue.

I opened a ticket with a patch to do this:
http://code.djangoproject.com/ticket/11401

-charlie

Justin Bronn

unread,
Jun 29, 2009, 3:03:00 PM6/29/09
to geod...@googlegroups.com
Charlie DeTar wrote:
> I opened a ticket with a patch to do this:
> http://code.djangoproject.com/ticket/11401

Thanks, Charlie. Fixed it with r11125 in trunk and r11126 for 1.0.X.
Springmeyer found the root cause of the problem -- the OSM JavaScript
was modified to only support OpenLayers 2.8:

http://trac.openstreetmap.org/changeset/16131

On the upside, at least it happened before the 1.1/1.0.3 releases which
are due any day now.

-Justin

Jeremy Epstein

unread,
Jun 29, 2009, 8:39:44 PM6/29/09
to geod...@googlegroups.com
Thanks, Charlie!

After updating to r11126, all is working perfectly again.

On a related note: are we able to subscribe to get notified about new
releases of OSM? Particularly compatibility-breaking releases? From
Googling and poking around on openstreetmap.org, I (surprisingly)
couldn't find any release announcement or changelog entry for the new
2.8 version of the API. So I'm not sure if this is currently possible.
Anyway, we should be keeping an eye on OSM now and then, as well as on
all other third-party services that we're relying on.

Cheers,
Jeremy.

Charlie DeTar

unread,
Jun 29, 2009, 10:17:50 PM6/29/09
to geod...@googlegroups.com
Jeremy Epstein wrote:
> Thanks, Charlie!
>
> After updating to r11126, all is working perfectly again.
>
> On a related note: are we able to subscribe to get notified about new
> releases of OSM? Particularly compatibility-breaking releases? From
> Googling and poking around on openstreetmap.org, I (surprisingly)
> couldn't find any release announcement or changelog entry for the new
> 2.8 version of the API. So I'm not sure if this is currently possible.
> Anyway, we should be keeping an eye on OSM now and then, as well as on
> all other third-party services that we're relying on.
>
> Cheers,
> Jeremy.

The new release was for OpenLayers, not Open Street Maps. Open Street
Maps is just a map data provider used with OpenLayers (OpenLayers does
the slippy map interface; it was OpenLayers' open street maps
implementation that was broken).

I don't know about lists, but this would probably be the place to start
looking:

http://openlayers.org/

First glance finds no announcement list or blog that carried anything
about the API update, other than a change in the version linked as
"stable" on the front page.

-charlie

cka...@googlemail.com

unread,
Jun 30, 2009, 2:40:02 AM6/30/09
to geodjango
OpenLayers 2.8 was announced in their IRC chan.

But back to _my_ problem:-) does anybody having problems with running
OpenLayers in Internet Eplorer, too?

Ariel Nunez

unread,
Jun 30, 2009, 11:00:25 AM6/30/09
to geod...@googlegroups.com
OpenLayers 2.8 was announced in their IRC chan.
We were talking about OpenStreetMap announcing they were dropping compatibility of OL 2.7 on their stable lib.
 
But back to _my_ problem:-) does anybody having problems with running
OpenLayers in Internet Eplorer, too?

The idea of this threads is that we can solve one problem at a time. Please make a new post with your problems and the detailed issues you are having, screenshots, error tracebacks, etc.

Ariel.
Reply all
Reply to author
Forward
0 new messages