Merge pull request #1097 from calvinmetcalf/GeometryCollection

GeoJSON GeometryCollection passes consisent params to pointToLayer
This commit is contained in:
Vladimir Agafonkin 2013-01-14 06:33:28 -08:00
commit dad3996d0e

View File

@ -103,13 +103,17 @@ L.extend(L.GeoJSON, {
latlngs = this.coordsToLatLngs(coords, 1);
return new L.MultiPolyline(latlngs);
case "MultiPolygon":
case 'MultiPolygon':
latlngs = this.coordsToLatLngs(coords, 2);
return new L.MultiPolygon(latlngs);
case "GeometryCollection":
case 'GeometryCollection':
for (i = 0, len = geometry.geometries.length; i < len; i++) {
layer = this.geometryToLayer(geometry.geometries[i], pointToLayer);
layer = this.geometryToLayer({
geometry: geometry.geometries[i],
type: 'Feature',
properties: geojson.properties
}, pointToLayer);
layers.push(layer);
}
return new L.FeatureGroup(layers);