收藏
回答

接受后台参数后地图无法显示?

我接收到了后台传回的数据(地图中心点),但是地图始终无法显示



.js与.wxml:

Page({
  data: {
    longitude'', 
    latitude'',       
    markers: []
  },


  onLoad() {
    wx.request({
      url'http://localhost:8080/map',
      method'post',
      header: { 'Content-Type''application/x-www-form-urlencoded;charset:utf-8' },
      successres => {
        res = res.data
        this.setData({
          latitude: res.data[0].latitude,
          longitude: res.data[0].longitude
        })
        console.log(this.data.latitude)
      },
      failfunction () {
      }
    })
  }
})

<view>
<map longitude="{{ longitude }}"
  latitude="{{ lantitude }}"
  scale="16"
  min-scale="15"
  max-scale="19"
  show-location />
</view>
回答关注问题邀请回答
收藏

1 个回答

  • Cjiang
    Cjiang
    2022-03-18

    你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

    2022-03-18
    有用
    回复 1
    • 峻Sir
      峻Sir
      2022-03-18
      机型: Nexus 5(微信开发者工具提供)
      基础调试库: 2.19.4
      代码片段: 如上
      解决方案: 重启电脑(两次)
      详细过程: 我先是重启了微信开发者工具,又重启了自己用Eclipse(4.16.0)写的SpringBoot(2.4.3),都没有用,最后重启了两遍电脑好了(就挺离谱的......)
      2022-03-18
      回复
登录 后发表内容