All pages on this website are written by myself, (C) Peter Thomson. I am a real person, not AI.
Using leaflet to display images with pan and zoom
pageid = 5337 parentid = 7710Leaflet can be used to display images with the ability to pan and zoom the image to see any detail in the image.
This frame shows a live view of the map we are creating:
The HTML code
For images we use a different coordinate system to normal maps. We use crs: L.CRS.Simple and we use the pixel sizes of our image as our coordinates. For the best resolution in the display, match the image pixel sizes to the zoom level. Start with the full size image and divide its width and height by 2 each time. Use the values for zoom 1 height, width as the initial values for the image.
Set the width and height of the map div to be in the same proportions as the image, and again for the best image resolution, select a pixel size the matches one of the zoom sizes of the image.