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

/* An application with a basic map.*/

import de.fhpotsdam.unfolding.*;
import de.fhpotsdam.unfolding.core.*;
import de.fhpotsdam.unfolding.data.*;
import de.fhpotsdam.unfolding.events.*;
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;


UnfoldingMap map;

AbstractMapProvider provider5;
void setup() {
  size(800, 600, P2D);
  smooth();
  provider5 = new OpenStreetMap.OpenStreetMapProvider();
  map = new UnfoldingMap(this,provider5);
}

void draw() {
  map.draw();
}

For the above code, the map does not show up and only to get some error messages. On the other hand, if I delete provider5, then it works. Could anyone let me know how to fix it?

I also tried the following, and it does not work either.

/* An application with a basic map.*/

int totalFrames = 3600;
Location center = new Location(62,10);
Integer zoom_start = 9;

import de.fhpotsdam.unfolding.*;
import de.fhpotsdam.unfolding.core.*;
import de.fhpotsdam.unfolding.data.*;
import de.fhpotsdam.unfolding.events.*;
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;


UnfoldingMap map;
AbstractMapProvider provideru;
String provideruAttrib;
String attrib;
Float attribWidth;



void setup() {
  size(1000, 1000, P3D);
  smooth();
  provideruAttrib = "Google Maps";
  provideru = new Google.GoogleMapProvider();
  map = new UnfoldingMap(this,provideru);
  MapUtils.createDefaultEventDispatcher(this, map);
  
  map.zoomAndPanTo(zoom_start, center);
}

void draw() {
  map.draw();
}

The problem is that for some reason the access to the providers you give is not working. As for why… i tried going through the whole Code on Github, but the only thing that should happen is to use the mercatoProjection with a specified location… so i don‘t even see where the url would even be loaded…

All i can tell you, is to try and use different Providers and see if others work… or not set a provider for now and only add one later on, to see if maybe something else is the problem.

1 Like

Yes, this should work.

Which version of Unfolding Maps are you using? What are the error messages you are getting?

1 Like