Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
FixBug .geojson file not supported in macos.
- In macOS .geojson file will be identified as type of "application/geo+json". So in checkFileType and readFile functions, they will not go into MIME_LOOKUPS list to find the corresponding type.
- Check first in MIME_LOOKUPS list and then the file.type will solve this problem.
On behalf of DB Systel GmbH
  • Loading branch information
congchen1101 committed Mar 19, 2024
1 parent 5261361 commit d4defe3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const tryUnzip = (file) => {
const checkFileType = (file) => {
return new Promise((resolve, reject) => {
const ext = recognizeExt(file.name);
const type = file.type || MIME_LOOKUPS[ext];
const type = MIME_LOOKUPS[ext] || file.type;
if (type === 'application/x-zip-compressed'
|| type === 'application/zip'
|| type === 'application/vnd.google-earth.kml+xml'
Expand All @@ -63,7 +63,7 @@ const checkFileType = (file) => {
*/
const readFile = (onWarnings) => (file) => {
const ext = recognizeExt(file.name);
const type = file.type || MIME_LOOKUPS[ext];
const type = MIME_LOOKUPS[ext] || file.type;
const projectionDefs = ConfigUtils.getConfigProp('projectionDefs') || [];
const supportedProjections = (projectionDefs.length && projectionDefs.map(({code}) => code) || []).concat(["EPSG:4326", "EPSG:3857", "EPSG:900913"]);
if (type === 'application/vnd.google-earth.kml+xml') {
Expand Down

0 comments on commit d4defe3

Please sign in to comment.