更新记录
1.0.5(2026-01-20) 下载此版本
解决已知bug
1.0.4(2026-01-20) 下载此版本
修复已知bug
1.0.3(2025-12-30) 下载此版本
修复已知bug
查看更多平台兼容性
uni-app(4.01)
| Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
|---|---|---|---|---|---|---|---|---|
| - | - | √ | √ | √ | - | √ | √ | - |
| 微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 小红书小程序 | 快应用-华为 | 快应用-联盟 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| - | - | - | - | - | - | - | - | - | - | - | - |
xiaoaping-googleMap
基于 genos-googlemap 的基础优化了一下
注意
manifest.json 打开定位
组件不能和h5谷歌地图 同时存在需包裹 ifdef APP
引入组件
<!-- #ifdef APP -->
<xiaoaping-googleMap ref="googleMap" googleKey="你的谷歌key" @confirmAddress="confirmAddress"></xiaoaping-googleMap>
<!-- #endif -->
国际化使用
如需适配多语言只需要把props里面的notSelectedText、confirmText、searchText内容替换一下
<!-- #ifdef APP -->
<xiaoaping-googleMap
ref="googleMap"
googleKey="你的谷歌key"
:notSelectedText="$t('notSelectedText')"
:confirmText="$t('confirmText')"
:searchText="$t('searchText')"
@confirmAddress="confirmAddress">
</xiaoaping-googleMap>
<!-- #endif -->
打开弹窗
this.$nextTick(() => {
this.$refs.googleMap.open()
})
接收返回
confirmAddress(e){
console.log(e);
}
参数说明
| 参数名 | 默认值 | 说明 |
|---|---|---|
| googleKey | '' |
谷歌地图 Web Key(必填),用于加载 Google Maps JS SDK |
| lang | cn |
地图语言,常用值:cn、en、ja、ko 等 |
| mapId | '' |
谷歌地图官方 Map ID,用于自定义地图样式(可选) |
| notSelectedText | 请选择地址 |
未选择地址时的提示文案 |
| confirmText | 确认 |
右上角确认按钮文字 |
| searchText | 搜索地址 |
搜索输入框占位提示文字 |
返回说明
{
"compound_code": "中国北京市东城区",
"latlng": {
"lat": 39.899784,
"lng": 116.40007
},
"name": "北京中铁创世国际文化发展有限公司"
}

收藏人数:
下载插件并导入HBuilderX
赞赏(0)

下载 89
赞赏 0
下载 11303496
赞赏 1869
赞赏
京公网安备:11010802035340号