code:-
import de.fhpotsdam.unfolding. <em>;
import de.fhpotsdam.unfolding.geo.</em> ;
import de.fhpotsdam.unfolding.utils.*;
import de.fhpotsdam.unfolding.providers.Microsoft;
import de.fhpotsdam.unfolding.marker.*;
UnfoldingMap map;
void setup() {
size(800, 600);
map = new UnfoldingMap(this,new Microsoft.AerialProvider());
MapUtils.createDefaultEventDispatcher(this);
}
void draw() {
map.draw();
Location berlinLocation = new Location(52.5, 13.4);
SimplePointMarker berlinMarker = new SimplePointMarker(berlinLocation);
map.addMarkers(berlinMarker);
}
output on terminal:-
Unfolding Map v0.9.6
No OpenGL renderer. Using Java2DMapDisplay.
output:-
1 Like
Lexyth
December 8, 2019, 5:19am
2
Try printing out berlinMarker.getScreenPosition(map) to check wether the marker is within the screen dimensions.
still nothing been displayed on the map
and the position showing is [ 429.0, 168.0, 0.0 ]
Lexyth
December 8, 2019, 4:09pm
5
Hmm… as far as i know, that Code shouldn‘t have any problems… except for the missing * in the first 2 imports, and the second import being like this
Maybe @tnagel knows more
tnagel
December 8, 2019, 5:03pm
6
This is a known bug (see https://github.com/tillnagel/unfolding/issues/118 ). Please use
size(800, 600, P2D);
as work-around.
1 Like
Error while using P2D in size()
Error:-
Java.lang.runtimeException: Java.lang.NoSuchFieldError: quality
Code in the image
I suggest using the original code but putting
map.draw();
after
map.addMarkers(berlinMarker);
,so the code would look like this;
import de.fhpotsdam.unfolding. ;
import de.fhpotsdam.unfolding.geo. ;
import de.fhpotsdam.unfolding.utils.*;
import de.fhpotsdam.unfolding.providers.Microsoft;
import de.fhpotsdam.unfolding.marker.*;
UnfoldingMap map;
void setup() {
size(800, 600);
map = new UnfoldingMap(this,new Microsoft.AerialProvider());
MapUtils.createDefaultEventDispatcher(this);
}
void draw() {
Location berlinLocation = new Location(52.5, 13.4);
SimplePointMarker berlinMarker = new SimplePointMarker(berlinLocation);
map.addMarkers(berlinMarker);
map.draw();
}
not sure if this would work or not, just thinking that you should add the marker to the map data before displaying it.
No, it did not make any difference
Lexyth
December 8, 2019, 9:09pm
10
That‘s probably not gonna help, but please add the marker in setup. You‘re currently adding a marker each frame… that might cause some problems.
Lexyth
December 8, 2019, 9:11pm
11
Are you sure you didn‘t mean P3D? I‘ve seen another post where it was fixed with P3D, though i‘m not sure if it was the same problem.
1 Like
tnagel
December 8, 2019, 9:54pm
12
2 Likes
Thanks guys…it worked finally with P3D for me
1 Like
does removeMarker and clearMarker does not exist because its showing error while I am using it. Although this command exists I unfoldingmap api page under manage marker