Skip to content

Commit

Permalink
Merge pull request #1192 from OpenGeoscience/square-annotations
Browse files Browse the repository at this point in the history
feat: Add square, ellipse, and circle annotation classes
  • Loading branch information
manthey authored Mar 30, 2022
2 parents 112a58e + 170bf6d commit 6c86a1d
Show file tree
Hide file tree
Showing 14 changed files with 916 additions and 363 deletions.
22 changes: 14 additions & 8 deletions examples/annotations/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ block append mainContent
#controls
.form-group.annotationtype(title='Select the type of annotation to add.')
.shortlabel Add
button#rectangle.lastused(next='polygon') Rectangle
button#rectangle.lastused(next='square') Rectangle
button#square.lastused(next='ellipse') Square
button#ellipse(next='circle') Ellipse
button#circle(next='polygon') Circle
button#polygon(next='point') Polygon
button#point(next='line') Point
button#line(next='rectangle') Line
Expand All @@ -13,6 +16,9 @@ block append mainContent
.annotation.none
.annotation.polygon Left-click points in the polygon. Double click, right click, or click the starting point to close the polygon.
.annotation.rectangle Left click-and-drag or left click opposite corners to draw a rectangle.
.annotation.square Left click-and-drag or left click opposite corners to draw a square.
.annotation.ellipse Left click-and-drag or left click opposite corners to draw an ellipse.
.annotation.circle Left click-and-drag or left click opposite corners to draw a circle.
.annotation.point Left click to create a point.
.annotation.line Left-click points in the line. Double click, right click, or click the starting point to end the line.
.form-group(title='If enabled, left-click to add another annotation, and right-click to switch annotation type. Otherwise, you must click a button above.')
Expand Down Expand Up @@ -62,29 +68,29 @@ block append mainContent
.form-group(annotation-types='point', title='Set to "false" to disable, "true" to use the specified radius at the current zoom, or a zoom level to use the specified radius at that zoom level.')
label(for='edit-scaled') Scale with Zoom
input#edit-scaled(option='scaled', format='booleanOrNumber')
.form-group(annotation-types='point polygon rectangle')
.form-group(annotation-types='point polygon rectangle square ellipse circle')
label(for='edit-fill') Fill
select#edit-fill(option='fill', format='boolean')
option(value='true') Yes
option(value='false') No
.form-group(annotation-types='point polygon rectangle')
.form-group(annotation-types='point polygon rectangle square ellipse circle')
label(for='edit-fillColor') Fill Color
input#edit-fillColor(option='fillColor', format='color')
.form-group(annotation-types='point polygon rectangle')
.form-group(annotation-types='point polygon rectangle square ellipse circle')
label(for='edit-fillOpacity') Fill Opacity
input#edit-fillOpacity(option='fillOpacity', format='opacity')
.form-group(annotation-types='point polygon rectangle')
.form-group(annotation-types='point polygon rectangle square ellipse circle')
label(for='edit-stroke') Stroke
select#edit-stroke(option='stroke', format='boolean')
option(value='true') Yes
option(value='false') No
.form-group(annotation-types='point polygon rectangle line')
.form-group(annotation-types='point polygon rectangle square ellipse circle line')
label(for='edit-strokeWidth') Stroke Width
input#edit-strokeWidth(option='strokeWidth', format='positive')
.form-group(annotation-types='point polygon rectangle line')
.form-group(annotation-types='point polygon rectangle square ellipse circle line')
label(for='edit-strokeColor') Stroke Color
input#edit-strokeColor(option='strokeColor', format='color')
.form-group(annotation-types='point polygon rectangle line')
.form-group(annotation-types='point polygon rectangle square ellipse circle line')
label(for='edit-strokeOpacity') Stroke Opacity
input#edit-strokeOpacity(option='strokeOpacity', format='opacity')
.form-group(annotation-types='line')
Expand Down
3 changes: 3 additions & 0 deletions examples/annotations/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
}
#instructions[annotation="polygon"] .annotation.polygon,
#instructions[annotation="rectangle"] .annotation.rectangle,
#instructions[annotation="square"] .annotation.square,
#instructions[annotation="ellipse"] .annotation.ellipse,
#instructions[annotation="circle"] .annotation.circle,
#instructions[annotation="point"] .annotation.point,
#instructions[annotation="line"] .annotation.line,
#instructions[annotation="none"] .annotation.none {
Expand Down
Binary file modified examples/annotations/thumb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6c86a1d

Please sign in to comment.