javascript - Changing the Length of drawn polyline : leaflet -
i new in using leaflet. can tell me how change length of drawn polyline in leaflet?. want make length small or large depending on zoom level.
leaflet polyline array of points, each of them consist of lat , lng. change it's size need update array , change distance between points width setlatlngs()
method.
if want fit screen need screen bounding box width map.getbounds()
lat or lng bbox , update line width it.
so this:
map.on('zoomend', function(){ var bounds = map.getbounds(); line.setlatlngs(bounds[0],bounds[1]); })
Comments
Post a Comment