Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example to use Arcade in a customized identify config file #961

Open
ERS-Long opened this issue Aug 25, 2020 · 2 comments
Open

example to use Arcade in a customized identify config file #961

ERS-Long opened this issue Aug 25, 2020 · 2 comments
Assignees

Comments

@ERS-Long
Copy link

Hi Tim,

Please see what is the issue with this function when i switched the Identify code to use Arcade.

I have a customized identify config code, the structure is something like

=================================================================
define([a set of dojo modules],
function (a set of names)
{
var formatters = {
myIdentify_Method1: function(identifyResults) {
//code here to prepare all the logic
//
//the problem is this function never got called
}
};

return {
map: true,
mapClickMode: true,
mapRightClickMenu: true,
identifyLayerInfos: true,
identifyTolerance: 10,
draggable: true,
returnFieldName: true,
returnUnformattedValues: true,

identifies : {
layer1: {
0: {
title: 'Gauges',
useExpression: false,
content: formatters.myIdentify_Method1
}
}
}
})

Please help, Thanks!

@tmcgee tmcgee self-assigned this Aug 25, 2020
@tmcgee
Copy link
Member

tmcgee commented Aug 26, 2020

Hello @ERS-Long

Good to hear from you!

I see you're trying to use your formatter function with Arcade to set the content of the popup. Typical usage within CMV is to call that function for a specific field like this. I highlighted line 87 also because setting useExpression: false as you have done will not use an Arcade expression. To use arcade, you would set that to true or remove it completely since true is the default,

If you do want to use Arcade expression to set the entire popup content, I am not sure if that is supported by Esri or CMV. I have never tried it and would be surprised if it works.

As far as why your function is not called at all, I seem to recall there being a CMV bug that won't allow you to set the content using a function as you have done. I'm not finding my notes about it at the moment. Will look at it further.

@ERS-Long
Copy link
Author

hi Tim,

Thanks a for your reply.

Yes, I was playing with Arcade to see what the benefit we can get out of it. But i still wants to keep the old function there.
For right now, i just did a work around, if i need to use Arcade, i will load the new identify widget code, if not i switch it back. Just for now.

Stay safe!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants