Documentation for MapLib/Overlay.swift¶
- class Overlay¶
Map overlay to draw different features (for example, current position, edit features, etc.)
Overlay showing current position
- var style : JsonObject¶
Overlay style json object
Overlay showing edit features
- var pointStyle : JsonObject¶
Point json object style.
- var lineStyle : JsonObject¶
Line json object style.
- var fillStyle : JsonObject¶
Polygon json object style.
- var crossStyle : JsonObject¶
The cross in screen center style read/write property.
- var geometryType : Geometry.GeometryType¶
Edit geometry type property.
- func setStyle(point name:String) Bool ¶
Set edit overlay point feature style.
- Параметры
name – Style name.
- Результат
True on success.
- func setStyle(line name:String) Bool ¶
Set edit overlay line feature style.
- Параметры
name – Style name.
- Результат
True on success.
- func setStyle(fill name:String) Bool ¶
Set edit overlay polygon feature style.
- Параметры
name – Style name.
- Результат
True on success.
- func setStyle(cross name:String) Bool ¶
Set edit overlay cross style.
- Параметры
name – Style name.
- Результат
True on success.
- func save() Feature? ¶
Save edits and return result feature instance.
- Результат
Feature class instance or nil.
- func createNewGeometry(in layer:Layer) Bool ¶
Create new geometry and start editing. If the layer datasource is point - te pont at the center of screen will be created, if line - line with two points, if polygon - polygon with three points.
- Параметры
layer – Layer in which to create new geometry. The feature will be created in layer datasource.
- Результат
True on success.
- func createNewEmptyGeometry(in layer:Layer) Bool ¶
Create new geometry and start editing. The geometry will be empty. This is for edit by walk editing.
- Параметры
layer – Layer in which to create new geometry. The feature will be created in layer datasource.
- Результат
True on success.
- func createNewGeometry(of type:Geometry.GeometryType) Bool ¶
Create new geometry and start editing.
- Параметры
type – Geometry type.
- Результат
True on success.
- func editGeometry(of feature:Feature) Bool ¶
Start editing geometry from feature.
- Параметры
feature – Feature to edit geometry.
- Результат
True on success.
- func addGeometryPoint() Bool ¶
Add point to geometry. Make sense only for line or polygon ring.
- Результат
True on success.
- func addGeometryPoint(with coordinates:Point) Bool ¶
Add point to geometry. Make sense only for line or polygon ring.
- Параметры
coordinates – Point coordinates.
- Результат
True on success.
- func deleteGeometryPoint() DeleteResultType ¶
Delete point from geometry.
- Результат
True on success.
- func deleteGeometryPart() DeleteResultType ¶
Delete geometry part
- Результат
The value of type enum DeleteResultType
- func deleteGeometryHole() DeleteResultType ¶
Delete geometry hole.
- Результат
delete result type indicating is this last hole or any already exists.
- func touch(down x:Double, y: Double) (pointId: Int32, isHole: Bool) ¶
Touch down event in edit overlay.
- Параметры
x – x screen coordinate.
y – y screen coordinate.
- Результат
Tuple with selected point identificator and is this point belongs to hole.
- func touch(up x:Double, y: Double) (pointId: Int32, isHole: Bool) ¶
Touch up event in edit overlay.
- Параметры
x – x screen coordinate.
y – y screen coordinate.
- Результат
Tuple with selected point identificator and is this point belongs to hole.
- func touch(move x:Double, y: Double) (pointId: Int32, isHole: Bool) ¶
Touch move event in edit overlay.
- Параметры
x – x screen coordinate.
y – y screen coordinate.
- Результат
Tuple with selected point identificator and is this point belongs to hole.