I'm using Leaflet to hide/show some polygones on a map but in all examples I've found, including the official one, the overlay title is statically set:
var overlayMaps = {
"Cities": cities
};
What if instead of "Cities" I want to have a translated string? In the rest of my Javascript code, I call the translated strings with:
$.ajax({
type: "POST",
url: Settings.base_url
...
}
or
$('#location_length').html(length_meters+' '+Settings.meters);
But if I try to use the following for the overlay, I get syntax error:
var overlayMaps = {
Settings.show_polygone: cities
};
Settings.show_polygone is defined in my footer, for example:
show_polygone: "<?php echo $this->lang->line('main')['show_polygone']; ?>"
Any idea how to achieve that?