当前位置:网站首页>Wechat applet map annotation
Wechat applet map annotation
2022-07-02 04:04:00 【Minced pork, pumpkin and scallop】
// Create click event
<view bindtap="click"> Map perimeter ></view>
// Loading event Send a request Get the longitude and latitude stored in the database
onLoad: function (options) {
let _this = this
let id = options.id;
wx.request({
url: 'http://www.www.com/index.php/msg',
data:{id:id},
success(e){
let data = e.data.data;
let latitude= e.data.data.latitude;
let longitude=e.data.data.longitude;
_this.setData({data,latitude,longitude})
}
})
},
// Click event Jump to the page Pass latitude to longitude Map page
click(){
let latitude = this.data.latitude;
let longitude = this.data.longitude;
wx.navigateTo({
url: '/pages/map/map?latitude='+latitude+"&&longitude="+longitude,
})
},
// Map page
<map markers="{
{array}}" latitude="{
{array[0]['latitude']}}" longitude="{
{array[0]['longitude']}}"></map>
// Map page initialization data
data: {
array:[],
},
// Map page connection value Render view
onLoad: function (options) {
let array = [{
latitude:options.latitude,
longitude:options.longitude
}]
this.setData({array})
},
边栏推荐
- It took me only 3 months to jump out of the comfort zone and become an automated test engineer for 5 years
- 【IBDFE】基于IBDFE的频域均衡matlab仿真
- Bitmap principle code record
- Recyclerview add header
- Uni app - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
- The fourth provincial competition of Bluebridge cup single chip microcomputer
- Flutter中深入了解MaterialApp,常用属性解析
- 初识P4语言
- go 语言命名规范
- SQL Yiwen get window function
猜你喜欢
Homework in Chapter 3 of slam course of dark blue vision -- derivative application of T6 common functions
Installation et utilisation du lac bleu
QT designer plug-in implementation of QT plug-in
66.qt quick-qml自定义日历组件(支持竖屏和横屏)
BiShe cinema ticket purchasing system based on SSM
[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
Jetpack之LiveData扩展MediatorLiveData
66.qt quick QML Custom Calendar component (supports vertical and horizontal screens)
MySQL error: expression 1 of select list is not in group by claim and contains nonaggre
The confusion I encountered when learning stm32
随机推荐
The 8th Blue Bridge Cup single chip microcomputer provincial competition
整理了一份ECS夏日省钱秘籍,这次@老用户快来领走
Interface debugging tool simulates post upload file - apipost
手撕——排序
Vite: scaffold assembly
初识P4语言
u本位合约爆仓清算解决方案建议
go 包的使用
Document declaration and character encoding
Force buckle 540 A single element in an ordered array
Blue Bridge Cup SCM digital tube skills
Where can I buy cancer insurance? Which product is better?
JVM knowledge points
Use a mask to restrict the input of the qlineedit control
文档声明与字符编码
Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)
pip 安装第三方库
Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs
go 分支与循环
The 7th Blue Bridge Cup single chip microcomputer provincial competition