mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
separated map and user reducers
This commit is contained in:
parent
9f8cb1a875
commit
b75c028ce1
14 changed files with 849 additions and 768 deletions
|
@ -14,6 +14,8 @@ import { TileLayer } from "$containers/map/TileLayer";
|
|||
import { Stickers } from "$containers/map/Stickers";
|
||||
import { selectUserEditing } from '$redux/user/selectors'
|
||||
|
||||
import 'leaflet/dist/leaflet.css';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
provider: selectMapProvider(state),
|
||||
route: selectMapRoute(state),
|
||||
|
@ -32,6 +34,8 @@ type IProps = React.HTMLAttributes<HTMLDivElement> &
|
|||
ReturnType<typeof mapStateToProps> &
|
||||
typeof mapDispatchToProps & {};
|
||||
|
||||
export let MainMap = map(document.getElementById('canvas')).setView([55.0153275, 82.9071235], 13);
|
||||
|
||||
const MapUnconnected: React.FC<IProps> = ({
|
||||
provider,
|
||||
route,
|
||||
|
@ -53,8 +57,8 @@ const MapUnconnected: React.FC<IProps> = ({
|
|||
React.useEffect(() => {
|
||||
if (!ref.current) return;
|
||||
|
||||
setLayer(map(ref.current).setView([55.0153275, 82.9071235], 13));
|
||||
}, [ref]);
|
||||
setLayer(MainMap);
|
||||
}, []);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!layer) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue