mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-05-06 00:16:40 +07:00
cleanup
This commit is contained in:
parent
cb07aa9fb0
commit
8adf64acb9
6 changed files with 94 additions and 355 deletions
|
@ -34,12 +34,10 @@ type IProps = React.HTMLAttributes<HTMLDivElement> &
|
|||
|
||||
const MapUnconnected: React.FC<IProps> = ({
|
||||
provider,
|
||||
route,
|
||||
stickers,
|
||||
editing,
|
||||
|
||||
mapClicked,
|
||||
mapSetRoute,
|
||||
mapSetSticker,
|
||||
mapDropSticker,
|
||||
}) => {
|
||||
|
@ -63,7 +61,7 @@ const MapUnconnected: React.FC<IProps> = ({
|
|||
return createPortal(
|
||||
<div>
|
||||
<TileLayer provider={provider} map={MainMap} />
|
||||
<Route />
|
||||
|
||||
<Stickers
|
||||
stickers={stickers}
|
||||
map={MainMap}
|
||||
|
@ -71,6 +69,9 @@ const MapUnconnected: React.FC<IProps> = ({
|
|||
mapDropSticker={mapDropSticker}
|
||||
is_editing={editing}
|
||||
/>
|
||||
|
||||
<Route />
|
||||
|
||||
<Router />
|
||||
</div>,
|
||||
document.getElementById('canvas')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { FC, useEffect, memo, useState, useCallback } from 'react';
|
||||
import { IMapRoute } from '../../../redux/map/types';
|
||||
import { InteractivePoly } from '~/modules/InteractivePoly';
|
||||
import { InteractivePoly } from '~/utils/polyline';
|
||||
import { isMobile } from '~/utils/window';
|
||||
import { LatLng, Map, LeafletEvent } from 'leaflet';
|
||||
import { selectEditor } from '~/redux/editor/selectors';
|
||||
|
@ -45,7 +45,7 @@ const RouteUnconnected: FC<Props> = memo(
|
|||
const interactive = new InteractivePoly([], {
|
||||
color: 'url(#activePathGradient)',
|
||||
weight: 6,
|
||||
maxMarkers: isMobile() ? 50 : 200,
|
||||
maxMarkers: isMobile() ? 50 : 150,
|
||||
smoothFactor: 3,
|
||||
})
|
||||
.addTo(MainMap)
|
||||
|
|
|
@ -11,6 +11,7 @@ import { MapContainer } from '~/constants/map';
|
|||
interface IProps {
|
||||
map: MapContainer;
|
||||
sticker: IStickerDump;
|
||||
onDragStart?: () => void;
|
||||
index: number;
|
||||
is_editing: boolean;
|
||||
|
||||
|
@ -53,7 +54,12 @@ const Sticker: React.FC<IProps> = ({
|
|||
setDragging(true);
|
||||
}, [setDragging, layer, map]);
|
||||
|
||||
const onDragStop = React.useCallback(() => {
|
||||
const onDragStop = React.useCallback(event => {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
if (!layer) return;
|
||||
|
||||
setDragging(false);
|
||||
onChange({
|
||||
...sticker,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue