POST
|
Hi everyone, Is there a way to delay or make the popup template load synchronously? Currently when I click on a feature on my map, the template loads as expected. In my customLandPopup, there is an Arcade expression that I am using to populate one of my fields. var myLayers = new MapImageLayer({
url: 'https:sample/MapServer/',
sublayers: [
{
id: 5,
visible: true,
title: 'Land',
popupTemplate: customLandPopup
},
]
}); For the very first click (#1) to query, let's say it returned 5 features. In the popup for the first feature, the expression will throw an error, and there will be a blank in the table: [esri.widgets.FeatureViewModel] query-required-fields Could not query required fields for the specified layer. Some fields will not be available. [esri.widgets.FeatureViewModel] arcade-execution-error TypeError: Cannot read property 'length' of undefined. For the subsequent 4 features, that same field will be correctly populated from the arcade expression. Is it possible that this is due to an asynchronous loading of the features while the popup is being opened? Thanks for any advice on this.
... View more
11-07-2019
05:35 AM
|
0
|
0
|
528
|
POST
|
Hi everyone, I am using Arcgis API for JS v4.13 to create a web application. I have a MapImageLayer created from a service url, which contains 4 sublayers: var MyLayer = new MapImageLayer({ url: 'https://url/to//MapServer/', sublayers: [ { id: 5, visible: true, title: 'abc' }, { id: 4, visible: true, title: 'def' }, { id: 3, visible: true, title: 'ghi', popupTemplate: customPopupThird }, { id: 1, visible: true, title: 'jkl', popupTemplate: customPopupFourth } ] }); For my first popupTemplate, the arcade expression inside works, but for customPopupFourth, it doesn't work. Below is the popuptemplate that doesn't work. title: 'Title for layer id 1', outFields: ['*'], expressionInfos: [ { name: 'CurLandAreatoHect', title: 'Current Land Area (ha)', expression: '$feature.CurLandArea / 10000' } ], content: [ { type: 'fields', fieldInfos: [ { fieldName: 'expression/CurLandAreatoHect' } ] } ] The console from the browser throws up this error: Logger.js:25 [esri.widgets.FeatureViewModel] query-required-fields Could not query required fields for the specified layer. Some fields will not be available. and Logger.js:25 [esri.widgets.FeatureViewModel] arcade-execution-error TypeError: Cannot read property 'length' of undefined at t._fixDates (Feature.js:25) at t.field (Feature.js:25) at Object.member (arcadeCompiler.js:25) at eval (eval at he (arcadeCompiler.js:25), <anonymous>:10:34) at Generator.next (<anonymous>) at arcadeCompiler.js:25 at new Promise (<anonymous>) at Object.v [as create] (promiseUtils.js:25) at Object.__awaiter (arcadeCompiler.js:25) at mainBody (eval at he (arcadeCompiler.js:25), <anonymous>:9:14) The resulting field in the table generated in the popup will be blank because of this error. Thank you!
... View more
11-05-2019
12:30 AM
|
0
|
1
|
1062
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|