Yes, you can use multiple images and set them as one image for each marker icon in your array of map markers.
More importantly, you can use images that are on a remote server. For example, in my case, I downloaded an array of sites, each of which has an image for the site, so I combine the marker image with the image of the site (received from the server). Here is my solution:
mergeImages(element) { var canvas: HTMLCanvasElement = this.canvas.nativeElement; var context = canvas.getContext('2d'); let img1 = new Image(); let img2 = new Image(); img1.onload = function () { canvas.width = img1.width; canvas.height = img1.height; img2.crossOrigin = 'anonymous'; img2.src = element.info.image || './assets/img/markers/markerIcon42.png'; }; img2.onload = () => { context.clearRect(0, 0, canvas.width, canvas.height); context.globalAlpha = 1.0; context.drawImage(img1, 0, 0); context.globalAlpha = 1; //Remove if pngs have alpha context.globalCompositeOperation = 'destination-over'; if (element.info.image === null) { context.drawImage(img2, 11, 4, 42, 42); } else { context.drawImage(img2, 15, 7, 35, 35); } var dataURL = canvas.toDataURL('image/png', 1.0); console.log(dataURL); this.markers.push({ lat: element.info.location.latitude, lng: element.info.location.longitude, controllerInfo: element.info, icon: { url: dataURL, labelOrigin: { x: 32, y: -10 }, scaledSize: { width: 64, height: 64 }, origin: { x: 0, y: 0 }, anchoriconAnchor: { x: 7, y: 7 }, }, controllerStaus: element.status, label: { text: element.info.siteName, color: "#ED2C2C", fontWeight: "500", fontSize: "14px" } }); console.log(this.markers); }; img1.src = './assets/img/markers/map-marker64.png'; }
One important thing to add is "img2.crossOrigin = 'anonymous';" this will prevent the toDataUrl cors-orign error.
This solution is also suitable for clustering.
Hope this helps