Reputation: 51
Is there a way to add google maps or mapbox to osx app built with swift in xcode? Both websites only show api for ios. Is there any option to add maps to osx app without using apple maps?
Upvotes: 1
Views: 510
Reputation: 860
I recently ported the Mapbox iOS SDK to OS X. It can be used with either Objective-C or Swift on OS X 10.10.0 and above. Until there’s an official release, you’ll need to clone the mapbox/mapbox-gl-native repository on GitHub and build the project from source. Most of the Mapbox iOS SDK documentation applies equally to the OS X port. The project comes with a demo application as well (via make xproj
).
Update: You don’t have to build it from source anymore! See https://github.com/mapbox/mapbox-gl-native/releases/ for prebuilt releases of the Mapbox macOS SDK. (Look for releases beginning with “macos-”.) See the SDK’s homepage for more information and an API reference.
Upvotes: 2
Reputation: 5128
Technically Mapbox GL runs on OS X, but it's direct C++, which means that you'd have to wrap it in Objective-C in order to use it with Swift, but it is possible.
Upvotes: 0
Reputation: 5566
There is no google-maps SDK for OS X. Your only way to go to is add a webView into your app and load a html that contains maps api calls linked to your AUTHORIZATION TOKEN.
Upvotes: 0