Skip to content

Commit

Permalink
feat: add marker data
Browse files Browse the repository at this point in the history
  • Loading branch information
ooooorobo committed Nov 25, 2023
1 parent 51ea060 commit 28ab5d7
Show file tree
Hide file tree
Showing 5 changed files with 1,559 additions and 20 deletions.
2 changes: 2 additions & 0 deletions src/components/layer/DraggableLayerContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { component$, Slot } from '@builder.io/qwik';
import { getDraggableLayerPointHandlers } from '../../util/mouse_drag.ts';
import { Point } from '../../type/Point.ts';
import { localStorageKey } from '../../page/app.tsx';

type Props = {
level: number;
Expand All @@ -9,6 +10,7 @@ type Props = {

export const DraggableLayerContainer = component$(({ screenLeftTop }: Props) => {
const { onMouseDown, onMouseMove } = getDraggableLayerPointHandlers((point) => {
localStorage.setItem(localStorageKey, JSON.stringify(screenLeftTop));
screenLeftTop.x = point.x;
screenLeftTop.y = point.y;
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/layer/MarkerLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ type Props = {
export const MarkerLayer = component$(({ markerList, mapLeftTop, scale }: Props) => {
return (
<div class={'marker_layer'}>
{markerList.map(({ position }) => (
{markerList.map(({ position, type }) => (
<div
class={'marker'}
style={{
transform: `translate(${mapLeftTop.x + position.x * scale - 12}px, ${mapLeftTop.y + position.y * scale - 12}px)`,
}}
/>
>{type}</div>
))}
</div>
);
Expand Down
Loading

0 comments on commit 28ab5d7

Please sign in to comment.