显示MKMapView灰度
是否可以将 MKMapView 显示更改为灰度?
Is it possible to change MKMapView display to grayscale ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
是否可以将 MKMapView 显示更改为灰度?
Is it possible to change MKMapView display to grayscale ?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
不,MapKit API 不支持对图块进行任何操作。如果您只对静态灰度图感兴趣,则可能会成功拍摄
MKMapSnapshot
并随后操作图像。但这不适用于交互式地图。您还可以在地图视图之上放置一个半透明图像视图。这不会让你完全脱色底层的mapView。但是,您可能会获得类似的效果。例如,请参阅 Metropolis Compass 应用。
No, the MapKit API does not support any manipulation of the tiles. If you're interested in just a static grayscale map, you might be successful in taking a
MKMapSnapshot
and manipulate the image afterwards. This won't work for an interactive map, though.You can also put a semi-transparent image view on top of the mapView. This won't allow you to completely decolorize the underlying mapView. However, you might achieve a similar effect. See the Metropolis Compass app for example.
您可以点击谷歌的地图标题 API 并重新着色标题并将它们加载为叠加层。这会有点hacky。
我认识一些人在 Flash 中做到了这一点。经许可,Google 可以接受:
https://spreadsheets.google.com/viewform?formkey=cm0zMDkzOHZWMjJneEl2RVdkNFZRb0E6MA
查看 Cloudmade 的替代映射工具包:http://cloudmade.com/products/iphone-sdk< /a>
编辑:
您可能可以重载 renderInContext,然后以某种方式重新绘制屏幕。听起来有点危险。
You could hit the map title API at google and recolor the titles and load them as a overlay. It would be a little hacky.
I knew some guys that did this in Flash. Google is ok with it with permission:
https://spreadsheets.google.com/viewform?formkey=cm0zMDkzOHZWMjJneEl2RVdkNFZRb0E6MA
Check out Cloudmade's alternative mapping toolkit : http://cloudmade.com/products/iphone-sdk
Edit:
You could maybe overload renderInContext and then repaint the screen somehow. It sounds a bit dangerous.