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.
- Parameters
map – Map class instance.
- fun cancelDraw() : Boolean
Cancel drawing process. Default return value is false. Using override function can cancel drawing on some cases.
- Returns
True to cancel drawing.
- fun refresh(normal: Boolean = true)
Refresh map.
- Parameters
normal – If true just refresh view, otherwise refill all map tiles.
- fun centerMap(coordinate: Point)
Center map at spatial reference coordinates and redraw it.
- Parameters
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.
- Parameters
envelope – Envelope to invalidate.
- fun pan(w: Double, h: Double)
Pan map to specific screen shift.
- Parameters
w – horizontal pixel shift
h – vertical pixel shift.
- fun scheduleDraw(drawState: MapDocument.DrawState, timeInterval: Long = Constants.refreshTime)
Schedule map redraw.
- Parameters
drawState – Draw state value. See Map.DrawState values.
timeInterval – Time interval in seconds.
- fun registerGestureRecognizers(delegate: GestureDelegate)
Register gesture delegate function.
- Parameters
delegate – delegate function.
- fun registerLocation(delegate: LocationDelegate)
Register location delegate function.
- Parameters
delegate – location delegate function.
- fun registerView(delegate: MapViewDelegate)
Register map drawing delegate function.
- Parameters
delegate – map drawing delegate function.