Edit: I am working on a project where I want to search through a GeoJSON, based on different attributes. To do this I am using leaflet-search plugin.
I want to search through my single GeoJSON. That GeoJSON has multiple attributes. I'm wondering if we could pass an array through the propertyName
option.
var controlSearch = new L.Control.Search({
layer: univ,
initial: false,
collapsed: true,
textPlaceholder: 'Search for University or Department',
propertyName: ['Institutio','Department'] ,
hideMarkerOnCollapse: true,
moveToLocation:function(latlng, title, map) {
latlng.layer.setIcon(theIcon())
map.setView(latlng, 13);
},
marker: false,
});
I've tried passing both my attributes as an array but that doesn't work. Does anyone have a solution?