Customer Service | Training | Contact Us
You are here: Home > User Forums > arcgis server forums > Thread Replies

ArcGIS Server Forums

ArcGIS API for Silverlight forum

Upload KML file ability?   Brendan Walashek Nov 04, 2009
Re: Upload KML file ability?   Daniel Walton Nov 04, 2009
Re: Upload KML file ability?   William Taylor Nov 10, 2009
Re: Upload KML file ability?   Brendan Walashek Nov 10, 2009
Re: Upload KML file ability?   Daniel Walton Nov 10, 2009
Re: Upload KML file ability?   Brendan Walashek Nov 10, 2009
Re: Upload KML file ability?   Daniel Walton Nov 10, 2009
Re: Upload KML file ability?   Dipmalya Majumder Nov 17, 2009
Re: Upload KML file ability?   Daniel Walton Nov 17, 2009
Re: Upload KML file ability?   Dipmalya Majumder Nov 17, 2009
Re: Upload KML file ability?   Daniel Walton Nov 18, 2009
Re: Upload KML file ability?   Dipmalya Majumder Nov 18, 2009
Report Inappropriate Content • Top • Print • Reply    
Subject Upload KML file ability? 
Author Brendan Walashek 
Date Nov 04, 2009 
Message Has anyone discovered the way to let the enduser be able to upload their own KML file to the ArcGIS Silverlight map? I have seen a perfect example of it here: http://gisfiretools.com/Firehawk.Web/
You can see the KML tool on the menu bar. Works like a charm. But I don't see any way of implementing this. Any code out there? 
  Brendan Walashek

McElhanney Consulting Services Ltd.
Vancouver, B.C.
Email: BWalashek@McElhanney.com 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Upload KML file ability? 
Author Daniel Walton 
Date Nov 04, 2009 
Message Brendan,

I replied to you via email as well but I'll post here for the sake of others. Our site does not actually upload any KML, rather it is a silverlight app that parses KML and renders it on the local machine using the ESRI ArcGIS Silverlight API. The silverlight team has provided some limited functionality KML classes which you can download at:

http://resources.esri.com/arcgisserver/apis/silverlight/index.cfm?fa=codeGalleryDetails&scriptID=16487 
  Dan Walton
GIS Fire Tools
Real Time Wildfire Image Processing and Situational Awareness
http://gisfiretools.com/firehawk.web/ 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Upload KML file ability? 
Author William Taylor 
Date Nov 10, 2009 
Message Would you please consider doing some with VB for KML SL functionality? I noticed that this one is for C#. 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Upload KML file ability? 
Author Brendan Walashek 
Date Nov 10, 2009 
Message I actually started my Silverlight/ESRI development in VB as well as I was more familiar with it, but then came to the painful realisation that most/all sample code out there was developed using C#. So I abruptly switched over to C#. Better now than later. I would suggest making the move to C#.
 
  Brendan Walashek

McElhanney Consulting Services Ltd.
Vancouver, B.C.
Email: BWalashek@McElhanney.com 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Upload KML file ability? 
Author Daniel Walton 
Date Nov 10, 2009 
Message Same here, I've been a VB.NET guy for 5 years; made the switch to C# as soon as I started working with ESRI/Silverlight stuff this summer. 
  Dan Walton
GIS Fire Tools
Real Time Wildfire Image Processing and Situational Awareness
http://gisfiretools.com/firehawk.web/ 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Upload KML file ability? 
Author Brendan Walashek 
Date Nov 10, 2009 
Message Dan, any hint to the actual "browse for KML" part of your application. I can see how the above ESRI sample can serve a KML at a URL location, but not sure how to enable a user to actually upload and generate it? How do you replace the XAML kml:KmlLayer Source="" contents with a local/client file? 
  Brendan Walashek

McElhanney Consulting Services Ltd.
Vancouver, B.C.
Email: BWalashek@McElhanney.com 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Upload KML file ability? 
Author Daniel Walton 
Date Nov 10, 2009 
Message Brendan,

I just reworked the KMLLayer.cs code a little, basically created another constructor that takes a binary byte array argument, which copies the array into memorystream object when that constructor is used and runs the code currently located in KMLLayer.webclient_OpenReadCompleted() on that memorystream instead of on e.Result(). Outside the KMLLayer class, you just open a streamreader on the local file the user selects and read the contents into a byte array and pass it in. 
 
 
  Dan Walton
GIS Fire Tools
Real Time Wildfire Image Processing and Situational Awareness
http://gisfiretools.com/firehawk.web/ 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Upload KML file ability? 
Author Dipmalya Majumder 
Date Nov 17, 2009 
Message I just started using this API. As I run My silverlight on my local host I'm able to render my kml/kmz file on my base map but when I try to link it using my web server, I don't see my kml layer at all.
In my case the kml file is located in the gis.web/ClientBin and everything is hosted on the sever.
Can you please tell me why I'm unable to see the KML layer as I run it on the web?

Thanks a lot. 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Upload KML file ability? 
Author Daniel Walton 
Date Nov 17, 2009 
Message You need to set up clientaccesspolicy.xml and crossdomain.xml files. See this thread:

http://forums.esri.com/Thread.asp?c=158&f=2455&t=278720&mc=10#862244

 
  Dan Walton
GIS Fire Tools
Real Time Wildfire Image Processing and Situational Awareness
http://gisfiretools.com/firehawk.web/ 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Upload KML file ability? 
Author Dipmalya Majumder 
Date Nov 17, 2009 
Message Thanks for the quick reply Daniel. I tried all those steps.
I have my clientaccesspolicy.xml and crossdomain.xml both on the wwwroot directory on C:\ (of course).
and I have my silverlight app running on D:\
I created a virtual directory of the .web folder and calling the gistestpage.aspx using the virtual directory.

I can see the silverlight app working and showing the base map but the kml doesn't render.

The KML file is located in the .web/ClientBin Directory by default.

I don't understand the what's going wrong.

Can you please Elaborate a bit more with example.

Thanks


 
 
These are my clientaccesspolicy.xml and crossdomain.xml


clientaccesspolicy.xml

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from http-request-headers="*">
        <domain uri="*"/>
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"/>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>




crossdomain.xml: 

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://testserver.gasco.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Upload KML file ability? 
Author Daniel Walton 
Date Nov 18, 2009 
Message Can you debug the Silverlight app and verify that you're receiving the kml data from your server? You can try setting up a proxy handler for the KML layer as well; there should be an example of this in the KML sample application. 
  Dan Walton
GIS Fire Tools
Real Time Wildfire Image Processing and Situational Awareness
http://gisfiretools.com/firehawk.web/ 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Upload KML file ability? 
Author Dipmalya Majumder 
Date Nov 18, 2009 
Message Oh Thanks!! I had to create a Proxy Handler. I got it up now.