OpenStreetMap/iOS:标记和路线不能一起工作
我是 OpenStreetMap 的新手,但有相当多的 iOS 开发经验。我正在开发一个应用程序,该应用程序上有一个 OpenStreetMap 地图,带有响应触摸的标记,以及从一系列位置以编程方式生成的路线。我可以让所有的部分都工作起来,但是放在一起:不太好。
在下面的示例中,我将标记放在地图上,并将 mapView 挂接到委托,这样我就可以响应标记上的触摸。然后,再次按照示例,我创建一个 CMRoute 并将其添加为子图层 ([mapView.contents.overlay addSublayer:walkRoute.path];)。这样做本质上是将标记隐藏在路线子层下;他们不再对触摸做出反应。
谁能给我指出一个方向,让我能够拥有地图视图和路线子图层,并且仍然能够检测标记触摸?我不要求提供代码(尽管那会很好),但要考虑如何实现这一点。
谢谢
I am a newbie to OpenStreetMap, but have a fair amount of iOS development experience. I'm working on an app that will have an OpenStreetMap map on it, with markers that respond to a touch, and a route generated programmatically from an array of locations. I can make all the pieces work, but together: not so good.
Following examples, I put the markers on the map, and hook the mapView to a delegate, so I can respond to touches on the markers. Then, again following examples, I create a CMRoute and add it as a sublayer ([mapView.contents.overlay addSublayer:walkRoute.path];). Doing that essentially hides the markers under the route sublayer; they no longer respond to a touch.
Can anyone point me in a direction that will give me the means to have a mapView and a route sublayer and still be able to detect marker touches? I don't ask for code (though that would be nice) but thoughts on how this could be accomplished.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论