Select to view content in your preferred language

Custom properties for a webmap

889
6
03-12-2018 12:44 PM
by Anonymous User
Not applicable

This question is a bit more widely applicable than just ArcGIS Online I know, but my current focus is really within the context of webmaps in ArcGIS Online. I'm interested in comments both relating to AGOL and also to the wider use of the web map specification.

The question is two-fold: 

Is there any way to include/add extra custom properties to the webmap?

Would doing this break anything - e.g. cause a webmap not to load in the map viewer, or not open in Collector?

Obviously, a webmap is just a JSON spec. I tried editing the JSON using ago assistant. I added a custom property and hit save. It appears to save, and I even can see a success response, but when I reload it, the custom property has disappeared. So something seems to be stripping it out. Meaning I can't even test the second part of my question, as I can't get a custom property to save.

Or is there some property that already exists (e.g. a metadata property of some sort) that allows me to save some custom key-value pairs in them that I can leverage?

0 Kudos
6 Replies
AdrianWelsh
MVP Honored Contributor

Paul,

I too have learned that when I do custom things to AGOL maps, I sometimes can save it and sometimes can see what I did, customly. Then when I open the map from another source, or just refresh, these things go away. This seems like a common lock down from AGOL. 

I would say that you cannot likely add custom extra values to the JSON in a hosted AGOL map. Maybe in something served from Enterprise, but I don't know.

What are you trying to do exactly? Can you not include these parameters into the Description or Summary of your AGOL web map?

0 Kudos
by Anonymous User
Not applicable

Hi Adrian

Yeah, I had thought of that approach - of saving a json object directly into the Description field or otherwise. I guess it would work, and just parse it from there. It just seems a rather strange thing to do, and any casual user viewing the item in AGOL would see this odd code snippet! Plus, someone (i.e. me!) could easily delete or change it from the item page unintentionally and stuff it up so an application trying to parse it would break. I'm more looking at saving this info in a way that a script/app would read/write this extra info.

I'm not saying it wouldn't work, it just probably isn't a very good way to go about it. I'm still hoping there's another way!

cheers,

-Paul

0 Kudos
KellyGerrow
Esri Frequent Contributor

Here is some information on the web map specification:

Web map specification overview | ArcGIS for Developers 

-Kelly

by Anonymous User
Not applicable

Thanks Kelly - I'd read through the specs, but couldn't see any particular place or way to save custom key-value data, hence the question. If you know of anything I've missed, let me know!

(I think we spoke at the Dev Summit? If so, thanks for your input there...)

cheers,

-Paul

0 Kudos
XanderBakker
Esri Esteemed Contributor

Why not store the key vale pairs in a table and access them from there (table | ArcGIS for Developers )

0 Kudos
by Anonymous User
Not applicable

Hi Xander

Thanks for the thought. Currently we do something similar, where the info is kept elsewhere and retrieved separately. The intent of the question was to find out if this extra complexity could be removed by simply storing this bit of info embedded actually in the webmap. Our application is obviously already retrieving the web map - it would make things so much easier if we could just access some custom properties from there.

cheers,

-Paul

0 Kudos