- 浏览: 7325447 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (1546)
- 企业中间件 (236)
- 企业应用面临的问题 (236)
- 小布Oracle学习笔记汇总 (36)
- Spring 开发应用 (54)
- IBatis开发应用 (16)
- Oracle基础学习 (23)
- struts2.0 (41)
- JVM&ClassLoader&GC (16)
- JQuery的开发应用 (17)
- WebService的开发应用 (21)
- Java&Socket (44)
- 开源组件的应用 (254)
- 常用Javascript的开发应用 (28)
- J2EE开发技术指南 (163)
- EJB3开发应用 (11)
- GIS&Mobile&MAP (36)
- SWT-GEF-RCP (52)
- 算法&数据结构 (6)
- Apache开源组件研究 (62)
- Hibernate 学习应用 (57)
- java并发编程 (59)
- MySQL&Mongodb&MS/SQL (15)
- Oracle数据库实验室 (55)
- 搜索引擎的开发应用 (34)
- 软件工程师笔试经典 (14)
- 其他杂项 (10)
- AndroidPn& MQTT&C2DM&推技术 (29)
- ActiveMQ学习和研究 (38)
- Google技术应用开发和API分析 (11)
- flex的学习总结 (59)
- 项目中一点总结 (20)
- java疑惑 java面向对象编程 (28)
- Android 开发学习 (133)
- linux和UNIX的总结 (37)
- Titanium学习总结 (20)
- JQueryMobile学习总结 (34)
- Phonegap学习总结 (32)
- HTML5学习总结 (41)
- JeeCMS研究和理解分析 (9)
最新评论
-
lgh1992314:
[u][i][b][flash=200,200][url][i ...
看看mybatis 源代码 -
尼古拉斯.fwp:
图片根本就不出来好吧。。。。。。
Android文件图片上传的详细讲解(一)HTTP multipart/form-data 上传报文格式实现手机端上传 -
ln94223:
第一个应该用排它网关吧 怎么是并行网关, 并行网关是所有exe ...
工作流Activiti的学习总结(八)Activiti自动执行的应用 -
ZY199266:
获取不到任何消息信息,请问这是什么原因呢?
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息 -
xiaoyao霄:
DestinationSourceMonitor 报错 应该导 ...
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息
GIS的学习(四十六)【转】osmdroid Limiting the view to an area
在地图中限制仅仅显示某一个区域,具体代码
完整代码:
讨论:
https://code.google.com/p/osmdroid/issues/detail?id=209
package com.example.yourproject.osmdroid.views; import microsoft.mappoint.TileSystem; import org.osmdroid.ResourceProxy; import org.osmdroid.events.ScrollEvent; import org.osmdroid.tileprovider.MapTileProviderBase; import org.osmdroid.util.BoundingBoxE6; import org.osmdroid.views.MapView; import org.osmdroid.views.util.constants.MapViewConstants; import android.content.Context; import android.graphics.Point; import android.graphics.Rect; import android.widget.Scroller; /** * MapView that limits scrolling to the area specified. Based on code from Marc * Kurtz (http://code.google.com/u/107017135012155810755/) * */ public class BoundedMapView extends MapView { protected Rect mScrollableAreaLimit; protected BoundingBoxE6 box; public BoundedMapView(Context context, ResourceProxy resourceProxy, MapTileProviderBase provider) { super(context, provider.getTileSource().getTileSizePixels(), resourceProxy, provider); } /** * Set the map to limit it's scrollable view to the specified BoundingBoxE6. * Note that, like North/South bounds limiting, this allows an overscroll of * half the screen size. This means each border can be scrolled to the * center of the screen. * * @param box * A lat/long bounding box to limit scrolling to, or null to * remove any scrolling limitations */ public void setScrollableAreaLimit(BoundingBoxE6 box) { final int worldSize_2 = TileSystem.MapSize(MapViewConstants.MAXIMUM_ZOOMLEVEL) / 2; // Clear scrollable area limit if null passed. if (box == null) { mScrollableAreaLimit = null; return; } // Get NW/upper-left final Point upperLeft = TileSystem.LatLongToPixelXY(box.getLatNorthE6() / 1E6, box.getLonWestE6() / 1E6, MapViewConstants.MAXIMUM_ZOOMLEVEL, null); upperLeft.offset(-worldSize_2, -worldSize_2); // Get SE/lower-right final Point lowerRight = TileSystem.LatLongToPixelXY(box.getLatSouthE6() / 1E6, box.getLonEastE6() / 1E6, MapViewConstants.MAXIMUM_ZOOMLEVEL, null); lowerRight.offset(-worldSize_2, -worldSize_2); mScrollableAreaLimit = new Rect(upperLeft.x, upperLeft.y, lowerRight.x, lowerRight.y); } @Override public void scrollTo(int x, int y) { final int worldSize_2 = TileSystem.MapSize(this.getZoomLevel(true)) / 2; while (x < -worldSize_2) { x += worldSize_2 * 2; } while (x > worldSize_2) { x -= worldSize_2 * 2; } if (y < -worldSize_2) { y = -worldSize_2; } if (y > worldSize_2) { y = worldSize_2; } if (mScrollableAreaLimit != null) { final int zoomDiff = MapViewConstants.MAXIMUM_ZOOMLEVEL - getZoomLevel(); final int minX = mScrollableAreaLimit.left >> zoomDiff; final int minY = mScrollableAreaLimit.top >> zoomDiff; final int maxX = mScrollableAreaLimit.right >> zoomDiff; final int maxY = mScrollableAreaLimit.bottom >> zoomDiff; if (x < minX) x = minX; else if (x > maxX) x = maxX; if (y < minY) y = minY; else if (y > maxY) y = maxY; } super.scrollTo(x, y); // do callback on listener if (mListener != null) { final ScrollEvent event = new ScrollEvent(this, x, y); mListener.onScroll(event); } } @Override public void computeScroll() { final Scroller mScroller = getScroller(); final int mZoomLevel = getZoomLevel(false); if (mScroller.computeScrollOffset()) { if (mScroller.isFinished()) { /** * Need to jump through some accessibility hoops here Silly * enough the only thing MapController.setZoom does is call * MapView.setZoomLevel(zoomlevel). But noooo .. if I try that * directly setZoomLevel needs to be set to "protected". * Explanation can be found at * http://docs.oracle.com/javase/tutorial * /java/javaOO/accesscontrol.html * * This also suggests that if the subclass is made to be part of * the package, this can be replaced by a simple call to * setZoomLevel(mZoomLevel) */ // This will facilitate snapping-to any Snappable points. getController().setZoom(mZoomLevel); } else { /* correction for double tap */ int targetZoomLevel = getZoomLevel(); if (targetZoomLevel == mZoomLevel) scrollTo(mScroller.getCurrX(), mScroller.getCurrY()); } postInvalidate(); // Keep on drawing until the animation has // finished. } } }
评论
1 楼
apple5939
2013-02-22
您好
我想請問您,我用了上述的"代碼" + 範例九 的離線地圖,但我在我的程式中無法限定住"離線地圖的範圍,都會超出會有"格子"出現。
請問您,要實現"離線地圖範圍"不能看見"格子"要怎麼做呢?
謝謝
我想請問您,我用了上述的"代碼" + 範例九 的離線地圖,但我在我的程式中無法限定住"離線地圖的範圍,都會超出會有"格子"出現。
請問您,要實現"離線地圖範圍"不能看見"格子"要怎麼做呢?
謝謝
发表评论
-
TestNG简单的学习(十三)TestNG中Junit的实现
2013-12-04 09:00 3351TestNG和junit的整合 ... -
TestNG简单的学习(十二)TestNG运行
2013-12-03 09:08 51569文档来自官方地址: ... -
TestNG简单的学习(十一)TestNG学习总结
2013-12-03 09:08 14165最近一直在学习关于TestNG方面的知识,根 ... -
TestNG简单的学习(十)TestNG @Listeners 的使用
2013-12-03 09:07 8682TestNG官方网站: http://testng.or ... -
TestNG简单的学习(九)TestNG Method Interceptors 的使用
2013-12-03 09:07 2704TestNG官方网站: http://testng ... -
TestNG简单的学习(八)TestNG Annotation Transformers 的使用
2013-12-03 09:07 2802TestNG官方网站: http://testng.or ... -
TestNG简单的学习(七)TestNG编程方式运行
2013-12-02 09:22 2447TestNG官方网站: http://testng.or ... -
TestNG简单的学习(六)测试工厂注释的使用
2013-12-02 09:22 2776TestNG官方网站: http://testng.or ... -
TestNG简单的学习(五)参数化测试数据的定制
2013-12-02 09:22 2693TestNG官方网站: http://testng.or ... -
TestNG简单的学习(四)测试方法通过名称名称依赖实现
2013-12-02 09:21 2074TestNG官方网站: http://testng.or ... -
TestNG简单的学习(三)测试方法通过测试分组依赖实现
2013-12-02 09:21 2821TestNG官方网站: http://testng.or ... -
TestNG简单的学习(二)参数化测试并发且多方法测试方法判定
2013-11-29 15:35 3691TestNG官方网站: http://testng.or ... -
TestNG简单的学习(一)类和方法级别@Test的区别
2013-11-29 15:31 9415TestNG官方文档的地址: http://testng ... -
Feed4Junit的简单使用(七)Feed4TestNg
2013-11-29 13:35 6123在Feed4Junit主要针对junit实现的 ... -
Feed4Junit的简单使用(六)数据来特定格式文件
2013-11-29 12:29 2759Feed4Junit官方地址: http://da ... -
Feed4Junit的简单使用(五)数据来自动态约束数据
2013-11-29 12:29 2621Feed4Junit官方地址: http://datab ... -
Feed4Junit的简单使用(四)数据来自定义数据源
2013-11-28 14:09 3091Feed4Junit官方地址: http://databe ... -
Feed4Junit的简单使用(三)数据源来自数据库
2013-11-28 13:58 3162Feed4Junit官方地址: http://databe ... -
Feed4Junit的简单使用(二)数据源来自文件
2013-11-28 13:50 4562Feed4Junit官方地址: http://datab ... -
Feed4Junit的简单使用(一)
2013-11-28 13:47 2204Feed4Junit官方地址: http://databe ...
相关推荐
Presented in this paper is the design philosophy employed for the construction of DIESTRO, an isotropic, six-axis, serial manipulator. The kinematic criteria applied so far in manipulator design have ...
The recent bursting of the great global credit bubble not only led to the first worldwide recession since the 1930s but also left an enormous burden of debt that now weighs on the prospects for ...
AspNetMVC2_RC_VS2008.exe ASP.NET MVC 2 Release Candidate Release Notes This document describes the Release Candidate release of the ...If you are using the Areas feature, make sure to not use {area} as...
specific area of interest or concern and not be forced to sequentially wade through an entire text, chapter by chapter, to get to what is important to you. In the true sense of a field manual, each ...
The World Wide Web has been credited with bringing the Internet to the masses. The Internet was previously the stomping ground of academics and a small, elite group of computer professionals, mostly...
The EM8500 incorporates a boost converter able to start with an input voltage as low as 300 mV and an input power of few μW. In functional mode the EM8500 operates at energy levels from a DC ...
博世LSU4.9氧传感器英文详细说明书, The wide band lambda sensor LSU is a planar ZrO2 dual cell limiting current sensor with an integrated heater. It is used to measure the oxygen content and the λ-...
ensuring real-time operation by limiting the optimization to a bounded window of keyframes through marginalization. Keyframes may be spaced in time by arbitrary intervals, while still related by ...
If You are a company or other form of organization, and You wish to authorize the Registered Software to be used in a local area network or other network, You must purchase a license for each ...
case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free ...
case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free ...
ssl: Add possibility to downgrade an SSL/TLS connection to a tcp connection, and give back the socket control to a user process. ssh: The following new key exchange algorithms are implemented:'ecdh...
The LM1117 is available in an adjustable version, which can set the output voltage from 1.25V to 13.8V with only two external resistors. In addition, it is also available in five fixed voltages, 1.8V,...
these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the...
The Way to Go,: A Thorough Introduction to the Go Programming Language 英文书籍,已Cross the wall,从Google获得书中源代码,分享一下。喜欢请购买正版。 目录如下: Contents Preface......................
holds an exclusive lock at the table level, and another transaction (T2) holds an exclusive lock at the row level, each of the transactions believe they have exclusive access to the resource....
In order to appropriately handle large raster imagery, the fundamental goal is to reduce the influence of the most limiting factors in mobile environments. In a clear departure from the traditional ...
access layer The layer that feeds traffic into the network and performs network entry control. End users access the network via the access layer. access A that provides remote access to a corporate ...