4

I am trying to add KML Layers to the ArcGIS JS API. I have the KML layers hosted on the ArcGIS Online server. This data that I am working with contains some sensitive information and I am trying to use them within a web application that I am creating using JS (includes jQuery), CSS, and HTML. In order for me to see these layers within the web app it appears that they need to be shared publicly on ArcGIS Online. I do not want to do that because of the sensitive content of them, however I am allowed to share them within my Organization or Group on ArcGIS Online.

Unfortunately, the API doesn't recognize my permissions within these groups, and won't display the KML layers. Is there any way that I can get the ArcGIS JS API to recognize my credentials and allow me to view the layers without sharing them with everyone (public)? In other words is there any way that I can leave them shared within the Organization and/or Group and still see them within my web application using the API?

Additionally I am using Google Earth API that has the same issues, a solution to that would be helpful too.

  • What error messages are you getting? Check your dev tools and look at the network calls. Are you getting like a 503 Forbidden or something on the call to get the KML? – Branco Jul 22 '15 at 18:12
5
+50

I think you need to use IdentityManager from the API that allows you to sign in with your arcgis.com account and then receive access to the data. Whatever users from your organization that have accounts can sign in as well.

https://developers.arcgis.com/javascript/jsapi/identitymanager-amd.html

And here is a sample that shows what I think you are trying to do. https://developers.arcgis.com/javascript/jssamples/widget_identitymanager_client_side.html

  • Any known solution like this for Google Earth API? – Cameron Sloan Jul 22 '15 at 19:12
  • 1
    I'm not positive whether Google Earth app integration is possible, but you could look at the Working with secure resources page for starters – Stephen Lead Jul 24 '15 at 2:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.