Select to view content in your preferred language

Flex 2.4 Local KML file

2250
12
08-09-2011 10:18 AM
PatrickTruitt
Deactivated User
I was hoping someone could shed some light on the needed steps to get a local KML to display on the map. I can get public KML files to load fine but I'm looking for a way to allow the user to display KML files that they may have on there local machine. Is the utility that ESRI uses to parse the public kml/kmz files available for other ArcGIS servers?
Tags (2)
0 Kudos
12 Replies
erdinç_kadiryildiz
Emerging Contributor

I was also thinking about this situation.An easier way is to create a directory in your server where you published your flex application.Just upload that kml file to your server. This directory must be published  on IIS.So that you can add that kml file as a kmllayer to your application like http://youserverip/thedirectory/xyz.kml. You can do this for kml files. But in flex you cannot access local directories because of security restrictions. You need to write a webservice or something like that to manage it. For kmz files,you can use also your webservice to extract the kml file from the kmz file to this directory.So that you can reach that kml file as a kmllayer.

0 Kudos
PatrickTruitt
Deactivated User
There is something else going on here behind the scenes. I'm working on my local development environment. I have setup a local server, opened it up via a crossdomain file and put the kml file on it. (http://localhost/kml/kmlfile.kml). When I run my flex app it will not bring that kml file in as a layer. Is there something I'm missing here? Is it because my flex app is running from my file system vs the same server? I thought the crossdomain file would fix this access issue. Captain clueless here.
0 Kudos
BjornSvensson
Esri Regular Contributor
"The KMLLayer is used to create a layer based on a publicly accessible KML file (.kml,.kmz)."
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/KMLLayer.html

Thus, localhost and KMLs sitting on internal networks will not work. The KML needs to be publicly accessible.

What's happening behind the scenes is that we use a utility "converter" service  to convert the KML to ArcGIS REST-like features. The same service is used by both Flex and Javascript Web APIs.
0 Kudos
PatrickTruitt
Deactivated User
I maybe working with some sensitive kml data so my question to ESRI is, could this "converter" be available to customers to live behind their firewall?
0 Kudos
BjornSvensson
Esri Regular Contributor
...could this "converter" be available to customers to live behind their firewall?


Yes, it will be part of the ArcGIS Portal.
0 Kudos
PatrickTruitt
Deactivated User
I'm guessing it's not apart of GeoPortal at this current date?
0 Kudos
BjornSvensson
Esri Regular Contributor
Correct. 

GeoPortal is different from ArcGIS Portal.  This will be part of ArcGIS Portal.
0 Kudos
PatrickTruitt
Deactivated User
Thank you. Any ETA on ArcGIS Portal?
0 Kudos
PatrickTruitt
Deactivated User
Do I really need the whole ArcGIS Portal Package just to have access to the utility that parses kml/kmz files? Our customer does not want their kml/kmz data out on a public server. Could just the utility be made available? Can someone please explain to me why this capability is limited to only public URL's but all other layer types can be internal?
0 Kudos