Latest 0.0.1
Homepage https://github.com/yandex/mapsapi-ios
License MPL
Platforms ios 9.0
Dependencies Cordova, CordovaPlugin-console, cordova-plugin-device, cordova-plugin-device-orientation, cordova-plugin-device-motion, cordova-plugin-globalization, cordova-plugin-geolocation, cordova-plugin-network-information, cordova-plugin-wkwebview-engine, cordova-plugin-file
Authors

Allows to easily add Yandex.Maps to your existing iOS project using Yandex.Maps JavaScript API.

MapsAPI
MapsAPI
MapsAPI

Installation

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

pod 'MapsAPI'

Start instantly

  1. Create class MyMapViewController inherited from MapsAPIViewController and add it to any place you want to put the map (screenshot 1).

  2. Copy myMap.js to your target resources and use JavaScript API to modify it and operate with the map (screenshot 2).

Example

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

Usage

Controls

Default preset uses controls from mapsapi-round-controls package.

Native Connector

Is used to send and receive data in Swift/ObjC <-> JavaScript code. Coming soon.

Additional parameters

You can overwrite params as follows:

class MyMapViewController: MapsAPIViewController {
    override func viewDidLoad() {
        // Default: "ru_RU".
        self.apiParams["lang"] = "en_US"

        // Default: "release".
        self.apiParams["mode"] = "debug"

        // Default: "2.1".
        self.apiVersion = "2.1-dev"

        // Default: false. See https://tech.yandex.com/maps/doc/jsapi/2.1/commercial/index-docpage/
        self.apiEnterprise = true
        self.apiParams["apikey"] = "your_key"

        // By default is taken from view controller name. I.e. "myMap" for MyMapViewController.
        self.jsFileName = "anotherFile"

        super.viewDidLoad()
    }
}

Multiple maps

You can add other view controllers and .js files keeping convention of matching names for each pair.

Offline

Tile cache coming soon.

Author

Alexander Zinchuk, [email protected]

Latest podspec

{
    "name": "MapsAPI",
    "version": "0.0.1",
    "summary": "Allows to easily add Yandex.Maps to your existing iOS project using Yandex.Maps JavaScript API",
    "description": "Allows to easily add Yandex.Maps to your existing iOS project using Yandex.Maps JavaScript API",
    "homepage": "https://github.com/yandex/mapsapi-ios",
    "screenshots": "https://raw.githubusercontent.com/yandex/mapsapi-ios/master/docs/iphone5s.png",
    "license": {
        "type": "MPL",
        "file": "LICENSE"
    },
    "authors": {
        "Alexander Zinchuk": "[email protected]"
    },
    "source": {
        "git": "https://github.com/yandex/mapsapi-ios.git",
        "tag": "0.0.1"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "MapsAPI/Classes/**/*",
    "resources": "MapsAPI/CordovaResources/*",
    "dependencies": {
        "Cordova": [
            "~> 4.1.0"
        ],
        "CordovaPlugin-console": [],
        "cordova-plugin-device": [],
        "cordova-plugin-device-orientation": [],
        "cordova-plugin-device-motion": [],
        "cordova-plugin-globalization": [],
        "cordova-plugin-geolocation": [],
        "cordova-plugin-network-information": [],
        "cordova-plugin-wkwebview-engine": [],
        "cordova-plugin-file": [
            "~> 4.2.0"
        ]
    }
}

Pin It on Pinterest

Share This