{"id":22451456,"url":"https://github.com/dwd-fe/react-native-amap","last_synced_at":"2025-08-02T00:32:24.127Z","repository":{"id":57335147,"uuid":"57965351","full_name":"dwd-fe/react-native-amap","owner":"dwd-fe","description":"React Native AMap component for iOS + Android","archived":false,"fork":false,"pushed_at":"2017-03-20T13:41:07.000Z","size":64808,"stargazers_count":87,"open_issues_count":15,"forks_count":25,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-28T14:18:03.689Z","etag":null,"topics":["amap","gaode","react-native"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dwd-fe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-03T11:49:32.000Z","updated_at":"2024-03-01T17:31:17.000Z","dependencies_parsed_at":"2022-08-30T21:51:44.864Z","dependency_job_id":null,"html_url":"https://github.com/dwd-fe/react-native-amap","commit_stats":null,"previous_names":["dianwoba/react-native-amap"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwd-fe%2Freact-native-amap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwd-fe%2Freact-native-amap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwd-fe%2Freact-native-amap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwd-fe%2Freact-native-amap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dwd-fe","download_url":"https://codeload.github.com/dwd-fe/react-native-amap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228419606,"owners_count":17916772,"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":["amap","gaode","react-native"],"created_at":"2024-12-06T06:08:01.158Z","updated_at":"2024-12-06T06:08:02.064Z","avatar_url":"https://github.com/dwd-fe.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-amap\nReact Native AMap component for iOS + Android\n\nreact-native-amap-view is a wrapper of AMap's Libraries inspired by react-native-maps and it's usable in Android and iOS\n\n##Demo\n\n![demo-gif](https://raw.githubusercontent.com/dianwoba/react-native-amap/master/doc/assets/demo.gif)\n\n## Installation\n\n`npm install react-native-amap-view --save`\n\n### iOS\nOnly test on react-native 0.29\n* `Add Files to \"xxx\"` on `Libaries` folder, and select `RCTAMap.xcodeproj`\n* In `Link Binary With Libraries`, add `libRCTAMap.a`\n* In `Link Binary With Libraries`, add `MAMapKit.framework` and `AMapSearchKit.framework`\n* In `Framework Search Paths`, add `$(PROJECT_DIR)/../node_modules/react-native-amap-view/ios`\n* `Add Files to \"xxx\"` on your project, and select `AMap.bundle`\n* In `Link Binary With Libraries`, add other libs, see [here](http://lbs.amap.com/api/ios-sdk/guide/create-project/manual-configuration/#t3)\n* Make sure `NSAllowsArbitraryLoads` in `Info.plist` is `true`\n* Make sure `LSApplicationQueriesSchemes` has `iosamap`\n* In `Info.plist`, Add `Privacy - Location Usage Description`=`NSLocationWhenInUseUsageDescription`(for foreground usage) \n  or `NSLocationAlwaysUsageDescription`(for background usage). see [here](http://lbs.amap.com/api/ios-sdk/guide/draw-on-map/draw-location-marker/)\n\n### Android\n* `android/setting.gradle`:\n```\ninclude ':react-native-amap-view'\nproject(':react-native-amap-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-amap-view/android')\n```\n* `android/app/build.gradle`:\n```\n    compile project(\":react-native-amap-view\")\n```\n* `MainApplication.java`:\n```\nimport com.dianwoba.rctamap.AMapPackage;\n      \n      return Arrays.\u003cReactPackage\u003easList(\n          ...\n          , new AMapPackage()\n          ...\n```\n* `AndroidManifest.xml`:\n```\n    \u003c!-- Geolocation --\u003e\n    \u003cuses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /\u003e\u003c!--用于访问GPS定位--\u003e\n    \u003cuses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" /\u003e\u003c!--用于进行网络定位--\u003e\n    \u003cuses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" /\u003e\u003c!--用于访问wifi网络信息，wifi信息会用于进行网络定位--\u003e\n    \u003cuses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\" /\u003e\u003c!--这个权限用于获取wifi的获取权限，wifi信息会用来进行网络定位--\u003e\n    \u003cuses-permission android:name=\"android.permission.READ_PHONE_STATE\" /\u003e\n    \u003cuses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\" /\u003e\n    \u003cuses-permission android:name=\"android.permission.ACCESS_MOCK_LOCATION\" /\u003e\n\n    \u003capplication ...\u003e\n      \u003cmeta-data android:name=\"com.amap.api.v2.apikey\" android:value=\"cc5fea37cc1d8bd20434a0020d85ec12\"\u003e\u003c/meta-data\u003e\n\n```\n\n## Usage\n```\nimport AMapView from 'react-native-amap-view'\n\n  render(){\n    return (\u003cView style={{flex: 1, backgroundColor: '#f00'}}\u003e\n      \u003cAMapView initialRegion={{latitude: 30.315888, longitude: 120.165817}} showsUserLocation\u003e\n        \u003cAMapView.Marker pinColor=\"green\" draggable title='xxx' description=\"这是一个好地方\" coordinate={{latitude: 30.315888, longitude: 120.165817}} /\u003e\n      \u003c/AMapView\u003e\n    \u003c/View\u003e);\n  }\n```\n\nATTENTION: Make sure that the ancestor containers of AMapView is flexed, otherwise you will see an empty view!\n\n### User Location\nDont use the `showsUserLocation` property for it has some bugs. \nInstead, use `geolocation` in iOS and [react-native-amap-location](https://github.com/xiaobuu/react-native-amap-location) in android.\nThen render a new marker for the user location.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwd-fe%2Freact-native-amap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwd-fe%2Freact-native-amap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwd-fe%2Freact-native-amap/lists"}