当前位置:网站首页>Use of wechat applet map
Use of wechat applet map
2022-07-24 05:39:00 【XIE392】
Simple use of applet map Components
One 、wxml
<view class="map">
<map id="map" style="width: 100%;height: 100%;" longitude="{
{longitude}}" latitude="{
{latitude}}" markers="{
{markers}}" scale="{
{scale}}" show-location ></map>
</view>
Two 、wxss
.map{
width: 100vw;
height: 100vh;
}
3、 ... and 、JS
Page({
data: {
longitude:"", // Center longitude
latitude:"", // Center latitude
markers:[], // Marker points
scale:10 // Zoom level , The value range is 3-20
},
onLoad: function (options) {
// Get current geographic location
wx.getLocation({
success:(res)=>{
let {
latitude,longitude} = res;
this.setData({
latitude,
longitude
})
}
})
},
// Customize markers
getMarkers(){
// Suppose the request data returns markers
// ......
this.setData({
markers:[{
joinCluster:true, // Point aggregation or not
iconPath:"/images/login.png", // The image path in the project directory
longitude:“131.29”, // longitude
latitude:“78.21”, // latitude
width:30, // Label the width of the icon
height:30, // Mark the height of the icon
callout:{
// The bubble window above the marker point
content:" Text ", // Text
color:"red", // text color
fontSize:24, // Text size
borderRadius:10, // Border fillet
bgColor:"bule", // Background color
padding:10, // Leave text margins blank
display:"ALWAYS", // 'BYCLICK': Click to display ; 'ALWAYS': Chang Xian
textAlign:"center"// text alignment . Valid values : left, right, center
}
}]
})
}
})
边栏推荐
- 面向 对象
- MySQL之索引&执行计划
- Logic development analysis of LP dual currency liquidity pledge mining system
- LP双币流动性质押挖矿系统逻辑开发分析
- Substrate 技术及生态6月大事记 | Polkadot Decoded 圆满落幕,黑客松获胜项目为生态注入新生力量
- 函数多种类型
- How to use phpstudy to build WordPress website locally
- Substrate technology and ecology June memorabilia | Polkadot decoded came to a successful conclusion, and the hacker song winning project injected new forces into the ecosystem
- umi之define属性
- XML之建模
猜你喜欢

MySQL的分页你还在使劲的limit?

仿某网站百度地图页面 百度API

What is the function of key

公司女同事深夜11点让我去她住处修电脑,原来是C盘爆红,看我一招搞定女同事....的电脑

Vulnhub solidstate: 1 target penetration test

渗透测试知识---行业术语

canvas - 填充

Inventory Poka ecological potential project | cross chain characteristics to promote the prosperity of multi track

mysqldump 导出中文乱码

Variables and constants in C language
随机推荐
7. Draw a Bezier curve on the screen and smooth the curve with anti aliasing technology.
02 mobile terminal page adaptation
3. Draw a five sided cone with a square bottom on the screen. The bottom of the cone is on the xoz plane and the top of the cone is on the Y axis. Use the following figure to map the texture of the fo
Constructor_ Date constructor
【虚拟化】如何将虚拟机从workstation转换到esxi
Useref create dynamic reference
Principle of fusdt liquidity pledge mining development logic system
Polkadot | 一文解读颠覆传统社媒的Liberty计划如何在波卡落地
Why is music NFT popular? Polkadot may become the best choice for developing music NFT
如何强制卸载Google浏览器,不用担心Google打开为白板,亲测有效。
Promise_ Async and await
Some thoughts on being a professional
Hex to RGB
Development technical guide | the most complete technical documents, tutorials and courses of substrate and Polkadot
Draw a square on the screen and use ice BMP texture maps the square; Draw a yellow teapot after the square. Assuming that the square is transparent, draw the mixed effect of teapot and square; Adjust
OpenGL draws two points on the screen, a blue point on the right, using anti aliasing technology, and a red point on the left, without anti aliasing technology. Compare the difference between the two
ODS、数据集市、数据仓库的异同点
Node connects to MySQL and uses Navicat for visualization
盘点波卡生态潜力项目 | 跨链特性促进多赛道繁荣
MySQL的使用