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
Maddy,
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?
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?
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.
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!
OK, it seems that your whole org is not public and that is why I am getting challenged to log in when trying to access your web map.
Ah! I figured it out. Here is the correct URL for the map.
But the problem remains after I use these new URLs. At this point, I am not accepting the query function to work (more changes still needed). But shouldn't the map load?
/////////////////////////////////////////////////////////////
// Modified MMK now my map
app.map = new Map("map");
var basemap = new ArcGISDynamicMapServiceLayer("https://www.arcgis.com/home/webmap/viewer.html?webmap=8e5f8705d24943eebc1c18ff18d1dc55&extent=-105.5...");
app.map.addLayer(basemap);
// query task and query for parcels
//modified my MMK now BOCO building footprint polygons
app.qtParcels = new QueryTask("https://services1.arcgis.com/44C95LOqZjbh8Row/arcgis/rest/services/BuildingRelateDepth/FeatureServer...");
app.qParcels = new Query();
// query task and query for landuse
//modified by MMK now table for attribute query
app.qtBuildings = new QueryTask("https://services1.arcgis.com/44C95LOqZjbh8Row/arcgis/rest/services/BuildingRelateDepth/FeatureServer...");
app.qBuildings = new Query();
///////////////////////////////////////////////////////////
My continuous thanks!
Maddy,
Do you not have a parcel polygon layer to use in this sample? It looks like one of your urls is building footprints but the other is just a related table. As Munachiso is stating in their response you can not use a web map url as the url for a ArcGISDynamicMapServiceLayer.
Hello Maddy,
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, 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:
Manage results from multiple queries | ArcGIS API for JavaScript 3.23
But I will try working with a simpler example first.
ArcGIS API for JavaScript Sandbox
Thanks again! I would welcome any additional advice,