API Docs for: 7.2
Show:

MQA.LineOverlay Class

Module: MQA

Creates an MQA.LineOverlay object.

Constructor

MQA.LineOverlay

()

Example:

MQA.withModule('shapes', function() {
    var line = new MQA.LineOverlay();
    line.shapePoints = [ 39.633041, -105.318492, 39.847136, -104.674787 ];

    map.addShape(line);
});

Properties

_curVisibility

Boolean private

Inherited from MQA.ShapeOverlay

Whether this shape is currently visible, for internal comparison with the public 'visible' property.

Defaults to true.

altStateFlag

Boolean protected

Inherited from MQA.ShapeOverlay

Set to true for the shape overlay to be in its 'alt' state.

borderWidth

Integer protected

Inherited from MQA.ShapeOverlay

The width of the border in pixels. Defaults to 3.

className

String final

Default: 'MQA.LineOverlay'

color

String protected

Inherited from MQA.ShapeOverlay

The hex value of the border color. Defaults to black ('#000000').

colorAlpha

Float protected

Inherited from MQA.ShapeOverlay

The opacity of the border (0-1). Defaults to 1.0.

fillColor

String protected

Inherited from MQA.ShapeOverlay

The hex value of the fill color. Defaults to black ('#000000').

fillColorAlpha

Float protected

Inherited from MQA.ShapeOverlay

The opacity of the fill color (0-1). Defaults to 1.0.

firesMouseEventsWhileNotVisible

Boolean protected

Inherited from MQA.ShapeOverlay

Whether this shape should trigger mouse events while it is not visible.

Defaults to false, as that's the behavior most people usually want. It is very surprising when a visible shape's mouse handlers don't fire because an invisible shape is above it.

This is useful for things like ellipse bounding boxes for the ShapeDrawingControl, which only activate when the cursor is over them.

key

String protected

Inherited from MQA.ShapeOverlay

User-defined key for this object.

maxZoomLevel

Integer protected

Inherited from MQA.ShapeOverlay

The maximum zoom level in which the shape overlay should display. Defaults to 18 (the highest available zoom level).

minZoomLevel

Integer protected

Inherited from MQA.ShapeOverlay

The minimum zoom level in which the shape overlay should display. Defaults to 2 (the lowest available zoom level).

shapePoints

Array protected

Inherited from MQA.ShapeOverlay

The shape points used to draw the overlay. The lat/lng values are translated into pixel placements.

visible

Boolean protected

Inherited from MQA.ShapeOverlay

Set to false if shape overlay should not be visible. Defaults to true.

zIndex

Object protected

Inherited from MQA.ShapeOverlay

zIndex - default null.

Methods

_applyZIndex

() private

Inherited from MQA.ShapeOverlay

Override to apply zindex changes to elements UNIMPLEMENTED

_hasValidPoints

() private

Inherited from MQA.ShapeOverlay

Check whether this.points can be used to render a visible shape.

Private helper method introduced so our drawing module can eliminate no-size or one-point shapes added by the user.

As such, may not be satisfactory when used outside the context of the ShapeDrawingControl control.

_prefix

() private

Inherited from MQA.ShapeOverlay

Return an identifier with a prefix attached to it and its first letter upper-cased.

Included here for use by CanvasShapeOverlay. Not intended for general consumption.

add

()

Inherited from MQA.ShapeOverlay

Add the shape to the surface. Must be called to show the shape.

attrUpdated

()

Inherited from MQA.ShapeOverlay

Called when one of the alternate state flag based attributes is updated. UNIMPLEMENTED

createPeer

() MQA.ShapeOverlay

Inherited from MQA.ShapeOverlay

creates a peer

Returns <MQA.ShapeOverlay>

returns this instance

defineProperty

(
  • name
  • transformFunction
  • defaultValue
  • setTrigger
)

Inherited from MQA.Component

Dynamically define a property, complete with getters, setters, an optional transformFunction, default value and setTrigger. This method can be invoked on a function's prototype to create a permanent property for all instances.

