Questions tagged [jmapviewer]

JMapViewer is an open-source OpenStreetMap viewer for Java applications.

JMapViewer is an open-source OpenStreetMap viewer for Java applications.

57 questions
4
votes
2 answers

Draw Line between two Geo Points in JMapViewer

I'm working with OpenStreet Maps in Java with JMap Viwer http://wiki.openstreetmap.org/wiki/JMapViewer I can load the maps and everything ok but I don't know how to draw a line between two points from a latitude and longitude. Any body know the…
3
votes
2 answers

how can i get the mouse click position from my JMapViewer world map

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…
Erik
  • 5,039
  • 10
  • 63
  • 119
3
votes
4 answers

How can I ensure correct drawing order in an OverlayLayout?

I am using a JPanel with an OverlayLayout to draw two unrelated components on top of each other. Specifically, I have a transparent component which contains my own line drawings, and beneath that, I am using a JMapViewer component, which displays…
double-m
  • 118
  • 8
3
votes
1 answer

JMapViewer, get the OSM map scale, Java

In my Java application I am using JmapViewer; the map is drawn on the jPanel. Is it possible to get the map scale corresponding to the current zoom level? The map is based on the well-known Mercator projection: X = R * lon * cos(lat1); Y = R *…
justik
  • 4,145
  • 6
  • 32
  • 53
3
votes
1 answer

JMapViewer add mouse listener to MapMarkerDot

I am trying to add a mouse listener to a MapMarker, so that when a mouse will hover a MapMarker, I could react with an event. I implemented the mouseListener, but I can't really add a listener. The issue is that I did not find a way the MapMarker…
Oz Radiano
  • 779
  • 2
  • 11
  • 30
3
votes
1 answer

JMapViewer OSM map cannot be dragged

I am trying to figure out which mapping tools work best for my java swing based OSM map. Earlier I made a functioning map on the basis of MapPanel. Later I could almost clone the application and merely replace MapPanel with JMapViewer to get this…
jhulst
  • 353
  • 1
  • 3
  • 18
2
votes
1 answer

Location.requestForegroundPermissionsAsync is not a function

I just try to use expo-location and I found that error Location.requestForegroundPermissionsAsync is not a function this is my code import * as Location from 'expo-location'; const setCurrentLocation = async() => { let { status } = await…
Fatma Mahmoud
  • 89
  • 2
  • 13
2
votes
1 answer

getMapPostition returns null value

Point da = map1().getMapPosition(48.922499263758255, 16.875); System.out.println(da); Can someone help me? I want to convert a coordinate to a point by using this getMapPosition, but whatever I do it gives me a null value. Why is it…
Renrenren
  • 25
  • 5
2
votes
1 answer

JMapViewer, MouseListener called 2 times

Working with JMapViewer, a strange behavior of the component was recognized. I am using DefaultMapController to get the map position (lat, lon). import java.awt.Graphics; import java.awt.Point; import java.awt.event.MouseAdapter; import…
justik
  • 4,145
  • 6
  • 32
  • 53
2
votes
1 answer

JMapViewer: pan and zoom not set by when map has just loaded

I have two custom images as markers on JMapViewer. I would like the map to set proper pan and zoom so that the two markers are visible on the map display. I have a button that does it. So, what is happening is that the map is not zoomed to these…
Igor Tupitsyn
  • 1,193
  • 3
  • 18
  • 45
2
votes
1 answer

How to add a ToolTip to MapMarker in JMapViewer

I'm trying to add a ToolTip to a custom MapMarker on JMapViewer. But repeaded searches on are not helping me solve this. The custom MapMarker is: public class MapMarkerUnit extends MapObjectImpl implements MapMarker and the Paint Method overide is…
KieranS
  • 35
  • 7
2
votes
0 answers

JMapViewer Routing between coordinates

Is it possible to display a route between two coordinates on JMapViewer on a Java application? I have managed to draw a polygon and get a straight line between two coordinates however I was wondering what would be required to actually make the line…
Kyanite
  • 706
  • 3
  • 13
  • 28
2
votes
2 answers

Draw Polyline in JMapViewer

I'm working with OpenStreetMap in Java with JMapViewer. I can draw polygon and rectangle using JMapViewer, but how to draw polyline? Thank you.
Nikolai
  • 23
  • 1
  • 4
2
votes
2 answers

JPanel with anonymous EventListener - why doesn't GC destroy listener?

I have been perusing the open source code of JMapViewer. If anyone else wishes to look at it, check the SVN. In a nutshell, the main class is JMapViewer, which is an extension of a JPanel. There is another very important class called…
The111
  • 5,757
  • 4
  • 39
  • 55
2
votes
2 answers

Dynamically updating markers in JMapViewer

Hello Stack Overflow community, I am a Java newbie and I am doing a simple java project where I take coordinates (lat and lon) from a (dynamic) source and use JMapViewer (Yes, not JXMapViewer) to display the markers on a map. I have put all the…
Kale Bamman
  • 25
  • 1
  • 5
1
2 3 4