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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:54:31+00:00 2026-06-12T15:54:31+00:00

I used a library name mapviewballoon in my project mapviewballon . when I set

  • 0

I used a library name mapviewballoon in my project mapviewballon .

when I set 20,30 or more pins the map on different locations it zooms to the last pin in the center, what I want is that the zoom level is such that it show up all pins in the map view.

how can I solve that, or calculate the right zoom, currently I given 14.

doing things as follow:

OverlayItem overlayItem = null;
GeoPoint point = null;
for (int i = 0; i < nearbyObjMapList.size(); i++) {
       if (!nearbyObjMapList.get(i).latitude.equals("0") && !nearbyObjMapList.get(i).longitude.equals("0")) {
           Latitude = Float.parseFloat(nearbyObjMapList.get(i).latitude);
           Longitude = Float.parseFloat(nearbyObjMapList.get(i).longitude);
           point = new GeoPoint((int)(Latitude*1E6),(int)(Longitude*1E6));
           overlayItem = new OverlayItem(point, nearbyObjMapList.get(i).venue_name,                            "");
           itemizedOverlay.addOverlay(overlayItem);
       }

                    }
if (thisState == null) {

      final MapController mc = mapView.getController();
      mc.animateTo(point);
      mc.setZoom(14);

 } else {

      // example restoring focused state of overlays
      int focused;
      focused = thisState.getInt("focused_1", -1);
      if (focused >= 0) {
                itemizedOverlay.setFocus(itemizedOverlay.getItem(focused));
          }
      focused = thisState.getInt("focused_2", -1);
           if (focused >= 0) {
                 temizedOverlay2.setFocus(itemizedOverlay2.getItem(focused));
            }

  }
  • 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-12T15:54:33+00:00Added an answer on June 12, 2026 at 3:54 pm

    Don’t use setZoom() and it is always better to use zoomToSpan when you have many pins to be pointed. You add below code after your for loop, which works perfect for me.

                       if(nearbyObjMapList.length!=0)
                       {
                        mapOverlays.add(itemizedoverlay);
                        // showing all overlay items
                        itemizedoverlay.populateNow();
                       // Adjusting the zoom level so that you can see all the markers on map
                        mv.getController().zoomToSpan(Math.abs( minLat - maxLat ), Math.abs( minLong - maxLong ));
                        // Showing the center of the map
                        mc.animateTo(new GeoPoint((maxLat + minLat)/2, (maxLong + minLong)/2 ));
                       }
                       mv.postInvalidate();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've always wondered how an actively developed common library used in two or more
I have a class library that targets .net 4 and is used across different
I have a Library project set up and a project which depends on this
I used a jQuery library called jFeed to parse and display my blogs rss
What graphics library is used to create the graphics in the Solitaire and Freecell
I have built a an app in PhoneGap/Cordova and used the JQuery library for
can somebody tell me what is jQuery plugin? I have used the jQuery library
Has anyone used a Java based library for generating excel documents? Preferably support for
I'm looking for a library that could be used to manipulate audio files. Essentially
I have used code like this: http://msdn.microsoft.com/en-us/library/dw70f090.aspx to access database before when working in

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.