Documentation for maplib/MapView.kt¶
- interface GestureDelegate¶
Gesture delegate protocol. Correspondent functions will be executed on gesture events.
- interface LocationDelegate¶
Location delegate protocol. Correspondent functions will be executed on location events.
- interface MapViewDelegate¶
Map drawing delegate protocol. Correspondent functions will be executed on map draw events.
- class MapView : GLSurfaceView¶
Map view with GL rendering.
MapView holds MapDocument and renders it.
- var showLocation : Boolean = false¶
Show/hide current position on map. The location overlay must be set.
- fun setMap(map: MapDocument)¶
Set map class to view.
- Параметры
map – Map class instance.
- fun cancelDraw() : Boolean¶
Cancel drawing process. Default return value is false. Using override function can cancel drawing on some cases.
- Результат
True to cancel drawing.
- fun refresh(normal: Boolean = true)¶
Refresh map.
- Параметры
normal – If true just refresh view, otherwise refill all map tiles.
- fun centerMap(coordinate: Point)¶
Center map at spatial reference coordinates and redraw it.
- Параметры
coordinate – New center coordinates.
- fun centerInCurrentLocation()¶
Center map in current location. If current location is null, nothing happened.
- fun invalidate(envelope: Envelope)¶
Invalidate part of the map. The refresh function invalidates all visible screen.
- Параметры
envelope – Envelope to invalidate.
- fun pan(w: Double, h: Double)¶
Pan map to specific screen shift.
- Параметры
w – horizontal pixel shift
h – vertical pixel shift.
- fun scheduleDraw(drawState: MapDocument.DrawState, timeInterval: Long = Constants.refreshTime)¶
Schedule map redraw.
- Параметры
drawState – Draw state value. See Map.DrawState values.
timeInterval – Time interval in seconds.
- fun registerGestureRecognizers(delegate: GestureDelegate)¶
Register gesture delegate function.
- Параметры
delegate – delegate function.
- fun registerLocation(delegate: LocationDelegate)¶
Register location delegate function.
- Параметры
delegate – location delegate function.
- fun registerView(delegate: MapViewDelegate)¶
Register map drawing delegate function.
- Параметры
delegate – map drawing delegate function.