Docs / Setup / iOS / Longdo
Longdo setup
How to drive the Longdo Map iOS SDK (Longdo Map Framework 4.x) through MapConductor. Unlike the Android module, the iOS provider renders markers, polylines, polygons, circles, ground images and raster layers as native overlays.
PACKAGE
ios-for-longdo
API KEY
Required
MIN iOS
16.0
VIEW
LongdoMapView
Before you start
Xcode 15 or newer
An API key issued in the Longdo Map console
A deployment target of iOS 16.0 or later
STEP 01
Get an API key
Issue a key in the Longdo Map console.
STEP 02
Add it with Swift Package Manager
Use File > Add Package Dependencies in Xcode and paste the package URL. Longdo Map Framework — a binary XCFramework — comes in automatically. It is SwiftPM-only.
Package URLSwift Package Manager
https://github.com/MapConductor/ios-for-longdo
Package.swiftSwift
dependencies: [
.package(url: "https://github.com/MapConductor/ios-sdk-core", from: "1.1.4"),
.package(url: "https://github.com/MapConductor/ios-for-longdo", from: "1.0.0"),
],
targets: [
.target(
name: "YourApp",
dependencies: [
.product(name: "MapConductorCore", package: "ios-sdk-core"),
.product(name: "MapConductorForLongdo", package: "ios-for-longdo"),
]
),
]STEP 03
Hand over the API key
Any one of three ways will do.
MyApp.swiftSwift
LongdoInitSDK.apiKey = "YOUR_LONGDO_API_KEY"
// or per view:
// LongdoMapView(state: state, apiKey: "YOUR_LONGDO_API_KEY") { ... }
// or add LONGDO_API_KEY to Info.plistVERIFY
What you should see
The setup is complete when a map centred on Bangkok renders with its marker and circle.
ContentView.swiftSwiftUI
import SwiftUI
import MapConductorCore
import MapConductorForLongdo
struct ContentView: View {
@StateObject private var state = LongdoViewState(
mapDesignType: LongdoDesign.Normal,
cameraPosition: MapCameraPosition(
position: GeoPoint(latitude: 13.7563, longitude: 100.5018),
zoom: 12
)
)
var body: some View {
LongdoMapView(state: state) {
Marker(
position: GeoPoint(latitude: 13.7563, longitude: 100.5018),
icon: DefaultMarkerIcon(label: "A")
)
Circle(
center: GeoPoint(latitude: 13.7563, longitude: 100.5018),
radiusMeters: 1500
)
}
}
}Map designs
LongdoDesign maps onto Longdo's base layers.
LongdoDesign
Notes
Normal / Easy / Political
The standard family
Pastel / PastelGray / Light / Gray
Muted styles
Night / Dark / Hard
Dark and high-contrast styles
Satellite / Hybrid
Satellite imagery and hybrid
Osm
OpenStreetMap-based
Troubleshooting
The map does not appear
- Check the API key really is reaching the SDK through one of the three routes.
- Check the deployment target is iOS 16.0 or later.
Performance drops with many markers
- Longdo renders each marker individually, so marker tiling and clustering do not help here. For very large marker sets, consider another provider.
The build fails
- Clean the build folder (Cmd+Shift+K).
- Delete ~/Library/Developer/Xcode/DerivedData and rebuild.
- Refresh the Swift Package Manager dependencies, and avoid mixing in CocoaPods.
Next
Circles are drawn as a geodesic ring polygon because Longdo's own Circle radius unit is ambiguous — so you can still specify the radius in metres.