# featureOf

Enforce expectations about types of Feature inputs for Turf. Internally this uses geojsonType to judge geometry types.

> npm install @turf/invariant


参数 类型 描述
feature Feature a feature with an expected geometry type
type string expected GeoJSON type
name string name of calling function


var linestring1 = turf.lineString([[-24, 63], [-23, 60], [-25, 65], [-20, 69]], {name: 'line 1'});

turf.featureOf(linestring1, 'LineString', 'line 1');
Last Updated: 1/19/2021, 10:59:20 AM