LineString Component


Properties

description
  Sets or gets the description displayed in the info window. The info window appears when the user taps on the LineString.
Data type: string
Designer Writable true <linestring name="linestringName" description="Test description">
Code Writeable true linestringName.description = "Test description"
Code Readable true let variable = linestringName.description

draggable
  Sets or gets whether or not the user can drag a map feature. This feature is accessed by long-pressing and then dragging the LineString to a new location.
Data type: boolean
Designer Writable true <linestring name="linestringName" draggable="true">
Code Writeable true linestringName.draggable = true
Code Readable true let variable = linestringName.draggable

enableInfobox
  Enables or disables the infobox window display when the user taps the LineString.
Data type: boolean
Designer Writable true <linestring name="linestringName" enableInfobox="true">
Code Writeable true linestringName.enableInfobox = true
Code Readable true let variable = linestringName.enableInfobox

points
  The list of points, as pairs of latitudes and longitudes, in the LineString.
Data type: array
Designer Writable false
Code Writeable true linestringName.points = [[-27.5083, 152.9281],[-27.5, 152.9]]
Code Readable true let variable = linestringName.points

pointsFromString
  Set the points of the LineString from a specially-coded character string of the form
Data type: string
Designer Writable true <linestring name="linestringName" pointsFromString="[[-27.507500625014966,152.9271769523621],[-27.50867678932243,152.92896652208583]]">
Code Writeable true linestringName.pointsFromString = [[-27.507500625014966,152.9271769523621],[-27.50867678932243,152.92896652208583]]
Code Readable false

strokeColor
  Sets or gets the color used to outline the LineString.
Data type: color
Designer Writable true <linestring name="linestringName" strokeColor="FF399866">
Code Writeable true linestringName.strokeColor = "FF399866"
Code Readable true let variable = linestringName.strokeColor

strokeOpacity
  Sets or gets the opacity of the outline of the LineString. A value of 0.0 will be invisible and a value of 1.0 will be opaque.
Data type: number
Designer Writable true <linestring name="linestringName" strokeOpacity="1">
Code Writeable true linestringName.strokeOpacity = 1
Code Readable true let variable = linestringName.strokeOpacity

strokeWidth
  Sets or gets the width of the stroke used to outline the LineString.
Data type: number
Designer Writable true <linestring name="linestringName" strokeWidth="2">
Code Writeable true linestringName.strokeWidth = 2
Code Readable true let variable = linestringName.strokeWidth

title
  Sets or gets the title displayed in the info window that appears when the user clicks on the map feature.
Data type: string
Designer Writable true <linestring name="linestringName" title="Test title">
Code Writeable true linestringName.title = "Test title"
Code Readable true let variable = linestringName.title

type
  Returns the type of the map feature. For LineString, this returns MapFeature.LineString ("LineString").
Data type: string
Designer Writable false
Code Writeable false
Code Readable true let variable = linestringName.type

visible
  Specifies whether the LineString should be visible on the screen. Value is true{
Data type: boolean
Designer Writable true <linestring name="linestringName" visible="true">
Code Writeable true linestringName.visible = true
Code Readable true let variable = linestringName.visible

class
  The styling class of the the component
Data type: string
Designer Writable true <linestring name="linestringName" class="Test class">
Code Writeable false
Code Readable false

id
  The styling id of the the component
Data type: string
Designer Writable true <linestring name="linestringName" id="Test id">
Code Writeable false
Code Readable false

name
  The name of the component that will be used to refer to it in code.
Data type: string
Designer Writable true <linestring name="linestringName" name="testComponent">
Code Writeable false
Code Readable false

Methods

Method name Description Parameters
distanceToFeature Computes the distance between the LineString and the given mapFeature. If centroids is true, the computation is done between the centroids of the two features. Otherwise, the distance will be computed between the two features based on the closest points. Further, when centroids is false, this method will return 0 if the LineString intersects or contains the mapFeature. If an error occurs, this method will return -1.
linestringName.distanceToFeature(mapFeature, centroids)
linestringName.distanceToFeature("componentName", true)
mapFeature component
centroids boolean
distanceToPoint Computes the distance between the LineString and the given latitude and longitude. If centroids is true, the distance is computed from the center of the LineString to the given point. Otherwise, the distance is computed from the closest point on the LineString to the given point. Further, this method will return 0 if centroids is false and the point is in the LineString. If an error occurs, -1 will be returned.
linestringName.distanceToPoint(latitude, longitude, centroid)
linestringName.distanceToPoint(-27, 153, true)
latitude number
longitude number
centroid boolean
hideInfobox Hides the LineString's info box if it is visible. Otherwise, no action is taken.
linestringName.hideInfobox()
showInfobox Shows the info box for the LineString if it is not visible. Otherwise, this method has no effect. This method can be used to show the info box even if EnableInfobox is false.
linestringName.showInfobox()
addEventListener Method used to create event listeners.
See Events below for samples.
eventName string
eventCallbackFunction callback

Events

Event name Description Parameters
click The Click event runs when the user taps on the LineString.
linestringName.addEventListener(
    "click",
    function () {
        //Your code here
    }
)
drag The Drag event runs in response to position updates of the LineString as the user drags it.
linestringName.addEventListener(
    "drag",
    function () {
        //Your code here
    }
)
longClick The LongClick event runs when the user presses and holds the LineString and then releases it. This event will only trigger if Draggable is false because it uses the same gesture as StartDrag.
linestringName.addEventListener(
    "longClick",
    function () {
        //Your code here
    }
)
startDrag The StartDrag event runs when the user presses and holds the LineString and then proceeds to move their finger on the screen. It will be followed by the Drag and StopDrag events.
linestringName.addEventListener(
    "startDrag",
    function () {
        //Your code here
    }
)
stopDrag The StopDrag event runs when the user releases the LineString at the end of a drag.
linestringName.addEventListener(
    "stopDrag",
    function () {
        //Your code here
    }
)