From a809b68bb29c289d2b3cf410590566109193617f Mon Sep 17 00:00:00 2001 From: James Lyne Date: Thu, 10 Dec 2020 02:23:22 +0000 Subject: [PATCH] Implement display of lines and circles --- src/api.ts | 5 +- src/components/map/layer/MarkerSetLayer.vue | 8 +- src/components/map/vector/Circles.vue | 140 ++++++++++++++++++++ src/components/map/vector/Lines.vue | 122 +++++++++++++++++ src/dynmap.d.ts | 2 +- 5 files changed, 273 insertions(+), 4 deletions(-) create mode 100644 src/components/map/vector/Circles.vue create mode 100644 src/components/map/vector/Lines.vue diff --git a/src/api.ts b/src/api.ts index 2c00949..a625e37 100644 --- a/src/api.ts +++ b/src/api.ts @@ -231,7 +231,7 @@ function buildLines(data: any): Map { lines.set(key, { x: line.x || [0, 0], - y: [line.ybottom || 0, line.ytop || 0], + y: line.y || [0, 0], z: line.z || [0, 0], style: { color: line.color || '#ff0000', @@ -322,7 +322,8 @@ export default { }); }); - for(let i = 0; i < 408; i++) { + //Extra fake players for testing + for(let i = 0; i < 150; i++) { players.add({ account: "VIDEO GAMES " + i, health: Math.round(Math.random() * 10), diff --git a/src/components/map/layer/MarkerSetLayer.vue b/src/components/map/layer/MarkerSetLayer.vue index beb2505..3d3232c 100644 --- a/src/components/map/layer/MarkerSetLayer.vue +++ b/src/components/map/layer/MarkerSetLayer.vue @@ -1,6 +1,8 @@ + + \ No newline at end of file diff --git a/src/components/map/vector/Lines.vue b/src/components/map/vector/Lines.vue new file mode 100644 index 0000000..ab0899c --- /dev/null +++ b/src/components/map/vector/Lines.vue @@ -0,0 +1,122 @@ + + + \ No newline at end of file diff --git a/src/dynmap.d.ts b/src/dynmap.d.ts index 8fc9ab0..23079da 100644 --- a/src/dynmap.d.ts +++ b/src/dynmap.d.ts @@ -203,7 +203,7 @@ interface DynmapLine { interface DynmapCircle { location: Coordinate; radius: PointTuple; - style: CircleMarkerOptions; + style: PathOptions; label: string; isHTML: boolean; minZoom?: number;