Replies: 1 comment
-
This should work:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, i have this code:
$.getJSON("data/ghiacciai.geojson",function(data){
L.geoJSON(data, {style: Stile_Ghiacciai,
onEachFeature: function(feature, featureLayer) {
featureLayer.bindPopup(feature.properties.Nome);
}
}).addTo(map);
});
// Add search control
var searchControl = new L.Control.Search({
position: 'topright',
layer: $.getJSON("data/ghiacciai.geojson"), // Specify the layer to search
propertyName: 'Nome', // Specify the property in the layer's features to search
marker: false // Don't add markers for search results
});
searchControl.addTo(map);
but I can't pass the layer to the search how can I solve it? Thank you
Beta Was this translation helpful? Give feedback.
All reactions