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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:47:40+00:00 2026-05-25T02:47:40+00:00

I have an array of latitude and longitude points. I use them to make

  • 0

I have an array of latitude and longitude points. I use them to make markers on the map. What can I do to show all of the markers on the map at the same time. eg make a good fit so that if the markers are within a city I zoom it in to only show the city and not the whole state, country etc…

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-05-25T02:47:40+00:00Added an answer on May 25, 2026 at 2:47 am

    something like this might help

    private void centerGroup(int groupId){
        if(groupId>0){
            int minLat = Integer.MAX_VALUE;
            int maxLat = Integer.MIN_VALUE;
            int minLon = Integer.MAX_VALUE;
            int maxLon = Integer.MIN_VALUE;
    
    
            Cursor cursor = getYourLantLongs(groupId);
    
            if (cursor.moveToFirst()){
                final int LAT_INDEX = cursor.getColumnIndex(T.Waypoints.LATITUDE);
                final int LON_INDEX = cursor.getColumnIndex(T.Waypoints.LONGITUDE);
    
                do {
                    final int lat = (int) (cursor.getFloat(LAT_INDEX)*1E6);
                    final int lon = (int) (cursor.getFloat(LON_INDEX)*1E6);
    
                    maxLat = Math.max(lat, maxLat);
                    minLat = Math.min(lat, minLat);
                    maxLon = Math.max(lon, maxLon);
                    minLon = Math.min(lon, minLon);
    
                } while(cursor.moveToNext());
    
    
                mapController.zoomToSpan(Math.abs(maxLat - minLat), Math.abs(maxLon - minLon));
                mapController.animateTo(new GeoPoint((maxLat + minLat)/2, (maxLon + minLon)/2 ));
    
                /*
                final int cLat =  (int)((maxLat*1E6 + minLat*1E6)/2);
                final int cLon =  (int)((maxLon*1E6 + minLon*1E6)/2);
    
                final int zLat =  (int)Math.abs(maxLat - minLat);
                final int zLon =  (int)Math.abs(maxLon - minLon);
    
                //mapController.zoomToSpan(zLat, zLon);
                mapController.animateTo(new GeoPoint(cLat, cLon));
                 */
            }
        }           
    }
    

    in short you make a square and zoom in.

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

Sidebar

Related Questions

I'm using the Bing Maps v7 control. I have an array of latitude/longitude points.
I have an android app that takes an array from a website {d:[{latitude:-1.0,longitude:-1.0,time:07:14 PM
I need to draw a Polygon from several points (I have their latitude, longitude).
I am geting stuck here I have array of latitude and longitude here ,
I have Latitude and Longitude of two points and Want to Draw line between
In MATLAB, I have an array of latitude and longitude pairs that represents locations
I have an array of latitude/longitude coordinate pairs that represent a polygon. I'm trying
I have an array of coordinates (latitude and longitude) in one .php script and
Problem Users can provide up to four latitude and longitude coordinates, in any order.
So, I have three numpy arrays which store latitude, longitude, and some property value

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.