Class: ArcConnectorLine

ArcConnectorLine

An arc curve connector line geometry can connect geometries or ui components with each other.

new ArcConnectorLine(src, target, optionsopt) [source]

var src = new Marker([0,0]).addTo(layer),
    dst = new Marker([1,0]).addTo(layer),
    line = new ArcConnectorLine(src, dst, {
        arcDegree : 120,
        showOn : 'always', //'moving', 'click', 'mouseover', 'always'
        arrowStyle : 'classic',
        arrowPlacement : 'vertex-last', //vertex-first, vertex-last, vertex-firstlast, point
        symbol: {
          lineColor: '#34495e',
          lineWidth: 2
       }
    }).addTo(layer);
Parameter Type Default Description
src Geometry | control.Control | UIComponent source to connect
target Geometry | control.Control | UIComponent target to connect
options opt Object null construct options defined in ConnectorLine
Extends:
Mixes From:
  • connectorLineMixin

Members

  • (constant) options

  • Properties:
    Name Type Description
    options Object ConnectorLine's options
    Properties
    Name Type Default Description
    showOn opt String always when to show the connector line, possible values: 'moving', 'click', 'mouseover', 'always'
    arcDegree opt Number 90 circle arc's degree.
    arrowStyle opt String null style of arrow, if not null, arrows will be drawn, possible values: classic
    arrowPlacement opt String vertex-last arrow's placement: vertex-first, vertex-last, vertex-firstlast, point
    symbol Object Path's default symbol
    id opt Boolean null id of the geometry
    visible opt Boolean true whether the geometry is visible.
    editable opt Boolean true whether the geometry can be edited.
    cursor opt String null cursor style when mouseover the geometry, same as the definition in CSS.
    shadowBlur opt Number 0 level of the shadow around the geometry, see MDN's explanation
    shadowColor opt String black color of the shadow around the geometry, a CSS style color
    measure opt String EPSG:4326 the measure code for the geometry, defines measureGeometry how it can be measured.
    draggable opt Boolean false whether the geometry can be dragged.
    dragShadow opt Boolean false if true, during geometry dragging, a shadow will be dragged before geometry was moved.
    dragOnAxis opt Boolean null if set, geometry can only be dragged along the specified axis, possible values: x, y
    Overrides:
    Source:

    Methods

  • (inherited) setCoordinates(coordinates) [source]

  • Set new coordinates to the line string
    Parameter Type Description
    coordinates Array.<Coordinate> | Array.<Array.<Number>> new coordinates
    Inherited From:
    Fires:
    Returns:
    LineString: this
  • (inherited) getCoordinates() [source]

  • Get coordinates of the line string
    Inherited From:
    Returns:
    Array.<Coordinate>|Array.<Array.<Number>>: coordinates
  • (inherited) getCenterInExtent(extent) [source]

  • Get center of linestring's intersection with give extent
    const extent = map.getExtent();
     const center = line.getCenterInExtent(extent);
    Parameter Type Description
    extent Extent
    Inherited From:
    Returns:
    Coordinate: center, null if line doesn't intersect with extent
  • (inherited) animateShow(optionsopt, cbopt) [source]

  • Show the linestring with animation
    line.animateShow({
       duration : 2000,
       easing : 'linear'
     }, function (frame, currentCoord) {
       //frame is the animation frame
       //currentCoord is current coordinate of animation
     });
    Parameter Type Default Description
    options opt Object null animation options
    Properties
    Parameter Type Default Description
    duration opt Number 1000 duration
    easing opt String out animation easing
    cb opt function null callback function in animation, function parameters: frame, currentCoord
    Inherited From:
    Returns:
    LineString: this