【Android MyOverlay扩展覆盖】少年乘勇气,百战过乌孙。这篇文章主要讲述Android MyOverlay扩展覆盖相关的知识,希望能为你提供帮助。
- private class MyOverlay extends Overlay {
- private GeoPoint center;
- private float radius;
- private Paint cPaint;
- public MyOverlay( GeoPoint c) {
- center = c;
- radius = 20;
- cPaint = new Paint( ) ;
- }
- @Override
- public void draw( Canvas canvas, MapView mapView, boolean shadow) {
- super.draw( canvas, mapView, shadow) ;
- if ( shadow == false) {
- // class exercise
- // Step 1: get pixel coordinate of center (in GeoPoint)
- Point screenPt = new Point( ) ;
- mapView.getProjection( ) .toPixels( center, screenPt) ;
- // Step 2: draw a circle at the converted pixel coordinate
- cPaint.setColor( Color.RED) ;
- cPaint.setAlpha( 100) ;
- canvas.drawCircle( screenPt.x, screenPt.y, radius, cPaint) ;
- }
- }
- }
推荐阅读
- android Plist解析器xml资产
- Android和Iphone-现代css媒体查询
- .NET-C#-Interop-Excel-Utility/Wrapper类
- Appindicator正面
- 使用AppleScript重新启动Django开发服务器
- 用于检测访问者是否在android设备上的函数
- AppStore从网站自动检测应用程序
- JPA NonflushableQueryRapper公司
- Android(将文本绘制为动态大小的位图)