Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/demos optimierung #125

Merged
merged 55 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
4c5c2bf
geoJson sotries / new decorator
Jun 30, 2023
c2f3ccb
FeatureEditor story
Jun 30, 2023
9077db3
new circle expression in geoJsonCircle story
Jun 30, 2023
bc3de66
Titels in mlGeoJson heat Map and circle stories
Jul 3, 2023
28b7462
Optimized Information by MlGpxViewer story
Jul 3, 2023
e4f287d
vectorTileLayer story:zoom level fixed
Jul 3, 2023
96ae328
restart button in the MlTransitionLayer demo
Jul 3, 2023
1b47f3b
Improved color visibilty for heatmap
Jul 3, 2023
a5c0777
changed font size for TempController Earthquakes
Jul 3, 2023
a1babb2
tags added in conponents meta.jsons
Jul 3, 2023
8d4e3f9
Merge branch 'feature/demos_optimierung' of https://github.com/mapcom…
Jul 3, 2023
4c3b107
symbol layer story definiert
Jul 4, 2023
40308d5
no3Dbutton story name changed (small "d")
Jul 4, 2023
8046fd9
navTools alternative postition story renamed
Jul 4, 2023
0c36caf
navTools "Demo" entfernt
Jul 4, 2023
16b9770
navTools story to TS
Jul 4, 2023
bb9e7e4
DEU titels to temporal controller stories
Jul 4, 2023
5850c79
Refactor of TempController story
Jul 4, 2023
d2166df
multilanguage titels for tempController demos
Jul 4, 2023
ddd10ce
TemporalController story refactor
Jul 4, 2023
a48374c
3dmodel button text + new WMSLoader preview img
Jul 4, 2023
1290920
tempController circle story titel shorted
Jul 4, 2023
6ef8c64
DEU text oto En in useCameraFollowPath
Jul 4, 2023
cc0b05f
MlFollowGps -adjust view to accurancy bbox
Jul 5, 2023
1d34b05
type filter prop in uploadButton added
Jul 5, 2023
9424fe8
WMSLoader/-Links mobile view updated
Jul 6, 2023
4676dc6
Merge pull request #124 from mapcomponents/feture/demos_optimierung
TFD1992 Jul 6, 2023
59fe10c
fixed WmsLoader Mobile View
Jul 6, 2023
e7ca4dd
window resize function in MlLayerSwipe
Jul 10, 2023
42ff658
Merge branch 'feature/demos_optimierung' of https://github.com/mapcom…
Jul 10, 2023
4d3844b
ScaleRedference positioned + file to tsx
Jul 10, 2023
dfef45b
Symbol layer definiert
Jul 10, 2023
515c2b5
MlNAvTools: adjustPitch Funktion fixed
Jul 10, 2023
89e2edf
MlNAvTools: adjustPitch Funktion fixed
Jul 10, 2023
e231acf
Merge branch 'feature/demos_optimierung' of https://github.com/mapcom…
Jul 10, 2023
9962715
active/inActive color in MlSketchTools
Jul 10, 2023
c36fcfb
hoveredgeometrie bug in MlSketchTool fixed
Jul 11, 2023
d9cd5b1
warnings removed
Jul 11, 2023
984b5a7
Feature Editore Style file added
Jul 11, 2023
468c3b7
Feature editor folder created
Jul 11, 2023
3638b7d
Adjusted point sizes for more intuitive editing
Jul 11, 2023
402aa1a
Center Location removed from mlThreeJSLayer
Jul 12, 2023
fd1a446
Merge branch 'feature/demos_optimierung' of https://github.com/mapcom…
Jul 12, 2023
dd03f8a
titel in MltransitionGeojson demo changed
Jul 12, 2023
8f14237
map-box-Draw version upgraded (1.4.2)
Jul 12, 2023
2e5da77
"Linestring" insetead of "LineString"
Jul 12, 2023
42a3f76
restart Button in featureEditor Sotry
Jul 12, 2023
0f6ccbe
mobiles: close buttonsMenu after click on a button
Jul 12, 2023
0546fe8
CenterPosition logo changed
Jul 12, 2023
0e745c3
console.log removed
Jul 12, 2023
0892d39
adjusted NavTools position
Jul 12, 2023
30a2c52
PRequest review
Jul 14, 2023
8195ea4
Merge branch 'feature/demos_optimierung' of https://github.com/mapcom…
Jul 14, 2023
2fe2df3
FetureEditore type in Story changed
Jul 14, 2023
4f687c4
Line Styler warning removed
Jul 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dist/components/MlFeatureEditor/MlFeatureEditor.stories.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export default storyoptions;
export const EditPolygon: any;
export const EditPoint: any;
export const EditLineString: any;
export const EditLinestring: any;
export const DrawPolygon: any;
export const DrawPoint: any;
export const DrawLineString: any;
export const DrawLinestring: any;
declare namespace storyoptions {
export const title: string;
export { MlFeatureEditor as component };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default storyoptions;
export const DefaultConfig: any;
export const No3DButton: any;
export const No3dButton: any;
export const ShowCenterLocationButton: any;
export const AlterToolPosition: any;
export const NoZoomButtons: any;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@emotion/css": "^11.10.5",
"@emotion/react": "^11.10.8",
"@emotion/styled": "^11.10.8",
"@mapbox/mapbox-gl-draw": "^1.4.0",
"@mapbox/mapbox-gl-draw": "^1.4.2",
"@mapbox/mapbox-gl-sync-move": "^0.3.1",
"@mui/icons-material": "^5.11.0",
"@mui/material": "^5.12.3",
Expand Down
Binary file removed public/assets/wg-marker.png
Binary file not shown.
Binary file modified public/thumbnails/MlWmsLoader.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/components/MlCenterPosition/MlCenterPosition.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useCallback } from "react";
import useMap from "../../hooks/useMap";
import { Button, SxProps, Theme } from '@mui/material';
import GpsFixedIcon from '@mui/icons-material/GpsFixed';
import FilterCenterFocusIcon from '@mui/icons-material/FilterCenterFocus';

