Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9125421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:48:01+00:00 2026-06-17T06:48:01+00:00

I am trying to show a MapView as a circle on Android just like

  • 0

I am trying to show a MapView as a circle on Android just like that:

protected void onDraw(Canvas canvas) {
    Path path = new Path();
    path.addCircle(400,200,100,Direction.CW);
    canvas.clipPath(path);
    super.onDraw(canvas);
}

Unfortunately the MapView (v2: com.google.android.gms.maps.MapView) component seems to ignore that and instead just taking the bounds/rect of that circle to draw the map 🙁

I’ve been searching the web for a while now, not finding a nice solution for that.

Is this even possible? (The Blundell solution is not working for me because I want the background to be visible around the map)

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:48:02+00:00Added an answer on June 17, 2026 at 6:48 am

    Android supports a hardware acceleration since API level 11. The problem is that not all drawing operations are supported when hardware acceleration is turned on. And Canvas.clipPath is one of them. Complete list of unsupported operations can be found here

    You can try to implement what you want without using clipPath or just disable hardware acceleration.

    To disable hardware acceleration on application level make sure you have targetSdkVersion 11 or higher and use hardwareAccelerated tag in the AndroidManifest:

    <application android:hardwareAccelerated="false" ...>
    

    You can disable hardware acceleration only for the particular view using the following method.

    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    public void enableHardwareAcceleration(View view, boolean enabled) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            if (enabled) {
                view.setLayerType(View.LAYER_TYPE_HARDWARE, null);
            } else {
                view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
            }
        }
    }
    

    Note that you have to use TargetApi annotation and check if device android version is Honeycomb or higher, otherwise Eclipse may produce an error.

    If code from your question isn’t working try to replace it with this:

    @Override
    protected void dispatchDraw(Canvas canvas) {
        Path path = new Path();
        int count = canvas.save();
    
        path.addCircle(400,200,100,Direction.CW);
    
        canvas.clipPath(path);
        super.dispatchDraw(canvas);
        canvas.restoreToCount(count);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm just trying to create a generic mapView in android and put a
I'm trying to show a MapView inside a fragment (using the hacked compatibility library).
I'm trying to show a simple countdown from 2 hours like so: $(function ()
I am trying to show a modal view controller that hovers over another viewcontroller.
I was trying to show a text gradually on the screen (like marquee). e.g.
Im trying to show the UIActivityIndicator on my NavigationBar in this MapView with the
I'm trying to use the Google directions API to show directions on my mapview
I am trying to show Google Map on the Top Half of the Android
I'm trying to show a dialog box that says waiting for GPS fix on
I'm trying to show a annotation callout right after the mapview loads. I'm sure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.