Skip to content
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

how to keep plots size unchanged when zoom in? #219

Closed
scil opened this issue Apr 9, 2016 · 4 comments
Closed

how to keep plots size unchanged when zoom in? #219

scil opened this issue Apr 9, 2016 · 4 comments

Comments

@scil
Copy link

scil commented Apr 9, 2016

i set plot size is 10,
but when zoom in,
the plot will grow larger .
is there any way to make sure it not grow ?

@neveldo
Copy link
Owner

neveldo commented Apr 11, 2016

Hello,

Indeed this is the normal behaviour. If you want to update the plot size at zoom, you will need to play with the 'update' event. Here is a similar thread : #16 in which you can find this example that works with mapael 1.1.0 : http://jsfiddle.net/neveldo/WRGsD/ . It's a good starting point but I think the formula is wrong as the size of the circle change a bit when zooming.

@scil
Copy link
Author

scil commented Apr 12, 2016

Thank you!
I use the default zoom step , and i try following formula and i think it works for me

        $('.map').on('afterZoom', function () {
            var size = defaultPlotSize * Math.pow(0.95, $(this).data("zoomLevel"));
            $(this).trigger('update', [{
                map: {
                    defaultPlot: { size: size, }
                }
            }])
        })

@scil scil closed this as completed Apr 12, 2016
@piyusha7
Copy link

hello,
Is there any function for zoom out to change size of plots?

@neveldo
Copy link
Owner

neveldo commented Feb 23, 2021

Hello @piyusha7 ,

There is a work in progress available in this PR from @Indigo744 : #352 (original issue : #253). However, there are still some bug to be fixed in order to ble able to merge the PR into the master branch. maybe you can take a look to this similar issue too : #253 , in which some solutions have been provided (some JSFiddle examples may be broken but the code is still readable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants