Mac OS X的MapKit? [英] A MapKit for Mac OS X?
问题描述
在iPhone上,我们有苹果的令人惊叹的MapKit。对于Mac OS X有类似的东西吗?
如果可能的话比一个简单的WebView更高级,因为我需要它至少自动管理:
- 注释
- 用户交互
- 放大/ >
- 重叠视图
(即使地图不是来自Google) >
非常感谢!
更新2
MapKit可在OS X 10.9 Mavericks中使用:地图工具包框架参考。
更新
情况已更改,现在存在第三方的Mac OS X的MapKit。在 http://github.com/Oomph/MacMapKit 和一个小写的 http://rickfillion.tumblr.com/post/1134987954/pretroducing-mapkit-for-mac
原始答案
Mac OS X上没有来自Apple的API。请在 bugreporter.apple.com 提交错误请求。
最好的选择是使用嵌入在WebKit视图中的Google Maps JavaScript API。请访问 Google Maps JavaScript API V3文档,了解API。
我意识到你要求一个简单的WebView,但也许你不知道一些WebKit视图允许的更高级的功能。
Webkit提供了在WebKit视图中的JavaScript脚本环境和其他Cocoa应用程序之间桥接的方法。
调用Objective-C的Javascript函数,使用WebKit视图的WebScriptObject。 使用Javascript From Objective-C rel =nofollow> WebKit Objective-C编程指南是一个很好的开始学习的地方。
如果你需要回调到你的Cocoa应用程序来自Javascript,从JavaScript调用Objective-C方法 WebKitJavaScript.htmlrel =nofollow> WebKit DOM编程主题提供了示例和解释。
这些技术一起使用应该提供您需要的功能。
on the iPhone we have the Apple's amazing MapKit. There is something similar for Mac OS X?
If possible something more advanced than a simple WebView, because I need that it manage automatically at least:
- annotations
- the user interaction
- the zoom in/out
- an overlay view
(Even if the maps are not from Google is ok.)
Thank you very much!
Update 2
MapKit is available in OS X 10.9 Mavericks : Map Kit Framework Reference.
Update - pulled from my comment below
The situation has changed and there now exists a third party MapKit for Mac OS X. Find it at http://github.com/Oomph/MacMapKit and a small writeup at http://rickfillion.tumblr.com/post/1134987954/pretroducing-mapkit-for-mac
Orginal Answer
There is no such API from Apple on Mac OS X. You should file a bug request at bugreporter.apple.com.
The best alternative is to use the Google Maps JavaScript API embedded in a WebKit view. Visit the Google Maps JavaScript API V3 Documentation to understand the API.
I realize that you asked for more then a simple WebView, but perhaps you're unaware of some of the more advance functionality a WebKit view allows.
Webkit provides means for bridging between the JavaScript scripting environment in your WebKit view and the rest of your Cocoa application.
To call a Javascript function from Objective-C, use your WebKit view's WebScriptObject. "Using Javascript From Objective-C" from the "WebKit Objective-C Programming Guide" is a great place to start learning.
If you need to call back into your Cocoa application from Javascript, "Calling Objective-C Methods From JavaScript" in the "WebKit DOM Programming Topics" provides examples and explanation.
These technologies used carefully together should provide the functionality you require.
这篇关于Mac OS X的MapKit?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!