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 happening?
Thanks.
A quick check of the relevant
JMapViewersource shows that your call togetMapPosition()invokes a nearby overload withcheckOutsideset totrue. The result isnullif thePointcorresponding to the coordinates is outside the visible map.Instead, use one of the implementations that lets you set
checkOutsidetofalseexplicitly. For example,or