Skip to content
2GIS Maps SDK for iOS
Swift HTML Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


2GIS Maps SDK for iOS.


Get Access

As a first step to use MapGL you need to get the access key (contact us if you need one).

Creating the Map

To show the map you should first create MapView object. It is a custom UIView so you can create it using XIB, Storyboard or in code.

let map = MapView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))

Showing the Map with default center and zoom "Your API access key")

Showing the Map with custom center and zoom
    apiKey: "Your API access key",
    center: CLLocationCoordinate2D(latitude: 25.23584, longitude: 55.31878),
    zoom: 16)

Showing the Marker with default image

All manipulations with the map is allowed after the show(apiKey:) method is completed. "apiKey") {
    _ in
    let marker = Marker(coordinates: map.mapCenter)

Showing the Marker with custom image

let marker = Marker(
    coordinates: CLLocationCoordinate2D(latitude: 25.23584, longitude: 55.31878),
    image: UIImage(named: "pin")!,
    anchor: .bottom)

Receiving Map Click Events

map.mapClick = {
    coordinates in
    // Do smth with map click coordinates

Receiving Marker Click Events

map.markerClick = {
    marker in
    // Do smth with marker


To run the example project, clone the repo, and run pod install from the Example directory.


MapGL is available through CocoaPods. To install it, simply add the following line to your Podfile.

pod 'MapGL'


MapGL is available under the BSD 2-Clause "Simplified" license. See the LICENSE file for more info.

You can’t perform that action at this time.