- assertType
- assertObjectType
- isHTMLElement
- filterDefault
- test
- Events
- Exception
- imagemarker
- ImageMarker
- Background
- defaultStageControl
- Drawn
- Opened
- Stage
- HandlerResult
- UserCtl
Assert given type is the expected one
-
given
Given type -
expected
Expected type -
Throws UnexpectedTypeException When the assertion is false
Assert given object is the expected type
-
given
Object Given type -
expected
Object Expected type -
Throws UnexpectedTypeException When the assertion is false
Test whether or not given object is a HTML element
el
Object Element
Returns boolean Whether or not it's a HTML element
Merge the given value with the default value
-
def
Object Default value -
val
Object Given value -
Throws UnexpectedTypeException When the data type in default value failed to match the one inside of the given one.
Returns Object Merged object
Perform the compatibility test
- Throws IncompatibleContextException When current running context is incompatibiable with ImageMarker
Event manager
Insert new event listener into a type
type
string Type of the target eventlistener
function The listener that will be called when event fired
Remove the given event listener from a type
type
string Type of the target eventlistener
function The listener which was going to be called when event fired
Fire a event
type
string Event typedata
Event data
Remove all event listeners
Base Exception
message
string The error message
Return the error message into a string
Returns string The error message
Creating a new ImageMarker instance
driver
Object stage driver
import imageMarker from '~ImageMarker/imagemarker.js'
let marker = imageMarker(driver)
Returns ImageMarker a new Image Marker instance
The main class, manages the status (from creation to destroy) of the ImageMarker
stageDriver
Object Instance of the stage driver
Tears down current instance, unrecoverablely
Clear current stage without destroying it
Open a new stage
background
Background Background objectwaitLoad
boolean Whether or not to wait until the background is loadedcontrolBuilder
Object Builder of user controls
Returns Promise<Opened> An opened stage
Re-adjecting current stage
Insert new event listener to an internal event
Remove a listener from listening an internal event
Background object
url
string URL address of the background imagewidth
number Width of the image in pxheight
number Height of the image in px
Return the URL
Returns string
Return the width of the background image
Returns number
Return the height of the background image
Returns number
Return the ratio of the background image
Returns number
Return the zoom level according to the given target width and height
Returns number The zoom level
Return whether or not given target width and height can be zoomed to
Returns boolean Whether or not zoomable
Creating a default user controls of the stage
Returns Object User controls
Drawn element on the stage
drawn
Object Drawn object
Return the raw element of current drawn object
Returns Object
Remove current element from the stage
Set the properties of current drawn object. Actual effect depends on the stage driver
properties
Object New properties
Return the dimension of current drawn object
Returns Object
Export the data of current drawn object
Returns Object
Represents an opened stage
Reset current opened stage to it's initial configuation
Zoom the stage
screenCenterX
number X coordinate of the center view pointscreenCenterY
number Y coordinate of the center view pointpanXOffset
number X pan offsetpanYOffset
number Y pan offsetzoomShift
number Zoom offset
Insert a drawing
Returns Drawn Drawn object
Compose a drawing
-
properties
Object Properties -
drawingControl
Object User drawning control -
composeType
string Drawing type -
Throws StageAlreadyComposing When the stage already at composing status
Returns Promise<Drawn> Drawn object
Close current stage
Stage control
Return current stage element
Returns Object
Open a new stage
-
background
Background Stage background -
onSuccess
function Successful callback -
onFail
function Failure callback -
controls
Object User controls -
waitLoad
boolean Whether or not to wait until the background is loaded -
Throws StageAlreadyOpened When the stage already been opened
Clear current stage
Destroy current stage
Re-adjust current stage
Handler result
context
continueNext
User control manager
rootElement
Object The root element which the control handler will be binded toevents
Events Event manager
Listen to the given UI control listener set
listeners
Object Listeners setdata
Object Context data which will be delievered to control listeners when control event is fired
Remove UI control listener set
listeners
Object Listeners set
Destroy current user control manager