<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<blockquote
cite="mid:CAHRZm1vP5c9yx_09nbcxeYLAqEKv8goPQgZ5x9Pd3dA4jgs=Eg@mail.gmail.com"
type="cite">
<div>i am trying to understand the initialize code in the <a
moz-do-not-send="true" href="http://dpaste.de/t214A/">link</a>.</div>
<div><br>
</div>
<div>It is encapsulated in the OpenLayers.Click command,</div>
<div><br>
</div>
<div>OpenLayers.Control.Click =
OpenLayers.Class(OpenLayers.Control, { <a moz-do-not-send="true"
href="http://dpaste.de/t214A/">link</a> });</div>
<div><br>
</div>
<div>I am not able to understand what exactly the initialization
code is doing and what 'this' implies?</div>
</blockquote>
<br>
First, you dont need to understand this to use it. You would work
with this in openlayers by manipulating openlayer.control
properties. This is code for creating a new descendent of an
openlayers control. The kind that live in openlayers/lib/control.<br>
<br>
If you havent worked with OO languages, this probably isnt the best
place to start.<br>
<br>
Anyway, the basics of it are to create a new descend of the
openlayer.control class. when your code does a myvar = new
Openlayers.control.click, then the initialise code is called. "this"
is the way you refer to owner of the function - the specific
instance of the class. What the code does is:<br>
- combines the various options into the handleroptions property.<br>
- call the prototype (Openlayers.control) initialize method<br>
- set the handler property of the handler to be a new instance of
the openlayers click handler control, using the handleroption
property.<br>
<br>
A javascript language reference text would be a good place to go.
The openlayers list isnt really a place to learn javascript.<br>
<p><span style="font-family:'Arial';font-size:8pt; color:#000000;">Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.</span></p>
<p><span style="font-family:'Arial';font-size:8pt; color:#000000;"> </span></p></body>
</html>