-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resize Image when Zooming in or out #221
Comments
Hello, Maybe ou could get the current size of the image you want to update through jquery, here is a code snippet that should work :
I hope it will help you, |
Thanks! I was trying tho achieve the same effect as using google maps when you zoom in, and that is to keep the image Plot always the "same" size, I mean, every time you zoom in, you have to make the plot smaller, otherwise it will turn big enough that will cover all the selected area. I solved it by updating the map plots in a event when using the mouseWheel or the click (zoom in, or zoom out) and the value of the image depends on this zoom. In case someone need it: $('.mapcontainer svg').bind('mouseup',(function(e) { zoomLevelAdjust = $(".mapcontainer ").data("zoomLevel"); Thanks!! |
Hello @javialej87 , thank you for having shared the solution! |
@javialej87 Awesome! Where in your code did you put your mapcontainer function? Please advise. Thank you, Kenny |
Hello Kenny! It's just and event so you have to call it after you have created the map. Take into account that you have to replace the "mapcontainer svg" for the Also, check if when you do the zoom in, or zoom out, the icons remains Good luck! 2016-08-23 20:13 GMT-03:00 Kenneth Fernandez [email protected]:
|
Related to #253 |
Hello!
I want to know how can i set the width and height of images (that are actually markers on the plot) dinamically when zooming in or out. I want this behaviour because every time i zoom in, the images remain the same width and height so they occupied too much space.
Using your examples i came down to this on the zoom event, but i need to know how can i retrieve the actual width and size of the image:
var updatedOptions = {'areas' : {}, 'plots' : {}};
updatedOptions.plots["886"] = {
type : "image",
url: "myImages/new_icon.png",
width: updatedOptions.plots["886"].width - 5,
height: updatedOptions.plots["886"].height- 5
};
If i hardcode the width and height it resize ok, but i need to know dinamically wich height and width has that image in particular (on the zoom event).
Thanks!!
The text was updated successfully, but these errors were encountered: