Most appropriate sub-area of p5.js?
p5.js version
2.3.2
Web browser and version
Firefox 155.0.1
Operating system
MacOS
Steps to reproduce this
This seems to be an error for the web editor specifically (not the library). I teach a class where I have students use Mappa.js library (easier on-ramp than Leaflet) within the p5.js web editor to create interactive maps. We have mostly been using OpenStreetMap as our map provider because it does not require API keys or tokens. However, OSM now requires a valid Referer/User-Agent to identify, and it seems that the web editor iframe may be blocking anything referrer from getting sent.
Here is a screenshot of the error:
Steps:
- Create a new project in p5.js web editor
- Use the index.html and sketch.js code below
- Click Run
Snippet:
index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="referrer" content="strict-origin-when-cross-origin">
<script src="https://unpkg.com/mappa-mundi@0.0.5/dist/mappa.js" type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/npm/p5@2.3.2/lib/p5.js"></script>
<script src="https://cdn.jsdelivr.net/npm/p5.sound@0.4.1/dist/p5.sound.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<meta charset="utf-8" />
</head>
<body>
<main>
</main>
<script src="sketch.js"></script>
</body>
</html>
sketch.js:
let myMap;
let canvas;
const mappa = new Mappa("Leaflet");
const options = {
lat: -40,
lng: 55,
zoom: 0.5,
style: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
};
function setup() {
canvas = createCanvas(800, 800);
myMap = mappa.tileMap(options);
myMap.overlay(canvas);
}
function draw() {
clear();
}
Most appropriate sub-area of p5.js?
p5.js version
2.3.2
Web browser and version
Firefox 155.0.1
Operating system
MacOS
Steps to reproduce this
This seems to be an error for the web editor specifically (not the library). I teach a class where I have students use Mappa.js library (easier on-ramp than Leaflet) within the p5.js web editor to create interactive maps. We have mostly been using OpenStreetMap as our map provider because it does not require API keys or tokens. However, OSM now requires a valid Referer/User-Agent to identify, and it seems that the web editor iframe may be blocking anything referrer from getting sent.
Here is a screenshot of the error:
Steps:
Snippet:
index.html:
sketch.js: