Loading a KML file to a web map in AGOL, Is it possible?

3558
7
Jump to solution
07-28-2013 10:16 AM
MiguelParedes
Esri Contributor
Greetings all, AGOL fans.

I'm completely new to using KML, so please bare with me if what I'm asking is "Silly".

I have a couple of KML files (.kml) that I would like to load to a web map.  However, there is a catch:
I don't want to add the KML file to My Content using Add Item, or any other method.

Is this is my own file, could I add it to a location in my own web server, and then add it to the web map using "Add > Add Layer from Web"?

Besides the Web Server method above, is there any other way of adding a KML file to a web map?

Many thanks in advance.
Miguel
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MikeMinami
Esri Notable Contributor
To access your internal server, the browser doesn't need to send any requests to ArcGIS Online. Because the browser is running inside your firewall, the URL to the service will be valid. The web browser sends requests directly to your server. As an analogy, you might have an internal employee website that you can view while you are at work. This site is visible to you because your computer and browser are within the company network. But, you can't see this internal website from home, unless you connect to your network (e.g., VPN).

However, drawing KML files requires a request to be sent to ArcGIS Online to parse the KML and return it to the browser in a form that is suitable for the map. Thus, ArcGIS Online needs to read the KML, which it can't do when it's behind a firewall.

Thanks,

Mike

View solution in original post

0 Kudos
7 Replies
TimWitt
Frequent Contributor
Hey Miguel,

There are no silly questions only silly answers 😉

Take a look here: http://resources.arcgis.com/en/help/arcgisonline/index.html#/About_KML/010q00000066000000/

Maybe this will answer your questions!

If my post was helpful please rate it or mark it as answer, thanks!

Tim
0 Kudos
BondHarper
Occasional Contributor II
0 Kudos
MiguelParedes
Esri Contributor
Tim, thanks for the response.  I have already looked at that page, but it has not offered much help.

Today I did a little test. I made my KML documents available through an external (to my firewall) website.  So through IIS, I created a virtual directory, added KML as a MIME type for the directory and then copied my documents to it. Then I tested the URL. All works well.   Then on my web map, I selected "Add > Add layer from the web". From the pull down menu, I selected "KML File", and in the URL: text box, I entered the URL to one of my KML documents. Clicked "Add Layer", and presto!  My KML file was added as a new layer.

So the workflow works!  I don't require to add the KML files to My Content in order to add them to a web map.  However, this is not just quite what I wanted.  What I really want is to do the same, but instead of having the KML file in an externally facing website, I want this to work with an internal facing website.  So I replicated what I did with the external website with on an internal one, on my own server. But this time it didn't work. I got the following error message:
[ATTACH=CONFIG]26297[/ATTACH]

So the big question is, can I use a reference for a KML document which is internal to my organisation?  I imagine I would, since a FS that I'm also displaying in the map comes from my own ArcGIS for Server, which internal to my organisation.

I hope you can appreciate my predicament.

Help anyone?

Many thanks in advance.
Miguel
0 Kudos
MikeMinami
Esri Notable Contributor
No, the URL to the KML must be publicly accessible.
Also, while the feature service will display (because the web browser can resolve the URL as it is also running internally), some functions won't be available because it's internal.

Thanks,

Mike
0 Kudos
MiguelParedes
Esri Contributor
No, the URL to the KML must be publicly accessible.
Also, while the feature service will display (because the web browser can resolve the URL as it is also running internally), some functions won't be available because it's internal.

Thanks,

Mike


Greetings Mike, 

Sorry if I'm being thick here, but I'm failing to see the difference between the two URLs.  Both are internal, so how come can AGOL resolve the service one, but not the KML one?

Many thanks,

Miguel
Miguel
0 Kudos
MikeMinami
Esri Notable Contributor
To access your internal server, the browser doesn't need to send any requests to ArcGIS Online. Because the browser is running inside your firewall, the URL to the service will be valid. The web browser sends requests directly to your server. As an analogy, you might have an internal employee website that you can view while you are at work. This site is visible to you because your computer and browser are within the company network. But, you can't see this internal website from home, unless you connect to your network (e.g., VPN).

However, drawing KML files requires a request to be sent to ArcGIS Online to parse the KML and return it to the browser in a form that is suitable for the map. Thus, ArcGIS Online needs to read the KML, which it can't do when it's behind a firewall.

Thanks,

Mike
0 Kudos
MiguelParedes
Esri Contributor
Brilliant Mike,

Many thanks for the explanation. My lack of knowledge on how KML is interpreted was what did me in.  Now, thanks to you, I feel a little more savvy, and finally, what I have been experiencing makes sense.
Miguel
0 Kudos