IMapView

public interface IMapView extends IRenderer

Interface that should implement each map view.

Author:Dmitry Baryshnikov

Methods

buffer

void buffer(float x, float y, float scale)

Save current map to offscreen buffer.

Параметры:
  • x – Offset in pixels by x coordinate
  • y – Offset in pixels by y coordinate
  • scale – Scale to set then draw map

draw

void draw(Canvas canvas, boolean clearBackground)

Draw map

Параметры:
  • canvas – Canvas to draw layers
  • clearBackground – True to clear background or false

draw

void draw(Canvas canvas, float x, float y, boolean clearBackground)

Draw map

Параметры:
  • canvas – Canvas to draw layers
  • x – Offset in pixels by x coordinate
  • y – Offset in pixels by y coordinate
  • clearBackground – True to clear background or false

draw

void draw(Canvas canvas, float x, float y, float scale)

Draw map

Параметры:
  • canvas – Canvas to draw layers
  • x – Offset in pixels by x coordinate
  • y – Offset in pixels by y coordinate
  • scale – Scale to set then draw map

getCurrentBounds

GeoEnvelope getCurrentBounds()
Результат:Get current map bounds in map coordinates

getFullBounds

GeoEnvelope getFullBounds()
Результат:Get full map bounds in map coordinates

getLimits

GeoEnvelope getLimits()
Результат:Current limits of this map

getMapCenter

GeoPoint getMapCenter()
Результат:Map center coordinates

getZoomLevel

float getZoomLevel()
Результат:Current map zoom level

mapToScreen

GeoPoint mapToScreen(GeoPoint pt)

Transform point from map to scree

Параметры:
  • pt – Point to transform
Результат:

Point in screen coordinates

See also: com.nextgis.maplib.datasource.GeoPoint

mapToScreen

float[] mapToScreen(GeoPoint[] geoPoints)

Transform from map to screen coordinates

Параметры:
  • geoPoints – Array of geopoints
Результат:

Array of points in format x1,y1, … xn, yn

See also: com.nextgis.maplib.datasource.GeoPoint

screenToMap

GeoPoint screenToMap(GeoPoint pt)

Transform point from screen to map

Параметры:
  • pt – Point to transform
Результат:

Point in map coordinates

See also: com.nextgis.maplib.datasource.GeoPoint

screenToMap

GeoEnvelope screenToMap(GeoEnvelope env)

Transform provided envelope from screen to map coordinates

Параметры:
  • env – Envelope
Результат:

Transformed envelope

See also: com.nextgis.maplib.datasource.GeoEnvelope

screenToMap

GeoPoint[] screenToMap(float[] points)

Transform from screen to map coordinates

Параметры:
  • points – Array of points in format x1,y1, … xn, yn
Результат:

Array of transformed points

setLimits

void setLimits(GeoEnvelope limits, int limitsType)

Set the map limits. The map cannot be scrolled out of this limits

Параметры:
  • limits – Envelope of limits
  • limitsType – The limits type (maybe Constants.MAP_LIMITS_NO, Constants.MAP_LIMITS_X, Constants.MAP_LIMITS_Y or Constants.MAP_LIMITS_XY)

See also: com.nextgis.maplib.datasource.GeoEnvelope

setViewSize

void setViewSize(int w, int h)

Set view size in pixels while map window resized.

Параметры:
  • w – New width
  • h – New height

setZoomAndCenter

void setZoomAndCenter(float zoom, GeoPoint center)

Set new map extent according to the zoom level and coordinates of center

Параметры:
  • zoom – A zoom level
  • center – A map center coordinates

zoomToExtent

void zoomToExtent(GeoEnvelope envelope)

Zoom to fill provided extent

Параметры:
  • envelope – Extent to zoom