Parameters:

  • name String

    Camel-cased property name

  • transformFunction Function

    (Optional) If defined, then the setter will filter the value to set through this function

  • defaultValue Object

    (Optional) If defined the default value to initialize immediately

  • setTrigger Function | String

    (Optional) If defined the given named trigger method will be called when the setter results in a change.

Example:

 myObj.defineProperty('myNewProp', parseInt, 0, function () { alert('myNewProp changed'); });
 myObj.setMyNewProp('1'); // Will trigger alert
 myObj.getMyNewProp();  // --> 1

 myObj.boolTrigger = function () { alert('bool changed'); };
 myObj.defineProperty('reallyBig', Boolean, false, 'boolTrigger');
 myObj.isReallyBig();   // --> false
 myObj.setReallyBig(1); // alert "bool changed"
 myObj.isReallyBig();   // --> true

dispose

()

Inherited from MQA.Component

Dispose

element

()

Inherited from MQA.ShapeOverlay

element

Returns

this Element

getActValue

() Object

Inherited from MQA.ShapeOverlay

Returns the actual value for a property, adjusted for the altStateFlag

Returns <Object>

value of state

getAltStateFlag

() Boolean

Inherited from MQA.ShapeOverlay

Get whether the shape overlay is in its 'alt' state.

Returns <Boolean>

getBorderWidth

() Integer

Inherited from MQA.ShapeOverlay

Get the width of the border in pixels.

Returns <Integer>

getColor

() String

Inherited from MQA.ShapeOverlay

Get the hex value of the border color. Starts as black ('#000000').

Returns <String>

getColorAlpha

() Float

Inherited from MQA.ShapeOverlay

Get the opacity of the border (0-1).

Returns <Float>

getFillColor

() String

Inherited from MQA.ShapeOverlay

Get the hex value of the fill color.

Returns <String>

getFillColorAlpha

() Float

Inherited from MQA.ShapeOverlay

Get the opacity of the fill color (0-1).

Returns <Float>

getFiresMouseEventsWhileNotVisible

() Boolean

Inherited from MQA.ShapeOverlay

Get whether this shape triggers mouse events while it is not visible.

Starts as false, as that's the behavior most people usually want. It is very surprising when a visible shape's mouse handlers don't fire because an invisible shape is above it.

This is useful for things like the ellipse bounding boxes in the ShapeDrawingControl, which only activate if the cursor is over them.

Returns <Boolean>

getKey

() String

Inherited from MQA.ShapeOverlay

Get user-defined key for this object.

Returns <String>

getMaxZoomLevel

() Integer

Inherited from MQA.ShapeOverlay

Get the maximum zoom level in which the shape overlay should display. Starts at 18 (the highest available zoom level).

Returns <Integer>

getMinZoomLevel

() Integer

Inherited from MQA.ShapeOverlay

Get the minimum zoom level in which the shape overlay should display. Starts at 2 (the lowest available zoom level).

Returns <Integer>

getShapePoints

() Array

Inherited from MQA.ShapeOverlay

Get the shape points used to draw the overlay.

Returns <Array>

getValue

(
  • pcKey
)
Mixed

Inherited from MQA.Component

Returns the value if it exists, undefined otherwise.

Parameters:

  • pcKey String

    The property name of the value to get.

Returns <Mixed>

The value of the specified property name. If the specified property does not exist, undefined is returned.

getVisible

() Boolean

Inherited from MQA.ShapeOverlay

Get set to false if shape overlay should not be visible. Starts as true.

Returns <Boolean>

getZIndex

() Object

Inherited from MQA.ShapeOverlay

Get zIndex - starts as null.

Returns <Object>

init

(
  • name
  • wireEvent
)

Inherited from MQA.ShapeOverlay

Initialize this ShapeOverlay.

Parameters:

layerInit

(
  • layer
  • map
)

Inherited from MQA.ShapeOverlay

Initializes Layer

Parameters:

remove

()

Inherited from MQA.ShapeOverlay

remove

resetAttributes

()

Inherited from MQA.ShapeOverlay

