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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:35:26+00:00 2026-06-15T08:35:26+00:00

I am updating an existing Android app to use the new Google Maps Android

  • 0

I am updating an existing Android app to use the new Google Maps Android API v2. I have about 2500 markers that I want to add to the map. With the older version of the API I found the responsiveness of the maps to be horrendous when there are 2500 markers, so I had to work around it by only adding markers that are in the current visible region of the map.

I was hoping 2500 markers would be faster with the new API, but it’s still awful, even on a Nexus 4, and I’m not seeing any sort of option to do clustering.

So my question: how can I determine if a certain lat/lng point is contained within the visible region of the map?

I have looked at VisibleRegion in the documentation, but I’ve not had any luck with it so far. Any help is greatly appreciated.

*Side note: 2500 markers on an iOS MKMapView (google maps or Apple maps) is very smooth and responsive even with an iPhone 3gs. I still can’t understand why it’s so slow on Android, even with the latest and greatest hardware.

  • 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-15T08:35:27+00:00Added an answer on June 15, 2026 at 8:35 am

    Alright, after trying a couple more things I figured out how to determine if a given point is in the visible region, and it’s pretty simple:

    //Note: this.mMap is an instance of GoogleMap
    
    LatLngBounds bounds = this.mMap.getProjection().getVisibleRegion().latLngBounds;
    
    LatLng markerPoint = new LatLng(item.getLatitude(), item.getLongitude());
    
    if(bounds.contains(markerPoint))
    {
        this.mMap.addMarker(new MarkerOptions(...));    
    }
    

    *Note that getting the projection of the GoogleMap is an expensive operation, so if you’re looping through a long list of items to create Markers and adding them to the map like I am, only grab the projection once before you loop.

    Update

    I decided to write up a blog post detailing how to show Markers that are in the visible region of the map and hide Markers as they are moved off the screen. It’s not a perfect solution, but if you are showing thousands of Markers and know that your users don’t need to see all of them at the same time (unless they zoom way out), it’s a pretty good work-around.

    Hiding and Showing on screen Markers with Google Maps Android API V2

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

Sidebar

Related Questions

I have very little knowledge about app development, but I am updating an existing
Have a problem with updating an existing record of my DB. In my view
I have been researching OSGI to determine its viability for updating an existing project.
When updating a row, I want to have a built-in check to do some
I am wonder about how to update the table. I have use below two
How would I go about updating existing DateTime columns in an update statement? I'd
I am updating an existing Microsoft Access application to use the UniToolbox2.UniTreeView control because
I am updating an existing project from GWT 1.5.2 to GWT 2.0.0. We use
Just came across a problem while updating an existing app to iOS 6. in
My page is currently updating an existing xml, the problem is that when it

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.