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

  • Home
  • SEARCH
  • 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 9118965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:16:52+00:00 2026-06-17T05:16:52+00:00

i m maikng an app using Maps. I m drawing circle on a specific

  • 0

i m maikng an app using Maps. I m drawing circle on a specific point using itemized overlay
and it works pretty fine. But i want to change the radius of that circle with the seekbar progress value. Can any body guide me to this
Thanks in advance.

  • 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-17T05:16:54+00:00Added an answer on June 17, 2026 at 5:16 am

    To Draw the Circle with on map We have to use itemozied Overlay But to change it with the Progress of Seek Bar We need to do the Following thing that will work with Seek Bar and also if you want to set the zoom level using seek bar It is handled in the following code Snippet

    Note: I have used seek bar with min value of 0 and max value of 9

       public void seekBarProgressEvent()
        {
            seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
    
                @Override
                public void onStopTrackingTouch(SeekBar seekBar) {
                    // TODO Auto-generated method stub
    
    
                }
    
                @Override
                public void onStartTrackingTouch(SeekBar seekBar) {
                    // TODO Auto-generated method stub
    
                }
    
                @Override
                public void onProgressChanged(SeekBar seekBar, int progress,
                        boolean fromUser) {
                    // TODO Auto-generated method stub
                    mapView.getOverlays().clear();
    
                    if(progress==0)
                    {
                        zoomLevel=17f;
    
    
    
                    }
                    else if(progress==1)
                    {
                        zoomLevel=16f;
    
    
    
                    }
                    else if(progress==2)
                    {
                        zoomLevel=15f;
    
    
    
                    }
                    else if(progress==3)
                    {
                        zoomLevel=14f;
    
    
    
                    }
                    else if(progress==4)
                    {
                        zoomLevel=14f;
    
    
    
                    }
                    else if(progress==5)
                    {
                        zoomLevel=13.50f;
    
    
    
                    }
                    else if(progress==6)
                    {
                        zoomLevel=13.10f;
    
    
                    }
                    else if(progress==7)
                    {
                        zoomLevel=12.85f;
    
    
                    }
                    else if(progress==8)
                    {
                        zoomLevel=12.10f;
    
    
                    }
                    else if(progress==9)
                    {
                        zoomLevel=11.85f;
    
                    }
                    //intent.putExtra("radius", radius);
                    //zoomLevel-=seekBar.getProgress();
                    Log.i("ZoomLevel", ""+zoomLevel);
                    mapView.getController().setZoom((int)zoomLevel);
                    Drawable drawable = getApplicationContext().getResources().getDrawable(R.drawable.mapmarker);
    // in Itemized overlay i m drawing circle of  Defined Radius like 100m 200m 300m etc
                    itemizedoverlay = new FolloowMapOverlay(drawable, getApplicationContext(),(radius));
                    MapPoint = new GeoPoint((int)(mylat*1E6), (int)(mylon*1E6));
                    OverlayItem overlayitem = new OverlayItem(MapPoint, "Current Location", "");
                    currentLocationOverlay = new CurrentLocationOverlay(drawable, getApplicationContext());
                    currentLocationOverlay.addOverlay(overlayitem);        
                    mapView.getOverlays().add(itemizedoverlay);  
                    mapView.getOverlays().add(currentLocationOverlay);  
                    mapView.invalidate();
                    mapController.setCenter(MapPoint);
                    mapController.animateTo(MapPoint);
                }
            });
    
        }
    

    The following is my Draw Circle method in my itemized overlay class

     private void drawCircleAtPoint(GeoPoint point, Canvas canvas, MapView mapView) {
    
            Projection projection = mapView.getProjection();        
            Point pt2 = new Point();
            projection.toPixels(point, pt2);
    // method that is used to conver the radius to pixel that takes input the radius and draw it on the coresponding pixels 
            float circleRadius = projection.metersToEquatorPixels(radius) * (1/ FloatMath.cos((float) Math.toRadians(MapController.mylat)));
            Paint circlePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
            Paint rectangle=new Paint(Paint.ANTI_ALIAS_FLAG);
            Log.d("Circular Radius", ""+circleRadius+"             "+radius);
    
            circlePaint.setColor(0x99000000);
            circlePaint.setStyle(Style.STROKE);
            canvas.drawCircle((float)pt2.x, (float)pt2.y, circleRadius, circlePaint);
    
    
    
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i m making APP which do image proceesing using java SE.i want to check
I am making an Android app using a tutorial, but I have an error
I'm making an PhoneGap app using Jquery Mobile, but I have a little problem
I'm making an app on PhoneGap using Jquery Mobile. The app runs fine on
I'm making a C#/XAML Windows 8 app using Bing Maps. I'm copying a bunch
I am making iOS app using Facebook Connect. But I can't find Facebook Connect
I am making a iPhone app using phone gap in that I want to
im making an app using SDK 7 (aos 2.1). But my app refuses to
I'm making an android app using eclipse. With that app it want to parse
Hello i am making an iphone app using the dropbox sdk and i want

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.