Draw five transparent circumcircles on the Google Map v2

后端 未结 1 1612
[愿得一人]
[愿得一人] 2021-01-14 22:11

I have recently started working with Google Map v2 and figured it out lot of things have been changed. Previously I was using Google Map v1 so I was using the concept of Map

相关标签:
1条回答
  • Just add a circle to the map using googleMap.addCircle(...)

    see documentation

    Update:

    I did exactly as I said to do and I had no problem doing what you want

    enter image description here

    here is the code, super simple super basic....

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
        View view = super.onCreateView(inflater, container, savedInstanceState);
        GoogleMap map = getMap();
    
        int radius = 500;
    
        for(int i=0; i<5; i++){
            map.addCircle(new CircleOptions().center(new LatLng(0,0)).radius(radius).fillColor(0x30000000).strokeWidth(3));
            radius += 500;
        }
        return view;
    }
    
    0 讨论(0)
提交回复
热议问题