0
I am using the Mapbox. When you click on a Poligono appears the name of the person who lives in the city. But I want when I click to change the name of 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 wrong that way, it’s not working
Is this JSON file a file on the server? That’s what you want to change?
– Sergio
Actually it is in the same php/html project folder that runs on a local server (on my machine), wamp server
– Guilherme Tadeu
And I want to change the object, give it another name etc
– Guilherme Tadeu
this has a bit of logic in the server and another in the browser. You know how to solve some of them?
– Sergio
I don’t know how to fix :/
– Guilherme Tadeu