Skip to content

Commit

Permalink
force rerender of map
Browse files Browse the repository at this point in the history
  • Loading branch information
MV88 committed Nov 14, 2024
1 parent 63daecd commit 7270a20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions web/client/actions/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const MAP_PLUGIN_LOAD = 'MAP:MAP_PLUGIN_LOAD';
export const ORIENTATION = 'MAP:ORIENTATION';
export const UPDATE_MAP_VIEW = 'MAP:UPDATE_MAP_VIEW';
export const UPDATE_MAP_OPTIONS = 'MAP:UPDATE_MAP_OPTIONS';
export const FORCE_RENDER = 'MAP:FORCE_RENDER';


/**
Expand Down Expand Up @@ -260,6 +261,11 @@ export const updateMapOptions = (configUpdate) => ({
configUpdate
});

export const forceReRender = (configUpdate) => ({
type: FORCE_RENDER,
configUpdate
});

/**
* Actions for map
* @name actions.map
Expand Down
5 changes: 4 additions & 1 deletion web/client/reducers/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import {
UNREGISTER_EVENT_LISTENER,
ORIENTATION,
UPDATE_MAP_VIEW,
UPDATE_MAP_OPTIONS
UPDATE_MAP_OPTIONS,
FORCE_RENDER
} from '../actions/map';
import { LOCATION_CHANGE } from 'connected-react-router';

Expand All @@ -38,6 +39,8 @@ function mapConfig(state = {eventListeners: {}}, action) {
const {type, ...params} = action;
params.zoom = isNaN(params.zoom) ? 1 : params.zoom;
return assign({}, state, params);
case FORCE_RENDER:
return {...state, center: {...state.center, x: state.center.x + 0.0000000000001}};
case CHANGE_MOUSE_POINTER:
return assign({}, state, {
mousePointer: action.pointer
Expand Down

0 comments on commit 7270a20

Please sign in to comment.