var map = L.map('map').setView([38.891, 139.824], 16);
 
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

var osmGeocoder = new L.Control.OSMGeocoder({
	collapsed: false,
	text: '検索',
	placeholder: '住所を入力してください。',
	callback: function (results) {
		var coords = L.latLng(results[0].lat,results[0].lon);
		var foundIcon = L.divIcon({ className: 'found-icon', iconAnchor: [8, 8] });
		L.marker(coords, {icon: foundIcon}).addTo(map);
		map.setView(coords,17);
	}
});
