CubicBezierCurve
Cubic Bezier Curve
var curve = new CubicBezierCurve(
[
[121.47083767181408,31.214448123476995],
[121.4751292062378,31.215475523000404],
[121.47869117980943,31.211916269810335]
],
{
symbol : {
'lineWidth' : 5
}
}
).addTo(layer);
Parameter |
Type |
Default |
Description |
coordinates
|
Array.<Coordinate>
|
Array.<Array.<Number>>
|
|
coordinates of the curve |
options
opt
|
Object
|
null
|
construct options defined in CubicBezierCurve |
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
|
true
|
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 |
zIndex
opt
|
Number
|
|
geometry's initial zIndex |
|
- Inherited From:
- Source:
Methods
Set new coordinates to the line string
Parameter |
Type |
Description |
coordinates
|
Array.<Coordinate>
|
Array.<Array.<Number>>
|
new coordinates |
Inherited From:
Fires:
Returns:
LineString:
this
Get coordinates of the line string
Inherited From:
Returns:
Array.<Coordinate>|Array.<Array.<Number>>:
coordinates
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
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