We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey everyone,
I'm trying to create an interactive map for my company with locations of customer sites around the world. I was looking into using Unfolding for this with Processing as it seems to be the go-to. I can't seem to get even a simple map on the screen with the following code:
import de.fhpotsdam.unfolding.mapdisplay.*;
import de.fhpotsdam.unfolding.utils.*;
import de.fhpotsdam.unfolding.marker.*;
import de.fhpotsdam.unfolding.tiles.*;
import de.fhpotsdam.unfolding.interactions.*;
import de.fhpotsdam.unfolding.ui.*;
import de.fhpotsdam.unfolding.*;
import de.fhpotsdam.unfolding.core.*;
import de.fhpotsdam.unfolding.mapdisplay.shaders.*;
import de.fhpotsdam.unfolding.data.*;
import de.fhpotsdam.unfolding.geo.*;
import de.fhpotsdam.unfolding.texture.*;
import de.fhpotsdam.unfolding.events.*;
import de.fhpotsdam.utils.*;
import de.fhpotsdam.unfolding.providers.*;
UnfoldingMap map;
void setup() {
size(800, 600, P2D);
map = new UnfoldingMap(this);
MapUtils.createDefaultEventDispatcher(this, map);
}
void draw() {
map.draw();
}
I get a blank canvas when I run it and errors of this type in the console:
"The file http://a.www.toolserver.org/tiles/bw-mapnik/2/2/3.png contains bad image data, or may not be an image."
Any ideas? Maybe I need to use a different source for the map images? Any help would be great! Thanks.
Answers
where are you even referencing that image?
image looks fine in my browser.
Same problem here. The image also looks fine in my browser. The problem is inside Processing...
fetching those tiles manually i get
the final image looks ok but the 302 and the 301 and the time take to negotiate those is probably causing the problem.
using that final hostname, a.tiles.wmflabs.org might be an idea, however you do that...
ok, add
and change the constructor to
you can use any of the alternatives listed here:
/libraries/Unfolding/reference/de/fhpotsdam/unfolding/providers/AbstractMapTileUrlProvider.html
(above path is relative to your sketchbook directory)
but i had trouble with the first couple i tried (google)