I've seen one other posting that was made some time ago regarding this issue but there was no resolution.
I am attempting to add a KML file to a Map Viewer web map and received the following somewhat "cryptic" message "Error...there was an error". Unfortunately, not particularly helpful on the elaboration front.
However, I was able to successfully load the KML file using Map Viewer Classic but I need Map Viewer's Group Layers functionality. Of course, I could back track, load everything in Classic, open it again using Map Viewer, and then re-do my groups but I would prefer not to employ that as a consistent work around.
Has anyone experienced this issue and, if so, is there a solution for this problem?
Solved! Go to Solution.
Yup so in the URL is the item id for the KML that you would use in this URL would look like this.
Can you share the map and KML layer being used? You can pop it into a group and invite russell_jsapi into it and I can check it out.
Unfortunately, I am not able to share this particular information outside our organization. Apologies. I was hoping someone had experienced something similar and could offer guidance without interacting with our data.
Are you adding the KML by through an item or through a URL?
The KML resides in AGO as a hosted layer using "+ New Item". The layer is located using Search in Map Viewer and when I attempt to add the error is broadcast.
There is a known limitation in the API when adding through item. You can workaround this by using https://orgid.maps.arcgis.com/sharing/rest/content/items/ITEMID/data?f=json and going through Map Viewer Add > KML and using the above url.
This KML is not "on the web" so it has no URL. It was a deliverable from a consultant.
You should have an item id for the KML available bc of the above "The KML resides in AGO as a hosted layer using "+ New Item"."
Where do I obtain this URL? I have a URL corresponding to the Overview page associated with the KML but it does not contain all the same elements you indicated prior. It hints at an "item.html?id=" but nothing before that is the same as the file path you mentioned. Or are you saying use the URL you provided explicitly...substituting our "orgid" and "ITEMID" indicated in the Overview?
Okay...so my nomenclature is a bit off. It's NOT a hosted layer...per say...it was brought in as a KML. It's description is KML...not Feature Layer(hosted). Sorry for the confusion.