gpt4 book ai didi

javascript - Google Maps Api 将多边形更改为圆形

转载 作者:行者123 更新时间:2023-12-02 23:53:14 24 4
gpt4 key购买 nike

我有一些带有点的代码,可以绘制多边形。

这是代码:

  app.pts = [
[33.644631, -70.610453],
[33.637884, -70.608253],
[33.637566, -70.608704],
[33.638933, -70.610935],
[33.641044, -70.614036],
[33.641386, -70.614176]
];

app.map = L.map('map').setView(app.pt, 15);


app.polygon = L.polygon(app.pts, {
color: '#00ff00',
opacity: 0.6,
fillOpacity: 0.2
});

我想要的是一个圆圈,所以我的问题是:

如何修改此代码以便可以绘制圆形而不是多边形?

圆的半径为 50 米,中心为 33.644631, -70.610453

最佳答案

the documentation

app.circle = L.circle([33.644631, -70.610453], {radius: 50});

关于javascript - Google Maps Api 将多边形更改为圆形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55547542/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com