如果有时间加了很多overlayItem,由于缩放问题 有些不能显示为了全部显示
public void centerOverlays() {
int minLat = 81 * MapStoresController.MAP_SCALE;
int maxLat = -81 * MapStoresController.MAP_SCALE;
int minLon = 181 * MapStoresController.MAP_SCALE;
int maxLon = -181 * MapStoresController.MAP_SCALE;
for (int i = 0; i < overlayItems.size(); i++) {
Store s = overlayItems.getItem(i).getStore();
minLat = (int) ((minLat > (s.getLocation().getLatitude() * MapStoresController.MAP_SCALE)) ? s.getLocation().getLatitude() * MapStoresController.MAP_SCALE : minLat);
maxLat = (int) ((maxLat < (s.getLocation().getLatitude() * MapStoresController.MAP_SCALE)) ? s.getLocation().getLatitude() * MapStoresController.MAP_SCALE : maxLat);
minLon = (int) ((minLon > (s.getLocation().getLongitude() * MapStoresController.MAP_SCALE)) ? s.getLocation().getLongitude() * MapStoresController.MAP_SCALE : minLon);
maxLon = (int) ((maxLon < (s.getLocation().getLongitude() * MapStoresController.MAP_SCALE)) ? .getLocation().getLongitude() * MapStoresController.MAP_SCALE : maxLon);
}
GeoPoint gp = controller.getUserLocation();
minLat = (minLat > gp.getLatitudeE6()) ? gp.getLatitudeE6() : minLat;
maxLat = (maxLat < gp.getLatitudeE6()) ? gp.getLatitudeE6() : maxLat;
minLon = (minLon > gp.getLongitudeE6()) ? gp.getLongitudeE6() : minLon;
maxLon = (maxLon < gp.getLongitudeE6()) ? gp.getLongitudeE6() : maxLon;
mapView.getController().zoomToSpan((maxLat - minLat), (maxLon - minLon));
mapView.getController().animateTo(new GeoPoint((maxLat + minLat) / 2, (maxLon + minLon) / 2));
}
2.
/**
* Fits the map with the passed in points so all points are visible.
* @param mapController MapView controller
* @param points list of points you want the map to contain
*/
private static void fitPoints(MapController mapController, List points) {
// set min and max for two points
int nwLat = -90 * 1000000;
int nwLng = 180 * 1000000;
int seLat = 90 * 1000000;
int seLng = -180 * 1000000;
// find bounding lats and lngs
for (GeoPoint point : points) {
nwLat = Math.max(nwLat, point.getLatitudeE6());
nwLng = Math.min(nwLng, point.getLongitudeE6());
seLat = Math.min(seLat, point.getLatitudeE6());
seLng = Math.max(seLng, point.getLongitudeE6());
}
GeoPoint center = new GeoPoint((nwLat + seLat) / 2, (nwLng + seLng) / 2);
// add padding in each direction
int spanLatDelta = (int) (Math.abs(nwLat - seLat) * 1.1);
int spanLngDelta = (int) (Math.abs(seLng - nwLng) * 1.1);
// fit map to points
mapController.animateTo(center);
mapController.zoomToSpan(spanLatDelta, spanLngDelta);
}
分享到:
相关推荐
DICOM图像,overlay层,包含只有一层overlay,两侧overlay,overlay加原始图像三种DICOM图像。 不少DICOM开源框架对这种图像支持不够,显示有问题。便于测试系统对带有overlay图像的显示是否正确
主机overlay和网络overlay介绍 .pptx
Overlay组播Overlay组播Overlay组播Overlay组播Overlay组播Overlay组播Overlay组播Overlay组播
SPM多重overlay方法,神经成像方面的人做为参考!SPM多重overlay方法,神经成像方面的人做为参考!
1.网络虚拟化技术介绍 2.Overlay基本概览和分类 3.VXLAN基础基础
overlay demo
封装好的overlay 要解决tearing的问题,用overlay
是一个有关shell中如何使用overlayicon接口的代码
OGRE用OVERLAY支座角色头上的名称,象网游一样在人物头顶显示人物名字。是学习OGRE的朋友的一个很好的资料。
File "OVERLAY.C" - Code to overlay a RichText control over a background
关于FPGA overlay的解释,很有参考价值,对于项目实践很有作用。。。。
这是一个比较不错的top和overlay两种显示特效案例,源码recyclerview-stickyheaders,recyclerview实现的头部分类(stickyheader)效果,有top和overlay两种分类显示方法。
泛泰a870 device overlay 参考代码
SurfaceFlinger与Overlay(ppt)
docker清理大杀器/docker的overlay、overlay2文件占用磁盘太大的解决办法
Overlay附加数据处理,版权属于原作者,如有侵权请联系我网站及时删除
overlay_load test
Merge Overlay v1.2 汉化版(数据叠加捆绑)
cas-overlay-template-master,用于搭建CAS-OVERLAY的包