How to put a marker at a specific position using unfolding map?

Location center = new Location(64, 20);
Integer zoom_start = 9;  

AbstractMapProvider provider5;
UnfoldingMap map;
String provider5Attrib;
String attrib;
Float attribWidth;
PImage clock;
PImage calendar;
int totalFrames = 3600;
Integer screenfillalpha = 120;
import de.fhpotsdam.unfolding.*;
import de.fhpotsdam.unfolding.core.*;
import de.fhpotsdam.unfolding.geo.*;
import de.fhpotsdam.unfolding.interactions.*;
import de.fhpotsdam.unfolding.mapdisplay.*;
import de.fhpotsdam.unfolding.mapdisplay.shaders.*;
import de.fhpotsdam.unfolding.marker.*;
import de.fhpotsdam.unfolding.providers.*;
import de.fhpotsdam.unfolding.texture.*;
import de.fhpotsdam.unfolding.tiles.*;
import de.fhpotsdam.unfolding.ui.*;
import de.fhpotsdam.unfolding.utils.*;
import de.fhpotsdam.utils.*;

// Import some Java utilities
import java.util.Date;
import java.text.SimpleDateFormat;

void setup(){
  provider5 = new OpenStreetMap.OpenStreetMapProvider();
  provider5Attrib = "OpenStreetMap";
  map = new UnfoldingMap(this,provider5);
  attrib = "© Prehosp Care | Unfolding Maps | Basemap by " + provider5Attrib;
  attribWidth = textWidth(attrib);
  map.zoomAndPanTo(zoom_start, center);
  clock = loadImage("clock_icon.png");
  clock.resize(0, 10);
  calendar = loadImage("calendar_icon.png");
  calendar.resize(0, 10);

void draw(){
  if (frameCount < totalFrames) {
    fill(0, screenfillalpha);
    rect(0, 0, width, height);

I was trying to put the clock and calendar images at specific locations and it did not work, because some kind of java errors…

at processing.core.PApplet.loadBytes(
	at processing.core.PApplet.loadImage(
	at de.fhpotsdam.unfolding.tiles.TileLoader.getTileFromUrl(Unknown Source)
	at Source)
Caused by: Server returned HTTP response code: 403 for URL:
	at processing.core.PApplet.loadBytes(
	... 4 more

Any comments are greatly appreciated.

1 Like

If you encounter such problems, start by commenting out the most like causes for those errors until you find the exact line that causes the first problem. Especially when you use 3rd-Party libraries.


My first advice would be to carefully read the errors, even if they seem over-detailed: You have a 403 (Forbidden) URL. Why are you connecting to that URL? If the URL is correct, what would you need to do for the connection to be allowed? For example, do you need credentials such as an API key?

@jeremydouglass This is a duplicate. Edited Code/question is here :

Creating a simple map using a given map provider does not work in unfolding map

(The url is set by the openstreetmap class and can‘t be changed)