mstahv / v-leaflet

Leaflet add-on for Vaadin
Other
43 stars 38 forks source link

Center and Zoom Asymmetry #37

Closed jdryan1 closed 10 years ago

jdryan1 commented 10 years ago

When centering a map to the location of a marker and then zooming in, you get different results depending on the sequence of the setCenter and setZoom calls.

This test case illustrates the problem.

In looking at the code, it would be more efficient to be able to specify both center and zoom on a single getRpcProxy call (since LeafletMapClientRpc supports that).

I have an LMap update with a setView method (as in the Leaflet API) that does just that. Shall I submit a pull request for it?

mstahv commented 10 years ago

Sounds good to me! With some "onBeforeClientResponse" hacks this might be fixable also with separate methods, but your solution is sounds clean and simple.

jdryan1 commented 10 years ago

Updated via pull request #38.