I'm using Mapbox. When you click on a polygon the name of the person who lives in the city appears. But I want it when I click to rename the person in the JSON file.
map.on('click', function(e) {
var features = map.queryRenderedFeatures(e.point, {
layers: ['counties']
});
var feature = features[0];
$.getJSON('features.geojson', function(data) {
feature.properties.nome = "JUBILEU";
});
$('#QuestaoModal').modal('show');
});
But the wrong way, it's not working