Draw rectangles with whole number bounds #843
Replies: 6 comments
-
What do you mean with |
Beta Was this translation helpful? Give feedback.
-
Hi @Falke-Design. Thank you for your reply. You are right, I was talking about I want to restrict areas, where the vertex should be placed. In my case it should be integer numbers. var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]]; should be rounded to integer var bounds = [[55, -6], [56, -3]]; My idea was to listen to |
Beta Was this translation helpful? Give feedback.
-
I think it will not work without changing the code deeper. Add this code after adding the controsl to the map. But keep in mind, when you override the code like that, you will not get any updates on this code snipptes.
|
Beta Was this translation helpful? Give feedback.
-
Hi @Falke-Design. Many thanks for provided code snippet. I'll try it and write you back with a result. |
Beta Was this translation helpful? Give feedback.
-
@maryna-livakivska any success? |
Beta Was this translation helpful? Give feedback.
-
@Falke-Design, this feature is put currently on hold in our project. I will try it as soon as it will be decided to proceed. Sorry for not writing back. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm looking for a way to draw a rectangle so that the bounds are only whole numbers.
To do this I listen to map event 'drawstart' and on working layer - event 'snapdrag'.
map.on('pm:drawstart', ({ workingLayer }) => { console.log(workingLayer); workingLayer.on('pm:snapdrag', e => { console.log(e); }); });
I have 2 questions:
Thanks for considering this issue.
Beta Was this translation helpful? Give feedback.
All reactions