export interface MlCenterPositionProps {
/**
Expand Down Expand Up @@ -65,7 +65,7 @@ const MlCenterPosition = (props: MlCenterPositionProps) => {
onClick={centerCurrentLocation}
disabled={locationAccessDenied}
>
<GpsFixedIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />
<FilterCenterFocusIcon sx={{ fontSize: { xs: '1.4em', md: '1em' } }} />
</Button>
</>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/MlCreatePdfForm/MlCreatePdfForm.meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"description": "Erzeugt eine PDF Datei aus der aktuellen Vorschau, mit anpassbarem Position, Format, Rotation und Auflösung."
}
},
"tags": [],
"category": "",
"tags": ["Map add-on"],
"category": "add-ons",
"type": "component"
}
91 changes: 0 additions & 91 deletions src/components/MlFeatureEditor/MlFeatureEditor.stories.js

This file was deleted.

123 changes: 123 additions & 0 deletions src/components/MlFeatureEditor/MlFeatureEditor.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
import React, { useEffect, useState } from 'react';
import { Button } from '@mui/material';
import MlFeatureEditor from './MlFeatureEditor';
import mapContextDecorator from '../../decorators/MapContextDecorator';
import TopToolbar from '../../ui_components/TopToolbar';
import { useFeatureEditorProps } from 'src/hooks/useFeatureEditor/useFeatureEditor';

const storyoptions = {
title: 'MapComponents/MlFeatureEditor',
component: MlFeatureEditor,
argTypes: {},
decorators: mapContextDecorator,
};
export default storyoptions;



const Template = (args: useFeatureEditorProps) => {


const [visible, setVisible] = useState(true);

useEffect(() => {
if (visible === false) {
setTimeout(() => {
setVisible(true);
}, 750);
}
}, [visible]);

return (
<>
<TopToolbar
unmovableButtons={
<Button
variant={ visible ? 'contained' : 'outlined'}
onClick={() => {
setVisible(false);
}}
sx={{ marginRight: { xs: '0px', sm: '10px' } }}
>
Restart
</Button>
}
/>
{visible && (
<MlFeatureEditor
{...args}
onChange={(features) => {
console.log(features);
}}
/>
)}
</>
);
};

export const EditPolygon = Template.bind({});
EditPolygon.args = {
mode: 'simple_select',
geojson: {
type: 'Feature',
properties: {},
geometry: {
coordinates: [
[
[7.0904979943736635, 50.73948334574527],
[7.087554458473562, 50.73827346433987],
[7.093562913197076, 50.73723639825727],
[7.096294028980594, 50.7387727842636],
[7.0904979943736635, 50.73948334574527],
],
],
type: 'Polygon',
},
},
};

export const EditPoint = Template.bind({});
EditPoint.args = {
mode: 'simple_select',
geojson: {
type: 'Feature',
properties: {},
geometry: {
type: 'Point',
coordinates: [7.0851268, 50.73884],
},
},
};

export const EditLinestring = Template.bind({});
EditLinestring.args = {
mode: 'simple_select',
geojson: {
type: 'Feature',
properties: {},
geometry: {
coordinates: [
[7.0904979943736635, 50.73948334574527],
[7.087554458473562, 50.73827346433987],
[7.093562913197076, 50.73723639825727],
[7.096294028980594, 50.7387727842636],
],
type: 'LineString',
},
},
};

export const DrawPolygon = Template.bind({});
DrawPolygon.args = {
mode: 'draw_polygon',
};

export const DrawPoint = Template.bind({});
DrawPoint.args = {
mode: 'draw_point',
};

export const DrawLinestring = Template.bind({});
DrawLinestring.args = {
mode: 'draw_line_string',
};
2 changes: 1 addition & 1 deletion src/components/MlFeatureEditor/MlFeatureEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import useFeatureEditor, { useFeatureEditorProps } from '../../hooks/useFeatureEditor';
import useFeatureEditor, { useFeatureEditorProps } from '../../hooks/useFeatureEditor/useFeatureEditor';
import './MlFeatureEditor.css';

const MlFeatureEditor: React.FC<useFeatureEditorProps> = (props) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/MlFollowGps/MlFollowGps.meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"description": "Darstellung der aktuellen Position und Blickrichtung"
}
},
"tags": [],
"category": "",
"tags": ["Map add-on"],
"category": "add-ons",
"type": "component"
}
43 changes: 38 additions & 5 deletions src/components/MlFollowGps/MlFollowGps.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
import React, { useRef, useEffect, useState, useCallback, useMemo } from "react";
import useMap from "../../hooks/useMap";
import MlGeoJsonLayer from "../MlGeoJsonLayer/MlGeoJsonLayer";
import React, { useRef, useEffect, useState, useCallback, useMemo } from 'react';
import useMap from '../../hooks/useMap';
import MlGeoJsonLayer from '../MlGeoJsonLayer/MlGeoJsonLayer';

import { Button } from '@mui/material';
import GpsFixedIcon from '@mui/icons-material/GpsFixed';

import { point, circle, lineArc, Feature, Point } from '@turf/turf';
import { CircleLayerSpecification, FillLayerSpecification } from 'maplibre-gl';
import {
point,
circle,
lineArc,
Feature,
Point,
bbox,
booleanContains,
bboxPolygon,
BBox,
} from '@turf/turf';
import { CircleLayerSpecification, FillLayerSpecification, LngLatBoundsLike } from 'maplibre-gl';

interface MlFollowGpsProps {
/**
Expand Down Expand Up @@ -166,6 +176,29 @@ const MlFollowGps = (props: MlFollowGpsProps) => {
return;
}, [mapHook.map, isFollowed, getLocationSuccess]);

useEffect(() => {
if (accuracyGeoJson?.type) {
const getBounds = mapHook.map?.getBounds();
const actualBounds = [
getBounds?._ne.lng,
getBounds?._ne.lat,
getBounds?._sw.lng,
getBounds?._sw.lat,
];
const accurancyBounds = bbox(accuracyGeoJson) as LngLatBoundsLike;
const contained = booleanContains(
bboxPolygon(actualBounds as BBox),
bboxPolygon(accurancyBounds as BBox)
);

if (contained === false) {
mapHook.map?.fitBounds(accurancyBounds, {
padding: { top: 25, bottom: 25 },
});
}
}
}, [accuracyGeoJson]);

return (
<>
{isFollowed && userLocationGeoJson && (
Expand Down
4 changes: 2 additions & 2 deletions src/components/MlGeoJsonLayer/MlGeoJsonLayer.meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"description": "Stellt GeoJSON Objekte dar"
}
},
"tags": [],
"category": "",
"tags": ["Map layer"],
"category": "layer",
"type": "component"
}
Loading
Loading