Skip to content

Path

Path is an abstract base class for line/polygon geometries that extends Geometry. It is the parent of line and polygon geometries such as LineString and Polygon, and unifies the smoothing, clipping, simplification, and symbolization of those geometries. It is usually not instantiated directly; use its subclasses instead.

js
import { Path } from "maptalks";

// Path is an abstract base class, usually not instantiated directly.
// Use its subclasses LineString / Polygon instead.
const line = new LineString([[100, 0], [101, 1]]);

Constructor

Path is an abstract base class; its constructor is called by its subclasses.

options

NameTypeDescriptionDefault
smoothnessNumberSmoothness, controls how smooth the line is.0
enableClipBooleanWhether to enable clipping.true
strictClipBooleanWhether to enable strict clipping.
enableSimplifyBooleanWhether to enable simplification.true
simplifyToleranceNumberSimplification tolerance (in pixels).2
symbolObjectSymbol settings such as lineColor, lineWidth, lineOpacity, polygonFill, etc.

Methods

  • animateShow(options, cb): Player — Shows the geometry with an animation, returning the animation Player; cb is the completion callback.

Static Methods

No class-specific static methods.

Events

No class-specific events.