baidu / amis

前端低代码框架,通过 JSON 配置就能生成各种页面。
https://baidu.github.io/amis/
Apache License 2.0
17.26k stars 2.51k forks source link

百度地图无法正常显示(从1.3.0开始) #3150

Closed 1178615156 closed 2 years ago

1178615156 commented 2 years ago

描述问题:

在版本1.2.1是能正常显示的 1638678252(1)

从1.3.0(以及1.4,1.5)开始都无法正常显示:

如何复现(请务必完整填写下面内容):

1638678364(1)

  1. 你是如何使用 amis 的? sdk

  2. 粘贴有问题的完整 amis schema 代码:

    
    
      {
        "config": {
          "animation": true,
          "animationDelay": 0,
          "animationDelayUpdate": 0,
          "animationDuration": 1000,
          "animationDurationUpdate": 300,
          "animationEasing": "cubicOut",
          "animationEasingUpdate": "cubicOut",
          "animationThreshold": 2000,
          "bmap": {
            "center": [
              120.13066322374,
              30.240018034923
            ],
            "roam": true
          },
          "legend": [
            {
              "data": [
                "bmap"
              ],
              "itemGap": 10,
              "itemHeight": 14,
              "itemWidth": 25,
              "padding": 5,
              "selected": {
                "bmap": true
              },
              "show": true
            }
          ],
          "series": [
            {
              "coordinateSystem": "bmap",
              "data": [
                {
                  "name": "广东",
                  "value": [
                    113.26653,
                    23.132191,
                    81
                  ]
                },
                {
                  "name": "北京",
                  "value": [
                    116.407526,
                    39.90403,
                    81
                  ]
                },
                {
                  "name": "上海",
                  "value": [
                    121.473701,
                    31.230416,
                    120
                  ]
                },
                {
                  "name": "江西",
                  "value": [
                    115.909228,
                    28.675696,
                    74
                  ]
                },
                {
                  "name": "湖南",
                  "value": [
                    112.98381,
                    28.112444,
                    112
                  ]
                },
                {
                  "name": "浙江",
                  "value": [
                    120.152791,
                    30.267446,
                    130
                  ]
                },
                {
                  "name": "江苏",
                  "value": [
                    118.763232,
                    32.061707,
                    139
                  ]
                }
              ],
              "label": {
                "formatter": "{b}",
                "margin": 8,
                "position": "top",
                "show": true
              },
              "name": "bmap",
              "symbolSize": 12,
              "type": "scatter"
            }
          ],
          "title": [
            {
              "itemGap": 10,
              "padding": 5,
              "text": "BMap-基本示例"
            }
          ],
          "tooltip": {
            "alwaysShowContent": false,
            "axisPointer": {
              "type": "line"
            },
            "borderWidth": 0,
            "formatter": "function (params) {        return params.name + ' : ' + params.value[2];    }",
            "hideDelay": 100,
            "padding": 5,
            "show": true,
            "showContent": true,
            "showDelay": 0,
            "textStyle": {
              "fontSize": 14
            },
            "trigger": "item",
            "triggerOn": "mousemove|click"
          }
        },
        "replaceChartOption": true,
        "type": "chart"
      }
cmdares commented 2 years ago

@nwind 您关注下。 目前系统设计中有个百度地图+动态渲染热力图的需求,经过尝试的确显示出不来。 同时希望官方能给个百度地图的案例。 谢谢。

juqkai commented 2 years ago

经过实验,是配置问题。 只需要在配置中添加:

config:{
 "backgroundColor": "rgba(255,255,255,0)",
...
}

原因是百度地图的图层变得不透明了。

1178615156 commented 2 years ago

经过实验,是配置问题。 只需要在配置中添加:

config:{
 "backgroundColor": "rgba(255,255,255,0)",
...
}

原因是百度地图的图层变得不透明了。

可以了谢谢.