Select to view content in your preferred language

Display layer based on Google Fusion Tables

3327
8
09-26-2011 03:15 PM
KirkKuykendall
Deactivated User
I've been asked to add a layer to a silverlight map depicting information in a Google Fusion Table, specifically this one: http://www.google.com/fusiontables/DataSource?snapid=S232942v7U3

Does anyone know an easy way to do this?

Are there any plans to provide a new layer type in future versions of the Silverlight API that would let me just config a layer using the url like I would any other mapservice layer?

Thanks,

Kirk
0 Kudos
8 Replies
DanielWalton
Frequent Contributor
It's something you can do yourself. Just create a class that inherits GraphicsLayer, and in the overriden Initialize() method place code to download the fusion table exported as a csv file (the URL for your table is http://www.google.com/fusiontables/exporttable?query=select%20*%20from%201236296%20), parse it and create Point graphics features with whatever symbol you want. The 'geometry' column is XML formatted according to the KML <Geometry> spec.
0 Kudos
KirkKuykendall
Deactivated User
Hey Dan -

Thanks for responding!  This makes sense.

Does anyone know if Esri has exposed a method to convert Kml geometries to Esri geometries?

The KmlLayer must be doing this somewhere behind the scenes.

Kirk
0 Kudos
DanielWalton
Frequent Contributor
Look here.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Does anyone know if Esri has exposed a method to convert Kml geometries to Esri geometries?

The KmlLayer must be doing this somewhere behind the scenes.

You are right the KML layer is doing that behind the scene but it's not exposed publicly.

You can get the kml sources on codeplex and extract the code converting the geometries (look at Extractxxxx methods called by KmlToFeatureDefinition.CreateFeatureDefinition)
0 Kudos
KirkKuykendall
Deactivated User
Thanks Dominique ...

It turns out it looks like I can set KmlLayer.Url to this url:
http://www.google.com/fusiontables/exporttable?query=select+col8+from+1236296+&o=kmllink&g=col8

(Found using Fiddler and clicking download to kml from the fusion map page).

Now the only pain is converting to web mercator.

The code for the Kml sample sure will be a lot messier when Esri retires the WGS84 basemaps and replaces with web mercator.
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#KmlLayerSimple
0 Kudos
DominiqueBroux
Esri Frequent Contributor

It turns out it looks like I can set KmlLayer.Url to this url

Great idea. Much simpler 🙂

Now the only pain is converting to web mercator.


This Mortens's post should help.
0 Kudos
KirkKuykendall
Deactivated User
Hey Dominique -

I'm aware of that strategy.

I really think 99% of the time anyone using a kmllayer will be wanting to display it in web mercator.  So I think bending the no-projection-on-the-client rule makes sense in this situation.

See more discussion here:
http://forums.arcgis.com/threads/40409-Can-KmlLayer-project-to-Web-Mercator-on-the-fly
0 Kudos
DominiqueBroux
Esri Frequent Contributor
OK. I got it.
I guess with your post, this enhancement will move up in the priority list:)
0 Kudos