mapbox / leaflet-omnivore

universal format parser for Leaflet & Mapbox.js
https://www.mapbox.com/mapbox.js/example/v1.0.0/omnivore-gpx/
Other
651 stars 126 forks source link

style geojson layer(polygon) #49

Closed geomajor56 closed 9 years ago

geomajor56 commented 10 years ago

This isn't really an issue but could you supply an example of styling a geojson layer(polygon) before or after converting from topojson. topojson and leaflet-omnivore make it possible to render a large layer but I can't figure out where to put the {style: style} function. I 'm not using the mapbox api, just leaflet. Also how would one implement the leafet onEachFeature. Any help would be greatly appreciated.

thanks in advance,

Mike S.

k-nut commented 10 years ago

Hey Mike, I made a fiddle that shows how you can apply the style by creating a geoJson layer that you can style. Is this what you want? If yes maybe we could add it to the official documentation. If not I will try to help you out further. http://jsfiddle.net/k_nut/d2z3ko5h/1/

tmcw commented 9 years ago

This is already covered by a live example on Mapbox: https://www.mapbox.com/mapbox.js/example/v1.0.0/omnivore-custom-layer/ - I'll add a truncated version to the readme.