当前位置:网站首页>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})
},边栏推荐
- [JS event -- event flow]
- Go branch and loop
- Didi open source Delta: AI developers can easily train natural language models
- The 11th Blue Bridge Cup single chip microcomputer provincial competition
- MySQL advanced SQL statement 2
- The 7th Blue Bridge Cup single chip microcomputer provincial competition
- Introduction to vmware workstation and vSphere
- 毕设-基于SSM电影院购票系统
- SQL: common SQL commands
- [live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!
猜你喜欢

2022-07-01: at the annual meeting of a company, everyone is going to play a game of giving bonuses. There are a total of N employees. Each employee has construction points and trouble points. They nee

Visual slam Lecture 3 -- Lie groups and Lie Algebras

Installation et utilisation du lac bleu

First acquaintance with P4 language

整理了一份ECS夏日省钱秘籍,这次@老用户快来领走

go 包的使用

JVM knowledge points

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

What is 5g industrial wireless gateway? What functions can 5g industrial wireless gateway achieve?

Typescript practice for SAP ui5
随机推荐
[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
Which product of anti-cancer insurance is better?
Use of go package
2022-07-01:某公司年会上,大家要玩一食发奖金游戏,一共有n个员工, 每个员工都有建设积分和捣乱积分, 他们需要排成一队,在队伍最前面的一定是老板,老板也有建设积分和捣乱积分, 排好队后,所有
The difference between vectorresize and reverse.
C language: examples of logical operation and judgment selection structure
【人员密度检测】基于形态学处理和GRNN网络的人员密度检测matlab仿真
Sorted out an ECS summer money saving secret, this time @ old users come and take it away
66.qt quick QML Custom Calendar component (supports vertical and horizontal screens)
How should the team choose the feature branch development mode or trunk development mode?
SQL: common SQL commands
Li Kou interview question 02.08 Loop detection
[JS -- map string]
Blue Bridge Cup SCM digital tube skills
The second game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
go 变量与常量
树莓派GPIO引脚控制红绿灯与轰鸣器
go 分支与循环
[JS event -- event flow]