Documentation for MapLib/MapView.swift¶
- protocol GestureDelegate : class¶
Gesture delegate protocol. Correspondent functions will be executed on gesture events.
- protocol LocationDelegate : class¶
Location delegate protocol. Correspondent functions will be executed on location events.
- protocol MapViewDelegate : class¶
Map drawing delegate protocol. Correspondent functions will be executed on map draw events.
Map view class.
- var currentLocation : CLLocation = nil¶
Last known location or nil.
- func cancelDraw() Bool ¶
Cancel drawing process. Default return value is false. Using override function can cancel drawing on some cases.
- Returns
True to cancel drawing.
- func refresh(normal: Bool = true)¶
Refresh map.
- Parameters
normal – If true just refresh view, othervise refill all map tiles.
- func zoomOut(multiply: Double = 2.0)¶
Zoom out.
- Parameters
multiply – Multiply factor. Default is 2.
- func centerMap(coordinate: Point)¶
Center map at spatial reference coordinates.
- Parameters
coordinate – New center coordinates.
- func centerInCurrentLocation()¶
Center map in current location. If current location is nil, nothing happened.
- func invalidate(envelope: Envelope)¶
Invalidate part of the map. The refresh function invalidates all visible screen.
- Parameters
envelope – Envelope to invalidate.
- func pan(w: Double, h: Double)¶
Pan map to specific screen shift.
- Parameters
w – horisontal pixel shift
h – vertical pixel shift.
- func scheduleDraw(drawState: Map.DrawState, timeInterval: TimeInterval = Constants.refreshTime)¶
Shedule map redraw.
- Parameters
drawState – Draw state value. See Map.DrawState values.
timeInterval – Time interval in seconds.
- func registerGestureRecognizers(_ delegate:GestureDelegate)¶
Register gesture delegate function.
- Parameters
delegate – delegate function.
- func registerLocation(_ delegate:LocationDelegate)¶
Register location delegate function.
- Parameters
delegate – location delegate function.
- func registerView(_ delegate:MapViewDelegate)¶
Register map drawing delegate function.
- Parameters
delegate – map drawing delegate function.
Map view with vector feature editing functions.
- func undoEdit()¶
Undo edit operation.
- func redoEdit()¶
Redo edit operation.
- func addGeometryPart()¶
Add geometry part.
- func addGeometryPoint()¶
Add geometry point.
- func addGeometryPoint(with coordinates:Point)¶
Add geometry point in specified coordinates.
- Parameters
coordinates – Point coordinates.
- func deleteGeometryPart() EditOverlay.DeleteResultType ¶
Deletes selected geometry part
- Returns
delete result type value. EditOverlay.DeleteResultType.
- func deleteGeometryPoint() EditOverlay.DeleteResultType ¶
Delete point from geometry.
- Returns
delete result type value. EditOverlay.DeleteResultType.
- func deleteGeometry()¶
Delete the whole geometry.
- func addGeometryHole()¶
Add hole to geometry.
- func deleteGeometryHole() EditOverlay.DeleteResultType ¶
Delete geometry hole.
- Returns
delete result type value. EditOverlay.DeleteResultType.