【问题标题】:Draw five transparent circles on the google map v2 by taking current location as the center of circle [duplicate]以当前位置为圆心在google map v2上绘制五个透明圆[重复]
【发布时间】:2013-05-22 00:42:03
【问题描述】:

我需要以当前位置为圆心,在 Google Maps v2 上绘制五个圆。这意味着五个圆中的每一个都具有相同的中心但具有不同的半径:第一个圆的半径为 10m,第二个圆的半径为 20m,第三个圆的半径为 30m,第四个圆的半径为 40m,第五个圆的半径为 50m。我正在使用谷歌地图 v2。

我还需要在圆的中心显示一个标记。

我正在尝试这样的方法在 Google Map v2 上画圆,但它只画了一个圆而不是五个外接圆

CircleOptions circleOptions = new CircleOptions()
                  .center(latLng)   //set center
                  .radius(500)   //set radius in meters
                  .fillColor(Color.TRANSPARENT)  //default
                  .strokeColor(0x10000000)
                  .strokeWidth(5);

                  myCircle = googleMap.addCircle(circleOptions);

我需要像这样画外接圆-

谁能帮我解决这个问题?我在 Google Map v2 中制作这个圆圈时遇到问题。任何帮助将不胜感激。

【问题讨论】:

  • 技术人员,我已从您帖子的第一段中删除了代码块。我看到你在之前的帖子中经常使用它们。我建议您不要这样做 - 代码块格式适用于代码元素,而不是用于突出显示文本,而且很难阅读。
  • 感谢您的建议。下次我会确保的。
  • 那个问题没有回答我的问题。您也可以阅读该问题的答案。

标签: java android google-maps-api-2


【解决方案1】:
for(int rad=100;rad<=500;rad+100)
{

    CircleOptions circleOptions = new CircleOptions()
              .center(latLng)   //set center
              .radius(rad)   //set radius in meters
              .fillColor(Color.TRANSPARENT)  //default
              .strokeColor(0x10000000)
              .strokeWidth(5);

              myCircle = googleMap.addCircle(circleOptions);
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多