summaryrefslogtreecommitdiff
path: root/src/Map/Shapes.js
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-06-05 20:45:39 -0500
committersanine <sanine.not@pm.me>2022-06-05 20:45:39 -0500
commit980dc4390e5414b4892421dea3ebb99f1a5839ac (patch)
tree591763555db3b9105ff304b24bfa9f854f4ee143 /src/Map/Shapes.js
parentb3d9ffe8107bd7e0989c1fed2e5bdf31037134bb (diff)
add Text shape
Diffstat (limited to 'src/Map/Shapes.js')
-rw-r--r--src/Map/Shapes.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Map/Shapes.js b/src/Map/Shapes.js
index 3443f73..e394b69 100644
--- a/src/Map/Shapes.js
+++ b/src/Map/Shapes.js
@@ -23,6 +23,7 @@ class Shape {
static Point = new ShapeType('Point');
static Path = new ShapeType('Path');
static Polygon = new ShapeType('Polygon');
+ static Text = new ShapeType('Text');
constructor(type, nodes) {
this.type = type;
@@ -67,6 +68,14 @@ class Polygon extends Shape {
}
}
+class Text extends Shape {
+ constructor(node, text, fontSize) {
+ super(Shape.Text, [node]);
+ this.text = text;
+ this.fontSize = fontSize;
+ }
+}
+
class ZoomLevel extends Enum {
static Globe = new ZoomLevel('Globe');
@@ -110,4 +119,4 @@ class MapObject {
}
-export { Node, Shape, Point, Path, Polygon, ZoomLevel, MapObject };
+export { Node, Shape, Point, Path, Polygon, Text, ZoomLevel, MapObject };