qiuxiang / react-native-baidumap-sdk

React Native BaiduMap SDK for Android + iOS
MIT License
330 stars 71 forks source link

Geocode 地理编码/逆编码模块 有病发次数限制吗? #137

Open sej1228 opened 5 years ago

qiuxiang commented 5 years ago

不能并发,同一时间只能有一个请求

sej1228 commented 5 years ago

不能并发,同一时间只能有一个请求

我在一个页面的生命周期里调用里逆编码,一秒钟之内近两次这个页面,第二次就会请求失败? 我该怎么处理这种情况/

qiuxiang commented 5 years ago

因为返回的是 promise,你可以 await

sej1228 commented 5 years ago

因为返回的是 promise,你可以 await

this.setState({detail: data, isLoading: false}, async ()=>{ const {location} = data const {latitude,longitude} = location const reverseResult = await Geocode.reverse({ latitude, longitude }) this.setState({address:reverseResult.address}) } );

sej1228 commented 5 years ago

因为返回的是 promise,你可以 await 经纬度返回的这种数据5e-324,是哪里出了错呢?

qiuxiang commented 5 years ago

是否可提供一段可以直接运行的,可重现的代码

PL-SQL commented 5 years ago

5e-324 是不是权限

sej1228 commented 5 years ago

对的,获取位置权限

                            宋恩骥

                                邮箱:279705954@qq.com

    签名由 网易邮箱大师 定制

在2018年11月09日 10:51,PL-SQL 写道: 5e-324 是不是权限

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread. {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/qiuxiang/react-native-baidumap-sdk","title":"qiuxiang/react-native-baidumap-sdk","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/qiuxiang/react-native-baidumap-sdk"}},"updates":{"snippets":[{"icon":"PERSON","message":"@PL-SQL in #137: 5e-324 是不是权限"}],"action":{"name":"View Issue","url":"https://github.com/qiuxiang/react-native-baidumap-sdk/issues/137#issuecomment-437232523"}}} [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/qiuxiang/react-native-baidumap-sdk/issues/137#issuecomment-437232523", "url": "https://github.com/qiuxiang/react-native-baidumap-sdk/issues/137#issuecomment-437232523", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } }, { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Re: [qiuxiang/react-native-baidumap-sdk] Geocode 地理编码/逆编码模块 有病发次数限制吗? (#137)", "sections": [ { "text": "", "activityTitle": "PL-SQL", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@PL-SQL", "facts": [

] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"qiuxiang/react-native-baidumap-sdk\",\n\"issueId\": 137,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"qiuxiang/react-native-baidumap-sdk\",\n\"issueId\": 137\n}" }, { "targets": [ { "os": "default", "uri": "https://github.com/qiuxiang/react-native-baidumap-sdk/issues/137#issuecomment-437232523" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 401464487\n}" } ], "themeColor": "26292E" } ]

sej1228 commented 5 years ago

因为没有拿到经纬度

                            宋恩骥

                                邮箱:279705954@qq.com

    签名由 网易邮箱大师 定制

在2018年11月09日 11:01,enji_song 写道: 对的,获取位置权限

                            宋恩骥

                                邮箱:279705954@qq.com

    签名由 网易邮箱大师 定制

在2018年11月09日 10:51,PL-SQL 写道: 5e-324 是不是权限

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread. {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/qiuxiang/react-native-baidumap-sdk","title":"qiuxiang/react-native-baidumap-sdk","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/qiuxiang/react-native-baidumap-sdk"}},"updates":{"snippets":[{"icon":"PERSON","message":"@PL-SQL in #137: 5e-324 是不是权限"}],"action":{"name":"View Issue","url":"https://github.com/qiuxiang/react-native-baidumap-sdk/issues/137#issuecomment-437232523"}}} [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/qiuxiang/react-native-baidumap-sdk/issues/137#issuecomment-437232523", "url": "https://github.com/qiuxiang/react-native-baidumap-sdk/issues/137#issuecomment-437232523", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } }, { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Re: [qiuxiang/react-native-baidumap-sdk] Geocode 地理编码/逆编码模块 有病发次数限制吗? (#137)", "sections": [ { "text": "", "activityTitle": "PL-SQL", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@PL-SQL", "facts": [

] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"qiuxiang/react-native-baidumap-sdk\",\n\"issueId\": 137,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"qiuxiang/react-native-baidumap-sdk\",\n\"issueId\": 137\n}" }, { "targets": [ { "os": "default", "uri": "https://github.com/qiuxiang/react-native-baidumap-sdk/issues/137#issuecomment-437232523" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 401464487\n}" } ], "themeColor": "26292E" } ]