thisissami
thisissami

Reputation: 16383

Is there any way to use leaflet to zoom into a rectangular image?

I use leaflet to zoom into images in webapps that I've made (see http://rihannadecoded.com for an example site). In order to make the images work, I need to make sure that they are a square that can break down into 256x256 pixel chunks.

Now I'd like to create a similar site for an image that is 5000x2000 pixels (or whatever other non-square resolution). Is there any way that I can use leaflet to do this?

Upvotes: 1

Views: 649

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117364

It shouldn't matter if the image is square and could be splitted ub to 256x256 chunks.

For a 5000x2000 image you e.g. may use 250x250 - tiles(use the tileSize-option to define the size of the tiles).

When the image can't be splitted into square chunks, you still have the option to complete the partially tiles on right/bottom with a background-color of your choice.

Upvotes: 1

Related Questions