Skip to content

Commit

Permalink
chore(parser): change @mapbox/togeojson to @tmcw/togeojson
Browse files Browse the repository at this point in the history
The Mapbox library has not been maintained for almost 3 years, and this
fork (@tmcw/togeojson) is better to used. See the repo itself: https://github.com/tmcw/togeojson
  • Loading branch information
zarov committed Jun 10, 2020
1 parent 5557a0a commit 21392ba
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 44 deletions.
44 changes: 9 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"@babel/polyfill": "^7.8.7",
"@babel/runtime": "^7.9.6",
"@mapbox/mapbox-gl-style-spec": "^13.14.0",
"@mapbox/togeojson": "^0.16.0",
"@mapbox/vector-tile": "^1.3.1",
"@tmcw/togeojson": "^4.0.0",
"@tweenjs/tween.js": "^18.5.0",
"earcut": "^2.2.2",
"js-priority-queue": "^0.1.5",
Expand Down
8 changes: 4 additions & 4 deletions src/Parser/GpxParser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import togeojson from '@mapbox/togeojson';
import { gpx } from '@tmcw/togeojson';
import GeoJsonParser from 'Parser/GeoJsonParser';

/**
Expand All @@ -13,13 +13,13 @@ export default {
* Parse a GPX file content and return a [FeatureCollection]{@link
* module:GeoJsonParser~FeatureCollection}.
*
* @param {XMLDocument} gpx - The GPX file content to parse.
* @param {XMLDocument} gpxFile - The GPX file content to parse.
* @param {GeoJsonParser~GeoJsonParserOptions} options - Options controlling the parsing.
*
* @return {Promise} A promise resolving with a [FeatureCollection]{@link
* module:GeoJsonParser~FeatureCollection}.
*/
parse(gpx, options) {
return GeoJsonParser.parse(togeojson.gpx(gpx), options);
parse(gpxFile, options) {
return GeoJsonParser.parse(gpx(gpxFile), options);
},
};
8 changes: 4 additions & 4 deletions src/Parser/KMLParser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import togeojson from '@mapbox/togeojson';
import { kml } from '@tmcw/togeojson';
import GeoJsonParser from 'Parser/GeoJsonParser';

/**
Expand All @@ -13,13 +13,13 @@ export default {
* Parse a KML file content and return a [FeatureCollection]{@link
* module:GeoJsonParser~FeatureCollection}.
*
* @param {XMLDocument} kml - The KML file content to parse.
* @param {XMLDocument} kmlFile - The KML file content to parse.
* @param {GeoJsonParser~GeoJsonParserOptions} options - Options controlling the parsing.
*
* @return {Promise} A promise resolving with a [FeatureCollection]{@link
* module:GeoJsonParser~FeatureCollection}.
*/
parse(kml, options) {
return GeoJsonParser.parse(togeojson.kml(kml), options);
parse(kmlFile, options) {
return GeoJsonParser.parse(kml(kmlFile), options);
},
};

0 comments on commit 21392ba

Please sign in to comment.