Is that the right syntax?<br><br>
<div class="gmail_quote">On Wed, Apr 2, 2008 at 12:16 PM, Christopher Schmidt <<a href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div></div>
<div class="Wj3C7c">On Wed, Apr 02, 2008 at 10:57:31AM -0600, Linda Rawson wrote:<br>> I have several custom enhancements I have made to the source code. With the<br>> onset of a new release I would like to put these in a separate file and<br>
> "override" the code that is in the release. For instance I might want to<br>> add the following function, just an example, it might already be in there to<br>> Map.js<br>><br>> getLayerByName: function(name) {<br>
> var foundLayer = null;<br>> for (var i = 0; i < this.layers.length; i++) {<br>> var layer = this.layers[i];<br>> if (<a href="http://layer.name/" target="_blank">layer.name</a> == name) {<br>
> foundLayer = layer;<br>> }<br>> }<br>> return foundLayer;<br>> },<br>> Would I do something like the following in a .js file to be called after<br>> Openlayers.js?<br>
><br>> Map.prototype.getLayerByName=function(name) {<br>> var foundLayer = null;<br>> for (var i = 0; i < this.layers.length; i++) {<br>> var layer = this.layers[i];<br>> if (<a href="http://layer.name/" target="_blank">layer.name</a> == name) {<br>
> foundLayer = layer;<br>> }<br>> }<br>> return foundLayer;<br>> }<br>><br><br></div></div>Yes, this is what I would do.<br><br>Regards,<br><font color="#888888">--<br>
Christopher Schmidt<br>MetaCarta<br></font></blockquote></div><br><br clear="all"><br>-- <br>Linda Rawson