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.
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.
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.