New StackOverflow Question: Leaflet control buttons group

12 views
Skip to first unread message

stacko...@mg.bodar.com

unread,
Mar 7, 2017, 5:10:31 AM3/7/17
to total...@googlegroups.com

Leaflet control buttons group

Asked by Mike on 2017-02-20T14:02:29Z

Reply on StackOverflow

Leaflet controls are added vertically as following:

map.addControl(new L.NewMarkerControl());
map.addControl(new L.NewLineControl());
map.addControl(new L.NewPolygonControl());
map.addControl(new L.NewRectangleControl());
map.addControl(new L.NewCircleControl());

enter image description here

I need the buttons to look like the Zoom buttons (Joined) .. and horizontally if possible like this:

enter image description here

I can't find anything on the subject online :(

I guess that the code should look something like this:

var controlsContainer = new L.NewControlsContainer()
controlsContainer.addTo(map);

controlsContainer.addControl(new L.NewMarkerControl());
controlsContainer.addControl(new L.NewLineControl());
controlsContainer.addControl(new L.NewPolygonControl());
controlsContainer.addControl(new L.NewRectangleControl());
controlsContainer.addControl(new L.NewCircleControl());

Demo here: CODEPEN DEMO

Please help.

Reply on StackOverflow
Reply all
Reply to author
Forward
0 new messages