A MapKit for Mac OS X?

主宰稳场 提交于 2019-11-29 02:26:41

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/4689345/a-mapkit-for-mac-os-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!