# Masked maps in Unfolding

**URL:** <https://discourse.processing.org/t/masked-maps-in-unfolding/11514>\
**Category:** Gallery\
**Created:** [May 23, 2019, 1:57pm UTC](https://discourse.processing.org/t/masked-maps-in-unfolding/11514 "2019-05-23T13:57:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tnagel](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@tnagel](https://discourse.processing.org/u/tnagel)\
**Post date:** [May 23, 2019, 1:57pm UTC](https://discourse.processing.org/t/masked-maps-in-unfolding/11514/1 "2019-05-23T13:57:04Z")

</div>

As it seems the old thread [https://discourse.processing.org/t/help-rounded-rectangle-unfolding-maps-masking-maps/11050](https://discourse.processing.org/t/help-rounded-rectangle-unfolding-maps-masking-maps/11050) has been deleted, I wanted to add the example code somewhere for others to use. The following code needs Unfolding Maps 0.9.92 or up (which you can find in the Github repo, or send us an e-mail.)

```auto
import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.mapdisplay.OpenGLMapDisplay;
import de.fhpotsdam.unfolding.mapdisplay.shaders.MaskedMapDisplayShader;
import de.fhpotsdam.unfolding.utils.MapUtils;
UnfoldingMap map;

MaskedMapDisplayShader mapDisplayShader;

void settings() {
  size(800, 800, P2D);
}

void setup() {
  map = new UnfoldingMap(this);
  MapUtils.createDefaultEventDispatcher(this, map);
  
  // Use any grayscale image as mask.
  PImage maskImage = loadImage("shader/mask-circular.png");
  mapDisplayShader = new MaskedMapDisplayShader(this, 400, 400, maskImage);
  ((OpenGLMapDisplay) map.mapDisplay).setMapDisplayShader(mapDisplayShader);
}

public void draw() {
  background(0);
  map.draw();
}

```

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 25, 2019, 2:56pm UTC](https://discourse.processing.org/t/masked-maps-in-unfolding/11514/2 "2019-05-25T14:56:17Z")

</div>

(Strange. Not sure why that thread was deleted – possibly the poster deleted their own account…)

Thank you so much for sharing this!

Could that version of Unfolding Maps be made available through PDE Contributions Manager as well?
