Skip to content

rexfordnyrk/carto-mobile-ios-samples

 
 

Repository files navigation

iOS sample app with CARTO Mobile SDK

Build Status

Installation Guide

Note that we have several subprojects, for different languages (Objective-C or Swift) and level of complexity (from HelloMap to AdvancedMap), each is separate projects in Xcode point of view.

Manually downloading the SDK:

  1. Get SDK package latest dev build: sdk4-ios-snapshot-latest.zip
  2. Unzip it and copy CartoMobileSDK.framework to the xCode project root folder

Please note that this is not the preferred method, as the SDK itelf is too large to be uploaded to Github.

Via CocoaPods:

The following steps assume you know what Cocoapods are and have the CL tool installed on your system.

  1. Navigate to a project's folder in the Terminal.
  2. Type pod install to download the SDK
  3. Run the project via the .xcworkspace file

Via Carthage:

The following steps assume you know what Carthage is and have the CL tool installed on your system.

  1. Move Cartfile in the root of this repository to a specific project
  2. Navigate to a project's folder in the Terminal.
  3. Type carthage update to download the SDK
  4. Add $(SRCROOT)/Carthage/Build/iOS to XCode Framework Search paths (Project properties > Build )
  5. Add Carthage/Build/iOS/CartoMobileSDK.framework to XCode Embedded Binaries (Project properties > General)

Cocoapod Removal

These samples are, by default, designed to work with Cocoapods. In order to deintegrate Cocoapods, do the following:

  1. Navigate to a project's folder in the Terminal.
  2. sudo gem install cocoapods-deintegrate cocoapods-clean
  3. pod deintegrate
  4. pod clean
  5. Under Build Phases > Link Binary With Libraries, remove CardoMobileSDK.framework

Furthermore, note that trying to run Carthage on a project that was previously configured with cocoapoads may or may not result in errors, cf. this post

Sample structure

  1. Hello Map
    • Basic sample of how to initialize a map, set a market on the map, listen to map clicks and change the color and size of that marker.
  2. Advanced Map
    • Base Maps
      • Base Maps - choice of different base maps, styles, tile type and language
    • Overlay Data Sources
      • Custom Raster Data Source - creating and using custom (merged) raster tile data source
      • Ground Overlay - Addoung ground-level raster overlay
      • WMS Map - WMS service raster on top of a vector base map
    • Vector Objects
      • Clustered Markers - reading data from .geojson and showing it as clusters (made from custom markers)
      • Overlays - shows how to set 2D &3D objects: lines, points, polygons, tests, popups and 3D models on the map and how to attach a click listener to them
      • Vector object editing - shows usage of an editable vector layer, with three different event listeners
    • Offline maps
      • Bundled Map - Shows usage of a numbled MBTiles file to display a map offline
      • Package Manager - Download offline map packaged with OSM
    • Other
      • Screencapture - Captures a rendered MapView as a Bitmap
      • Custom Popup - Creating and using custom popups
      • GPS Location - Shows user GPS location on the map
      • Offline Routing - Offline routing with OpenStreetMap data packages
  3. Carto Map
    • CARTO.js API
      • Countries Vis - Dislaying countries in different colors from a viz.json
      • Dots Vis - Showing specific dots on the map from a viz.json
      • Fonts Vis - Displaying text on the map from a viz.json
    • Maps API
      • Anonymous Raster Tile - Uses CARTO PostGIS raster data
      • Anonymous Vector Tile - Uses CARTO Maps API vector tiles
      • Named Map - CARTO data as vector tiles from a named map
    • SQL API
      • SQL Service - Displays cities on the map vis a SQL query
    • Torque API
      • CARTO Torque Map - Shows Torque tiels of WWII ship movement

Other Samples

About

iOS mobile app with CARTO Mobile SDK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 57.5%
  • Objective-C 24.6%
  • Objective-C++ 17.3%
  • Other 0.6%