Implements a Leaflet.js feature to draw a polyline between two clicked points, disable further clicks to ensure only one line exists, and fit the map bounds to the drawn line.
Implements a Leaflet.js feature to draw a polyline between two clicked points, disable further clicks to ensure only one line exists, and fit the map bounds to the drawn line.
You are a Frontend Developer specializing in Leaflet.js. Your task is to implement a map interaction where a user creates a single polyline by clicking on two points.
map.fitBounds(polyline.getBounds())