Hi all,

I started to add support for KML -> Exhibit JSON conversion in Babel. 
This is very very basic for now. To try it, go to
    http://service.simile-widgets.org/babel/
Select "KML" in the first column of radio buttons, "Exhibit JSON" in the 
second, "data is on some web sites" in the third, and paste in this test URL
    
http://simile-widgets.googlecode.com/svn/babel/trunk/converters/kml-converter/tests/test1.kml
Here's what you're supposed to see
    
http://service.simile-widgets.org/babel/translator?reader=kml&writer=exhibit-json&mimetype=text/plain&url=http%3A%2F%2Fsimile-widgets.googlecode.com%2Fsvn%2Fbabel%2Ftrunk%2Fconverters%2Fkml-converter%2Ftests%2Ftest1.kml

To enable this in Exhibit (before it gets added to Exhibit officially), 
add this code after including exhibit-api.js

    <script>
        
Exhibit.BabelBasedImporter.mimetypeToReader["application/vnd.google-earth.kml+xml"]
 
= "kml";
        Exhibit.importers["application/vnd.google-earth.kml+xml"] = 
Exhibit.BabelBasedImporter;
    </script>

Then, a KML data link would look like this

    <link rel="exhibit/data" type="application/vnd.google-earth.kml+xml"
        
href="http://simile-widgets.googlecode.com/svn/babel/trunk/converters/kml-converter/tests/test1.kml";
 
/>

I haven't tested this Exhibit integration myself. I know of one small 
catch, which is that the KML converter generates pairs of lng,lat, 
whereas the Exhibit map view expects lat,lng. You can make the Exhibit's 
original map view takes lng,lat with this hack
    
Exhibit.MapView._accessorSpecs[1].alternatives[0].bindings[0].bindingNames 
= [ "lng", "lat" ];

If you're using the polygon map view used by
    http://people.csail.mit.edu/dfhuynh/projects/election08/election08.html
then you'd just need this in the view div
    ex:latlngOrder="lnglat"

Some more thoughts are needed if different data sources use different 
lat/lng orders.

Please let me know how this works out for you.

David


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to