diff --git a/src/coord/geo/GeoJSONResource.ts b/src/coord/geo/GeoJSONResource.ts index 93a1d71233..d2c665c4ae 100644 --- a/src/coord/geo/GeoJSONResource.ts +++ b/src/coord/geo/GeoJSONResource.ts @@ -115,7 +115,7 @@ export class GeoJSONResource implements GeoResource { fixTextCoord(mapName, region); fixDiaoyuIsland(mapName, region); - // Some area like Alaska in USA map needs to be tansformed + // Some area like Alaska in USA map needs to be transformed // to look better const specialArea = this._specialAreas && this._specialAreas[regionName]; if (specialArea) { @@ -141,7 +141,7 @@ export class GeoJSONResource implements GeoResource { return { // For backward compatibility, use geoJson // PENDING: it has been returning them without clone. - // do we need to avoid outsite modification? + // do we need to avoid outside modification? geoJson: this._geoJSON, geoJSON: this._geoJSON, specialAreas: this._specialAreas @@ -161,9 +161,5 @@ function calculateBoundingRect(regions: GeoJSONRegion[]): BoundingRect { } function parseInput(source: GeoJSONSourceInput): GeoJSON | GeoJSONCompressed { - return !isString(source) - ? source - : (typeof JSON !== 'undefined' && JSON.parse) - ? JSON.parse(source) - : (new Function('return (' + source + ');'))(); + return !isString(source) ? source : JSON.parse(source); }