I am following this very big example to set labels on the style of the vector but it's confusing.
The labels should be the Plot numbers, of each feature, which come from the JSON file.
Also i have seen this API. How can I get the data and display it?
new ol.style.Text({
font: '12px Calibri,sans-serif',
textBaseline: 'bottom',
fill: new ol.style.Fill({
color: 'rgba(0,0,0,1)'
}),
stroke: new ol.style.Stroke({
color: 'rgba(255,255,255,1)',
width: 3
})
});
var style_simple = new ol.style.Style({
fill: new ol.style.Fill({
color: 'khaki'
}),
stroke: new ol.style.Stroke({
color: 'blue',
width: 2,
opacity:1
})
});
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
url: 'JS/getjson.json',
format: new ol.format.GeoJSON()
}),style:style_simple
});
var map = new ol.Map({
target: 'map',
layers: [roadlayer,vector],
controls: ol.control.defaults().extend([new ol.control.ScaleLine()]),
view: new ol.View({
center: ol.proj.fromLonLat([33.33386, 35.14710]),
zoom: 14,
maxZoom: 19
})
});