I'm using the leaflet plugin photon to request adresses like here : https://adresse.data.gouv.fr/map/
It works fine and the geocoder was added to my map. Now I would like to put the geocoder outside of my map in a searchbox. Is there a way to do it ?
API_URL = '//api-adresse.data.gouv.fr';
var searchPoints = L.geoJson(null, {
onEachFeature: function (feature, layer) {
layer.bindPopup(feature.properties.name);
}
});
function showSearchPoints (geojson) {
searchPoints.clearLayers();
searchPoints.addData(geojson);
};
var photonControlOptions = {
resultsHandler: showSearchPoints,
placeholder:' Ex : Rue Diderot Paris',
position: 'topright',
url: API_URL + '/search/?',
noResultLabel: 'Aucun résultat',
};
var map = new L.Map("map", {
center: new L.LatLng(49.047, 1.605),
layers: [layerstreets],
zoom: 13,
zoomControl: false,
photonControl: true,
photonControlOptions: photonControlOptions
});
searchPoints.addTo(map);