Home

Awesome

CARTO SDK Cordova Plugin

CARTO Mobile maps SDK Plugin for Cordova/PhoneGAP platorm

NB! This a proof of concept solution. It only features a small percentage of CARTO Mobile SDK's features. It is provided in 'as is' basis - CARTO does not intend to support, document or sell it, and there are no development plans for it. Feel free to use it, and if you extend then please post Pull Requests, so also others can make use of it.

Getting Started

A general guide to installing cordova and creating a project can be found here

Installation

NB! If installing iOS plugin for the first time, you need to change compiler flags the Cordova project's XCode project

API

NB! This a proof of concept solution. It implements only a small percentage of CARTO Mobile SDK's features. Other features can be added by you (please submit Pull Request!) or by us upon request

Sample project

Contributing

We're always looking for contributors for this plugin, please add your enhancements as Pull Request in github and feel free to post issues. Contact CARTO if you need full coverage of CARTO Mobile SDK for Cordova.

Overview

A general overview of Cordova Plugin creation can be found here, but I'll also, in short, explain it here.

The heart and soul of a plugin is plugin.xml that defines all the platforms that are supported, the classes and libraries that it contains.

A method definition in Cordova Plugin consts of two main layers:

A JavaScript module

www/mapview.js in this plugin that in turn calls native code, e.g.

module.exports = {
	registerLicense: function(license) {
			cordova.exec(null, null, "CDMapView", "registerLicense", [license]);
	}
};

Native

Debugging

There's no easy solution for debugging Cordova, that's why we've also included a small cheat-sheet in the README

Debugging JavaScript

Android

NB! You must click Inspect each time you start a new session (cordova run android)

iOS

Debugging Native

Android
iOS