首页 > 解决方案 > 如何在 LeafletJs 的弹出窗口中显示情节?

问题描述

我尝试了多种方法将绘图放在绘制多边形的弹出窗口中。

<head>
  <script src='https://cdn.plot.ly/plotly-latest.min.js'></script>
</head>
<div id='myDiv'><!-- Plotly chart will be drawn inside this DIV --></div>
<script>
    function plot(number)
    {
        var y = [];
        for (var i = 0; i < 500; i ++) {
          y[i] = Math.random();
        }
        var data = [
             {
                y: y,
                type: 'histogram',
                marker: {
                color: 'deepskyblue',
                },
              }
            ];
        Plotly.newPlot('myDiv', data);
    }
    plot(600);
</script>

多边形layer现在是如何在多边形弹出窗口中显示顶部图bind

layer.bindPopup(???)

标签: javascriptplottooltip

解决方案


推荐阅读