I find it quite practical to work with leaflet Polygon and it would be great to be able to build such objects directly from GeoJSON content. I did not find any Polygon constructor taking neither a GeoJSON object nor a GeoJSON string as input. Is there some method to build a leaflet polygon directly from a feature or an array of polygons from a featurecollection?
Something like:
geoJ = GeoJSON object returned/parsed from ajax call
pol = L.polygon( geoJ.features[0] )
bounds = pol.getBounds()
L.geoJson(geoJ)
to perform the conversion. It does not show anything on map as long as you do not explicitly ask Leaflet to do so (map.addLayer). Then you would iterate through each layer (corresponding to each polygon) witheachLayer()
method.