2.4 Flex Viewer with KML's served locally

2840
14
08-06-2011 03:52 PM
NeoGeo
by
Occasional Contributor III
Some KML's and KMZ's work as layers in the new 2.4 Flex Viewer if served from a remote server, but when I try to acess KML's served locally on the GIS server through IIS, the viewer returns "Layer failed to load.  Fault code 400.  Fault info:  File not found. Wrong URL. Fault details:"

No details were given.  The KML virtual directory has MIME types for both kml and kmz.  If I access the url for one of the kml files from a browser, it gives me the option to open or download the file.  I do have a crossdomain file which allows everything in the web root folder.  I thought perhaps it just could not handle that particular kml so I created a super simple kml using the sample from Google's web site with a single point, but it still gives me that error.  Thinking that maybe it was something I had wrong with my IIS configuration, I pointed it to a feed on the other ArcGIS Server which I know works because I am using them with kml tools in the Flex 1.x Viewer on that server, but it gives me the same error. Any ideas?

Thanks!
Tags (2)
0 Kudos
14 Replies
BjornSvensson
Esri Regular Contributor
when I try to acess KML's served locally on the GIS server through IIS, the viewer returns "Layer failed to load..."


What's the URL of your KML/KMZ? 
It needs to be a publicly accessible URL...
0 Kudos
DonCopple
Occasional Contributor III
I think what Bjorn is saying is correct.  You don't want your browser, in this case flash player to be able to access local files, although I know the advanced draw tools widget on the code gallery will save/and load a graphic file to the local machine.  Maybe something in that code would allow it (kml) to be loaded locally using a proxy url?  Otherwise it needs to be a pubilcally availible kml.

Bjorn, are the bugs being worked out for some of the public kml/kmz files that will not load.  I would like to load ones availible form NOAA, but just get question marks when it opens the data.  No point display.  Also, some work needs to be done with the size of the icons in the kml/kmz to get them to display a little better.  Glad to get some KML/KMZ support though...
Thanks,
Don
0 Kudos
BjornSvensson
Esri Regular Contributor
...are the bugs being worked out for some of the public kml/kmz files that will not load


Yes, please see my response on your other KML thread (as well as how to best report "problem" KML):
http://forums.arcgis.com/threads/36062-Flex-API-2.4-KML-support-added-need-sample-of-how-to-add-kml
0 Kudos
NeoGeo
by
Occasional Contributor III
What's the URL of your KML/KMZ? 
It needs to be a publicly accessible URL...


I did not state the description very well.  Technically it is not local since local would be on the client/workstation running the Flex Viewer.  I actually meant that it would not access the kml's hosted from IIS on either of our ArcGIS server machines even though I can access those url's through a browser.  This is all on the military network though, not available through the internet.  I see that someone else reported a problem with feeds on an intranet.  That would pretty much mean the military would not be able to use this tool.  I submitted the problem through the link mentioned in the other thread.
0 Kudos
DonCopple
Occasional Contributor III
Try right clicking in your viewer and change flash player global settings, under the advaced tab, add you site to the trusted sites list.  This allows flash to access a file on your local drive.  At least try it and see if that works.  See picture.....
0 Kudos
NeoGeo
by
Occasional Contributor III
Adding the servers to the trusted sites list did not make any difference, but as noted before these are not on a local drive, they are actually on a server on the local network.  I have tried both kmls, and kmz's as well as using the IP address, just the server name, and the fully qualified domain name, none of which worked. 

It looks like it is hitting utility.arcgis.com.  Someone had mentioned some sort of parser on ESRI's side without elaborating.  Is it possible that they have a parser on ESRI's site trying to read from the kml's url which is not accessible from the internet because it is on the military network?  If so, that would be really crummy for all military organizations and anyone using an intranet to serve data in house.
0 Kudos
DonCopple
Occasional Contributor III
Maybe look at the kml developer site to set up your server to serve the KML file.  Found a similar issue within the Google Earth Developer API, and it stated something about setting up your server to accept the kml/kmz mime type thorugh http the address.

Your IIS has to be configured to allow it to access http with a MIME type of KML or KMZ.

Here is a link to the KML hosting informtion: 
http://code.google.com/apis/kml/documentation/kml_tut.html#kml_server

Let me know if that works......
0 Kudos
BjornSvensson
Esri Regular Contributor
The main issue is that the KML needs to be at a publicly accessible URL.

This is because the Flex API (as well as the JavaScript API) use a utility service on arcgis.com to convert the KML for us.

Requirements/Limitations:

Known issues:

  • If your KML contains areas outside of Web Mercator scope (i.e North pole, South pole) as in some of the NOAA feeds, then it will fail if your Map is in Web Mercator. If your basemap is in geographic, it works fine.  This issue will be fixed in the next version.


See also http://forums.arcgis.com/threads/36062-Flex-API-2.4-KML-support-added-need-sample-of-how-to-add-kml
0 Kudos
NeoGeo
by
Occasional Contributor III
Will it be possible to get a copy of the utility service to run it on our side for people serving data on corporate intranets and for military usage on the military network?  I know this is possible because we have almost the exact same setup with a .net utility service we were using with our ArcGIS 9.x/Flex viewer 1.x but we have not migrated it to ArcGIS 10/Flex 2.x and the integration is not as good as it would be if the 2.4 Flex viewer worked.

I do appreciate the input so that me and hundreds of others reading this don't keep banging our heads against the wall trying to figure out why it doesn't work.
0 Kudos