How to draw circle around a pin using Google MAps API v2

后端 未结 5 1015
刺人心
刺人心 2021-01-31 20:31

I am using the new API(Google Map API V2) for my android application, i have done creating the map and adding markers to it, now my task is to manually create a circle around an

5条回答
  •  梦毁少年i
    2021-01-31 21:14

    This is better:

        double radiusInMeters = 100.0;
         //red outline
        int strokeColor = 0xffff0000;
        //opaque red fill
        int shadeColor = 0x44ff0000; 
    
    
        CircleOptions circleOptions = new CircleOptions().center(position).radius(radiusInMeters).fillColor(shadeColor).strokeColor(strokeColor).strokeWidth(2);
        mCircle = map.addCircle(circleOptions);
    
        MarkerOptions markerOptions = new MarkerOptions().position(position);
        mMarker = map.addMarker(markerOptions);
    

提交回复
热议问题