Problem with PApllet when trying to use PApplet with unfolding map, in applet can't produce a map

Hello,

I’m following a course on Coursera where we’re trying to visualize the geospatial data on map.

Earlier I have gone through the code and executed properly, in Windows and in Linux and had the all function working properly. Though during that period, sometime I’ve got black Applet due to map provider’s issue, but I could solve it replacing the current map provider with another.

Now sometime I’m getting only grey applet with javax.media.opengl.GLException, Caused by: java.lang.NullPointerException or black applet with The file "http://tillnagel.com/transparent255.png" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable. error. or other different type of error.
I’m trying to change the map provider but almost always getting the same error.

I would really appreciate if someone could suggest me how correct this error and also any suggestion to improve the question will be welcomed.

Thanks!

Please provide your code or an mcve.

Kf

Thank you very much for your reply.

Here I’m putting the simple code for just producing a map.
It’s not code from the project, for which I need a map in applet. If the code for the project is needed, I can also provide. This time, to make problem simple, I’m just putting the code to produce a simple map in applet.

package co.map;

import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.geo.Location;
import de.fhpotsdam.unfolding.providers.MapBox;
import de.fhpotsdam.unfolding.utils.MapUtils;
import processing.core.PApplet;

public class HelloWorld extends PApplet
{
   //Unfolding map object
   public UnfoldingMap map1;
   
   public void setup()
   {
   	// Set a zoom level
   	int zoomLevel = 10;
   			
   	size(800, 800);
   	map1 = new UnfoldingMap(this, 10, 10, 450, 600, new MapBox.BlankProvider());
   	
   	// The next line zooms in and centers the map at 
       // 32.9 (latitude) and -117.2 (longitude)
   	//map1.zoomAndPanTo(zoomLevel, new Location(32.9f, -117.2f));
   	map1.zoomAndPanTo(zoomLevel, new Location(30.31385f, 59.938750f));
   	
   	// This line makes the map interactive
   	MapUtils.createDefaultEventDispatcher(this, map1);
   }//end of setup method
   
   public void draw()
   {
   	map1.draw();
   }//end of draw method
   
}//end of the HelloWorld class

I’m randomly trying all possible map providers to get clear map in my applet. Unfortunately always getting the same result.
I really need to solve this issue for my course, because I’m doing an specialization course and this course is one the the whole course. So if I can’t pass this course then I can’t pass the speculation. That’s why I need a solution for the this problem.

Any kind of suggestion solve this problem is most welcome.

Thanks again!

Could you please also have a look in this issue, one of UnfoldingMap constructor is like this:

UnfoldingMap(processing.core.PApplet p, float x, float y, float width, float height, AbstractMapProvider provider) 

But when I’m trying to create a map object using this constructor by this code:

map1 = new UnfoldingMap(this, 50, 50, 350, 500, new AbstractMapTileProvider());

I’m getting this compile time error:

Cannot instantiate the type AbstractMapTileProvider

What could be the reason behind this?
Maybe I didn’t understand the constructor properly?

Just now I’ve one small development. I’ve able to produce a map using

Microsoft.AerialProvider

though with out OPENGL or P2D. But I’m afraid it will work later.
On the other hand, if I want use OPENGL or P2D then getting error

Caused by: javax.media.opengl.GLException

I found this solution, silly of me, I was using an abstract class.

Great you found the solution. This is probably not documented by unfolding needs the renderer to be OPENGL, like P2D.

Kf

Thank you. Yes, you’re right. I’ve followed the OpenGl site and there I found some tips regarding upengl update with graphic card update. Followed these instructions I’ve able to use opengl for 3D or P2D argument.