Yes, that was it.  Linking to the updated exhibit-api.js file worked.  I 
started with two KML files, one created by hand in Google Earth and 
another converted from an ESRI shapefile.  I successfully added these to 
an Exhibit.  They displayed fine, the facets worked (tested using the 
"vote for" field in the election08 app), and onClick worked as expected.

All this works great for polygons (I was using polygon-map-view.js in 
the election08 app).  Now, how do we get points, lines, and polygons on 
the same map?   I'm currently linking to the following.  Should I link 
to trunk for both?

http://api.simile-widgets.org/exhibit/2.2.0/extensions/map/map-extension.js
http://api.simile-widgets.org/exhibit/2.2.0/exhibit-api.js

- John




David Huynh wrote:
> John Callahan wrote:
>   
>> OK.  I first downloaded David's application at 
>> http://people.csail.mit.edu/dfhuynh/projects/election08/election08.html 
>> to my own server and everything worked fine. I then created two polygon 
>> KML files on my own (one through Google Earth and the other by 
>> converting from an ESRI shapefile.)  I ran both of these through Babel 
>> and downloaded the output as json files.  I used these two new json 
>> files as data sources in the election08 application. Everything looked 
>> great.  Polygons showed up where they should.  So, the translation seems 
>> to work.
>>
>> I needed to make only a few changes to election08.html to make the data 
>> sources from Babel work.
>>
>> 1) As David mentioned, add ex:latlngOrder="lnglat" to the polygon map view
>> 2) changed ex:polygon=".border" to ex:polygon=".polygon"
>> 3) edited line 263 in polygon-map-view.js to use ";" as the separator 
>> between coordinate pairs.  (it was set to "|")
>>
>>
>> No such luck adding the data sources directly from Babel.  Using the 
>> same election08.html, I took out the links to the previous json data 
>> files and added the following immediately 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>
>>
>> <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";
>>  
>> />
>>
>>
>> This did not work for the test1.kml files or for the two kml files I 
>> created.  The error I got was a javascript dialgue box stating "Failed 
>> to load javascript file:" wiht the following as the file:
>>
>> http://simile.mit.edu/babel/translator?reader=kml&writer=exhibit-jsonp&url=http%3A%2F%2Fsimile-widgets.googlecode.com%2Fsvn%2Fbabel%2Ftrunk%2Fconverters%2Fkml-converter%2Ftests%2Ftest1.kml&callback=Exhibit.JSONPImporter._callbacks.cb1
>>
>> When you enter this URL directly in a browser, you get
>>
>> Babel error: No reader of name kml
>>   
>>     
> My exhibit is still using the simile.mit.edu babel service. Could you 
> try to switch the exhibit-api.js URL to
>
>     http://api.simile-widgets.org/exhibit/2.2.0/exhibit-api.js
>
> That should use the new babel service, which supports KML.
>
> 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