<!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">
Just a note for those trying to do the same thing. Bob was
successful when he changed his function name to be all lowercase.<br>
<pre class="moz-signature" cols="72">Best Regards,
Brent Fraser</pre>
<br>
On 5/24/2011 8:34 AM, Brent Fraser wrote:
<blockquote cite="mid:4DDBC1EB.5020509@geoanalytic.com" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
Bob,<br>
<br>
Have a look at <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://www.geomoose.org/docs/user_extensions.html">http://www.geomoose.org/docs/user_extensions.html</a>
and varoius pages on the wiki (<a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://www.geomoose.org/wiki/index.php/Main_Page">http://www.geomoose.org/wiki/index.php/Main_Page</a>),
and the functions defined in the geomoose.js file. The functions
in the file are the user-accessible "official" GeoMOOSE API.
These resources may give you a few ideas.<br>
<br>
In one of my sites, I needed to get the value of the selected
item in a combo box and use it for input value in services.<br>
<br>
My combo box is a little complicated; the important bits are
id="GA_SelectedImage" and the first part of the option value
(1,2,3,etc)<br>
<br>
<div id="control-panel"><br>
<center><br>
Image:<br>
<select id="GA_SelectedImage"
onchange="GeoMOOSE.UX.registered_extensions.GA_ImageOps.prototype.zoomToImage(this.value);"><br>
<option value="">Choose Image:</option><br>
<option
value="1:-2172034,13348962,-1027313,14456993:Landsat/p230r005_20010703">L7
2001-07-03 p230-r005</option><br>
<option
value="2:-2564614,12851203,-1468813,13863841:Landsat/p230r006_20010703">L7
2001-07-03 p230-r006</option><br>
<option
value="3:-2564614,12851203,-1468813,13863841:Landsat/p231r006_20010608">L7
2001-06-08 p231-r006</option><br>
<br>
<br>
I have a service called "add_polygon" (see the Feature Editor doc)
where one of the inputs is defined as "imageid":<br>
<br>
<service name="add_polygon"><br>
<input type="ga_get_imageid" name="feature:imageid"
value="0"/><br>
<br>
<br>
Note the type tag value refers to my custom input type. And [I
think?] since its outside the the "<step>" tag it is not
shown to the user. If I wanted to make it visible and changeable
by the user I could have done:<br>
<br>
<service name="add_polygon"><br>
<br>
<step type="input"><br>
<input type="ga_get_imageid" name="feature:imageid"
value="0"/><br>
<br>
<br>
I defined the type by creating a Javascript file in the extensions
folder containing:<br>
<br>
GeoMOOSE.Services.InputType.GetImageID =
OpenLayers.Class(GeoMOOSE.Services.InputType, {<br>
MAPBOOK_NAME: "ga_get_imageid",<br>
<br>
getValue: function() {<br>
var selection =
document.getElementById('GA_SelectedImage');<br>
var theValue =
selection.children[selection.selectedIndex].value;<br>
<br>
var aParams = theValue.split(':');<br>
var id = aParams[0];<br>
return id;<br>
}<br>
});<br>
<br>
And my JavaScript file is loaded in my main html page:<br>
<script type="text/javascript"
src="extensions/GeoAnalytic_Custom.js"></script> <br>
<br>
So basically, when the service is invoked, it processes the input
types, and calls the ga_get_imageid function. The function finds
the combo box control, gets the selected value, and returns the
important part of the value. GeoMoose sets the service's input
type value to that returned value and passes it to the target URL
of the service.<br>
<br>
Somewhat complicated, but it separates my custom JavaScript from
the standard GeoMOOSE (making updates much easier).<br>
<pre class="moz-signature" cols="72">Best Regards,
Brent Fraser</pre>
<br>
On 5/23/2011 12:11 PM, Bistrais, Bob wrote:
<blockquote
cite="mid:4EFF8BB964547748A07CA32961810C041B47CE9A@SOM-TEAQASMAIL1.som.w2k.state.me.us"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 11 (filtered
medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<div class="Section1">
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">Hi,<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">I’m looking
to dynamically control some of the parameter values in
mapbook.xml. In a nutshell, I’ve been able to save a
selected town name by holding it in a hidden input in
index.html. So what I’d like to do, in the
search_parcels service, is to update a parameter with
that town name. I believe it would make use of some
javascript, but I’m not quite sure how to do it. Any
suggestions? Any more clarification needed?<o:p></o:p></span></font></p>
</div>
<br>
</blockquote>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
<a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/quest-d2dcopy1">http://p.sf.net/sfu/quest-d2dcopy1</a></pre>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Geomoose-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Geomoose-users@lists.sourceforge.net">Geomoose-users@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/geomoose-users">https://lists.sourceforge.net/lists/listinfo/geomoose-users</a>
</pre>
</blockquote>
</body>
</html>