Mac OS X 的 MapKit? [英] A MapKit for Mac OS X?

查看:26
本文介绍了Mac OS X 的 MapKit?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 iPhone 上,我们有 Apple 令人惊叹的 MapKit.Mac OS X 有类似的东西吗?

on the iPhone we have the Apple's amazing MapKit. There is something similar for Mac OS X?

如果可能的话,比简单的 WebView 更高级的东西,因为我需要它至少自动管理:

If possible something more advanced than a simple WebView, because I need that it manage automatically at least:

  • 注释
  • 用户交互
  • 放大/缩小
  • 叠加视图

(即使地图不是来自谷歌也可以.)

(Even if the maps are not from Google is ok.)

非常感谢!

推荐答案

更新 2

MapKit 在 OS X 10.9 Mavericks 中可用:Map套件框架参考.

MapKit is available in OS X 10.9 Mavericks : Map Kit Framework Reference.

更新 - 从我下面的评论中提取

Update - pulled from my comment below

情况已经改变,现在有一个适用于 Mac OS X 的第三方 MapKit.在 http://找到它github.com/Oomph/MacMapKithttp 上的一篇小文章://rickfillion.tumblr.com/post/1134987954/pretroducing-mapkit-for-mac

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

原始答案

Apple 在 Mac OS X 上没有此类 API.您应该在 bugreporter.apple.com 上提交错误请求一>.

There is no such API from Apple on Mac OS X. You should file a bug request at bugreporter.apple.com.

最好的替代方法是使用嵌入在 WebKit 视图中的 Google Maps JavaScript API.访问 Google Maps JavaScript API V3 文档以了解 API.

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.

我知道您要求的不仅仅是一个简单的 WebView,但您可能不知道 WebKit 视图允许的一些更高级的功能.

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 提供了在 WebKit 视图中的 JavaScript 脚本环境和 Cocoa 应用程序的其余部分之间架起桥梁的方法.

Webkit provides means for bridging between the JavaScript scripting environment in your WebKit view and the rest of your Cocoa application.

要从 Objective-C 调用 Javascript 函数,请使用 WebKit 视图的 WebScriptObject."使用 Objective-C 中的 Javascript"rel="noreferrer">WebKit Objective-C 编程指南" 是开始学习的好地方.

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.

如果您需要从 Javascript 回调到您的 Cocoa 应用程序,"从 JavaScript 调用 Objective-C 方法" in the "WebKit DOM 编程主题" 提供了示例和说明.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