【问题标题】:Draw line from center of a circle, Google Maps API, Android从圆心画线,Google Maps API,Android
【发布时间】:2016-07-30 09:09:59
【问题描述】:

我想添加一条从圆心到边框的线。

我已经画了圆圈:

circle = googleMap.addCircle(new CircleOptions()
   .center(point)
   .radius(radius)
   .strokeWidth(5.5f)
   .strokeColor(Color.RED));

现在我想画线……

polyLine = googleMap.addPolyline(new PolylineOptions()
     .add(centerPoint, borderPoint)
     .width(5)
     .color(Color.RED));

问题是我不知道如何获取圆的边界点。

我如何从圆的中心到边界画线,它怎么能像雷达一样在圆中旋转?

【问题讨论】:

    标签: android google-maps-android-api-2 geometry google-polyline


    【解决方案1】:

    通过使用GroundOverlay实现它

    groundOverlay = googleMap.addGroundOverlay(new GroundOverlayOptions()
         .image(BitmapDescriptorFactory.fromResource(R.drawable.radar_line))
         .position(point, radius*2)
         .transparency(0.7f)
         .bearing(radarRadius));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-11-21
      • 2014-02-07
      • 2013-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多