[mapguide-users] Fusion Viewer API - missing .js ?
Zac Spitzer
zac.spitzer at gmail.com
Sat Aug 13 01:40:06 EDT 2011
have your tried dumping the sel object into the browsers console
and investigating what you have to work with?
PS: always mention which version of fusion/mapguide your are working with :)
On Sat, Aug 13, 2011 at 7:25 AM, Greg <gbneff at cid.utah.gov> wrote:
> I am trying to write a simple selection handler for my fusion app but I am
> getting an error:
> http://osgeo-org.1803224.n2.nabble.com/file/n6681805/error.png
>
> /Here is what I have so far in my index.html file./
>
> <title>Cid_Map</title>
>
> <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
>
>
>
> <link rel="stylesheet" href="jxtheme.css" type="text/css" media="screen"
> charset="utf-8">
>
>
> <link rel="stylesheet" href="icons.css" type="text/css" media="screen"
> charset="utf-8">
> <script type="text/javascript">
>
> var dTasks;
> var dLegend;
>
> window.onload = function () {
> Fusion.initializeLocale(); //need to call this first if
> String.Translate is to be used in the onload
>
> Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED, function () {
> var map = Fusion.getMapByIndice(0);
> map.registerForEvent(Fusion.Event.MAP_SELECTION_ON, selectionOn);
> map.registerForEvent(Fusion.Event.MAP_SELECTION_OFF, selectionOff);
> });
>
> function selectionOn() {
> var map = Fusion.getMapByIndice(0);
> map.getSelection(selectionCallback);
> }
>
> function selectionCallback(sel) {
> *var numSel = sel.getNumElements();*
> if (numSel == 1) {
> alert(numSel + "item selected");
> }
> else {
> alert(numSel + "items selected.");
> }
> }
>
> function selectionOff() {
> // the user cleared the selection
> alert('Selection Cleared');
> }
>
> Maybe I need to include a reference to another .js file or should everything
> be included in fusionSF-compressed.js? I am probably missing something very
> simple.
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/Fusion-Viewer-API-missing-js-tp6681805p6681805.html
> Sent from the MapGuide Users mailing list archive at Nabble.com.
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
--
Zac Spitzer
Solution Architect / Director
Ennoble Consultancy Australia
http://www.ennoble.com.au
http://zacster.blogspot.com
+61 405 847 168
More information about the mapguide-users
mailing list