Yandex MapKit is a cross-platform library that lets you use the capabilities of Yandex Maps in mobile applications for iOS and Android. Learn more about the MapKit SDK on the documentation page.
Visit the Getting started page for quick start development with the MapKit SDK.
The current repository contains sample code for how to use the MapKit SDK for iOS applications.
There are two iOS projects in the repository:
-
MapkitSamples
: Contains several iOS applications with sample code in Swift, all of which are demonstrated in the MapKit SDK Tutorials documentation.-
MapWithPlacemark
: A simple MapKit SDK application with Getting started with MapKit for iOS information. -
MapObjects
: Using the Map Objects API to add objects to the map. -
MapInteraction
: Examples from the Map Interaction tutorial. -
MapSearch
: Examples of how to use the Search and Geosuggest functionality. -
MapRouting
: About the Routes and Routing API.
-
-
MapKitDemo
: A demo application that contains the basic functionality of the lite and full MapKit SDK versions. It is not supported with Tutorials documentation, unlike theMapkitSamples
project.
-
Clone the repository:
git clone https://github.com/yandex/mapkit-ios-demo.git
-
Execute the following command in your project's directory to install dependencies:
pod install
-
Demo applications use the MapKit SDK, which requires API key. You can get a free MapKit API key in the Get the MapKit API Key documentation.
-
Depending on the project you want to build, follow the steps in the following sections.
-
Open the project's build settings. Add the following user-defined setting with your API key value in place of the
YOUR_API_KEY
placeholder:MAPKIT_API_KEY = "YOUR_API_KEY";
-
Choose the desired target in Xcode, build and run.
-
Open the
AppDelegate.swift
and edit theMAPKIT_API_KEY
constant declaration, setting its value with your API key in place of theYOUR_API_KEY
placeholder:let MAPKIT_API_KEY = "YOUR_API_KEY"
You can as well store this API key in your project's build settings and
Info.plist
file. -
Build and run the MapKitDemo target in Xcode.
If you have problems or suggestions while using MapKit, visit the contact page.
MapWithPlacemark Demonstrates how to create a MapKit map, move it, and display custom tappable placemarks. |
MapObjects How to display different objects on the map, including: images, geometries, and clusterized collections. |
---|---|
MapInteraction About interacting with the MapKit map using camera movements, tap actions, focus rect and focus point, and interactions with POIs. |
MapSearch Shows how to use Search and Geosuggest functionality in the full MapKit SDK. |
---|---|
MapRouting Building routes using requested map points. |
---|