Class Map.Renderer
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
Map
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidfinalize()booleanpaint()To be called by the host widget/component to paint.projectPointOnTerrain(Coordinate mapPoint) Projects the given point by moving it up or down towards the terrain.toImage()
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
paint
public boolean paint()To be called by the host widget/component to paint.For OpenGL you must ensure that we have a current context.
The invalidation callback mechanism (
Map#setMapInvalidationCallback) provides information on when something has changed on theMap, and a repaint is needed. This allows to only call thepaint()method when it is needed. -
toImage
Copies the most recent contents of theMapto anImage.This function does not wait for the
Rendererto finish all background processing, nor does it perform a repaint. It only provides a snapshot of the contents that were painted last.The image size is equal to the
mapsize, multiplied by thedisplay scaleat the moment when the last paint call was executed. Note that this may mean that when theMaphas been resized but not repainted yet, the returned image will have a size based on theMapbefore the resize happened. This is usually not an issue since this function is typically called right after a repaint. -
projectPointOnTerrain
Projects the given point by moving it up or down towards the terrain.The projection is done along the axis that runs perpendicular to the ellipsoid surface at that point. If no terrain is available, the point is projected on the ellipsoid of the
map reference.- Parameters:
mapPoint- a point in map coordinates- Returns:
- the projected location, in map coordinates.
-