We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using the following:
p5.js
It displays the tilemap just fine, but I cannot draw anything on top of it.
Here is the JavaScript code where I attempt to draw an ellipse at the mouse cursor on top of the map.
import $ from "jquery"; import Mappa from 'mappa-mundi'; $.getScript("https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/p5.js", function(data, textStatus, jqxhr) { const key = 'REDACTED' const mappa = new Mappa('Mapbox', key); // Options for map const options = { lat: 0, lng: 0, zoom: 4, studio: true, style: 'mapbox://styles/mapbox/traffic-night-v2', }; let s = (sk) => { let myMap; let canvas; window.sk = sk; var width = $("#canvas").width(); var height = $("#canvas").height(); // SETUP sk.setup = () => { canvas = sk.createCanvas(width, height).parent('canvas'); myMap = mappa.tileMap(options); myMap.overlay(canvas); sk.fill(109, 255, 0); sk.stroke(100); sk.background(100); } // DRAW sk.draw = () => { sk.clear(); sk.ellipse(sk.mouseX, sk.mouseY, 40, 40); } } let P5 = new p5(s, "canvas"); });
And here is the HTML.
<html> <head> <title>Express</title> <link rel="stylesheet" href="/css/style.css"> <link rel="stylesheet" href="https://api.mapbox.com/mapbox.js/v3.1.1/mapbox.css"> <script src="./dist/bundle.js"></script> </head> <body> <!--<canvas id="myCanvas" resize></canvas>--> <div class="master-grid"> <div class="center-panel"> <!----------------------------------------------------------> <div id="canvas" style="width: 100%; height: 100%;"></div> <!----------------------------------------------------------> </div> </div> </body> </html>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am using the following:
p5.js
scriptIt displays the tilemap just fine, but I cannot draw anything on top of it.
Here is the JavaScript code where I attempt to draw an ellipse at the mouse cursor on top of the map.
And here is the HTML.
The text was updated successfully, but these errors were encountered: