POST
|
The layers in my map often have many overlapping features and when the popup is opened I'd like to be able to order them by a field in order to have the most relevant features at the top of the stack. Was able to find an older 3.x example of this, but I can't find the equivalent for 4.x. Any suggestions? No need to rewrite this for me, just point me to the right object/method/event if it exists, thanks! connect.connect(map.infoWindow, "onSetFeatures" , function () {
var orderedFeatures = [];
for ( var i = 0 ; i< map.infoWindow.features.length; i++ ) {
if (map.infoWindow.features[i]._layer.id === 'ImportantLayer' ) {
orderedFeatures.unshift(map.infoWindow.features[i]);
}
else {
orderedFeatures.push(map.infoWindow.features[i]);
}
}
map.infoWindow.features = orderedFeatures;
});
... View more
11-27-2020
02:59 PM
|
0
|
0
|
70
|
POST
|
Hi, When trying to use the Filter widget in combination with the Attribute Table widget, there seems to be a bug in that if a custom filter is applied with the Filter widget, no fields (except objectid) appear in the Attribute Table after its opened. I've tested this with the AGOL version and a couple WABde version including 2.16. Here are my steps: To do this, I have an app with widget including Filter, Layer List, Attribute Table, etc. Ensure layer is visible. From the Filter widget, apply any custom filter such as NameField = 'Feature Name' From the Layer List (3 circle button) select 'View in Attribute Table'. Only the objectid field is visible and no other fields can be shown. If I open that attribute table before applying the filter in the Filter widget all the fields are there and the filter behaves as expected, but a user shouldn't have to do this. The app must be refreshed to see the other fields again. Any ideas on how to fix this? Alternately, I know there is a custom filter section within the Attribute Table widget the behaves similar to the custom filters in the Filter widget. Unfortunately I'm being told its too many clicks to get to this. A solution I would like to get working is just add another item below 'View in Attribute Table' to be like 'Filter in Attribute Table' that opens the Attribute Table and directly open the custom filter option window. If I could do this, I could get rid of the Filter widget. Unfortunately the Layer List is a beast and haven't had success yet implementing this. Suggestions on that? Thanks for the help! Joe
... View more
05-12-2020
12:49 PM
|
0
|
0
|
99
|
POST
|
Hi, I am wondering if a solution was found to this? I am also trying to run arcpy in a python Flask app and having trouble accessing files within the scope of the Flask app. To make it super simple I am just trying to run arcpy.Exists() on a table in a gdb on my local drive. When the line of code is before the Flask app it will return True, but within the Flask app it returns False. If I use os.path.exists, this returns True when it should, the problem is always with arcpy. Thanks!
... View more
03-27-2020
11:34 AM
|
0
|
1
|
109
|
POST
|
Cameron, That's great that you've mostly fixed it. I actually might have fixed it on my end too, all I did was rename the affected layers in the webmap, removing brackets ( ) that were in the titles. I don't know if it was the brackets causing the issue (doubt it) or just resaving the webmap might have refreshed some other json. I've had other issues with layer titles when the services have < > symbols in them. Usually I just end up replacing them with visually identical looking symbols in the windows character map tool. So that was my reasoning for at least trying this. Thanks for the quick reply! Joe
... View more
03-18-2020
07:26 AM
|
0
|
0
|
86
|
POST
|
Hi, did you ever figure out the cause of the Untitled Layer problem? I'm having this in my custom 4.x app as well, but its so intermittent and random that I'm having a hard time to debugging it. I was thinking it was a browser cache problem, but sometimes it even persists in an incognito window. It seems to always to always display the real title when I have the browser console open making this hard to figure out.
... View more
03-17-2020
01:35 PM
|
0
|
2
|
86
|
POST
|
Hi, I am using the Add Data widget in several apps. When adding a KML via the drop, it works in my workspace environment where I don't require a proxy to access the services. When the app is deployed to Test/Prod environments is uses the Esri resource-proxy to access the secured services, webmap, etc. I have rules in the proxy configured for https://mydomain/portal/sharing and https://mydomain/arcgis/rest/services which works for everything except this. . There browser error I get looks like this: (index):1 Access to XMLHttpRequest at 'https://mydomain/portal/sharing/kml' from origin 'https://appdomain' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute. AddFromFilePane.js?wab_dv=2.10:387 Unable to load KML . I've narrowed this down to the widget's use / lack of use of the proxy by disabling it temporarily (and ignoring layer load errors) and it does work when deployed to those web servers. What I don't get is that in both the working and problem environments, the requests look exactly the same in the network tab, so I'm not sure what is wrong. Any advice? Thanks!
... View more
12-13-2019
12:04 PM
|
0
|
1
|
197
|
POST
|
I think I've figured this out, although there might be a better spot to stick the hack. In MapManager.js deep into the _show2DWebMap function: if (layerObject){ // START CUSTOM CODE if (layerObject.layerId == 28 ) { console.log(layerObject); var extent = new Extent({ "xmin" : - 180 , "xmax" : 180 , "ymin" : 70 , "ymax" : 90 , "spatialReference" :{ "wkid" : 4326 } }); var qTask = new QueryTask(layerObject.url); var query = new Query(); query.geometry = extent; query.where = "1=1" ; qTask.executeForIds(query, lang.hitch( this , function (results){ var whereClause = layerObject.objectIdField + " IN (" + results.join() + ")" ; layerObject.setDefinitionExpression(whereClause); })); } // END CUSTOM CODE lang.setObject( "_wabProperties.originalRefreshinterval" , layerObject.refreshInterval, layerObject); } I just did this for a different layer than what I intend for now, so I will change the initial custom if statement and geometry variable to match my desired layer and spatial filter requirements. Modified Robert Scheitlin's solution at: https://community.esri.com/thread/239333-applying-extent-filter-while-using-the-filter-manager-class Thanks!
... View more
11-22-2019
11:00 AM
|
2
|
0
|
98
|
POST
|
Hi, we are trying to avoid making copies of data and use ArcGIS REST services from other departments in our webmaps and apps. Our client wants to only show some features within a certain extent for one of these layers. The easiest to implement solution for this applies only to hosted feature layers: ArcGIS Online: Filter by Polygon Feature Is there an easy solution to apply a spatial filter to a regular feature layer added to a webmap? If not, has anyone applied a quick hack to a Web AppBuilder (Dev Edition) app to apply a spatial filter as the map is loaded? Thanks in advance! We are using Server/Portal 10.7.1
... View more
11-22-2019
09:20 AM
|
0
|
1
|
339
|
POST
|
This turned out to not be a problem with the app, widget or javascript related. The cause was the data source was an Oracle DB (non geodata enabled). The services was published with a multi machine ArcGIS Server configuration. Each server machine was applying its own ObjectIds, but the search would not necessarily send it's query back to the same machine (round robin from the web adaptor). Only solution was to stop publishing from Oracle, non geodata enabled database. This database has caused many problems and this issue was the final straw.
... View more
11-22-2019
09:07 AM
|
1
|
0
|
56
|
POST
|
Hi, I'm using the Search widget in a custom 4.13 app. I have multiple search sources configured. Most of the time this works, however sometimes when clicking on a suggested item it goes to a completely wrong feature. My code for this app is pretty long, if required to post it I wont be able to do that until next Tuesday, so hopefully I can provide enough detail. Here is my steps that produce this (sometimes). I enter "4" in the search and have a few suggestions. The search suggestion I click is "V-4278" which represents a chart id. It pans the map to a feature with id "V-4024" which is not what I picked (or even listed in the 5 max suggestions). To try to dubug this I've inserted the following code which shows something that doesn't make sense to me: searchWidget.on( "select-result" , function (event) { console.log(event); console.log(searchWidget); }); Here is what is output in the console for that click on that suggestion: event.result : { extent : {…} , feature : {…} , key : 14 , name : "V-4024" , sourceIndex : 6 } searchWidget.suggestions[6].results : { text : "V-4278" , key : 14 , sourceIndex : 6 } What I don't get is why do these both have the same key? That seems to be a problem, I just have no idea what the cause is. Any suggestions? It also seems that if it goes to the wrong feature, it will always go to the same wrong feature (V-4278 always goes to V-4024, or V-4022 always goes to V-4011). What is also interesting is that when I click a suggestion it doesn't always go to it, sometimes I have to hit enter. When that happens it seems to always go to the correct feature.
... View more
11-08-2019
01:59 PM
|
0
|
2
|
123
|
Online Status |
Offline
|
Date Last Visited |
3 weeks ago
|