MapKit 线条和多边形
我上面有一张地图和一条线(多段线)。我正在尝试围绕这条线制作一个平滑的多边形。我面临的问题是如何创建看起来光滑且末端呈圆形的多边形。有什么建议/解决方案吗? 我尝试在现有的一条不同粗细的线条上画另一条线,但它在缩放时效果不佳......
I have a map and line (poly-line) on it. I'm trying to make a smooth polygon around this line. The problem I'm facing is how to create that polygon look smooth with rounded ends. any suggestions/solutions?
I've tried to draw another line over existing one with different thickness, but it doesn't work well with zooming...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 MKOverlayPathView(MKPolylineView 的超类)中,有一个名为 lineCap 的属性。将其设置为
kCGLineCapRound
检查此处:
http://developer.apple.com/ Library/ios/#documentation/MapKit/Reference/MKOverlayPathView_class/Reference/Reference.html
希望有帮助。
In MKOverlayPathView which is a superclass of MKPolylineView there is a property called lineCap. Set it to
kCGLineCapRound
check here:
http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKOverlayPathView_class/Reference/Reference.html
Hope it helps.