Hi,
We have received Blink feature client side code from our management which you have sent.
And we applied same concept/code in our application and we achieved the result. Thanks for it. But one problem is there.
We are actually displaying Flights instead of points. Each flight will have direction. We applied the direction also but we are unable to get it. Please help me on this.
Here is my sample code
var olMap;
var OnMapCreated = function (map) {
olMap = map;
posLayer = new OpenLayers.Layer.Vector();
posLayer.style = {
label: “B”,
fontColor: “red”,
fontSize: “50px”,
fontFamily: “Aircraft_b”,
rotation: “45”
};
olMap.addLayer(posLayer);
blinkPosAircrafts(featuresWkts2);
}
}
//This method we are calling in server n passing data. For example value is - “[“POINT(-11525515.5572741 2873506.51320092)_20.6463623046875_255,255,168,64”]”
function setPosData(featuresWkts) {
featuresWkts2 = featuresWkts;
}
function blinkPosAircrafts(featuresWkts) {
if (featuresWkts != undefined) {
let wktArray = JSON.parse(featuresWkts);
let wktReader = new OpenLayers.Format.WKT();
posLayer.removeAllFeatures();
for (let i = 0; i < wktArray.length; i++) {
let feature = wktReader.read(wktArray[i].split(’’)[0]);
feature.style = posLayer.style;
feature.style.fontColor = rgba2hex(wktArray[i].split(’’)[2]);
posLayer.features.push(feature);
}
clearInterval(posinterval);
if (posLayer.features.length > 0) {
posinterval = setInterval(() => {
var color;
for (let i = 0; i < posLayer.features.length; i++) {//posLayer.features.length;
let feature = posLayer.features[i];
if (!feature.style) {
feature.style = Object.assign({}, posLayer.style);
}
color = rgba2hex(wktArray[i].split(’_’)[2]);
feature.style.fontColor = feature.style.fontColor === color ? “transparent” : color;
}
posLayer.redraw();
}, 1000);
}
}
}
Thanks,
Ashok