Map-like ability | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Map-like ability

Hey beginner here! I've been trying to make a map-like interface out of an image and i hit a brick wall when it comes to adding zooming in and out properties. I've had some ideas on how to create something like it but it seems like there has to be a better way to do it and i'd like to know if such way exists. Oh i dont want to use any google maps API just to be able to zoom in and out of an image. Thanks in advnace. PS: what i thought might work is have an event handler on scroll or on mouse click to scale the image through the css transfom or to change the image with a bigger more detailed one but it feels odd.

9th Oct 2017, 1:08 PM
Nakos
Nakos - avatar
5 Answers
+ 3
Also, do you want a clipping rectangle (so the viewport stays the same)?
9th Oct 2017, 2:11 PM
Kirk Schafer
Kirk Schafer - avatar
+ 2
Do you want to drag the map around aswell or just zoom?
9th Oct 2017, 2:00 PM
Schindlabua
Schindlabua - avatar
+ 2
Yeah you are on the right track then. Here's a minimal example: https://code.sololearn.com/WoD9DTUmtWwa/?ref=app You might want to make sure to not scroll the image out of existence and so maybe make zoom_factor have a lower and upper bound or something :)
9th Oct 2017, 3:54 PM
Schindlabua
Schindlabua - avatar
0
just zoom in and out and to have the viewpoint stay the same
9th Oct 2017, 3:22 PM
Nakos
Nakos - avatar
0
Thanks a lot i'll study that as much as it gets
9th Oct 2017, 3:59 PM
Nakos
Nakos - avatar