I have a process which generates a simple Google Static Map (can also be a MapBox static image as the code is pretty much interchangeable).
It's recycled code from a project I found years ago.
The final map url creation string is something like this:
var mapurl = "https://maps.googleapis.com/maps/api/staticmap?center=" + center.toFixed(6) + "," + center.toFixed(6) + "&zoom=" + zoominfo.zoom + "&size=" + mapsize.width + "x" + mapsize.height + "&scale=4&format=png&key=APIKEY" + mapStyle
Lets say a URL string is this:
What I'd like to do is set up a bounding box for a specific set of lat/lon co-oridnates, and if the the url generated comes within those bounds, a seperate "customised" image is instead shown as an overlay. Think of this as essentially a custom map tile, nothing to do with google or mapbox static maps.
This map tile represents a particular region on earth, aligned to specific co-ordinates.
The closest thing I've seen is an implementaion of Google Maps GL JS where an overlay can be added: https://docs.mapbox.com/mapbox-gl-js/example/image-on-a-map/
This is essentially what I'm trying to do, albeit with Static Maps. Static Maps does not allow you to add custom raster overlays.