You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey folks, great plugin! I'd like to leave the search box open by default as "finding my address" is my primary use case. Setting it to expanded: true works great, but takes up a bit too much real estate on mobile since it's beneath the zoom controls.
When I move it to topright it would be great, but then the full width blocks the zoom controls.
Any suggestions?
The text was updated successfully, but these errors were encountered:
This is a summary (to save you a click). This is an effect of the zoom controls being added by default by Leaflet, so when you add a search bar to the map, it comes "after" the zoom controls.
What you want to do is initialize your map without the zoom controls. Then, add the geocoder, and finally, create a new zoom control and add it afterwards. The code will look like this:
// Initialize a map with zoom control disabled by defaultvarmap=L.map('map',{zoomControl: false});// Add your geocoder controlL.control.geocoder('<your-api-key>').addTo(map);// Add zoom control backL.control.zoom().addTo(map);
Hey folks, great plugin! I'd like to leave the search box open by default as "finding my address" is my primary use case. Setting it to
expanded: true
works great, but takes up a bit too much real estate on mobile since it's beneath the zoom controls.When I move it to
topright
it would be great, but then the full width blocks the zoom controls.Any suggestions?
The text was updated successfully, but these errors were encountered: