mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
updated leaflet version and tree-shaked deps
This commit is contained in:
parent
973f934614
commit
d8d448bcf7
7 changed files with 22 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
|||
import createReducer from 'reduxsauce/lib/createReducer';
|
||||
import { createReducer } from '~/utils/reducer';
|
||||
import { IDialogs } from '~/constants/dialogs';
|
||||
import { MODES } from '~/constants/modes';
|
||||
import { EDITOR_HANDLERS } from './handlers';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import createReducer from 'reduxsauce/lib/createReducer';
|
||||
import { createReducer } from '~/utils/reducer';
|
||||
import { MAP_HANDLERS } from './handlers';
|
||||
import { DEFAULT_PROVIDER } from '~/constants/providers';
|
||||
import { IMapRoute } from './types';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import createReducer from 'reduxsauce/lib/createReducer';
|
||||
import { createReducer } from '~/utils/reducer';
|
||||
import { DEFAULT_USER, IUser } from '~/constants/auth';
|
||||
import { USER_HANDLERS } from './handlers';
|
||||
|
||||
|
|
|
@ -89,10 +89,9 @@ class KmMarksLayer extends LayerGroup {
|
|||
html: `
|
||||
<div
|
||||
class="leaflet-km-dist ${allwaysPositiveAngleDeg(angle) !== angle ? 'reverse' : ''}"
|
||||
style="transform: translate(-50%, -50%) rotate(${allwaysPositiveAngleDeg(angle)}deg);"
|
||||
>
|
||||
${distance}
|
||||
<svg width="48" height="48" preserveAspectRatio="xMidYMid" transform="rotate(0deg)">
|
||||
<svg width="48" height="48" preserveAspectRatio="xMidYMid">
|
||||
<image xlink:href="${arrow_image}" x="0" y="0" width="48" height="48"/>
|
||||
</svg>
|
||||
</div>
|
||||
|
|
13
src/utils/reducer.ts
Normal file
13
src/utils/reducer.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
// create-reducer.ts
|
||||
import { Action } from 'redux';
|
||||
|
||||
type Handlers<State, Types extends string, Actions extends Action<Types>> = {
|
||||
readonly [Type in Types]: (state: State, action: Actions) => State
|
||||
}
|
||||
|
||||
export const createReducer = (
|
||||
initialState,
|
||||
handlers,
|
||||
) => (state = initialState, action) => (handlers.hasOwnProperty(action.type)
|
||||
? handlers[action.type](state, action)
|
||||
: state);
|
Loading…
Add table
Add a link
Reference in a new issue