simplegeo / polymaps

Polymaps is a free JavaScript library for making dynamic, interactive maps in modern web browsers.
http://polymaps.org/
Other
1.6k stars 213 forks source link

Can a inline geoJSON object be added directly? #119

Closed psaia closed 12 years ago

psaia commented 12 years ago

I think that if I have a geoJSON object already loaded on the page I should be able to add it to the map. Though, I could be missing something. I definitely didn't see any examples of this in the API.

mbostock commented 12 years ago

Try geoJson.features.

psaia commented 12 years ago

Well I believe geoJson.features is not working for me because I am passing a JSON object with the type "FeatureCollection" on it. I guess there is no support for that?

mbostock commented 12 years ago

Wrap the object in an array, e.g., features([myFeature]).

psaia commented 12 years ago

That worked, thanks!