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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:03:37+00:00 2026-05-20T03:03:37+00:00

Ive been trying to acheive the same, this is exactly what i want :-

  • 0

Ive been trying to acheive the same, this is exactly what i want :-
Google Maps Image

i have implemented googleMapView with overlays, i have one issue i want to show a popup when clicked on each overlay, and when i click on another overlay the previous popus should disappear and new one should appear at the clicked location(ie projection points). And popup shouldnt appear when i click anywhere else on screen.Im using onTap event to record onclick. (map_overlay) is the layout that i want to show when someone click a projection point on the map. The code is below and map_overlay.xml could be any file.

Class: ItemizedOverlay

public boolean onTap(GeoPoint p, MapView mapView) {

LayoutInflater inflater = (LayoutInflater)cContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

LayoutParams lp = new MapView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, p, LayoutParams.WRAP_CONTENT);
LinearLayout view = (LinearLayout)inflater.inflate(R.layout.map_overlay, null);

mapView.removeView(view);    
mapView.invalidate();    
mapView.addView(view,lp);

mapView.invalidate();

return true;
}

Below is the Main class in which im displaying projection points which is working fine and im calling I have implemented the onTap event in another class as shown above:

public **class MapView** extends MapActivity{
    private ArrayList<MyClass> overlayItem ;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.large_mapview);
        mapView = (MapView) findViewById(R.id.mapview);
       // mapView.setBuiltInZoomControls(true);

        List<Overlay> mapOverlays = mapView.getOverlays();
        Drawable drawable = this.getResources().getDrawable(R.drawable.mappointer2);
        ItemizedOverlay itemizedoverlay = new ItemizedOverlay(drawable,this);
        OverlayItem overlayitem;
        GeoPoint point;
        double lat;
        double lng;        

        for (int i = 0; i < overlayItem.size(); i++) {

            lat = Double.parseDouble(overlayItem.get(i).getLatitude());
            lng = Double.parseDouble(overlayItem.get(i).getLongitude());
            point = new GeoPoint((int) (lat * 1E6),(int) (lng * 1E6));

            overlayitem = new OverlayItem(point, i+"".toString(), overlayItem.get(i).getDetails().toString());
            itemizedoverlay.addOverlay(overlayitem);
            mapOverlays.add(itemizedoverlay);

        }

        mapView.invalidate();
    }
}
  • 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-20T03:03:37+00:00Added an answer on May 20, 2026 at 3:03 am

    Check out Android-mapviewballoons on github. Has an ItemizedOverlay that you can extend that does this exact thing. I use it in several of my apps.

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

Sidebar

Related Questions

I've been trying to implement unit testing and currently have some code that does
I've been trying to understand how Ruby blocks work, and to do that I've
I've been trying to use SQLite with the PDO wrapper in PHP with mixed
I've been trying to wrap my head around how threads work in Python, and
I've been trying to understand Process.MainWindowHandle . According to MSDN; The main window is
I've been trying to convert SVG images to PNG using C#, without having to
I've been trying to figure out a regex to allow me to search for
I've been trying to come up with a way to create a 3 column
I've been trying to display text using a Quartz context, but no matter what
I've been trying to get into F# on and off for a while but

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.