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 8780103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:57:32+00:00 2026-06-13T19:57:32+00:00

I drew a line between 2 geopoints. How do I set screen zoom by

  • 0

I drew a line between 2 geopoints. How do I set screen zoom by these 2 geopoints. What I want to do is to show start and finish points by default. Is there any algorithm for that?

  • 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-13T19:57:34+00:00Added an answer on June 13, 2026 at 7:57 pm

    here what I did :

    private void centerMap() {
    
                int minLat = Integer.MAX_VALUE;
                int maxLat = Integer.MIN_VALUE;
                int minLon = Integer.MAX_VALUE;
                int maxLon = Integer.MIN_VALUE;
    
                for (Point point : twoPoints) {
    
                        int lat = (int) (point.getLatitude() * 1E6);
                        int lon = (int) (point.getLongitude() * 1E6);
    
                        maxLat = Math.max(lat, maxLat);
                        minLat = Math.min(lat, minLat);
                        maxLon = Math.max(lon, maxLon);
                        minLon = Math.min(lon, minLon);
                }
    
                        mc.zoomToSpan(Math.abs(maxLat - minLat), Math.abs(maxLon - minLon));
                mc.animateTo(new GeoPoint((maxLat + minLat) / 2, (maxLon + minLon) / 2));
        }
    

    (Where mc is your MapController)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an image that the user drew on a canvas and i want
I want to create a dropdown navigation. I drew this sketch: I already tried
Sample data: sDate NAME 2010-03-28 Andrew 2011-05-10 Drew 2010-04-11 Clary 2009-12-26 Kriz I want
Given the data set (8, 1, 6, 9, 3, 5, 4, 7) I drew
I'm trying to draw a line between two cities, on a world map, using
I drew rectangle diagram with boarder dotted blue line. I would like to rectangle
I've set up some polygons, drew them on the map just fine. I also
I manually drew a sphere, at last :) I want my sphere to be
Why is there a difference between how things are handled in a canvas? E.g
I drew the problem so you can better understand it: So, the question -

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.