var option= dom.byId("selectfield"); var optionValue = option.options[option.selectedIndex].value; console.log(optionValue); if (optionValue == "ON"){map.centerAndZoom(pt, 12);} else {} }
Solved! Go to Solution.
addGraphic(pt); var option= dom.byId("selectfield"); var optionValue = option.options[option.selectedIndex].value; console.log(optionValue); if (option.value == "ON"){map.centerAndZoom(pt, 12);} else {}
var option= dom.byId("selectfield"); var optionValue = option.options[option.selectedIndex].value; console.log(optionValue); if (optionValue == "ON"){map.centerAndZoom(pt, 12);} else {}
<select data-dojo-type="dijit/form/Select" class="field" name="selectfield" id="selectfield"> <option value="ON">TRACKING ON</option> <option value="OFF">TRACKING OFF</option> </select>
require([ "esri/map", "esri/geometry/Point", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/graphic", "esri/Color", "dojo/domReady!" ], function( Map, Point, SimpleMarkerSymbol, SimpleLineSymbol, Graphic, Color ) {
require([ "dojo/dom", "esri/map", "esri/geometry/Point", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/graphic", "esri/Color", "dojo/domReady!" ], function( dom, Map, Point, SimpleMarkerSymbol, SimpleLineSymbol, Graphic, Color ) {