- 浏览: 1213764 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
lankk:
lankk 写道事实上,在运行String s1=new St ...
理解String 及 String.intern() 在实际中的应用 -
lankk:
事实上,在运行String s1=new String(&qu ...
理解String 及 String.intern() 在实际中的应用 -
lankk:
同意1楼的说法http://docs.oracle.com/j ...
理解String 及 String.intern() 在实际中的应用 -
raoyutao:
...
jdk 线程池 ThreadPoolExecutor -
hongdanning:
理解了。之前困惑的一些明白了。谢谢分享。
理解String 及 String.intern() 在实际中的应用
画线
CLLocationCoordinate2D lats[2]; float lat = 90-i*10; lats[0] = CLLocationCoordinate2DMake(lat,179); lats[1] = CLLocationCoordinate2DMake(lat,-179); MKPolyline *overlay = [MKPolylinepolylineWithCoordinates:lats count:2]; [self.mapaddOverlay:overlay]; - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)overlay { MKPolylineView *polyLineView = [[[MKPolylineViewalloc] initWithOverlay:overlay] autorelease]; CLLocationCoordinate2D coordinate = [overlay coordinate]; if (coordinate.latitude == 0) { polyLineView.strokeColor = [UIColorgreenColor]; }else{ polyLineView.strokeColor = [UIColorblueColor]; } if (coordinate.latitude == 0 && coordinate.longitude == 0) { polyLineView.strokeColor = [UIColorredColor]; } polyLineView.lineWidth = 1.0; return polyLineView; }
自定义画字
overlay 代码
- (CLLocationCoordinate2D)coordinate { returncoordinate; } - (MKMapRect)boundingMapRect { MKMapPoint upperLeft = MKMapPointForCoordinate(coordinate); CLLocationCoordinate2D lowerRightCoord = CLLocationCoordinate2DMake(coordinate.latitude - 0.5, coordinate.longitude + 0.5); MKMapPoint lowerRight = MKMapPointForCoordinate(lowerRightCoord); double width = lowerRight.x - upperLeft.x; double height = lowerRight.y - upperLeft.y; MKMapRect bounds = MKMapRectMake(upperLeft.x, upperLeft.y, width, height); return bounds; }
overlayView代码
- (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context{ // float zoom = 0.000004/zoomScale; MKMapRect theMapRect = [self.overlayboundingMapRect]; CGRect theRect = [selfrectForMapRect:theMapRect]; CGContextSetAlpha(context, 0.5); // CGContextSetFillColorWithColor(context, [[UIColor redColor] CGColor]); // CGContextFillRect(context, theRect); // CGContextAddRect(context, theRect); // CGContextClip(context); // float w, h; // w = theRect.size.width; // h = theRect.size.height; // // CGContextSelectFont (context, // 3 // "Helvetica-Bold", // h/10, // kCGEncodingMacRoman); // CGContextSetCharacterSpacing (context, 10); // 4 // CGContextSetTextDrawingMode (context, kCGTextFillStroke); // 5 // // CGContextSetRGBFillColor (context, 0, 1, 0, .5); // 6 // CGContextSetRGBStrokeColor (context, 0, 0, 1, 1); // 7 // CGAffineTransform myTextTransform =CGAffineTransformScale(CGAffineTransformIdentity, 1.f, -1.f ); // CGContextSetTextMatrix (context, myTextTransform); // 9 // CGPoint xx = [self pointForMapPoint:theMapRect.origin]; // CGContextShowTextAtPoint (context, xx.x, xx.y, "Quartz 2D", 9); float w, h; w = theRect.size.width; h = theRect.size.height; NSString *text = [selfgenerateText]; // CGContextSetAlpha(context, 0.5); CGContextSetFillColorWithColor(context, [[UIColorblackColor] CGColor]); char *commentsMsg; commentsMsg = (char *)[text UTF8String]; CGContextSelectFont(context, "Helvetica-Bold", h, kCGEncodingMacRoman);// the h is the height of the text, it's key, because if it's small you can't see CGContextSetTextDrawingMode(context, kCGTextFill); CGAffineTransform myTextTransform =CGAffineTransformScale(CGAffineTransformIdentity, 1.f, -1.f ); CGContextSetTextMatrix (context, myTextTransform); CGPoint xx = [selfpointForMapPoint:theMapRect.origin]; CGContextShowTextAtPoint(context,xx.x,xx.y,commentsMsg, strlen(commentsMsg));// the point must convert from mappoint to cgpoint }
asdasd
发表评论
-
手动编程 NSLayoutConstraint
2017-08-09 23:51 634项目中有个admob view是后期加上的 没写在st ... -
iOS autolayout 下 键盘 遮挡 处理 keyboard handler move up
2017-08-09 23:41 763在ios 中 由于键盘出现后会遮挡屏幕下面区域, ... -
iOS 开发一年多总结下
2012-12-19 16:47 1783收获很多 1. 一个人包办从构思, 设计, 实现, ... -
libxml2 xpath 解析含有 prefix namespace 的 xml
2012-11-06 13:28 3449有一段xml 里面有 prefix URL namespac ... -
iOS 6 设备转向问题
2012-09-21 00:33 3592iOS 6 对设备转向时 View Rotations 的处理 ... -
ios5 支持 json 转化
2011-10-29 21:58 7403------ 解析json成dic对象 - ... -
Quartz 2D (ProgrammingWithQuartz) note
2011-10-09 20:03 2881http://www.evernote.com/shard/s ... -
ios 添加字体
2011-10-09 19:09 2048<!--?xml version="1.0&q ... -
MBProgressHUD 画不出来解决办法
2011-09-02 14:34 2199- (void)tableView:(UITabl ... -
ios 系统相关
2011-09-02 14:28 1484判断当前设备 是否ipad #define ... -
ios 5 才执行的代码
2011-09-02 13:03 1256设置navigationBar背景在ios5有了官方支持 ... -
UIPopoverController 相关问题
2011-09-02 12:57 1538Popover + tableView 的宽度问题 ... -
Settings 设置问题
2011-09-02 12:05 9931. setting面板的设置只有当用户去了设置面 ... -
ios 国际化相关
2011-09-02 12:04 1753添加国际化 1. 代码中使用字符串的地方 使 ... -
UITableView 相关问题
2011-09-02 11:53 1890动态调整cell高度 - (UITable ... -
提取ipa png 图标
2011-08-10 11:19 6229Apple 对 iPhone 应用程序中的 png 图片进 ... -
个人申请 idp
2011-07-19 15:15 1723要准备的东西 一张双币信用卡(扣$99用) 一张可以接受外汇 ... -
本人第一款ios app上架了
2011-07-19 12:26 1490第一次开发ios app, 希望大家多多支持, 多多下载, ... -
MKPointAnnotation 导致的内存泄露
2011-07-11 21:59 1513程序是在一个map 上添加annotation, 添加的时候有 ... -
Grand Central Dispatch 笔记
2011-07-05 19:56 2494https://www.evernote.com/shard/ ...
相关推荐
React-GoogleMap 在ReactJS中使用Google Map的演示( 教程###使用npm install npm启动浏览器localhost:// 3000
最新版本的Android Google Map 轨迹回放源码, 可以用Google Map实现gps动态导航的功能. 参看博客地址:http://blog.csdn.net/ostrichmyself/article/details/6821112, 修正两个问题: 1. 不能重复播放 2. 拖动才能...
Numerical “map overlay” combines spatial features from one map layer with the attribute (numerical) properties of another. This vignette explains the R method “over”, which provides a consistent ...
此资料包含 Android学习笔记 - 地图.doc 通过地名获得经纬度并标识在...点中overlay弹出带尾巴的气泡的实现.doc 传递坐标到Google地图.doc android map.doc Android地图和定位学习总结 .doc 希望对大家有帮助。。。。
mars老师写的重写overlay类在google地图上添加标记的程序,代码清楚易懂
DICOM图像,overlay层,包含只有一层overlay,两侧overlay,overlay加原始图像三种DICOM图像。 不少DICOM开源框架对这种图像支持不够,显示有问题。便于测试系统对带有overlay图像的显示是否正确
OpenStreetMap IOS版demo,共包含: 添加annotation,overlay,Ployline 具体实现方式请看demo中的源码
Google Map Custom Overlay入门非常简单。 按照Google Maps官方文档页面的说明初始化Google Map,然后使用CustomOverlay函数显示自定义叠加层。 选项 latlng-自定义叠加层的纬度和经度 map- Google Map对象 内容-...
主机overlay和网络overlay介绍 .pptx
在地图上覆盖自定义的图片,或在地图上画线。 注意:请在Mac下解压使用
Overlay组播Overlay组播Overlay组播Overlay组播Overlay组播Overlay组播Overlay组播Overlay组播
js-googlemap-infobox InfoBox扩展了Google Maps JavaScript API V3 OverlayView类。 版本 1.1.13 [2014年3月19日] 作者 加里·利特尔
此扩展程序可让您在Google Map Maker上添加圆,图像,KML或地形叠加层。在Google Map Maker中绘制圆圈可能很难正确。此扩展程序将显示一个覆盖在地图上的圆,在绘制诸如回旋处的圆时,可用于跟踪。您可以根据自己的...
docker清理大杀器/docker的overlay、overlay2文件占用磁盘太大的解决办法
关于FPGA overlay的解释,很有参考价值,对于项目实践很有作用。。。。
此扩展程序可让您在Google Map Maker上添加圆,图像,KML或地形叠加层。 在Google Map Maker中绘制圆圈可能很难正确。 此扩展程序将显示一个覆盖在地图上的圆,在绘制诸如回旋处的圆时,可用于跟踪。 您可以根据自己...
SPM多重overlay方法,神经成像方面的人做为参考!SPM多重overlay方法,神经成像方面的人做为参考!
模仿苹果系统的UI风格 用来做ajax请求绝佳的选择
google-maps-deckgl-overlay 在Deck.gl中使用Google Maps的示例。 叠加层逻辑主要来自 来自航班数据 演示版 查看
1.网络虚拟化技术介绍 2.Overlay基本概览和分类 3.VXLAN基础基础