File tree Expand file tree Collapse file tree 4 files changed +1787
-1494
lines changed Expand file tree Collapse file tree 4 files changed +1787
-1494
lines changed Original file line number Diff line number Diff line change 87
87
"uglify-js" : " ^3.0.22" ,
88
88
"unassertify" : " ^2.0.3"
89
89
},
90
- "peerDependencies" : {
91
- "mapbox-gl" : " >=0.27.0"
92
- },
93
90
"dependencies" : {
94
- "@mapbox/geojson-area" : " ^0.2.1" ,
95
- "@mapbox/geojson-extent" : " ^0.3.2" ,
96
- "@mapbox/geojson-normalize" : " 0.0.1" ,
97
- "@mapbox/geojsonhint" : " 3.0.0" ,
98
- "@mapbox/point-geometry" : " 0.1.0" ,
91
+ "@mapbox/geojson-area" : " ^0.2.2" ,
92
+ "@mapbox/geojson-extent" : " ^1.0.0" ,
93
+ "@mapbox/geojson-normalize" : " ^0.0.1" ,
94
+ "@mapbox/point-geometry" : " ^0.1.0" ,
99
95
"hat" : " 0.0.3" ,
100
- "lodash.isequal" : " ^4.2 .0" ,
101
- "xtend" : " ^4.0.1 "
96
+ "lodash.isequal" : " ^4.5 .0" ,
97
+ "xtend" : " ^4.0.2 "
102
98
}
103
99
}
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import normalize from '@mapbox/geojson-normalize';
3
3
import hat from 'hat' ;
4
4
import featuresAt from './lib/features_at' ;
5
5
import stringSetsAreEqual from './lib/string_sets_are_equal' ;
6
- import geojsonhint from '@mapbox/geojsonhint' ;
7
6
import * as Constants from './constants' ;
8
7
import StringSet from './lib/string_set' ;
9
8
@@ -74,10 +73,6 @@ export default function(ctx, api) {
74
73
} ;
75
74
76
75
api . add = function ( geojson ) {
77
- const errors = geojsonhint . hint ( geojson , { precisionWarning : false } ) . filter ( e => e . level !== 'message' ) ;
78
- if ( errors . length ) {
79
- throw new Error ( errors [ 0 ] . message ) ;
80
- }
81
76
const featureCollection = JSON . parse ( JSON . stringify ( normalize ( geojson ) ) ) ;
82
77
83
78
const ids = featureCollection . features . map ( ( feature ) => {
Original file line number Diff line number Diff line change @@ -207,20 +207,6 @@ test('Draw.add -- GeometryCollection', (t) => {
207
207
t . end ( ) ;
208
208
} ) ;
209
209
210
- test ( 'Draw.add -- Invalid geojson' , ( t ) => {
211
- t . throws ( ( ) => {
212
- Draw . add ( {
213
- type : 'Feature' ,
214
- properties : { } ,
215
- geometry : {
216
- type : 'Point' ,
217
- coordinates : 7
218
- }
219
- } ) ;
220
- } , / c o o r d i n a t e s / , 'Invalid GeoJSON throws an error' ) ;
221
- t . end ( ) ;
222
- } ) ;
223
-
224
210
test ( 'Draw.add - accept lots of decimal percision' , ( t ) => {
225
211
for ( let i = 0 ; i < 30 ; i ++ ) {
226
212
const div = Math . pow ( 10 , i ) ;
You can’t perform that action at this time.
0 commit comments