Class: Curve

Curve

Curve style LineString, an abstract parent class for all the curves.

(abstract) new Curve(coordinates, optionsopt) [source]

Parameter Type Default Description
coordinates Array.<Coordinate> | Array.<Array.<Number>> coordinates of the line string
options opt Object null construct options defined in LineString
Extends:

Members

  • (constant) options

  • Inherited From:
    Properties:
    Name Type Default Description
    options opt Object null
    Properties
    Name Type Default Description
    arrowStyle opt String | Array.<Number> null style of arrow, can be a pre-defined value or an array [arrow-width, arrow-height] (value in the array is times of linewidth), possible predefined values: classic ([3, 4])
    arrowPlacement opt String vertex-last arrow's placement: vertex-first, vertex-last, vertex-firstlast, point
    smoothness opt String 0 line smoothing by quad bezier interporating, 0 by default
    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.
    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
    Inherited From:
    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