主题
地址关键字输入提示 FunctionCode | SER-B005
getSuggestion
- 用于获取输入关键字的补完与提示,帮助用户快速输入
注意
- 需要在 腾讯地图开放平台 申请地图定位需要的key
入参
名称 | 描述 | 类型 | 必填 |
---|---|---|---|
keyword | 搜索关键词,最多支持96个字符 | string | 是 |
key | 地图平台申请的key | string | 否 |
出参
名称 | 描述 | 类型 | 必填 |
---|---|---|---|
code | 状态码 | number | 否 |
result | 定位结果 | {data: [item], count: number} | 否 |
message | 提示信息 | string | 否 |
安装
bash
npm install @lkcloud/common-jssdk
使用
js
import { getSuggestion } from '@lkcloud/common-jssdk'
getSuggestion({
key: '腾讯地图开放平台申请的key',
keyword: '上海张江高科'
}).then((res) => {
console.log(res)
})
json
{
"code": 0,
"result": {
"data": [
{
"id": "13653186089699175564",
"title": "上海张江高科技园区(顾唐路)",
"address": "上海市浦东新区张东路1158号",
"category": "房产小区:产业园区",
"type": 0,
"location": {
"lat": 31.221419,
"lng": 121.631205
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "14956266231624555803",
"title": "上海张江高科技园区",
"address": "上海市浦东新区盛夏路与祖冲之路交叉口正北方向140米左右",
"category": "房产小区:产业园区",
"type": 0,
"location": {
"lat": 31.212856,
"lng": 121.628823
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "11485237043418591146",
"title": "上海张江高科技产业东区",
"address": "上海市浦东新区龙东大道6101号附近",
"category": "房产小区:产业园区",
"type": 0,
"location": {
"lat": 31.237173,
"lng": 121.698563
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "1277686276858543875",
"title": "上海张江高科技园区(金科路)",
"address": "上海市浦东新区金科路与华夏中路交叉口北40米",
"category": "房产小区:产业园区",
"type": 0,
"location": {
"lat": 31.17434,
"lng": 121.60264
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "17439751314633282634",
"title": "张江高科实验小学(藿香校区)",
"address": "上海市浦东新区张江镇藿香路88号(晨晖路)",
"category": "教育学校:小学",
"type": 0,
"location": {
"lat": 31.201046,
"lng": 121.593931
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "4689370741270570251",
"title": "张江高科实验小学(香楠校区)",
"address": "上海市浦东新区香楠路295号(丹桂路与香楠路交叉口东北角)",
"category": "教育学校:小学",
"type": 0,
"location": {
"lat": 31.215282,
"lng": 121.614436
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "10804258867963650411",
"title": "张江高科[地铁站]",
"address": "地铁2号线",
"category": "基础设施:交通设施:地铁站",
"type": 2,
"location": {
"lat": 31.201824,
"lng": 121.587598
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "15189475461957371304",
"title": "上海市张江高科技园区管委会",
"address": "上海市浦东新区张东路1158-3号楼附近",
"category": "机构团体:政府机关",
"type": 0,
"location": {
"lat": 31.221396,
"lng": 121.631348
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "2775984897684393085",
"title": "上海张江高科技园区(凌空北路)",
"address": "上海市浦东新区龙东高架路辅路与凌空北路交叉口东北60米",
"category": "房产小区:产业园区",
"type": 0,
"location": {
"lat": 31.238165,
"lng": 121.703713
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "10707897935178863106",
"title": "张江高科",
"address": "上海市浦东新区北蔡镇毕升路与张衡路交叉口东300米",
"category": "公司企业:公司企业",
"type": 0,
"location": {
"lat": 31.186149,
"lng": 121.586521
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "10084800161457926860",
"title": "上海市张江高科技园区安全监察队",
"address": "上海市浦东新区牛顿路111号",
"category": "机构团体:政府机关",
"type": 0,
"location": {
"lat": 31.208937,
"lng": 121.591457
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "9873679750360786452",
"title": "上海市张江高科技园综合发展有限公司",
"address": "上海市浦东新区秀沿路1417号",
"category": "公司企业:公司企业",
"type": 0,
"location": {
"lat": 31.137721,
"lng": 121.585156
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "5392482917089907435",
"title": "张江高科·集创公园",
"address": "上海市浦东新区银冬路491号",
"category": "房产小区:产业园区",
"type": 0,
"location": {
"lat": 31.206726,
"lng": 121.634351
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "16799863375910810362",
"title": "上海张江高科技园区-西北1门",
"address": "上海市浦东新区龙东大道与杨镇路交叉口南40米",
"category": "室内及附属设施:通行设施类:门/出入口",
"type": 0,
"location": {
"lat": 31.215908,
"lng": 121.594087
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "9478061919090906028",
"title": "张江高科汇康天地项目",
"address": "上海市浦东新区环桥路",
"category": "公司企业:公司企业",
"type": 0,
"location": {
"lat": 31.131048,
"lng": 121.605545
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "12348655369449483923",
"title": "上海市张江高科技园区10幢-北门",
"address": "上海市浦东新区祖冲之路",
"category": "室内及附属设施:通行设施类:外部门",
"type": 0,
"location": {
"lat": 31.201609,
"lng": 121.581128
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "3839947118016278196",
"title": "张江高科·天之骄子",
"address": "上海市浦东新区盛夏路58号",
"category": "房产小区:住宅区:住宅小区",
"type": 0,
"location": {
"lat": 31.21469,
"lng": 121.628896
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "4621331937642682570",
"title": "张江高科",
"address": "上海市浦东新区张江镇春晓路与碧波路交叉口正北方向40米左右",
"category": "公司企业:公司企业",
"type": 0,
"location": {
"lat": 31.205858,
"lng": 121.582472
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "16179457438679628405",
"title": "张江高科·领袖之都(东区)",
"address": "上海市浦东新区张东路1387号",
"category": "房产小区:产业园区",
"type": 0,
"location": {
"lat": 31.21845,
"lng": 121.635421
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
},
{
"id": "17680539018268185756",
"title": "张江高科四标园区",
"address": "上海市浦东新区祖冲之路887号",
"category": "房产小区:产业园区",
"type": 0,
"location": {
"lat": 31.206626,
"lng": 121.594382
},
"adcode": 310115,
"province": "上海市",
"city": "上海市",
"district": "浦东新区"
}
],
"count": 100,
"status": 0
}
}