Manage results from multiple queries | ArcGIS API for JavaScript 3.23
I am interested in modifying the API javascript example above. I am confused on the maps and data the example is referencing. I have an ArcOnline map ready to go with shared polygon data. When I try to change the referenced map and data below the app breaks. I think I might be using the wrong formats. My map and data aren't 'Map Servers'.
Any help would be appreciated
Sandbox example:
My web map:
http://dugis.maps.arcgis.com/home/webmap/viewer.html?webmap=e350b9fa73314f78b356aef06fc6308d
Hello Maddy,
So you can start off with something like this https://jsbin.com/fohexopeyu/4/edit?html,js,output
Essentially, we do the following:
This sample is kind off rough and can be updated to be more efficient (like using just one queryTask instead of two and using Div's to show the result instead of an Alert). But I think it is a good start.
Thanks, Munachiso and Robert. So I guess maybe I explain the larger project since it seems the example I am basing everythign off of might not be the best fit. I am try to develop a simple web app that calculates cost based off a polygon layer and hosted table. Once a user selects their building, the polygons attributes are should select (query) the appropriate $%. The design flow is:
This is why I was interested in modifying:
But I will try working with a simpler example first.
ArcGIS API for JavaScript Sandbox
Thanks again! I would welcome any additional advice,
I would use this example instead (https://developers.arcgis.com/javascript/3/jssamples/ags_createwebmapid.html). Looking at your past responses, it seems you are trying to load in a webmap using a ArcGISDynamicMapServiceLayer class which will not work. If you want to load a webmap from Arcgis online then you would use arcgisUtils.createMap(). Then you can add any layers you want to the web map.
Thanks Robert for all your help. I again checked the map and it shows the same thing as above- shared with Everyone (public).
I'll try searching other places on GeoNet for a solution.
Best!
Maddy,
So the layers are public but the web map seems like it is not so I can not look at the web map to get to the layer urls.
Hmm, maybe that is part of the problem? When I check the map and the two layers it contains, all items say they are shared. See below.
Any recommendations?
The web map link you shared in this thread is not public so I can not view the layers you are using in that web map. The fact that your layer are likely FeatureServer service vs MapServer services like the sample is not going to be an issue. Are the services you are using in your web map shared publicly?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.