微信小程序开发中怎样使用Map对象
//index.js
//获取应用实例
const app = getApp()
Page({
data: {
map_width: 380
, map_height: 380
}
//show current position
, onLoad: function (options) {
console.log(options.schedule_id);
var that = this;
// 获取定位,并把位置标示出来
that.setData({
longitude: 113.324520
, latitude: 23.099994
, markers: [
{
id: 0
, iconPath: "/images/position.png"
, longitude: 113.324520
, latitude: 23.099994
, width: 30
, height: 30
}
]
})
//set the width and height
// 动态设置map的宽和高
wx.getSystemInfo({
success: function (res) {
console.log(res.windowWidth);
that.setData({
map_width: res.windowWidth
, map_height: res.windowWidth
, controls: [{
id: 1,
iconPath: '/images/location.png',
position: {
最后
以上就是拼搏大船最近收集整理的关于微信小程序开发中怎样使用Map对象的全部内容,更多相关微信小程序开发中怎样使用Map对象内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复