<div id="navToolbar" > <div id="zoomin" onClick="HIGHLIGHT ME; navToolbar.activate(esri.toolbars.Navigation.ZOOM_IN);">Zoom In</div> <div id="zoomout" onClick="HIGHLIGHT ME; navToolbar.activate(esri.toolbars.Navigation.ZOOM_OUT);">Zoom Out</div> .... <div id="deactivate" onClick="UNHIGHLIGHT OTHERS; navToolbar.deactivate()">Deactivate</div> </div>
//this toggles the button highlight in the toolbar to show which tool is currently active //note - doesn't do the FullExtent since it's a button not a togglebutton function toggleButtonIcon(tool) { //only the tools in the toolbar are dijit togglebuttons so can iterate thru them dijit.registry.byClass("dijit.form.ToggleButton").forEach(function(togbtn) { if (togbtn == tool) { togbtn.attr("checked", true); } else { togbtn.attr("checked", false); } }); }
Do you know why dijit.registry.byClass may cause a TypeError? I'm getting dijit.registry.byClass is not a function. dijit/registry is already a requirement..
Note that for backwards compatibility, the dijit.registry global variable (as opposed to the dijit/registry module) includes array iterator methods (forEach, filter, byClass, map, every, and some). However, AMD code should not expect these functions to be available in the Object returned from require([“dijit/registry”]).
Okay, yes...I just read that as well. I'm now confused by my options, but I'll probably open a new thread unless you have a quick tip.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.