Skip to content

Commit

Permalink
try to fix build issues because maplibre
Browse files Browse the repository at this point in the history
  • Loading branch information
helllth committed Sep 20, 2022
1 parent 28f9581 commit 4643296
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
},
"scripts": {
"start": "react-scripts start",
"buildBelow18": "react-scripts build",
"build": "react-scripts --openssl-legacy-provider build",
"test": "react-scripts test",
"eject": "react-scripts eject",
Expand All @@ -51,17 +52,20 @@
"production": [
">0.2%",
"not dead",
"not op_mini all"
"not op_mini all",
"defaults",
"not ie 11"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
"last 1 safari version",
"ie 11"
]
},
"devDependencies": {
"@babel/core": "^7.3.3",
"@babel/preset-env": "^7.3.1",
"babel-loader": "8.1.0"
}
}
}
9 changes: 7 additions & 2 deletions src/LibreMap.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React, { useRef, useEffect, useState } from "react";
import maplibregl from "maplibre-gl";
// eslint-disable-next-line import/no-webpack-loader-syntax
import maplibregl from "!maplibre-gl";
import maplibreglWorker from "maplibre-gl/dist/maplibre-gl-csp-worker";

import "maplibre-gl/dist/maplibre-gl.css";
import "./mapLibre.css";
import { Button } from "react-bootstrap";
import { Map } from "maplibre-gl";
maplibregl.workerClass = maplibreglWorker;

export default function Map(props = { opacity: 0.1 }) {
export default function LibreMap(props = { opacity: 0.1 }) {
const mapContainer = useRef(null);
const map = useRef(null);
const [lng] = useState(7.150764);
Expand Down

0 comments on commit 4643296

Please sign in to comment.