Currently, I am integrating an image into my web application using standard JavaScript and HTML. The image represents a basic map, and my objective is to utilize p5.js to draw on it.
<div id="map">
<img src="Assets/MENA.jpg" class="image" width="1500" height="750">
</div>
function createConflictMapMENA() {
this.name="MENA conflict map";
this.id="conflict-map"
this.draw = function() {
var map = document.createElement('img')
map.src = 'Assets/MENA.jpg'
gallery.selectVisual(map);
fill(255, 0, 0);
ellipse(30, 30, 10);
}
}
Within the this.draw = function(){}
section, I am using p5.js library's ellipse()
and fill()
functions to depict a red circle. Here is a representation of what I have created:
https://i.sstatic.net/PXYwG.png
However, when I attempt to modify the coordinates to place the circle over the map, the circles end up positioned beneath it. Is there a method for me to make these two elements cooperate without needing to manually draw the circle in pure JS?