mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
setting changed on actual map change
This commit is contained in:
parent
34f98fb08b
commit
1a00b98ba3
3 changed files with 17 additions and 8 deletions
|
@ -13,13 +13,15 @@ import { Stickers } from '~/containers/map/Stickers';
|
|||
import { KmMarks } from '~/containers/map/KmMarks';
|
||||
|
||||
import 'leaflet/dist/leaflet.css';
|
||||
import { selectEditorEditing } from '~/redux/editor/selectors';
|
||||
import { selectEditorEditing, selectEditorMode } from '~/redux/editor/selectors';
|
||||
import { MODES } from '~/constants/modes';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
provider: selectMapProvider(state),
|
||||
route: selectMapRoute(state),
|
||||
stickers: selectMapStickers(state),
|
||||
editing: selectEditorEditing(state),
|
||||
mode: selectEditorMode(state),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = {
|
||||
|
@ -37,6 +39,7 @@ const MapUnconnected: React.FC<IProps> = ({
|
|||
provider,
|
||||
stickers,
|
||||
editing,
|
||||
mode,
|
||||
|
||||
mapClicked,
|
||||
mapSetSticker,
|
||||
|
@ -44,11 +47,11 @@ const MapUnconnected: React.FC<IProps> = ({
|
|||
}) => {
|
||||
const onClick = React.useCallback(
|
||||
event => {
|
||||
if (!MainMap.clickable) return;
|
||||
if (!MainMap.clickable || mode === MODES.NONE) return;
|
||||
|
||||
mapClicked(event.latlng);
|
||||
},
|
||||
[mapClicked]
|
||||
[mapClicked, mode]
|
||||
);
|
||||
|
||||
React.useEffect(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue