当前位置:网站首页>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})
},边栏推荐
- [ibdfe] matlab simulation of frequency domain equalization based on ibdfe
- Recyclerview add header
- Bitmap principle code record
- How to solve the problem that objects cannot be deleted in Editor Mode
- Monkey test
- 向数据库中存入数组数据,代码出错怎么解决
- Welcome the winter vacation multi school league game 2 partial solution (B, C, D, F, G, H)
- Li Kou interview question 02.08 Loop detection
- 潘多拉 IOT 开发板学习(RT-Thread)—— 实验1 LED 闪烁实验(学习笔记)
- The original author is out! Faker. JS has been controlled by the community..
猜你喜欢

0 foundation how to learn automated testing? Follow these seven steps step by step and you will succeed

Fluent icon demo

Typescript practice for SAP ui5

The 10th Blue Bridge Cup single chip microcomputer provincial competition

The second game of the 12th provincial single chip microcomputer competition of the Blue Bridge Cup

The first game of the 12th Blue Bridge Cup single chip microcomputer provincial competition

Lei Jun wrote a blog when he was a programmer. It's awesome

Yyds dry inventory compiler and compiler tools

The 5th Blue Bridge Cup single chip microcomputer provincial competition

Set vscode. When double clicking, the selected string includes the $symbol - convenient for PHP operation
随机推荐
Li Kou interview question 02.08 Loop detection
Go branch and loop
Which insurance company has a better product of anti-cancer insurance?
Microsoft Research Institute's new book "Fundamentals of data science", 479 Pages pdf
JVM知识点
Introduction to vmware workstation and vSphere
[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
微信小程序 - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
Basic operations of MySQL database (based on tables)
The 5th Blue Bridge Cup single chip microcomputer provincial competition
Recently, the weather has been extremely hot, so collect the weather data of Beijing, Shanghai, Guangzhou and Shenzhen last year, and make a visual map
Demonstration description of integrated base scheme
Raspberry pie GPIO pin controls traffic light and buzzer
Opencv learning example code 3.2.4 LUT
Influence of air resistance on the trajectory of table tennis
First acquaintance with P4 language
2022-07-01:某公司年会上,大家要玩一食发奖金游戏,一共有n个员工, 每个员工都有建设积分和捣乱积分, 他们需要排成一队,在队伍最前面的一定是老板,老板也有建设积分和捣乱积分, 排好队后,所有
Use of go package
【无线图传】基于FPGA的简易无线图像传输系统verilog开发,matlab辅助验证
手撕——排序