6.3.1.2.8. IMapView

public interface IMapView extends IRenderer

Interface that should implement each map view.

Author:Dmitry Baryshnikov

6.3.1.2.8.1. Methods

6.3.1.2.8.1.1. buffer

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

Save current map to offscreen buffer.

Parameters:
  • x – Offset in pixels by x coordinate
  • y – Offset in pixels by y coordinate
  • scale – Scale to set then draw map

6.3.1.2.8.1.2. draw

void draw(Canvas canvas, boolean clearBackground)

Draw map

Parameters:
  • canvas – Canvas to draw layers
  • clearBackground – True to clear background or false

6.3.1.2.8.1.3. draw

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

Draw map

Parameters:
  • 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

6.3.1.2.8.1.4. draw

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

Draw map

Parameters:
  • 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

6.3.1.2.8.1.5. getCurrentBounds

GeoEnvelope getCurrentBounds()
Returns:Get current map bounds in map coordinates

6.3.1.2.8.1.6. getFullBounds

GeoEnvelope getFullBounds()
Returns:Get full map bounds in map coordinates

6.3.1.2.8.1.7. getLimits

GeoEnvelope getLimits()
Returns:Current limits of this map

6.3.1.2.8.1.8. getMapCenter

GeoPoint getMapCenter()
Returns:Map center coordinates

6.3.1.2.8.1.9. getZoomLevel

float getZoomLevel()
Returns:Current map zoom level

6.3.1.2.8.1.10. mapToScreen

GeoPoint mapToScreen(GeoPoint pt)

Transform point from map to scree

Parameters:
  • pt – Point to transform
Returns:

Point in screen coordinates

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

6.3.1.2.8.1.11. mapToScreen

float[] mapToScreen(GeoPoint[] geoPoints)

Transform from map to screen coordinates

Parameters:
  • geoPoints – Array of geopoints
Returns:

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

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

6.3.1.2.8.1.12. screenToMap

GeoPoint screenToMap(GeoPoint pt)

Transform point from screen to map

Parameters:
  • pt – Point to transform
Returns:

Point in map coordinates

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

6.3.1.2.8.1.13. screenToMap

GeoEnvelope screenToMap(GeoEnvelope env)

Transform provided envelope from screen to map coordinates

Parameters:
  • env – Envelope
Returns:

Transformed envelope

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

6.3.1.2.8.1.14. screenToMap

GeoPoint[] screenToMap(float[] points)

Transform from screen to map coordinates

Parameters:
  • points – Array of points in format x1,y1, … xn, yn
Returns:

Array of transformed points

6.3.1.2.8.1.15. setLimits

void setLimits(GeoEnvelope limits, int limitsType)

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

Parameters:
  • 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

6.3.1.2.8.1.16. setViewSize

void setViewSize(int w, int h)

Set view size in pixels while map window resized.

Parameters:
  • w – New width
  • h – New height

6.3.1.2.8.1.17. setZoomAndCenter

void setZoomAndCenter(float zoom, GeoPoint center)

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

Parameters:
  • zoom – A zoom level
  • center – A map center coordinates

6.3.1.2.8.1.18. zoomToExtent

void zoomToExtent(GeoEnvelope envelope)

Zoom to fill provided extent

Parameters:
  • envelope – Extent to zoom