How can I read custom attributes of a layer?
For example I've added a layer with custom attribute test and value sam.
createG4U('#g4u-map', 'conf/client.commented.json', 'conf/layers.commented.json').then(function (map) {
map.asSoonAs('ready', true, function () {
map.get('api').addFeatureLayer({
"id": "1",
"type": "GeoJSON",
"style": stylefunction,
"source": {
"url": "files/sample.json"
},
"visible": true,
"test" : "sam"
});
map.getLayers().forEach(function (layer) {
console.log(layer);
});
});
});
Kind regards,
Sam