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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:08:42+00:00 2026-05-23T07:08:42+00:00

I hope someone can help with this. I have created a map app that

  • 0

I hope someone can help with this. I have created a map app that puts an icon on locations from an xml file, but I need to make the icons clickable to open a page of info about the location.

At present I have this under the class GPSLocationListener implements LocationListener:

MapOverlay mapOverlay = new MapOverlay();
mapOverlay.setPointToDraw(point, "pointer", null);

List<Overlay> listOfOverLays = mapView.getOverlays();
listOfOverLays.clear();

// doc is data from xml file                
NodeList nodes = doc.getElementsByTagName("result");

listOfOverLays.add(mapOverlay);

for (int i = 0; i < nodes.getLength(); i++) {                       

    Element e = (Element)nodes.item(i);

    String locId = XMLfunctions.getValue(e, "id");
    String aString = XMLfunctions.getValue(e, "lat");
    double lat = Double.parseDouble(aString);
    String bString = XMLfunctions.getValue(e, "long");
    double longi = Double.parseDouble(bString);


    // here, 'point' and mapOverlay have already been created and added                                 
    GeoPoint point2 = new GeoPoint((int) (lat * 1E6), (int) (longi * 1E6));
    MapOverlay mapOverlay2 = new MapOverlay();
    mapOverlay2.setPointToDraw(point2, "place", XMLfunctions.getValue(e, "name"));
    OverlayItem item = new OverlayItem(point2, "", "");
    listOfOverLays.add(mapOverlay2);
    }   

Outside of this class I have a class to create the location icons and assign the location names:

class MapOverlay extends Overlay{
    private GeoPoint pointToDraw;
    private String pointerIcon;
    private String locName;

    public void setPointToDraw(GeoPoint point, String pointer, String locationName){
        pointToDraw = point;
        pointerIcon = pointer;
        locName = locationName;
    }

    @Override
    public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when){
        super.draw(canvas, mapView, shadow);

        // convert point to pixels
        Point screenPts = new Point();

        mapView.getProjection().toPixels(pointToDraw, screenPts);

        // add marker
        if(pointerIcon == "pointer"){

            Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pointer);
            canvas.drawBitmap(bmp, screenPts.x, screenPts.y - 22, null);
        }
        else if(pointerIcon == "bar"){
            Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pointer2);
            canvas.drawBitmap(bmp, screenPts.x, screenPts.y - 15, null);
            Paint paint = new Paint();
            paint.setColor(Color.BLACK);
            paint.setTextSize(20);
            canvas.drawText(locName, screenPts.x, screenPts.y-20, paint);
        }

        return true;
    }
}

I just need to make the image ‘pointer2’ clickable and open a new page with the ‘locId’, so that I know which location has been clicked. I have read alot online about doing this, but nothing has worked. Any information that can get me closer to making this work it greatly appreciated.

  • 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-23T07:08:42+00:00Added an answer on May 23, 2026 at 7:08 am

    Sorted it, but pretty much had to start from scratch and use Itemised Overlay. Here is what I referenced: http://blog.chrisblunt.com/android-map-view-double-taps-and-overlay-markers/

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

Sidebar

Related Questions

Hope someone can help me with this.. I have a magento store up&running, via
This really, really urks me, so I hope that someone can give me a
hope someone can help me. I have a function like <script language=JavaScript type=text/javascript> function
I hope someone could help me on this. I want to add a month
I hope someone can help me find an answer. I'm working with a legacy
I have a .NET Winforms app (created in VS2005) that I deploy using ClickOnce.
Still wrapping my head around SQL and PHP, but hope someone can help with
I hope someone can guide me as I'm stuck... I need to write an
The docs at www.fastcgi.com aren't clear on this (to me), so I hope someone
Hope anyone can shed light on this so I can use pens with dash

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.