{"id":13658641,"url":"https://github.com/icerockdev/moko-maps","last_synced_at":"2025-07-01T11:09:23.651Z","repository":{"id":36756184,"uuid":"229725077","full_name":"icerockdev/moko-maps","owner":"icerockdev","description":"Control your map from common code for mobile (android \u0026 ios) Kotlin Multiplatform development","archived":false,"fork":false,"pushed_at":"2022-04-12T11:29:25.000Z","size":409,"stargazers_count":94,"open_issues_count":20,"forks_count":17,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-07T05:04:01.130Z","etag":null,"topics":["android","ios","kotlin","kotlin-multiplatform","kotlin-native","moko"],"latest_commit_sha":null,"homepage":"https://moko.icerock.dev/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icerockdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-23T09:59:18.000Z","updated_at":"2025-03-19T12:40:40.000Z","dependencies_parsed_at":"2022-08-08T17:01:01.629Z","dependency_job_id":null,"html_url":"https://github.com/icerockdev/moko-maps","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/icerockdev/moko-maps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-maps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-maps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-maps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-maps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icerockdev","download_url":"https://codeload.github.com/icerockdev/moko-maps/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-maps/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262950389,"owners_count":23389645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","ios","kotlin","kotlin-multiplatform","kotlin-native","moko"],"created_at":"2024-08-02T05:01:01.325Z","updated_at":"2025-07-01T11:09:23.625Z","avatar_url":"https://github.com/icerockdev.png","language":"Kotlin","readme":"![moko-maps](https://user-images.githubusercontent.com/5010169/71351401-27c14d80-25a6-11ea-9183-17821f6d4212.png)  \n[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://img.shields.io/maven-central/v/dev.icerock.moko/maps) ](https://repo1.maven.org/maven2/dev/icerock/moko/maps) ![kotlin-version](https://kotlin-version.aws.icerock.dev/kotlin-version?group=dev.icerock.moko\u0026name=maps)\n\n# Mobile Kotlin maps module\nThis is a Kotlin Multiplatform library that provides controls of maps to common code.\n\n## Table of Contents\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Samples](#samples)\n- [Set Up Locally](#set-up-locally)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n- **Markers** - add markers to map from common code;\n- **Route** - draw route by waypoints from common code;\n- **Camera** - control camera (zoom, location) from common code.\n\n## Requirements\n- Gradle version 6.0+\n- Android API 16+\n- iOS version 9.0+\n\n## Installation\nroot build.gradle  \n```groovy\nallprojects {\n    repositories {\n        mavenCentral()\n        maven { url = \"https://mapbox.bintray.com/mapbox\" } // if mapbox required\n    }\n}\n```\n\nproject build.gradle\n```groovy\ndependencies {\n    commonMainApi(\"dev.icerock.moko:maps:0.6.0\")\n    commonMainApi(\"dev.icerock.moko:maps-google:0.6.0\")\n    commonMainApi(\"dev.icerock.moko:maps-mapbox:0.6.0\")\n}\n\nkotlin.targets\n    .matching { it is org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget }\n    .configureEach {\n        val target = this as org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget\n\n        target.binaries\n            .matching { it is org.jetbrains.kotlin.gradle.plugin.mpp.Framework }\n            .configureEach {\n                val framework = this as org.jetbrains.kotlin.gradle.plugin.mpp.Framework\n                val frameworks = listOf(\"Base\", \"Maps\").map { frameworkPath -\u003e\n                    project.file(\"../ios-app/Pods/GoogleMaps/$frameworkPath/Frameworks\").path.let { \"-F$it\" }\n                }.plus(\n                    project.file(\"../ios-app/Pods/Mapbox-iOS-SDK/dynamic\").path.let { \"-F$it\" }\n                )\n\n                framework.linkerOpts(frameworks)\n            }\n    }\n```\n\nWith [mobile-multiplatform-gradle-plugin](https://github.com/icerockdev/mobile-multiplatform-gradle-plugin) cocoapods configuration simplest:\n`build.gradle.kts`:\n```kotlin\ncocoaPods {\n    podsProject = file(\"ios-app/Pods/Pods.xcodeproj\")\n\n    precompiledPod(\n        scheme = \"GoogleMaps\",\n        onlyLink = true\n    ) { podsDir -\u003e\n        listOf(\n            File(podsDir, \"GoogleMaps/Base/Frameworks\"),\n            File(podsDir, \"GoogleMaps/Maps/Frameworks\")\n        )\n    }\n    precompiledPod(\n        scheme = \"Mapbox\",\n        onlyLink = true\n    ) { podsDir -\u003e\n        listOf(File(podsDir, \"Mapbox-iOS-SDK/dynamic\"))\n    }\n}\n```\n\nproject Podfile\n```ruby\npod 'GoogleMaps', '3.7.0'\npod 'Mapbox-iOS-SDK', '5.5.0'\n\n# GoogleMaps is static library that already linked in moko-maps-google. Remove duplicated linking.\npost_install do |installer|\n  host_targets = installer.aggregate_targets.select { |aggregate_target|\n    aggregate_target.name.include? \"Pods-\"\n  }\n  \n  host_targets.each do |host_target|\n    host_target.xcconfigs.each do |config_name, config_file|\n      config_file.frameworks.delete(\"GoogleMaps\")\n      config_file.frameworks.delete(\"GoogleMapsBase\")\n      config_file.frameworks.delete(\"GoogleMapsCore\")\n      \n      xcconfig_path = host_target.xcconfig_path(config_name)\n      config_file.save_as(xcconfig_path)\n    end\n  end\nend\n```\n\n## Usage\n### Markers\n```kotlin\nclass MarkerViewModel(\n    val mapsController: GoogleMapController\n) : ViewModel() {\n\n    fun start() {\n        viewModelScope.launch {\n            val marker1 = mapsController.addMarker(\n                image = MR.images.marker,\n                latLng = LatLng(\n                    latitude = 55.045853,\n                    longitude = 82.920154\n                ),\n                rotation = 0.0f\n            ) {\n                println(\"marker 1 pressed!\")\n            }\n\n            marker1.rotation = 90.0f\n        }\n    }\n}\n```\n### Route\n```kotlin\nclass MarkerViewModel(\n    val mapsController: GoogleMapController\n) : ViewModel() {\n\n    fun start() {\n        viewModelScope.launch {\n            val route = mapsController.buildRoute(\n                points = listOf(\n                    LatLng(\n                        latitude = 55.032200,\n                        longitude = 82.889360\n                    ),\n                    LatLng(\n                        latitude = 55.030853,\n                        longitude = 82.920154\n                    ),\n                    LatLng(\n                        latitude = 55.013109,\n                        longitude = 82.926480\n                    )\n                ),\n                lineColor = Color(0xCCCC00FF),\n                markersImage = MR.images.marker\n            )\n        }\n    }\n}\n```\n\n## Samples\nPlease see more examples in the [sample directory](sample).\n\n## Set Up Locally\nBefore open project need to setup `gradle.properties` with tokens:\n```\n# mapbox tokens by guide https://docs.mapbox.com/android/maps/guides/install/\nmapbox.secretToken=YOUR_SECRET_MAPBOX_KEY\nmapbox.publicToken=YOUR_PUBLIC_MAPBOX_KEY\n\n# google maps api key by guide https://developers.google.com/maps/documentation/android-sdk/get-api-key\ngoogleMaps.apiKey=YOUR_API_KEY\n```\n\n# ios info.plist setup with tokens:\n```\nMGLMapboxAccessToken=YOUR_PUBLIC_MAPBOX_KEY\nGoogleAPIkey=YOUR_API_KEY\n```\nadd the following entry to your `.netrc` file:\n```\nmachine api.mapbox.com\nlogin mapbox\npassword YOUR_SECRET_MAPBOX_KEY\n```\n\n- The [maps directory](maps) contains the base classes for all maps providers;\n- The [maps-google directory](maps-google) contains the Google Maps implementation;\n- The [maps-mapbox directory](maps-mapbox) contains the mapbox implementation;\n- In [sample directory](sample) contains sample apps for Android and iOS; plus the mpp-library connected to the apps.\n\n*before compilation of iOS target required `pod install` in `sample/ios-app` directory*\n\n## Contributing\nAll development (both new features and bug fixes) is performed in the `develop` branch. This way `master` always contains the sources of the most recently released version. Please send PRs with bug fixes to the `develop` branch. Documentation fixes in the markdown files are an exception to this rule. They are updated directly in `master`.\n\nThe `develop` branch is pushed to `master` on release.\n\nFor more details on contributing please see the [contributing guide](CONTRIBUTING.md).\n\n## License\n        \n    Copyright 2019 IceRock MAG Inc.\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n    \n       http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","funding_links":[],"categories":["Libraries"],"sub_categories":["📱 Device"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficerockdev%2Fmoko-maps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficerockdev%2Fmoko-maps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficerockdev%2Fmoko-maps/lists"}