i am using leaflet control geocoder, i cannot figure out two things, the first is i want to position it in a div, not on the map, is there a way i can do that? if yes then how?
i have only come across the positioning method but it only lets me select it in the form of topleft topright etc. the second problem is that i want to set an icon both for when the marked location that pops up when geocoder gives result and for the actual geocoder (like a little search icon ), heres what i have.
I am relatively new to this.
var geocoder = L.Control.geocoder({
collapsed:false,
position:"topright"
})
.on('markgeocode', function(e) {
document.getElementById("currentLocation").value=e.geocode.name;
e.geocode.icon=MarkerIcon;
})
.addTo(mymap);
Best Answer
Here is some of my code, I have a side panel with textboxes, when they hit the submit button, I form the url pass it to the geocoder, grab the first Lat/Lng response, and plot it as a marker. I used the Font_AwesomeMarkers so you will want to modify the marker it uses.