Using UnfoldingMaps to draw to PGraphics

268 views Asked by At

I want to use Unfolding Maps to write to a PGraphics in Processing.

import de.fhpotsdam.unfolding.*;
import de.fhpotsdam.unfolding.geo.*;
import de.fhpotsdam.unfolding.utils.*; 
import de.fhpotsdam.unfolding.providers.*;

UnfoldingMap map;
PGraphics g;

void setup() {
    size(800, 600);
    map= new UnfoldingMap(this, new OpenStreetMap.OpenStreetMapProvider( ));
    map.zoomAndPanTo(new Location(52.5f, 13.4f), 10);    
    g = createGraphics(width, height);
}

void draw() {
    map.draw();
    g.beginDraw();
    //g.map.draw();no
    //map.draw(g);nope
    g.endDraw();
}

At map.draw() how do I make this print to the buffer g?

1

There are 1 answers

2
tnagel On

Not the most straight-forward, but the current way of doing that would be

g.image(map.mapDisplay.getOuterPG().get(), 0, 0);