An example of a map presented with leaflet.js and the OSMGeocoder plugin with a range of options.
xxxxxxxxxx
<html>
<head>
<title>osmGeocoder Search Plugin for Leaflet Map</title>
<meta charset="utf-8" />
<link
rel="stylesheet"
href="https://cdn.leafletjs.com/leaflet-0.7/leaflet.css"
/>
<link
rel="stylesheet"
href="https://k4r573n.github.io/leaflet-control-osm-geocoder/Control.OSMGeocoder.css"
/>
</head>
<body>
<div id="map" style="width: 600px; height: 400px"></div>
<script
src="https://cdn.leafletjs.com/leaflet-0.7/leaflet.js">
</script>
<script
src="https://k4r573n.github.io/leaflet-control-osm-geocoder/Control.OSMGeocoder.js">
</script>
<script>
var map = L.map('map').setView([-41.2858, 174.78682], 14);
mapLink =
'<a href="https://openstreetmap.org">OpenStreetMap</a>';
L.tileLayer(
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© ' + mapLink + ' Contributors',
maxZoom: 18,
}).addTo(map);
var osmGeocoder = new L.Control.OSMGeocoder({
collapsed: false,
position: 'bottomright',
text: 'Find!',
});
map.addControl(osmGeocoder);
</script>
</body>
</html>