基于高德地图JS api开发的geojson编辑器.
http://geojson.finevis.cc/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
658 B
22 lines
658 B
3 years ago
|
import produce from "immer";
|
||
|
import { initState } from "../../initState";
|
||
|
import { IOverlay } from "@store";
|
||
|
|
||
|
export function createOverlay(state = initState, payload: any) {
|
||
|
return produce(state, (draft) => {
|
||
|
draft.map.status = "createOverlay";
|
||
|
draft.map.overlayType = payload as string;
|
||
|
});
|
||
|
}
|
||
|
|
||
|
export function finishCreateOverlay(state = initState, payload: any) {
|
||
|
return produce(state, (draft) => {
|
||
|
const overlay = payload as IOverlay;
|
||
|
// todo: uniqueName.
|
||
|
overlay.name = "矩形" + overlay.id;
|
||
|
draft.map.status = "";
|
||
|
draft.map.overlayType = "";
|
||
|
draft.map.rectangles = state.map.rectangles.concat([overlay]);
|
||
|
});
|
||
|
}
|