http://arcgisserverurl/service/{layer1}
http://arcgisserverurl/service/{layer2}
<script> var serviceURL = "http://arcgisdev01:6080/arcgis/rest/services/Schools_Shared/MapServer/"; var queryURL; //trigger function on load //showAlert(); function getQueryURL() { var layerNum = document.getElementById("selectedYear").options[selectedYear.selectedIndex].value; queryURL = serviceURL + layerNum; //showAlert(serviceURL); //fill in text boxes to check my code document.getElementById("currentYear").value = layerNum; document.getElementById("fullURL").value = queryURL; } function showAlert() { alert(queryURL); } </script> <body> <select id="selectedYear" onchange="getQueryURL()"> <option value="1">Current Year</option> <option value="0">Projected Year</option> </select> <input type="text" id="currentYear" size="5"> <input type="text" id="fullURL" size="60"> <input type="button" value="Show URL" onclick="showAlert()"> </body>
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.