truncate library

Functions

truncate(GeoJSONObject geojson, {int precision = 6, int coordinates = 3, bool mutate = false}) GeoJSONObject
Takes a Feature or FeatureCollection and truncates the precision of the geometry. precision sets the coordinate decimal precision coordinates sets the maximum number of coordinates (primarly used to remove z coordinates) mutate allows GeoJSONObject input to be mutated (significant performance increase if true) Returns GeoJSONObject layer with truncated geometry example: var point = Point(coordinates: Position.of( 70.46923055566859, 58.11088890802906, 1508 )); var truncated = truncate(point, precision: 3, coordinates: 2); //=truncated.geometry.coordinates => 70.469, 58.111 //addToMap var addToMap = truncated;