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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:30:53+00:00 2026-05-28T14:30:53+00:00

Im using the JMapViewer jar to show the world map on a JPanel. On

  • 0

Im using the JMapViewer jar to show the world map on a JPanel.

On the map im adding MapMarkerDot's which are gps points.

The problem is when i click a MapMarkerDot on the map i cannot
find an interface or listener to catch the click and give me the
clicked MapMarkerDot identity.

has anyone here worked with the code or can give me some ideas what to do.

I would not like to modify the jar source but maybe i have to input an interface.

I know this is kind of an abstract question but hoping for help

  • 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-28T14:30:53+00:00Added an answer on May 28, 2026 at 2:30 pm

    Answering my own question.
    Basically solved this by raw x/y calculation comparing the
    MapMarker position against mouse click position.

    if (e.getButton() == MouseEvent.BUTTON1) {
        Point p = e.getPoint();
        int X = p.x+3;
        int Y = p.y+3;
        List<MapMarker> ar = map.getMapMarkerList();
        Iterator<MapMarker> i = ar.iterator();
        while (i.hasNext()) {
    
            MyMapMarkerDot mapMarker = (MyMapMarkerDot) i.next();
    
            if(mapMarker.position != null){
    
                int centerX =  mapMarker.position.x;
                int centerY = mapMarker.position.y;
    
                // calculate the radius from the touch to the center of the dot
                double radCircle  = Math.sqrt( (((centerX-X)*(centerX-X)) + (centerY-Y)*(centerY-Y)));
    
                // if the radius is smaller then 23 (radius of a ball is 5), then it must be on the dot
                if (radCircle < 8){
                    ShowClickedUser(mapMarker.Tag);
                }
    
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
Using android 2.3.3, I have a background Service which has a socket connection. There's
Using VB6 I am using checkbox and combobox in a Form. When i click
using VB.Net2010 I need to call a C# DLL The problem I have is
Using mercurial, I've run into an odd problem where a line from one committer
Using MVC2 I have an AJAX form which is posting to a bound model.
Using Delphi 2010. I am looking for (possibly) a function or procedure which can
using chrome 15 on osx 10.6.8 When adding event listeners, I've found that putting
Using online interfaces to a version control system is a nice way to have
Using PyObjC , you can use Python to write Cocoa applications for OS X.

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.