xxxxxxxxxx
27
let myMap;
let canvas;
const mappa = new Mappa('Leaflet');
// Lets put all our map options in a single object
const options = {
lat: 33,
lng: 130,
zoom: 1.5,
style: "http://{s}.tile.osm.org/{z}/{x}/{y}.png"
}
function setup(){
canvas = createCanvas(800,400);
// background(100); let's uncomment this, we don't need it for now
// Create a tile map with the options declared
myMap = mappa.tileMap(options);
myMap.overlay(canvas);
}
function draw(){
clear();
const itoshima = myMap.latLngToPixel(33.511777, 130.146019);
// Using that position, draw an ellipse
ellipse(itoshima.x, itoshima.y, 5, 5);
}