POST
|
Thanks Robert, I'll send in a report, I've added a quick and messy work around for the time being (pop-up content gets drawn twice, usually fast enough to be unnoticeable).
... View more
09-14-2016
07:56 AM
|
0
|
0
|
299
|
POST
|
I've been working on a custom popup widget using the JavaScript popup object, calling a number of external services with deferred results, meaning I need to manually create the popup content. I've noticed an issue with the order of the popup events, set-features and selection-change. A have a single ArcGIS server map service with 4 layers, added to portal as a map image layer. This map image layer has been added to a web map, and my app uses this web map. My custom popup has been configured on all 4 layers. When clicking on a feature in any layer that isn't the last layer (i.e. id 0-2), the popup is triggered with a selection-change then set-features. When clicking on a feature in the last layer (i.e. 3), the popup is triggered with set-features then a selection-change. This makes coding the calls to external services and generating the popup content a lot more complex than it needs to be, ideally I would make one call to my services on set-features, then generate content on selection-change, but this issue prevents that. Is there a reason for the change in event order for the last layer in a service? Is there anything I can change to make the events occur in the same order for every layer?
... View more
09-13-2016
04:04 AM
|
0
|
2
|
1230
|
POST
|
Thanks for the response Alex. If I've read your second point correctly what we are trying to do should work? We have added the secured content without storing credentials (we are never prompted for them when adding the content or using it). When using a web map or an app with the secured content, I can see in the ArcGIS server logs that it is the user who is authenticated when first loading the secure content. When querying the secured content the query calls are all coming from the user. When running a geoprocessing service, all the calls are coming from the user. When calling the applyEdits method the log shows all the calls coming from the service account and not the user. Is this an issue I can resolve with Portal configuration (outside of federating the server, which I believe could cause issues with legacy applications), or is it a more fundamental Portal issue?
... View more
10-28-2015
10:51 AM
|
0
|
1
|
445
|
POST
|
Hi, I'm trying to resolve an issue I'm having with Portal where edits to feature services are submitted as the Portal service account instead of the user signed into Portal. Both Portal and ArcGIS server are configured to user web tier authentication to allow users to sign in seamlessly. I have set up a feature class in SQL server and enabled editor tracking. This feature class has been published as a single layer in a feature service on ArcGIS Server. I can edit in ArcGIS Desktop and the REST end point (applyEdits) which correctly captures the name of the user signed into ArcGIS Server. When I add the feature service as a layer to Portal (using the feature layer URL, no log in details requested), and edit in a Portal map, any new features or edits have the name of the service account running the Portal service added to the editor tracking fields not the name of the user. I've been through the ArcGIS Server logs, and I can see that as the map draws all the requests have the correct user name. I queried layers and ran a Geoprocessing Service and can see that all calls from Portal to ArcGIS server have the correct user name. When I create a new feature in my layer using the edit tools, all requests start coming from the windows service account instead of my user name. After the feature has been created subsequent calls to the feature layer (pop-up, query) again start coming from the Portal user. If I use my custom app to programatically create a new feature, all requests are coming from my Portal user until I call "applyEdits" on my feature layer, when again requests start coming from the service account. Is there anyway to force applyEdits to use the windows/Portal user instead of the service account to apply edits? Thanks, Andy
... View more
10-26-2015
08:30 AM
|
0
|
3
|
2899
|
POST
|
I've had a minor success by adding the following proxy information to the config.json in a copy of my app deployed on the web server hosting the Portal web adapter (copied from an app created in and downloaded from Portal): "httpProxy": {
"useProxy": true,
"url": "https://portal.domain.local/arcgis/sharing/proxy"
} The proxy above doesn't work at all for the apps in Web AppBuilder, or those I've deployed to my local IIS server. Is there anyway I can configure web app builder with this proxy?
... View more
10-20-2015
11:05 AM
|
0
|
0
|
758
|
POST
|
Hi, I'm having issues editing my feature service through a custom web app created with the developer version of web app builder. I have a feature service in ArcGIS server, which I've added to my Portal as a feature layer, and then added to a web map. I can edit everything at this point without any errors, creating and updating features. I can create an app in Portal, and still be able to edit everything without any issues. As soon as I add this web map to an app built in the developer version of Web App Builder, using the standard edit widget. If I try and create or edit features I get 401 Unauthorized errors in Web AppBuilder: "POST https://mymachine.domain.local:3344/proxy.js?https://arcserver.domain.local/arcgis/rest/services/Test/TEST_Edits/FeatureServer/0/applyEdits 401 (Unauthorized)" And when I deploy the app to a web server I get this error: "XMLHttpRequest cannot load https:/?https://arcserver.domain.local/arcgis/rest/services/Test/TEST_Edits/FeatureServer/0/applyEdits. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource." I'm using Windows authentication in both ArcGIS server and Portal with no signing in required. I can see all my content in the Web AppBuilder, including secured services. I have set up all my sites to use windows authentication in IIS and added CORS settings to every web.config file I can find (portal web adapter, arcgis server web adapter, and my app). Is there anywhere I can look for logs files that might indicate why I can't edit from my custom web apps? Does anyone know how can I get my custom Web Apps to work with my feature services? Thanks Andy
... View more
10-20-2015
10:33 AM
|
0
|
3
|
3778
|
POST
|
Hi Robert, Thanks for your help, the code you posted didn't resolve the issue, but it pointed me in the right direction. The final solution was to ditch layerInfosObject.traversal, and instead generate 2 arrays of layerInfo objects and layerTypes, wait for all the types to resolve, and then set the selected values. This is the working code: postCreate: function() {
var layerTypes = [];
var lyrOptions = [];
// Get the map layers
this.getLayerList().then(lang.hitch(this, function(myLayerInfos){
array.forEach(myLayerInfos,lang.hitch(this,function(layerInfo){
// Get an array of map layer types
layerTypes.push(layerInfo.getLayerType());
}));
// When all the type have been retrieved...
all(layerTypes).then(lang.hitch(this,function(layerTypes) {
for (var j=0; j<layerTypes.length;j++) {
// ... build an options list of just the feature layers
if (layerTypes == "FeatureLayer"){
lyrOptions.push({ value: myLayerInfos .title, label: myLayerInfos .title });
}
}
this.makeSelects(lyrOptions);
}));
}));
},
getLayerList: function() {
// Get an array of layerInfo for every layer in the map
var def = new Deferred();
var myLayerInfos = [];
LayerInfos.getInstance(this.map, this.map.itemInfo).then(lang.hitch(this, function(layerInfosObj) {
myLayerInfos.push.apply(myLayerInfos,this.iterLayers(layerInfosObj.getLayerInfoArray()));
def.resolve(myLayerInfos);
}), lang.hitch(this, function(err) {
console.error(err);
def.reject(err);
}));
return def.promise;
},
iterLayers: function(layerInfos){
// Iterate through layers and sublayers to get an array of all the layers
var result = [];
array.forEach(layerInfos,lang.hitch(this,function(layerInfo){
result.push(layerInfo);
result.push.apply(result,this.iterLayers(layerInfo.getSubLayers()));
}));
return result;
},
makeSelects: function(lyrOptions) {
// Create selection lists
var sel1 = new Select({
id: "selectOpportunity",
emptyLabel: " -- Choose a Map layer -- ",
options: lyrOptions
}).placeAt(this.opportunityFcList).startup();
var sel2 = new Select({
id: "selectRestricted",
emptyLabel: " -- Choose a Map layer -- ",
options: lyrOptions
}).placeAt(this.restrictedFcList).startup();
if (this.config.opportunityLayer !== undefined) {
dijit.byId('selectOpportunity').set('value', this.config.opportunityLayer);
}
if (this.config.restrictedLayer !== undefined) {
dijit.byId('selectRestricted').set('value', this.config.restrictedLayer);
}
}, Thanks for your time, I didn't think it would take so long to resolve this one!
... View more
10-08-2015
04:34 AM
|
1
|
0
|
931
|
POST
|
Thanks Robert, I'm getting an error in the console now: TypeError: Cannot read property 'itemData' of undefined
at Function.<anonymous> (https://localhost/webappbuilder/stemapp/jimu.js/LayerInfos/LayerInfos.js:755:55)
at https://js.arcgis.com/3.14/init.js:167:296
at k (https://js.arcgis.com/3.14/init.js:189:431)
at m (https://js.arcgis.com/3.14/init.js:189:357)
at resolve (https://js.arcgis.com/3.14/init.js:191:441)
at null.<anonymous> (https://localhost/webappbuilder/stemapp/jimu.js/LayerInfos/LayerInfoFactory.js:69:18)
at https://js.arcgis.com/3.14/init.js:167:296
at ha (https://js.arcgis.com/3.14/init.js:22:473)
at https://js.arcgis.com/3.14/init.js:23:202
at ia (https://js.arcgis.com/3.14/init.js:23:89)
----------------------------------------
rejected at a (https://js.arcgis.com/3.14/init.js:190:337)
at k (https://js.arcgis.com/3.14/init.js:190:89)
at m (https://js.arcgis.com/3.14/init.js:189:357)
at resolve (https://js.arcgis.com/3.14/init.js:191:441)
at null.<anonymous> (https://localhost/webappbuilder/stemapp/jimu.js/LayerInfos/LayerInfoFactory.js:69:18)
at https://js.arcgis.com/3.14/init.js:167:296
at ha (https://js.arcgis.com/3.14/init.js:22:473)
at https://js.arcgis.com/3.14/init.js:23:202
at ia (https://js.arcgis.com/3.14/init.js:23:89)
at fa (https://js.arcgis.com/3.14/init.js:23:144)
----------------------------------------
Error
at then.b.then (https://js.arcgis.com/3.14/init.js:192:253)
at Function.clazz.getInstance (https://localhost/webappbuilder/stemapp/jimu.js/LayerInfos/LayerInfos.js:754:48)
at Function.clazz.getLayerInfoArrayByType (https://localhost/webappbuilder/stemapp/jimu.js/LayerInfos/LayerInfos.js:712:11)
at declare._getLayerList (https://localhost/webappbuilder/apps/2/widgets/EditOpportunity/setting/Setting.js:88:14)
at declare.postCreate (https://localhost/webappbuilder/apps/2/widgets/EditOpportunity/setting/Setting.js:41:8)
at l.create (https://js.arcgis.com/3.14/init.js:1124:207)
at l.postscript (https://js.arcgis.com/3.14/init.js:1122:464)
at new <anonymous> (https://js.arcgis.com/3.14/init.js:98:192)
at null.<anonymous> (https://localhost/webappbuilder/stemapp/jimu.js/WidgetManager.js:338:33)
at https://js.arcgis.com/3.14/init.js:167:296"n @ init.js:199(anonymous function) @ init.js:199g.filter @ init.js:220k @ init
.js:199 I tried putting in a check on layerInfo to see if it was undefined in the array.forEach but the result was the same. I'm using the Developer Web App Builder 1.2, which may be an issue? (This function isn't in any of the documents, though looking at it seems similar to what I've tried with dojo/promise/all to collect all the layer types together, I may have been doing it wrong but it was still proceeding with the settings before getting all the promised results)
... View more
10-07-2015
09:30 AM
|
1
|
2
|
931
|
POST
|
Hi Robert, Thanks for the suggestion, I've tried that and the end result is the same, the config is not loaded when first opening the settings page, but it is on subsequent opening of the settings. I've also been experimenting with Deferred/Promise and the "all" function but the end result always ends up the same (apart from the occasional error where). I've tried to unpick how the attribute table widget (the only widget I can think of that displays a list of map layers) is able to get a list of layers before loading its config but my JavaScript knowledge isn't quite there yet.
... View more
10-07-2015
08:12 AM
|
0
|
4
|
931
|
POST
|
Hi, I'm new to the web app builder and JavaScript and I'm having a small problem with the settings page of my custom widget. I have 2 selection boxes listing the feature layers that are in the map, allowing the user to pick two of the layers in the map for use in my widget. The problem I have is on first loading the settings page, the chosen layers from the widgets config file are not being selected in the selection boxes. When opening the settings page a second time it displays the chosen layers in the selection boxes with no problems. I'm assuming this has something to do with timing as the layerInfos class is deferred? I think that means the selection boxes don't have any options when the settings from the config file are applied, so there are no options to select. How can I wait for the selection boxes to be fully populated before applying the settings from the config file? If it helps, my current code is run in postCreate: postCreate: function() {
//var opts = this._getLayerList();
//this._makeSelects(opts);
this._getLayerList();
}, Which gets a list of feature layers: _getLayerList: function() {
// Get the feature layer names...
var lyrOptions = [];
LayerInfos.getInstance(this.map, this.map.itemInfo).then(lang.hitch(this,function(layerInfosObject) {
layerInfosObject.traversal(lang.hitch(this,function(layerInfo) {
layerInfo.getLayerType().then(lang.hitch(this,function(type) {
if (type == "FeatureLayer") {
lyrOptions.push( { value: layerInfo.title, label: layerInfo.title } );
}
}));
}));
}));
//return lyrOptions;
this._makeSelects(lyrOptions);
}, And the list of layers in then used to populate the selection boxes: _makeSelects: function(lyrOptions) {
// Create selection lists
var sel1 = new Select({
id: "selectOpportunity",
emptyLabel: " -- Choose a Map layer -- ",
options: lyrOptions
}).placeAt(this.opportunityFcList).startup();
var sel2 = new Select({
id: "selectRestricted",
emptyLabel: " -- Choose a Map layer -- ",
options: lyrOptions
}).placeAt(this.restrictedFcList).startup();
} The problem is, setConfig is happening before the seletion boxes have any options, so my chosen options are not being selected the first time the settings page is opened: setConfig: function(config) {
// Load settings from the config file
this.config = config;
// Set select value from config
if (config.opportunityLayer !== undefined) {
dijit.byId('selectOpportunity').set('value', config.opportunityLayer);
}
if (config.restrictedLayer !== undefined) {
dijit.byId('selectRestricted').set('value', config.restrictedLayer);
}
}, Thanks, Andy
... View more
10-07-2015
06:34 AM
|
0
|
6
|
4254
|
Title | Kudos | Posted |
---|---|---|
1 | 10-07-2015 09:30 AM | |
1 | 10-08-2015 04:34 AM |
Online Status |
Offline
|
Date Last Visited |
03-14-2023
10:35 AM
|