当前位置:网站首页>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})
},边栏推荐
- Which insurance company has a better product of anti-cancer insurance?
- 近段时间天气暴热,所以采集北上广深去年天气数据,制作可视化图看下
- XSS prevention
- [personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
- 手撕——排序
- Object oriented thinking
- 0基础如何学习自动化测试?按照这7步一步一步来学习就成功了
- Spring recruitment of Internet enterprises: Kwai meituan has expanded the most, and the annual salary of technical posts is up to nearly 400000
- uni-app - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
- MySQL error: expression 1 of select list is not in group by claim and contains nonaggre
猜你喜欢

A thorough understanding of the development of scorecards - the determination of Y (Vintage analysis, rolling rate analysis, etc.)

Li Kou interview question 02.08 Loop detection

Homework in Chapter 3 of slam course of dark blue vision -- derivative application of T6 common functions

The 8th Blue Bridge Cup single chip microcomputer provincial competition

Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs

Go language introduction

MySQL error: expression 1 of select list is not in group by claim and contains nonaggre

JVM knowledge points
![[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)](/img/e3/fc2e78dc1e3e3cacbd1a389c82d33e.jpg)
[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)

Pandora IOT development board learning (RT thread) - Experiment 1 LED flashing experiment (learning notes)
随机推荐
go 变量与常量
Monkey test
[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)
Force buckle 540 A single element in an ordered array
Go function
集成底座方案演示说明
Feature Engineering: summary of common feature transformation methods
How to solve the code error when storing array data into the database
[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
Bitmap principle code record
Target free or target specific: a simple and effective zero sample position detection comparative learning method
Class design basis and advanced
Welcome the winter vacation multi school league game 2 partial solution (B, C, D, F, G, H)
66.qt quick QML Custom Calendar component (supports vertical and horizontal screens)
Set vscode. When double clicking, the selected string includes the $symbol - convenient for PHP operation
The difference between vectorresize and reverse.
Typescript practice for SAP ui5
SQL:常用的 SQL 命令
uni-app - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
Pandora IOT development board learning (RT thread) - Experiment 1 LED flashing experiment (learning notes)