<div dir="ltr">opps forgot to add this to the list :)<br><br>You just need to create a couple of functions and a event register for the selection:<br><br><pre>function onInitialize() {<br>    var map = Fusion.getMapById(&#39;mapwindow&#39;); <br>
    map.registerForEvent(Fusion.Event.MAP_SELECTION_ON, selectionOn);<br><br><br>}<br><br>// event watcher. <br>function selectionOn() {<br>    var mapWidget = Fusion.getMapById(&#39;mapwindow&#39;); <br>    var maps = mapWidget.getAllMaps(); <br>
    var map = maps[0];<br><br>    // get the selection and trigger selectionLoaded with the obj<br><br>    map.getSelection(selectionLoaded.bind(null));<br>}<br><br>// selection loaded now zoom to the extents<br>function selectionLoaded(obj){<br>
    var a = [];<br><br>    a[0] = parseFloat(obj.fMinX);<br>    a[1] = parseFloat(obj.fMinY);<br><br>    a[2] = parseFloat(obj.fMaxX);<br>    a[3] = parseFloat(obj.fMaxY);<br><br>    var mapWidget = Fusion.getMapById(&#39;mapwindow&#39;); <br>
    var maps = mapWidget.getAllMaps(); <br>    var map = maps[0];<br><br>    map.mapWidget.setExtents(new OpenLayers.Bounds(a[0], a[1], a[2],  a[3]));<br><br>}</pre>You
will notice that in the selectionLoaded Func this object will return
the extents of the selection, Now in this function you need to just
trigger a &quot;zoomToExtents&quot; function with the extents<br><br><br>
Hope this helps<br><br>Cheers<br><br>Paul D. <br><br><div class="gmail_quote">On Fri, Sep 26, 2008 at 6:49 PM, Marc Pfister <span dir="ltr">&lt;<a href="mailto:mpfister@enplan.com">mpfister@enplan.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">








<div link="blue" vlink="purple" lang="EN-US">

<div>

<p>So how do I execute one widget from another one? I want the
MapServer search widget to zoom to the selection by calling the ZoomToSelection
widget. Is there a way to trigger a widget in Fusion similar to activating one
with activateWidget? Otherwise, what is the appropriate &nbsp;JS syntax?</p>

<p>&nbsp;</p>

<p>Fusion.Widget.ZoomToSelection.prototype.execute() at least
gets me to the ZoomToSelection function, but then I get an error about this.GetMap()
so I must be blowing it in the function scope.</p>

<p>&nbsp;</p>

<p><span style="font-size: 10pt; font-family: Wingdings; color: orange;">n</span><span style="font-size: 12pt;"><br>
</span><span style="font-size: 10pt; color: gray;">Marc Pfister<br>
Geospatial Data Manager<br>
ENPLAN<br>
<a href="mailto:mpfister@enplan.com" target="_blank">mpfister@enplan.com</a><br>
530/221-0440 x108<br>
530/221-6963 Fax</span><span style="font-size: 12pt;"></span></p>

<p>&nbsp;</p>

</div>

</div>


<br>_______________________________________________<br>
fusion-users mailing list<br>
<a href="mailto:fusion-users@lists.osgeo.org">fusion-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/fusion-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/fusion-users</a><br>
<br></blockquote></div><br></div>