I've been using Leaflet for a while, and recently came into possession a large (and I mean large) PNG image containing a satellite photo of a specific area (a couple km in radius). I'd love to be able to switch to that to compare it with the current map in Leaflet.js. How would I accomplish this?
I can easily find out which pixel position corresponds to a certain real-life GPS coordinate, and from that Leaflet.js should in theory be able to lay my large map image in the map, right? But how? That's the question.
var bookmarks = L.layerGroup();
var layer1 = L.tileLayer('<URL_GOING_TO_STREET_MAP>', { id: 'mapbox.one' }); // maxZoom: 18,
var layer2 = L.tileLayer('<URL_GOING_TO_SATELLITE_MAP>', { id: 'mapbox.two' });
var layer3 = L.tileLayer('<URL_GOING_TO_STREET_AND_SATELLITE_COMBO_MAP>', { id: 'mapbox.three' });
var theMap = L.map('map', {
center: [ <CENSORED>, <CENSORED> ],
zoom: 4,
layers: [ layer3, bookmarks ]
});
var baseLayers = {
"Standard": layer1,
"Satellite": layer2,
"Satellite + info combo": layer3
};
var overlays = {
"Bookmarks": bookmarks
};
L.control.layers(baseLayers, overlays).addTo(theMap);
fetch('./data/generated.geojson').then(function(response) { return response.json() }).then(function(actualData)
{
L.geoJSON(actualData).bindTooltip(function (layer)
{
return layer.feature.properties.name;
}).openTooltip().addTo(bookmarks);
});