愿你出走半生,归来仍是少年!
地图控制器是用于控制MapView的一系列操作,常用于用户交互使用。在MapView创建后会自动生成一个默认的MapController了,通过MapView的getController可获取到。
void | animateTo(IGeoPoint point) |
---|---|
void | animateTo(IGeoPoint point, Double pZoom, Long pSpeed, Float pOrientation) |
void | animateTo(IGeoPoint point, Double pZoom, Long pSpeed, Float pOrientation, Boolean pClockwise) |
void | animateTo(IGeoPoint pPoint, Double pZoom, Long pSpeed) |
void | animateTo(int x, int y) |
通过以上几个方法都可使地图快速的定位至指定的空间位置,其中Point、XY都是4326坐标系下的经纬度,zoom代表缩放完成后的地图缩放等级,speed代表完成缩放动画所需的时间,单位是毫秒。
这几个缩放是有动画效果的,不是瞬间啊平移,交互效果良好。
通过这个方法可将指定点设定为地图的中心,并保持当前的缩放等级。这个是瞬间完成平移,简单实用。
int | setZoom(int zoomlevel) |
---|---|
double | setZoom(double pZoomlevel) |
boolean | zoomIn() |
boolean | zoomIn(Long animationSpeed) |
boolean | zoomInFixing(int xPixel, int yPixel, Long zoomAnimation) |
boolean | zoomInFixing(int xPixel, int yPixel) |
boolean | zoomOut(Long animationSpeed) |
boolean | zoomOut() |
boolean | zoomOutFixing(int xPixel, int yPixel) |
boolean | zoomTo(int zoomLevel) |
boolean | zoomTo(int zoomLevel, Long animationSpeed) |
boolean | zoomToFixing(int zoomLevel, int xPixel, int yPixel, Long zoomAnimationSpeed) |
boolean | zoomTo(double pZoomLevel, Long animationSpeed) |
boolean | zoomTo(double pZoomLevel) |
boolean | zoomToFixing(double zoomLevel, int xPixel, int yPixel, Long zoomAnimationSpeed) |
boolean | zoomToFixing(double zoomLevel, int xPixel, int yPixel) |
boolean | zoomToFixing(int zoomLevel, int xPixel, int yPixel) |
这些就是缩放设置,进行缩放等级的设置。