0

Android Google maps V2 How to draw a Custom Views(1/3 filled circle) on map where can i get canvas object to draw.As all new classes are final classes I can't extend them.

I need to draw a some cutom views on the map.I am upgrading from v1 to v2.The Overlays has been deprecated.I tries with Tile Provider but it is not drawing anything.

  • Have you seen that: http://stackoverflow.com/questions/20382823/google-maps-api-v2-draw-part-of-circle-on-mapfragment/20408460 ? – user2808624 Dec 04 '15 at 15:12

1 Answers1

0
exampleButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                GroundOverlayOptions overlayOptions = new GroundOverlayOptions()
                        .image(BitmapDescriptorFactory.fromResource(R.drawable.testImage))
                        .position(new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude()), 8600f, 6500f);
                map.addGroundOverlay(overlayOptions);
            }
        });

This is the code to draw an image at a specified lat long which is working for google maps v2. You can basically get an image of 1/3 filled circle and set it to the lat long you want.

Hope it helps.

Sidakpreet N
  • 137
  • 1
  • 1
  • 10