[mapguide-users] Fusion Viewer API - missing .js ?

Greg gbneff at cid.utah.gov
Fri Aug 12 17:25:27 EDT 2011


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.


More information about the mapguide-users mailing list