免费国产欧美国日产_少妇AV一区二区三区无码_蜜桃精品av无码喷奶水小说_jk18禁网站视频_精产国品一二三级产品区别_被夫の上司に犯波多野结衣_78m成人手机免费看_最爽最刺激18禁视频_偷偷色噜狠狠狠狠的777米奇

易優(yōu)GEO 重磅上線 ~ 一站式GEO優(yōu)化工具,讓豆包、文心一言、DeepSeek 在回答中主動推薦你的品牌,搶占AI流量入口!  點擊查看

小程序模板網

小程序地圖map

發(fā)布時間:2018-04-20 10:36 所屬欄目:小程序開發(fā)教程
小程序地圖map

wxml:

 

					
  1. class="button" bindtap="getlocation" style="margin-top:30px" markers="{{markers}}">定位
  2. longitude="{{longitude}}" latitude="{{latitude}}" markers="{{markers}}" covers="{{covers}}" style="width: 100%; height: 300px;margin-top:30px">

js:

 

					
  1. //獲取應用實例
  2. var app = getApp()
  3. Page({
  4. data: {
  5. latitude: 0,//緯度
  6. longitude: 0,//經度
  7. speed: 0,//速度
  8. accuracy: 16,//位置精準度
  9. markers: [],
  10. covers: [],
  11. },
  12. onLoad: function () {
  13. },
  14. getlocation: function () {
  15. var markers = [{
  16. latitude: 28.211400,
  17. longitude: 112.914250,
  18. name: '喜地大廈',
  19. desc: '我的位置'
  20. }]
  21. var covers = [{
  22. latitude: 28.211400,
  23. longitude: 112.914250,
  24. iconPath: '/image/ic_position.png',
  25. rotate: 0
  26. }]
  27. this.setData({
  28. longitude: 112.914250,
  29. latitude: 28.211400,
  30. markers: markers,
  31. covers: covers,
  32. })
  33. wx.getLocation({
  34. type: 'gcj02',
  35. success: function (res) {
  36. var latitude = res.latitude
  37. var longitude = res.longitude
  38. var speed = res.speed
  39. var accuracy = res.accuracy
  40. console.log("latitude:" + latitude)
  41. console.log("longitude:" + longitude)
  42. console.log("speed:" + speed)
  43. console.log("accuracy:" + accuracy)
  44. wx.openLocation({
  45. latitude: latitude,
  46. longitude: longitude,
  47. scale: 28
  48. })
  49. }
  50. })
  51. }
  52. })


易優(yōu)小程序(企業(yè)版)+靈活api+前后代碼開源 碼云倉庫:starfork
本文地址:http://www.szcjxy.com/wxmini/doc/course/23750.html 復制鏈接 如需定制請聯系易優(yōu)客服咨詢: 點擊咨詢
在線客服