public class BaseMapView
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
protected boolean |
swigCMemOwn |
构造器和说明 |
---|
BaseMapView() |
BaseMapView(long cPtr,
boolean cMemoryOwn) |
限定符和类型 | 方法和说明 |
---|---|
void |
cancelAllTasks()
Cancels all qued tasks such as tile and vector data fetches.
|
void |
clearAllCaches()
Releases memory occupied by all caches.
|
void |
clearPreloadingCaches()
Releases the memory occupied by the preloading area.
|
void |
delete() |
void |
enableDoubleClick(boolean canDoubleClick) |
protected void |
finalize() |
MapPos |
getCameraPos() |
MapPos |
getCameraPosMini() |
static long |
getCPtr(BaseMapView obj) |
MapPos |
getFocusPos()
Returns the position that the camera is currently looking at.
|
MapPos |
getFocusPosMini() |
Layers |
getLayers()
Returns the Layers object, that can be used for adding and removing map layers.
|
MapEventListener |
getMapEventListener()
Returns the map event listener.
|
MapRenderer |
getMapRenderer()
Returns the MapRenderer object, that can be used for controlling rendering options.
|
Options |
getOptions()
Returns the Options object, that can be used for modifying various map options.
|
Options |
getOptionsMini() |
RedrawRequestListener |
getRedrawRequestListener()
Returns the redraw request listener.
|
float |
getRotation()
Returns the map rotation in degrees. 0 means looking north, 90 means west, -90 means east and 180 means south.
|
static java.lang.String |
getSDKVersion()
Returns the SDK version and build info.
|
float |
getTilt()
Returns the tilt angle in degrees. 0 means looking directly at the horizon, 90 means looking directly down.
|
float |
getZoom()
Returns the zoom level.
|
ScreenPos |
mapToScreen(MapPos mapPos)
Calculates the screen position corresponding to a map position, using the current view parameters.
|
ScreenPos |
mapToScreenMini(MapPos mapPos,
int screenWidth,
int screenHeight,
Options options) |
void |
moveToFitBounds(MapBounds mapBounds,
ScreenBounds screenBounds,
boolean integerZoom,
boolean resetRotation,
boolean resetTilt,
float durationSeconds)
Animate the view parameters (focus position, tilt, rotation, zoom) so that the specified bounding box becomes fully visible.
|
void |
moveToFitBounds(MapBounds mapBounds,
ScreenBounds screenBounds,
boolean integerZoom,
float durationSeconds)
Animate the view parameters (focus position, tilt, rotation, zoom) so that the specified bounding box becomes fully visible.
|
void |
onDrawFrame()
Draws a single frame to the current graphics context.
|
void |
onInputEvent(int event,
float x1,
float y1,
float x2,
float y2)
Handles a user input event.
|
void |
onSurfaceChanged(int width,
int height)
Changes the screen size of the map view.
|
void |
onSurfaceCreated()
Prepares renderers for drawing.
|
void |
onSurfaceDestroyed()
Stops renderer.
|
void |
pan(MapVec deltaPos,
float durationSeconds)
Pans the view relative to the current focus position.
|
void |
pickMapPos(ScreenPos screenPos,
MapPickListener listener,
boolean waitWhileUpdating) |
static boolean |
registerLicense(java.lang.String licenseKey,
LicenseManagerListener listener)
Registers the SDK license.
|
void |
requestComponentsDraw() |
void |
rotate(float deltaAngle,
float durationSeconds)
Rotates the view relative to the current rotation value.
|
void |
rotate(float deltaAngle,
MapPos targetPos,
float durationSeconds)
Rotates the view relative to the current rotation value.
|
MapPos |
screenToMap(ScreenPos screenPos)
Calculates the map position corresponding to a screen position, using the current view parameters.
|
MapPos |
screenToMapMini(ScreenPos screenPos,
Options options) |
void |
setCameraPos(MapPos pos,
float height,
float rotate,
float tilt,
float durationSeconds) |
void |
setCameraPosMini(MapPos pos,
float height,
float rotate,
float tilt) |
void |
setFocusPos(MapPos pos,
float durationSeconds)
Sets the new absolute focus position.
|
void |
setKineticRatio(double ratio) |
void |
setMapEventListener(MapEventListener mapEventListener)
Sets the map event listener.
|
void |
setMapMoveListener(MapMoveListener mapMoveListener)
yk 2022/5/18 设置地图移动监听以及移动结束监听
|
void |
setMapZoomEventListener(MapZoomEventListener mapZoomEventListener)
yk 2022/5/17 单独拆分监听事件
|
void |
setRedrawRequestListener(RedrawRequestListener listener)
Sets the listener which will notified when the map needs to be redrawn
|
void |
setRotation(float angle,
float durationSeconds)
Sets the new absolute rotation value. 0 means look north, 90 means west, -90 means east and 180 means south.
|
void |
setRotation(float angle,
MapPos targetPos,
float durationSeconds)
Sets the new absolute rotation value. 0 means look north, 90 means west, -90 means east and 180 means south.
|
void |
setTilt(float tilt,
float durationSeconds)
Sets the new absolute tilt value. 0 means look directly at the horizon, 90 means look directly down.
|
void |
setZoom(float zoom,
float durationSeconds)
Sets the new absolute zoom value.
|
void |
setZoom(float zoom,
MapPos targetPos,
float durationSeconds)
Sets the new absolute zoom value.
|
void |
tilt(float deltaTilt,
float durationSeconds)
Tilts the view relative to the current tilt value.
|
void |
zoom(float deltaZoom,
float durationSeconds)
Zooms the view relative to the current zoom value.
|
void |
zoom(float deltaZoom,
MapPos targetPos,
float durationSeconds)
Zooms the view relative to the current zoom value.
|
public BaseMapView(long cPtr, boolean cMemoryOwn)
public BaseMapView()
public static long getCPtr(BaseMapView obj)
protected void finalize()
finalize
在类中 java.lang.Object
public void delete()
public static boolean registerLicense(java.lang.String licenseKey, LicenseManagerListener listener)
licenseKey
- The license string provided for this application.listener
- The listener that receives notifications when the license has been updated.public static java.lang.String getSDKVersion()
public void onSurfaceCreated()
public void onSurfaceChanged(int width, int height)
width
- The new width of the map view.height
- The new height of the map view.public void onDrawFrame()
public void onSurfaceDestroyed()
public void onInputEvent(int event, float x1, float y1, float x2, float y2)
event
- The event type. First pointer down = 0, second pointer down = 1, either pointer moved = 2, x1
- The x coordinate of the first pointer. -1 if there are no coordinates.y1
- The y coordinate of the first pointer. -1 if there are no coordinates.x2
- The x coordinate of the second pointer. -1 if there are no coordinates.y2
- The y coordinate of the second pointer. -1 if there are no coordinates.public Layers getLayers()
public Options getOptions()
public Options getOptionsMini()
public MapRenderer getMapRenderer()
public MapPos getFocusPos()
public MapPos getFocusPosMini()
public MapPos getCameraPos()
public MapPos getCameraPosMini()
public float getRotation()
public float getTilt()
public float getZoom()
public void pan(MapVec deltaPos, float durationSeconds)
deltaPos
- The relative coordinate shift.durationSeconds
- The duration in which the panning operation will be completed in seconds.public void setFocusPos(MapPos pos, float durationSeconds)
pos
- The new absolute focus position.durationSeconds
- The duration in which the panning operation will be completed in seconds.public void setCameraPos(MapPos pos, float height, float rotate, float tilt, float durationSeconds)
public void setCameraPosMini(MapPos pos, float height, float rotate, float tilt)
public void rotate(float deltaAngle, float durationSeconds)
deltaAngle
- The delta rotation value in degrees.durationSeconds
- The duration in which the rotation operation will be completed in seconds.public void rotate(float deltaAngle, MapPos targetPos, float durationSeconds)
deltaAngle
- The delta angle value in degrees.targetPos
- The zooming target position in the coordinate system of the base projection.durationSeconds
- The duration in which the rotation operation will be completed in seconds.public void setRotation(float angle, float durationSeconds)
angle
- The new absolute angle value in degrees.durationSeconds
- The duration in which the rotation operation will be completed in seconds.public void setRotation(float angle, MapPos targetPos, float durationSeconds)
angle
- The new absolute angle value in degrees.targetPos
- The zooming target position in the coordinate system of the base projection.durationSeconds
- The duration in which the rotation operation will be completed in seconds.public void tilt(float deltaTilt, float durationSeconds)
deltaTilt
- The number of degrees the camera should be tilted by.durationSeconds
- The duration in which the tilting operation will be completed in seconds.public void setTilt(float tilt, float durationSeconds)
tilt
- The new absolute tilt value in degrees.durationSeconds
- The duration in which the tilting operation will be completed in seconds.public void zoom(float deltaZoom, float durationSeconds)
deltaZoom
- The delta zoom value.durationSeconds
- The duration in which the zooming operation will be completed in seconds.public void zoom(float deltaZoom, MapPos targetPos, float durationSeconds)
deltaZoom
- The delta zoom value.targetPos
- The zooming target position in the coordinate system of the base projection.durationSeconds
- The duration in which the zooming operation will be completed in seconds.public void setZoom(float zoom, float durationSeconds)
zoom
- The new absolute zoom value.durationSeconds
- The duration in which the zooming operation will be completed in seconds.public void setZoom(float zoom, MapPos targetPos, float durationSeconds)
zoom
- The new absolute zoom value.targetPos
- The zooming target position in the coordinate system of the base projection.durationSeconds
- The duration in which the zooming operation will be completed in seconds.public void moveToFitBounds(MapBounds mapBounds, ScreenBounds screenBounds, boolean integerZoom, float durationSeconds)
mapBounds
- The bounding box on the map to be made visible in the base projection's coordinate system.screenBounds
- The screen bounding box where to fit the map bounding box.integerZoom
- If true, then closest integer zoom level will be used. If false, exact fractional zoom level will be used.durationSeconds
- The duration in which the operation will be completed in seconds.public void moveToFitBounds(MapBounds mapBounds, ScreenBounds screenBounds, boolean integerZoom, boolean resetRotation, boolean resetTilt, float durationSeconds)
mapBounds
- The bounding box on the map to be made visible in the base projection's coordinate system.screenBounds
- The screen bounding box where to fit the map bounding box.integerZoom
- If true, then closest integer zoom level will be used. If false, exact fractional zoom level will be used.resetTilt
- If true, view will be untilted. If false, current tilt will be kept.resetRotation
- If true, rotation will be reset. If false, current rotation will be kept.durationSeconds
- The duration in which the operation will be completed in seconds.public MapEventListener getMapEventListener()
public void setMapEventListener(MapEventListener mapEventListener)
mapEventListener
- The new map event listener.public void setMapZoomEventListener(MapZoomEventListener mapZoomEventListener)
mapZoomEventListener
- public void setMapMoveListener(MapMoveListener mapMoveListener)
mapMoveListener
- public RedrawRequestListener getRedrawRequestListener()
public void setRedrawRequestListener(RedrawRequestListener listener)
listener
- The redraw listener.public MapPos screenToMap(ScreenPos screenPos)
screenPos
- The screen position.public ScreenPos mapToScreen(MapPos mapPos)
mapPos
- The map position in base projection coordinate system.public ScreenPos mapToScreenMini(MapPos mapPos, int screenWidth, int screenHeight, Options options)
public void cancelAllTasks()
public void clearPreloadingCaches()
public void clearAllCaches()
public void requestComponentsDraw()
public void enableDoubleClick(boolean canDoubleClick)
public void pickMapPos(ScreenPos screenPos, MapPickListener listener, boolean waitWhileUpdating)
public void setKineticRatio(double ratio)