From 519c7807e4bb20394fa1bf0f0bf3710c7329b808 Mon Sep 17 00:00:00 2001 From: Anand Thakker Date: Mon, 30 Jul 2018 15:13:58 -0400 Subject: [PATCH] Use @mapbox/geojson-types --- .flowconfig | 1 + package.json | 1 + src/source/geojson_source.js | 3 +-- src/style/style.js | 2 +- src/types/geojson.js | 16 ---------------- src/util/vectortile_to_geojson.js | 2 +- yarn.lock | 4 ++++ 7 files changed, 9 insertions(+), 20 deletions(-) delete mode 100644 src/types/geojson.js diff --git a/.flowconfig b/.flowconfig index 6a02582fad3..86decd252ba 100644 --- a/.flowconfig +++ b/.flowconfig @@ -8,6 +8,7 @@ .*/node_modules/htmltojsx/.* .*/node_modules/documentation/.* .*/node_modules/module-deps/.* +.*/node_modules/@mapbox/geojson-types/fixtures/.* .*/test/unit/style-spec/fixture/invalidjson.input.json .*/test/integration/render-tests/.* diff --git a/package.json b/package.json index a3fdb651da9..cf0e06238fc 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "node": ">=6.4.0" }, "dependencies": { + "@mapbox/geojson-types": "^1.0.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", "@mapbox/mapbox-gl-supported": "^1.4.0", "@mapbox/point-geometry": "^0.1.0", diff --git a/src/source/geojson_source.js b/src/source/geojson_source.js index 1a5f5f942cf..80cae750373 100644 --- a/src/source/geojson_source.js +++ b/src/source/geojson_source.js @@ -13,8 +13,7 @@ import type Dispatcher from '../util/dispatcher'; import type Tile from './tile'; import type {Callback} from '../types/callback'; import type {PerformanceResourceTiming} from '../types/performance_resource_timing'; -import type {GeoJSON} from '../types/geojson'; -import type {Feature as GeoJSONFeature} from 'flow-geojson'; +import type {GeoJSON, GeoJSONFeature} from '@mapbox/geojson-types'; import type {GeojsonSourceSpecification} from '../style-spec/types'; /** diff --git a/src/style/style.js b/src/style/style.js index 67a0f73061b..4ad10f9b9e6 100644 --- a/src/style/style.js +++ b/src/style/style.js @@ -50,7 +50,7 @@ import type {Callback} from '../types/callback'; import type EvaluationParameters from './evaluation_parameters'; import type {Placement} from '../symbol/placement'; import type {Cancelable} from '../types/cancelable'; -import type {GeoJSON} from '../types/geojson'; +import type {GeoJSON} from '@mapbox/geojson-types'; import type { LayerSpecification, FilterSpecification, diff --git a/src/types/geojson.js b/src/types/geojson.js deleted file mode 100644 index 1addec25d07..00000000000 --- a/src/types/geojson.js +++ /dev/null @@ -1,16 +0,0 @@ -// @flow - -import type { - Point, - MultiPoint, - LineString, - MultiLineString, - Polygon, - MultiPolygon, - GeometryCollection, - Feature, - FeatureCollection -} from 'flow-geojson'; - -export type GeoJSONGeometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | GeometryCollection; -export type GeoJSON = GeoJSONGeometry | Feature | FeatureCollection; diff --git a/src/util/vectortile_to_geojson.js b/src/util/vectortile_to_geojson.js index 5d4f5786f0d..24c156e2a1b 100644 --- a/src/util/vectortile_to_geojson.js +++ b/src/util/vectortile_to_geojson.js @@ -1,5 +1,5 @@ // @flow -import type {GeoJSONGeometry} from '../types/geojson'; +import type {GeoJSONGeometry} from '@mapbox/geojson-types'; class Feature { type: 'Feature'; diff --git a/yarn.lock b/yarn.lock index 24837ad3826..e1f4e3e9844 100644 --- a/yarn.lock +++ b/yarn.lock @@ -97,6 +97,10 @@ dependencies: wgs84 "0.0.0" +"@mapbox/geojson-types@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz#9aecf642cb00eab1080a57c4f949a65b4a5846d6" + "@mapbox/jsonlint-lines-primitives@^2.0.2": version "2.0.2" resolved "https://registry.yarnpkg.com/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz#ce56e539f83552b58d10d672ea4d6fc9adc7b234"