Classes
Type Definitions
-
Options{Object}
-
Point:一维线段(例如[[10, 20]])表示该点。LineString:线字符串的每个线段对应一个二维线段(例如[[10, 20], [30, 40]])。Polygon:外环和内环的每个线段对应一个二维线段。Circle:用32个点表示圆周的正多边形的每个线段对应一个二维线段。GeometryCollection:所包含几何图形的所有线段。MultiPoint:每个点对应一个一维线段。MultiLineString:各线字符串的每个线段对应一个二维线段。MultiPolygon:各多边形的每个线段对应一个二维线段。
属性:
Name Type Description featuresCollection<要素> | undefined 吸附到这些要素。应提供此选项或source。
sourceVectorSource | undefined 吸附到此数据源的要素。应提供此选项或features
edgeboolean
(defaults to true)吸附到边。
vertexboolean
(defaults to true)吸附到顶点。
intersectionboolean
(defaults to false)吸附到线段之间的交叉点。
pixelTolerancenumber
(defaults to 10)像素容差,用于判断指针是否足够接近线段或顶点以进行吸附。
segmentersSegmenters | undefined 按
Type自定义分段器。默认使用以下分段器: -
Segment{Array<Coordinate>}
-
由两个坐标组成的数组表示线段,或由一个坐标组成的数组表示点。
-
SegmentData{Object}
-
-
Segmenters{Object}
-
此处指定的每个分段器将覆盖对应几何图形类型的默认分段器。要将特定几何图形类型的所有几何图形从吸附中排除,请将分段器设置为
null。属性:
Name Type Description PointSegmenter<Point> | null | undefined Point 分段器。
LineStringSegmenter<LineString> | null | undefined LineString 分段器。
PolygonSegmenter<Polygon> | null | undefined Polygon 分段器。
CircleSegmenter<Circle> | null | undefined Circle 分段器。
GeometryCollectionSegmenter<GeometryCollection> | null | undefined GeometryCollection 分段器。
MultiPointSegmenter<MultiPoint> | null | undefined MultiPoint 分段器。
MultiLineStringSegmenter<MultiLineString> | null | undefined MultiLineString 分段器。
MultiPolygonSegmenter<MultiPolygon> | null | undefined MultiPolygon 分段器。
-
SnappedInfo{Object}
-
关于上次吸附状态的信息。
属性:
Name Type Description vertexCoordinate | null 吸附到的顶点。
vertexPixelPixel | null 吸附到的顶点的像素坐标。
feature要素 | null 被吸附到的要素。
segmentSegment | null 线段,如果吸附到顶点则为
null。