Select to view content in your preferred language

KML Widget - Feedback needed

4886
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
BrendanCunningham
Emerging Contributor
Hi Luke,
I got it to work, and i'll definitely use it.
I think it could be used instead of the bookmarks, as I don't want bookmark saving.deleting.
Therefore I'll use your one as it could be a list that is updated outside of the Bookmarks XML Config file.
Also, the bookmarks list is littered with coordinates which often is not necessary, therefore your widget looks better.

One thing, the icon from the KML is tiny when I go to zoom to a placemark. How is this sized?

Not the biggest KML expert, and definitely not the biggest GeoRSS Widget expert... but can can polylines and polygons be added instead of points? That would cap it!

Brendan
0 Kudos
LukeBerndt
Emerging Contributor
Good to hear! The widget can take in Polys and Lines and style them according the KML. NOAA has a KML for the Oil Spill with a polygon that is interesting to plot.

If you want to change the icon size, open up KMLWidget.mxml and look for this line:
graphicPointSym = new PictureMarkerSymbol(icon,15,15);

15,15 sets the size of the icon. I think it was originally 30,30 in the GeoRSS widget, but things were getting really cluttered when I started loading in large files with lots of placemarkers.

Thanks for giving it a try!


Hi Luke,
I got it to work, and i'll definitely use it.
I think it could be used instead of the bookmarks, as I don't want bookmark saving.deleting.
Therefore I'll use your one as it could be a list that is updated outside of the Bookmarks XML Config file.
Also, the bookmarks list is littered with coordinates which often is not necessary, therefore your widget looks better.

One thing, the icon from the KML is tiny when I go to zoom to a placemark. How is this sized?

Not the biggest KML expert, and definitely not the biggest GeoRSS Widget expert... but can can polylines and polygons be added instead of points? That would cap it!

Brendan
0 Kudos
BrendanCunningham
Emerging Contributor
Luke,
Does your widget have any ability to handle KML Network Links?
If so, then data entry could be carried out in something like Google Maps, and the widget KML data would automatically update!
Just a thought...
0 Kudos
JamesKo
Occasional Contributor
Luke,

I just downloaded your widget and am getting the following errors:

1046: Type was not found or was not a compile-time constant: Container.
1046: Type was not found or was not a compile-time constant: Feature.
1046: Type was not found or was not a compile-time constant: Style.

Any ideas?

Thanks in advance...
0 Kudos
MatthewLawton
Deactivated User
James, I think this was originally written for the SFV 1.3. I am getting many of the same errors as you are in the SFV 2.0. I was following the migration tips from ESRI and Adobe to convert this to Flex 4, but it is beyond me. I just can't seem to get it to work.

Luke, any chance of getting a SFV 2.0 version of this widget?
0 Kudos
LukeBerndt
Emerging Contributor
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
MatthewLawton
Deactivated User
Luke, I got the widget to work in my 1.3 application. I have an odd problem though. I brought in the USGS earthquake KMZ service and it works okay (projects to the wrong place, but I know that is a separate issue). But if I try to bring in a wildfire KML service (http://66.134.213.74/WildEarth/WildCAD_NVSFC.kml) I get this error:

TypeError: Error #1088: The markup in the document following the root element must be well-formed.
 at com.esri.solutions.flexviewer.widgets.kmlparser::XmlParser/parse()
 at com.esri.solutions.flexviewer.widgets.kmlparser.kml::Kml22()
 at com.esri.solutions.flexviewer.widgets::KMLWidget/loadXML()


Any thoughts?
0 Kudos
MatthewLawton
Deactivated User
I hate to bump this, but I am still having the same problem with my KML feed as described in the above post. Does anyone have any ideas regarding this error? This is the SFV 1.3 version that I am attempting to use.

Any help is appreciated.
0 Kudos
MatthewLawton
Deactivated User
For the record, I think the cause of the error above was that I didn't put the KML location in double quotes. Once I added quotes to the URL in the config file I got a different error. I am now getting a security error, which I think is related to the whole proxy issue (which I am very unclear about). I will pursue that issue in a different thread.

Thanks!
0 Kudos