Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/msysh/aws-sample-location-service-route-for-ios
This project is an extremely simple code that runs the route calculation feature of Amazon Location Service on iOS and draws the route on a map.
https://github.com/msysh/aws-sample-location-service-route-for-ios
amazon-location-service cdk swiftui
Last synced: 30 days ago
JSON representation
This project is an extremely simple code that runs the route calculation feature of Amazon Location Service on iOS and draws the route on a map.
- Host: GitHub
- URL: https://github.com/msysh/aws-sample-location-service-route-for-ios
- Owner: msysh
- License: apache-2.0
- Created: 2024-12-02T03:07:19.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-02T04:23:37.000Z (about 1 month ago)
- Last Synced: 2024-12-02T05:25:31.847Z (about 1 month ago)
- Topics: amazon-location-service, cdk, swiftui
- Language: Swift
- Homepage: https://blog.msysh.me/posts/2024/12/draw-route-using-amazon-location-service-on-ios.html
- Size: 222 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Amazon Location Service Route Demo for iOS
[日本語の情報(for Japanese)](https://blog.msysh.me/posts/2024/12/draw-route-using-amazon-location-service-on-ios.html)
This iOS demo application showcases the integration of Amazon Location Service for calculating truck-specific routes using SwiftUI. The app demonstrates how to implement route calculations with custom truck parameters while avoiding toll roads and tunnels.
It's an extremely simple code, so it's ideal for those who are just starting to use Amazon Location Service for iOS.
![Sample Image](./doc/sample-image.png)
## Features
- Interactive map display using MapLibre
- Truck-specific route calculation
- Custom vehicle parameters support including:
- Axle count
- Engine type
- Gross weight
- Hazardous cargo handling
- Vehicle dimensions
- Speed limitations
- Route avoidance options for toll roads and tunnels
- Visual route display on the map## Prerequisites
- Xcode 15.0 or later
- iOS 15.0 or later
- AWS Account with Amazon Location Service configured
- Amazon Cognito Identity Pool## Setup
### 1. Clone this repository
```bash
git clone https://github.com/msysh/aws-sample-location-service-route-for-ios.git
cd aws-sample-location-service-route-for-ios
```### 2. Install dependencies:
```bash
cd cdk
npm install
```### 3. Deploy the CDK stack:
```bash
npx cdk deploy
```### 4. Open the iOS project in Xcode:
```bash
cd ios/AmazonLocationServiceRouteDemo
open AmazonLocationServiceRouteDemo.xcodeproj
```### 5. Configure Info.plist
Configure following properties:
| Key | Description | Example Value |
| --- | --- | --- |
| AmazonCognitoIdentityPoolId | Cognito ID Pool's ID | `:` |
| AmazonLocationServiceApiKey | API Key value | `v1.public.a1b2c3...` |
| AmazonLocationServiceMapStyle | Map style | `Standard`, `Monochrome` ... etc |
| AmazonLocationServiceRegion | AWS region | `us-east-1` |### 6. Build and run the application
## Cleanup
Before `cdk destroy`, you need delete API key of Location Service following command:
```bash
aws location delete-key --key-name ${API_KEY_NAME} --force-delete
```And then, you can delete AWS resources following command:
```bash
cd aws-sample-location-service-route-for-ios/cdk
cdk destroy
```## Project Structure
- `/cdk` - AWS CDK infrastructure code
- `/ios` - iOS application source code## License
Apache-2.0 license