[OpenLayers-Users] Problem with "OpenLayers not defined" and "OpenLayers.Protocol.HTTP"

Jürgen Dankoweit Juergen.Dankoweit at T-Online.de
Wed Aug 8 23:45:29 PDT 2012


Hello,


with a from OpenLayers.Format derived object I have a great problem and
I don't know where it is. Every time the object
"OpenLayers_Format_METARStation" is called the webbrowser shows me the
following error message:
Uncaught ReferenceError: OpenLayers is not defined meteoauswahl.js:54
(anonymous function)
The funny thing is that everything is displayed correctly...

The line 54 points to "OpenLayers.Class(" which is shown in the code
snippet below and it is marked with an arrow:

[...]
/* ================================================================ */
/* Objekte                                                          */
/* ================================================================ */
/* Neues Objekt erstellen f. dyn. Anpassung der dargest. Stationen  */
/* wird von OpenLayers.Format abgeleitet */
OpenLayers_Format_METARStation =
 OpenLayers.Class( // <---------------------
 OpenLayers.Format, {
  read: function(obj) {
   if (obj) {
[...]

The new object is called from OpenLayers.Protocol.HTTP as shown below:

[...]
format_ext = new OpenLayers_Format_METARStation();
protocol_ext = new OpenLayers.Protocol.HTTP({
    url: meteo_url_stationen,
    params: {
     per_page: 100,
     page: 1,
     lkz: ""
    },
    srsInBBOX: true,
    readWithPOST: false,
    readWithGET: true,
    format: format_ext
   });
[...]

Here is the link to the site on which the problem exists:
http://www.dankoweit.de/Wetterdienste/hp_wetterdienste_auswahl.html

I used the the example on the site
http://docs.openlayers.org/library/formats.html for my code.

I hope anybody could help because this error is very annoying.
Many thanks for the answers.

Best regards

Juergen
-- 
Meine stets unfertige Homepage: www.dankoweit.de


More information about the Users mailing list