Skip to content

Commit 76c545a

Browse files
authored
Merge pull request #21 from mapcomponents/Add-MultiTab
Add multi tab
2 parents 4ae9b1e + acced55 commit 76c545a

18 files changed

+1015
-352
lines changed

multi_tab/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
2-
"name": "app_title",
2+
"name": "multi_tab",
33
"private": true,
44
"version": "0.0.0",
55
"type": "module",
6+
"homepage": ".",
67
"scripts": {
78
"dev": "vite",
89
"build": "tsc && vite build",

webGis/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"homepage": ".",
66
"dependencies": {
7+
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
78
"@emotion/react": "^11.11.1",
89
"@emotion/styled": "^11.11.0",
910
"@mapcomponents/react-maplibre": "^0.1.85",

webGis/src/AppContext.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createContext } from "react";
2-
import { useState, useEffect } from "react";
2+
import { useState } from "react";
33

44
const AppContext = createContext({});
55

webGis/src/components/BottomSidebar.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import * as React from "react";
22
import { Global } from "@emotion/react";
3-
import { styled, useTheme } from "@mui/material/styles";
3+
import { styled, } from "@mui/material/styles";
44
import {
55
Box,
66
Typography,
7-
CssBaseline,
87
SwipeableDrawer,
9-
autocompleteClasses,
10-
} from "@mui/material/";
11-
import { grey } from "@mui/material/colors";
8+
} from "@mui/material/";
9+
1210

1311
const drawerBleeding = 56;
1412

webGis/src/components/CustomDraggableFrame.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import theme from "../theme";
44
import StraightenOutlinedIcon from "@mui/icons-material/StraightenOutlined";
55
import SquareFootOutlinedIcon from "@mui/icons-material/SquareFootOutlined";
66
import makeStyles from "@mui/styles/makeStyles";
7-
import useMediaQuery from "@mui/material/useMediaQuery";
87
import "maplibre-gl/dist/maplibre-gl.css";
98

109
import DraggableFrame from "./DraggableFrame";
@@ -17,9 +16,9 @@ import GeoJSONLoader from "../components/Frames/GeoJSONLoader";
1716
import LineGeoJSONIntersectionFeatureInfo from "../components/Frames/LineGeoJSONIntersectionFeatureInfo";
1817

1918

20-
import { ExampleConfig } from "../components/MlIconLayerstories";
19+
import { ExampleConfig } from "./MlIconLayerstories";
2120

22-
const useStyles = makeStyles((theme) => ({
21+
const useStyles = makeStyles(() => ({
2322
icon: {
2423
width: "40px",
2524
margin: "10px",
@@ -36,7 +35,6 @@ const useStyles = makeStyles((theme) => ({
3635
}));
3736

3837
function CustomDraggableFrame(props) {
39-
const mediaIsMobile = useMediaQuery("(max-width:900px)");
4038
const classes = useStyles(theme);
4139

4240
const entry = [

webGis/src/components/DraggableFrame.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { useMediaQuery } from "@mui/material";
1212

1313
import BottomSidebar from "./BottomSidebar";
1414

15-
const useStyles = makeStyles((theme) => ({
15+
const useStyles = makeStyles(() => ({
1616
icon: {
1717
width: "30px",
1818
margin: "10px",
@@ -34,10 +34,10 @@ function DraggableFrame(props) {
3434
var startPos;
3535

3636
useEffect(() => {
37-
if (props.componentId == "toolbar") {
37+
if (props.componentId === "toolbar") {
3838
window.addEventListener(
3939
"resize",
40-
function (event) {
40+
function () {
4141
setPos({ ...pos, x: window.innerWidth - 100 });
4242
},
4343
true
@@ -91,7 +91,7 @@ function DraggableFrame(props) {
9191
if (index > -1) {
9292
newState.splice(index, 1);
9393

94-
if (props.componentId == "featureInfo") {
94+
if (props.componentId === "featureInfo") {
9595
appContext.setFeatureInfoEnabled(false);
9696
}
9797
}

webGis/src/components/Frames/FeatureInfo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useState, useContext } from "react";
1+
import { useEffect, useContext } from "react";
22

33
import Grid from "@mui/material/Grid";
44

@@ -25,7 +25,7 @@ const useStyles = makeStyles((theme) => ({
2525
},
2626
}));
2727

28-
function FeatureInfo(props) {
28+
function FeatureInfo() {
2929
const classes = useStyles(theme);
3030

3131
const appContext = useContext(AppContext);

webGis/src/components/Frames/GeoJSONLoader.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useCallback, useEffect, useState, useContext, useRef } from "react";
1+
import { useContext, useRef } from "react";
22

33
import Grid from "@mui/material/Grid";
44

@@ -10,10 +10,10 @@ import { Button } from "@mui/material";
1010

1111
import ShareOutlinedIcon from '@mui/icons-material/ShareOutlined';
1212

13-
import TextField from "@mui/material/TextField";
13+
1414
import AppContext from "../../AppContext.js";
1515

16-
const useStyles = makeStyles((theme) => ({
16+
const useStyles = makeStyles(() => ({
1717
icon: {
1818
width: "40px",
1919
margin: "10px",
@@ -29,7 +29,7 @@ const useStyles = makeStyles((theme) => ({
2929
},
3030
}));
3131

32-
function GeoJSONLoader(props) {
32+
function GeoJSONLoader() {
3333
const classes = useStyles(theme);
3434

3535
const inputRef = useRef(null);

webGis/src/components/Frames/LayerTree.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
import { useEffect, useState } from "react";
2-
3-
import IconButton from "@mui/material/IconButton";
4-
51
import makeStyles from "@mui/styles/makeStyles";
62
import theme from "../../theme.js";
73
import Grid from "@mui/material/Grid";
@@ -26,7 +22,7 @@ const useStyles = makeStyles((theme) => ({
2622
},
2723
}));
2824

29-
function LayerTree(props) {
25+
function LayerTree() {
3026
const classes = useStyles(theme);
3127

3228
return (

webGis/src/components/Frames/LineGeoJSONIntersectionFeatureInfo.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ import { useEffect, useState, useContext } from "react";
22

33
import Grid from "@mui/material/Grid";
44
import Box from "@mui/material/Box";
5-
import Card from "@mui/material/Card";
6-
import CardActions from "@mui/material/CardActions";
7-
import CardContent from "@mui/material/CardContent";
8-
import Button from "@mui/material/Button";
95
import Typography from "@mui/material/Typography";
106
import Table from "@mui/material/Table";
117
import TableBody from "@mui/material/TableBody";
@@ -25,7 +21,7 @@ import { MlFeatureEditor } from "@mapcomponents/react-maplibre";
2521

2622
import * as turf from "@turf/turf";
2723

28-
const useStyles = makeStyles((theme) => ({
24+
const useStyles = makeStyles(() => ({
2925
icon: {
3026
width: "40px",
3127
margin: "10px",
@@ -41,7 +37,7 @@ const useStyles = makeStyles((theme) => ({
4137
},
4238
}));
4339

44-
function LineGeoJSONIntersectionFeatureInfo(props) {
40+
function LineGeoJSONIntersectionFeatureInfo() {
4541
const classes = useStyles(theme);
4642

4743
const appContext = useContext(AppContext);

0 commit comments

Comments
 (0)