I downloaded a webapp builder template (javascript) that I've placed on my own web server and is running fine. However, I am not able to modify the widgets in the config.json file to the settings that I want. For instance, I want the "Coordinate" widget to have meters instead of feet, however, when I adjust the config.json file in the widget file, these changes aren't reflect. Has anyone encountered this issue? I may be doing it all wrong so if someone can point me in the right direction, that would be much appreciated. I read the webapp builder documentation (http://doc.arcgis.com/en/web-appbuilder/extend-apps/coordinate.htm) but can't seem to figure it out.
This is the json in the current config file (for the app itself, not just the widget):
{ "label": "Coordinate", "uri": "widgets/Coordinate/Widget", "position": { "left": 200, "bottom": 20 }, "config": {} }
This is the json in the widget config file:
{ "outputunit": "dms", "spatialReferences": [] }
The latter says DMS but the units still show up as feet.
Anyway, any help would be appreciated.
Thank you
Solved! Go to Solution.
Ruchira,
What is the path to the config file that is listed in the apps main config.json? Like this example:
{
"label": "Coordinate",
"uri": "widgets/Coordinate/Widget",
"position": {
"left": 200,
"bottom": 20
},
"id": "widgets/Coordinate/Widget_4",
"positionRelativeTo": "map",
"name": "Coordinate",
"config": "widgets/Coordinate/config_Coordinate.json"
},
Notice the config path is "widgets/Coordinate/config_Coordinate.json". What does yours look like?
Ruchira,
Not sure why you are not using the Web AppBuilder to do this configuration for you... Sounds like you are just taking the StemApp and deploying it to your web server. Here is what the json should look like for the coordinate widget.
{
"outputunit": "dms",
"spatialReferences": [
{
"wkid": "3857",
"label": "WGS_1984_Web_Mercator_Auxiliary_Sphere",
"outputUnit": "",
"transformationWkid": "",
"transformationLabel": "",
"transformForward": false
},
{
"wkid": "102629",
"label": "NAD_1983_StatePlane_Alabama_East_FIPS_0101_Feet",
"outputUnit": "FOOT",
"transformationWkid": "",
"transformationLabel": "Transformation Name",
"transformForward": false
}
],
"decimalPlaces": 3,
"addSeparator": false
}
Thanks for your reply, Robert.
I think the download option is only available for those who are signed up for the beta program. However, I'm just using the Web App Builder on AGO. I can't configure an app on there the way I want and then download that app to deploy on my own web server. Not that I can see, anyway.
Also, I tried implementing your code into the template I downloaded (the webapp template) but still doesn't seem to work.
Basically, I modified "webapp\widgets\Coordinate\config.json" to include your code and it doesn't seem to get reflected on my map.
Ruchira,
What is the path to the config file that is listed in the apps main config.json? Like this example:
{
"label": "Coordinate",
"uri": "widgets/Coordinate/Widget",
"position": {
"left": 200,
"bottom": 20
},
"id": "widgets/Coordinate/Widget_4",
"positionRelativeTo": "map",
"name": "Coordinate",
"config": "widgets/Coordinate/config_Coordinate.json"
},
Notice the config path is "widgets/Coordinate/config_Coordinate.json". What does yours look like?
Oh wow! That did it. I didn't have the config property set to point to the json file!
Thank you so much for your help, Robert. I really appreciate it!