Library Output Map Thing to PGraphics Layer

edited February 2018 in Library Questions

Hi, I try to load shape files in a PGraphics layer. I used the mapthing library I have the problem, that I can't push the output of a library in the PGraphics buffer pg. It's always parented with the main sketch. Similar problem with the GeoMap, I posted here: https://forum.processing.org/two/discussion/26483/geomap-into-pgraphics#latest

Any Help very appriciated. Thanks Tom


import com.reades.mapthing.*;
import net.divbyzero.gpx.*;
import net.divbyzero.gpx.parser.*;

BoundingBox envelope = new BoundingBox(4267, 90f, 180f, -90f, -180f);


Lines   canals;
PGraphics pg ;

public void setup() {

  colorMode(HSB,360,100,100);

  int d = 1200;
  size(2000,1000);
  pg= createGraphics(2000,1000); 

  smooth();

  canals  = new Lines(envelope, dataPath("shapes/Canals.shp"));

  canals.setLocalSimplificationThreshold(0.1d);

}

public void draw() {
  background(0,0);

  pg.beginDraw(); 

  pg.strokeWeight(2.5f);
  pg.stroke(209,55,87,150);
  canals.project(this);                   //pg.canals.project(this) doesn't work..
  pg.endDraw(); 

  image(pg,0,0);  
}
Sign In or Register to comment.