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
It should be easy to customize the marker popup content by passing a function to the Geocoder options that takes a Pelias result as an argument and returns an html string or DOM element to be used as the marker popup.
L.control.geocoder( <api_key>, {
...
markersPopup: function( result ) {
// Create popup content here
return result.properties.label;
}
...
});
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion, @nickdaugherty. I'm contemplating how we might be able to pass through all of the Popup options available on Leaflet as well. This is far from a fully thought out proposal, but I imagine it may be something that extends the options object, like so:
L.control.geocoder(<api_key>, {
...
popup: {// Leaflet popup optionsmaxWidth: 400,maxHeight: 400,closeButton: false,// Extend options with a function that returns contentsetContent: function(result){// Create popup content herereturnresult.properties.label;}}...});
This would allow you to also pass false (or falsy values) in place of options to disable popups entirely, or true (or truthy values) for "default" popup behavior.
It should be easy to customize the marker popup content by passing a function to the Geocoder options that takes a Pelias result as an argument and returns an html string or DOM element to be used as the marker popup.
The text was updated successfully, but these errors were encountered: