За пример взял вот это
Слой из GeoJSON.
Выборку получаю по клику на карте
Код: Выделить всё
var feature = layer.getSource().getClosestFeatureToCoordinate(evt.coordinate);
при обращении к методу get () c указанием имени поля. получаю undefined, хотя атрибут есть в properties (см. скриншот)
Код: Выделить всё
function createInfoContetnt(features, coordinate) {
for (var i = 0; i < features.length; i++) {
var f = features[i];
console.log(f instanceof ol.Feature); // true
console.log(f.get('CadastreNumber')); // undefined!!!
//console.log(features[i].getProperties());
}