⚠️ ARCHIVED - This repository is no longer maintained
January 5, 2026 · View on GitHub
This repository has been archived and is no longer actively maintained.
This project was last updated on 2017-01-27 and is preserved for historical reference only.
- 🔒 Read-only: No new issues, pull requests, or changes will be accepted
- 📦 No support: This code is provided as-is with no support or updates
- 🔍 For reference only: You may fork this repository if you wish to continue development
For current CARTO projects and actively maintained repositories, please visit: https://github.com/CartoDB
Mobile Cordova Samples
Sample project showing CARTO Mobile maps SDK Cordova plugin. Plugin itself: https://github.com/CartoDB/mobile-sdk-cordova
Structure
-
Everything related to building the views and controllers of our SDK, and Cordova in general, is located under
www/. -
CARTO MapView initialization and usage is under
www/js/index.js/ -
Uses two Cordova plugins
-
com.carto.plugin.sdk 0.0.1 "CartoMobileSDK"
-
cordova-plugin-device 1.1.5-dev "Device"
Setup
cordova prepare– Platforms and plugins are automatically restored from config.xml when the 'cordova prepare' command is run.cordova run android&cordova run ios– automatically locates an available device and runs the app (prefers real device to emulator/simulator)
NB! If installing iOS plugin for the first time, you need to change compiler flags the Cordova project's XCode project
-
Open the workspace file (XCode) under
platforms/ios/HelloCordova/, open build settings and make the following changes:- Set
C++ Language DialecttoC++11 - Set
C++ Standard Librarytolibc++
- Set
Feature Description
- Identifies platform (that's why we need the device plugin) for license registration
- Registers platform-specific license
- Initializes MapView (html element as parameter)
- Sets click listener on the map view
- Listens to map view clicks (gets latitude, longitude, click type) and places custom SDK balloon popup to click coordinates
Contributing
As you can see, this sample is rather bare-bones, and the lacking is mostly on the plugin-side (we're not just too lazy to create proper samples).
If you wish to contribute (our plugin is open source), contact us or check out the plugin's souce