<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Hi,<br>
the problem was caused by a class which directly inherits from
Control class. I don't know why but when I use an other class as
parent class it works and Control class is only once in the file
build by the python-script.<br>
It works now, but I would like to know why it's not working with
Control so I send below the code of the attributes and constructor
maybe someone sees the error:<br>
<pre style="font-family: consolas;"><span style="color: darkgreen;">/**
* @requires OpenLayers/Control.js
*/</span>
<span style="color: darkgreen;">/**
*
* Inherits from:
* - <OpenLayers.Control>
*/</span>
OpenLayers.Control.AudioSearchControl = OpenLayers.Class(OpenLayers.Control, {
        resultDiv: <span style="color: blue;">null</span>,
        coordsDiv: <span style="color: blue;">null</span>,
        iconActive: <span style="color: maroon;">'olControlAudioItemActive menuIcon'</span>,
        iconInactive: <span style="color: maroon;">'olControlAudioItemInactive menuIcon'</span>,
        iconActiveSide: <span style="color: maroon;">'olControlAudioLeftActive menuIconLeft'</span>,
        iconInactiveSide: <span style="color: maroon;">'olControlAudioLeftInactive menuIconLeft'</span>,
        toggle: <span style="color: blue;">true</span>,
        clickOut: <span style="color: blue;">false</span>,
        audioLayer: <span style="color: blue;">null</span>,
        featureLayer: <span style="color: blue;">null</span>,
        layer: <span style="color: blue;">null</span>,
        lemmataArray: [],
        korpusContainer: <span style="color: blue;">null</span>,
        mediaPointArray: [],
        activeFeature: <span style="color: blue;">null</span>,
        layerSelect: <span style="color: blue;">null</span>,
        featureSelect: <span style="color: blue;">null</span>,
        geometryTypes: <span style="color: blue;">null</span>,
        selectControl: <span style="color: blue;">null</span>,
        featureSelectControl: <span style="color: blue;">null</span>,
        initialize: <span style="color: blue;">function</span> (options) {
                OpenLayers.Control.prototype.initialize.apply(<span style="color: blue;">this</span>, [options]);
                <span style="color: blue;">this</span>.geometryTypes = [<span style="color: maroon;">"OpenLayers.Geometry.Polygon"</span>];
        },
...
</pre>
<br>
<br>
Am 14.02.2011 07:46, schrieb Slawomir Messner:
<blockquote cite="mid:4D58CFD0.1070803@staff.uni-marburg.de"
type="cite">Am 12.02.2011 12:12, schrieb Eric Lemoine:
<br>
<blockquote type="cite">On Friday, February 11, 2011, Slawomir
Messner
<br>
<a class="moz-txt-link-rfc2396E" href="mailto:slawomir.messner@staff.uni-marburg.de"><slawomir.messner@staff.uni-marburg.de></a> wrote:
<br>
<blockquote type="cite">Hi,
<br>
I updated our version of OpenLayers to svn trunk. Now I get
the following error:
<br>
P is undefined
<br>
I debugged a lot and there seems to be a problem with classes
which inherit from a class which is not directly inherits form
Class, like ZoomPanel where this error occurs first. Then I
tried to fix it with adding OpenLayers.Control as first
inherit class:
<br>
OpenLayers.Control.ZoomPanel =
OpenLayers.Class(OpenLayers.Control,OpenLayers.Control.Panel,...
<br>
this works but then the next class came where the parent class
is not Control or Class it self. So I edited all of them (I
was not expect that this is the solution but I was interested
what next comes). The next thing was that the Navigation
control couldn't initialize the DragPan. OL.Control.DragPan
was undefined.
<br>
This was the point where I rollback the changes till the
update and tried it with several older versions of Class,
OpenLayers.js but nothing helped, the error was OpenLayers is
undefined.
<br>
In hope someone can help me so I don't have to rollback before
the update and we can stay compatible with the new trunk.
<br>
</blockquote>
<br>
Hi. Could you please provide a small example (with actual code)
<br>
demonstrating the problem? We haven't seen any problem with the
new
<br>
Class impl. until now.
<br>
<br>
<br>
</blockquote>
Hi,
<br>
I made some more debugging. When I pull out all our custom classes
out of the build of OpenLayers and include them by script-tags all
is fine. So push them back and then I found the reason why some
classes which inherits form classes that inherit from Control
throw P is undefined and why not all. It's because the code of
Control is twice in the build OpenLayers.js. First at the
beginning and second at line 7xxxx, in the second half of the
code. So after the second time all classes which inherited from
Control are gone.
<br>
I pulled out the custom class which is after the second control
code in the build but it didn't help. So now I will pull all our
classes out and put them one after another back in.
<br>
If someone knows what to look for or the reason why control could
be pasted twice, then I would be thankful to know. It would maybe
save a lot of time.
<br>
There are probably missing or to many @requires tag.
<br>
<br>
<br>
_______________________________________________
<br>
Dev mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Dev@lists.osgeo.org">Dev@lists.osgeo.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/openlayers-dev">http://lists.osgeo.org/mailman/listinfo/openlayers-dev</a>
<br>
<br>
</blockquote>
<br>
</body>
</html>