Re-applies all attributes

resetTransform

()

Inherited from MQA.ShapeOverlay

resetTransform

setAltStateFlag

(
  • altStateFlag
)

Inherited from MQA.ShapeOverlay

Pass true for the shape overlay to be in its 'alt' state.

Parameters:

setBorderWidth

(
  • borderWidth
)

Inherited from MQA.ShapeOverlay

Set the width of the border in pixels. Starts at 3.

Parameters:

  • borderWidth Integer

setColor

(
  • color
)

Inherited from MQA.ShapeOverlay

Set the hex value of the border color. Starts as black ('#000000').

Parameters:

setColorAlpha

(
  • colorAlpha
)

Inherited from MQA.ShapeOverlay

Set the opacity of the border (0-1). Starts at 1.0.

Parameters:

  • colorAlpha Float

setFillColor

(
  • fillColor
)

Inherited from MQA.ShapeOverlay

Set the hex value of the fill color. Starts as black ('#000000').

Parameters:

setFillColorAlpha

(
  • fillColorAlpha
)

Inherited from MQA.ShapeOverlay

Set the opacity of the fill color (0-1). Starts as 1.0.

Parameters:

  • fillColorAlpha Float

setFiresMouseEventsWhileNotVisible

(
  • shouldFireEvents
)

Inherited from MQA.ShapeOverlay

Set whether this shape triggers mouse events while it is not visible. Starts as false

Pass true to make overlays like ellipse bounding boxes in the ShapeDrawingControl, which only activate if the cursor is over them.

Parameters:

setKey

(
  • key
)

Inherited from MQA.ShapeOverlay

Set the user-defined key for this object.

Parameters:

setMaxZoomLevel

(
  • maxZoomLevel
)

Inherited from MQA.ShapeOverlay

Set the maximum zoom level in which the shape overlay should display. Starts at 18 (the highest available zoom level).

Parameters:

  • maxZoomLevel Integer

setMinZoomLevel

(
  • minZoomLevel
)

Inherited from MQA.ShapeOverlay

Set the minimum zoom level in which the shape overlay should display. Starts at 2 (the lowest available zoom level).

Parameters:

  • minZoomLevel Integer

setShapePoints

(
  • shapePoints
)

Inherited from MQA.ShapeOverlay

Sets the shapepoints and creates the actual shape. Currenly only accepts a string formated as lat,lng,lat,lng..etc

Parameters:

  • shapePoints String

    "latitude,longitude,latitude,longitude"

setValue

(
  • pcKey
  • pcValue
)
Boolean

Inherited from MQA.Component

Sets the specified key to the specified value.

Parameters:

  • pcKey String

    The key to the property

  • pcValue Mixed

    The value to set the property to.

Returns <Boolean>

true if the key exists and is set successfully, otherwise false.

setValues

(
  • pcValues
)
Number

Inherited from MQA.Component

Sets multiple properties for the object.

Parameters:

  • pcValues Object

    The key:value pairs to set where "key" is the property name and "value" is the value to set.

Returns <Number>

the number of objects set successfully

setVisible

(
  • visible
)

Inherited from MQA.ShapeOverlay

Pass false if shape overlay should not be visible. Starts as true.

Parameters:

setZIndex

(
  • zIndex
)

Inherited from MQA.ShapeOverlay

Set zIndex - starts as null. Triggers _applyZIndex when called.

Parameters:

updateProperties

(
  • [options]
)

Inherited from MQA.ShapeOverlay

Updates the shapes properties using an object

Parameters:

  • [options] Object optional
    • [color] String optional

      e.g. "#037eab"

    • [colorAlpha] Number optional

      e.g. 1

    • [borderWidth] Number optional

      e.g. 2

    • [fillColor] String optional

      e.g. "#399abd"

    • [fillColorAlpha] Number optional

      e.g. 0.20

    • [zIndex] Number optional

      e.g. 1000

updateVisibility

()

Inherited from MQA.ShapeOverlay

Called when one of the visibility related properties changes.