Select to view content in your preferred language

KML Widget - Feedback needed

4888
20
06-03-2010 11:06 AM
LukeBerndt
Emerging Contributor
Good Afternoon,
I just uploaded a Widget for displaying KML & KMZ files to the Code Gallery. I wanted to see if anyone had gotten it to work. I only have another week left on my trial version of Flash Builder so I wanted to see if there were things I needed to fix before it expired.

The widget is up here: http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=codeGalleryDetails&scriptID=16972

- Luke
Tags (2)
0 Kudos
20 Replies
GabiVoicu
Deactivated User
Good Afternoon,
I just uploaded a Widget for displaying KML & KMZ files to the Code Gallery. I wanted to see if anyone had gotten it to work. I only have another week left on my trial version of Flash Builder so I wanted to see if there were things I needed to fix before it expired.

The widget is up here: http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=codeGalleryDetails&scriptID=16972

- Luke


link not working....where is the kml widget?
0 Kudos
GabiVoicu
Deactivated User
.........It does support network links. I forgot to re-enable the part the would have it periodic reload them though to get updates. It should just be a couple of lines of code to get that going. The GeoRSS widget does this and I think I left most of the code for it in.

- Luke

We are very much interested in this part with the network links. It seems like it would have been so easy for you to do that. We want those lines of code - is there any way?!
We can also get the trial version perhaps and change the widget that way but if we only knew how?!!!
0 Kudos
GabiVoicu
Deactivated User
....kml widget for flexviewer 2.2 and network links enabled would be nice!...i wish i knew how easy it would be to update this kml widget..........

Hi Matt,
You are correct, I wrote it for the 1.3 Flex Viewer. I haven't tried porting it to 2.0 yet, but I can't imagine it would be too hard. Unfortunately I don't have a real copy of Flash Builder, I built the widget using the 60 day Trial and unfortunately it has run out. If anyone has an extra copy, let me know.

I put the code up on gitHub, including some stuff I was working on before it conked out. I was trying to allow for Placemark flags stored in the KMZ and also for the caching of flags.

http://github.com/robotastic/KMLWidget

Brendan -
It does support network links. I forgot to re-enable the part the would have it periodic reload them though to get updates. It should just be a couple of lines of code to get that going. The GeoRSS widget does this and I think I left most of the code for it in.

- Luke
0 Kudos
BrianMorgan
Emerging Contributor
I could really use this functionality in my project, and would be happy to provide you with a Flash Builder license if you could upgrade the widget to 2.2 and enable the network links functionality.  Let me know if you are interested.  Thanks! - Brian
0 Kudos
EjayLai
Deactivated User
I find it useful for a project also. I would see if it is easy to fix.
0 Kudos
SanitSananikone
New Contributor
Has anyone been able to solve the "1046: Type was not found or was not a compile-time constant" errors? I am trying to build the KML Widget within FlexViewer 1.3 using Flex Builder 3.

Thank you.
0 Kudos
shay-geo
Frequent Contributor
Does anyone on the forum know , How to get KML or KMZ from secured services?


Thanks and Regards,
shail_gis
0 Kudos
NeoGeo
by
Frequent Contributor
Sasan7 - Not sure if this is one of those times, but if the widget includes something that requires a library from Flash 10 you will need to change the Flash version target to version 10 in Flex Builder.

Sagavathe - If you don't want to modify the widget you can use an asp page that logs into the secure server as a live proxy.  You point the kml widget at the asp page and the asp page points to the kml.  The other way I have done it for secure sites is to create a Python (or your language of choice)script to download it and schedule it to run in Windows Task Scheduler (or I suppose you could make a CGI script out of it if you wanted to instead of running it as a scheduled task. Another time I ended up writing a Ruby script for a site with more complicated access problems and ran it on a scheduled basis.  Most of them were specific to the site because I had to jump through hoops once logged in to get to the kml, but if it just requires http authentication to directly access the file, the asp proxy is probably easiest.
Here is part of a basic Python urllib example I just plagiarized so I wouldn't have to think too hard:

import urllib params = urllib.urlencode({'username': 'myuser', 'password': 'mypassword'})site = "http://www.mysite.com/login.html"urllib.urlopen(site, params)import <strong class="highlight">urllib</strong>

params = <strong class="highlight">urllib</strong>.urlencode({'username': 'myuser', 'password': 'mypassword'})
site = "http://www.mysite.com/login.html"
<strong class="highlight">urllib</strong>.urlopen(site, params)
0 Kudos
SanitSananikone
New Contributor
Thank you for the reply. I finally got it compiling without errors, but it now seems to be stuck right in the init function. All I get is a continuous "Loading feed" message when I start the widget. Something with my proxy maybe?
0 Kudos
dcopple
Frequent Contributor
Anyone getting this to work with the newest version of Flex/Flash.  It would be nice to just have the .swf file and an example xml code that would be used in the widget.  The newest verison just needs a correctly formatted xml file, and then reference the flash widget that is compiled in the .swf file.  Could not find any way to use the .as files in the newest version (2.2?)  It is looking for a widget with the xml code, and swf flash component.
0 Kudos