We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I want to change radius of circle by inputting value. Is it posssible and how can I do this? Thank you! (I use mapboxgl)
The text was updated successfully, but these errors were encountered:
you can try to use draw.set, this can update all draw feature.
my idea is get the all draw, and change someone's feature by id, then set.
below code is example write by vue.js
changeCircleRadius: function (event, draw_layer) { const allDraw = this.draw.getAll(); const id = draw_layer.id; const center = draw_layer.center; const newRadius = event.currentTarget.value; const circle = require('@turf/circle').default; const circleFeature = circle(center, newRadius); allDraw.features.forEach(feature => { if(feature.id == id){ feature.geometry.coordinates = circleFeature.geometry.coordinates; feature.properties.radiusInKm = newRadius; } }); this.draw.set(allDraw); },
Sorry, something went wrong.
No branches or pull requests
I want to change radius of circle by inputting value. Is it posssible and how can I do this? Thank you! (I use mapboxgl)
The text was updated successfully, but these errors were encountered: