Marker not displaying on map using unfolding library

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

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 ]

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 :sweat_smile:

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

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.

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

Please use the newest Unfolding beta at http://services.informatik.hs-mannheim.de/~nagel/GDV/Unfolding_for_processing_0.9.92.zip

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