nothing is displayed in my ol3 map

المشرف العام

Administrator
طاقم الإدارة
I generated this geojson data in my server:

{"type":"MultiLineString","coordinates":[[30.0212,40.123],[30.0229,40.1235],[30.0246,40.1239],[30.0262,40.1241],[30.027,40.1241],[30.0283,40.1241]]}

in ol3 I did:

// data above the client via ajax$.each(data , function (k,v) { console.log(k,v);

var g1=JSON.parse(v); var vectorFeature = new ol.Feature({ geometry: g1 , }); featuresArr.push(vectorFeature); })var vectorSource = new ol.source.Vector();

vectorSource.addFeatures(featuresArr);

var yol2=new ol.layer.Vector({
projection: 'EPSG:3857', source: [vectorSource] });

if( yol2 instanceof ol.layer.Vector) { // alert("yol2"); olTrMap.addLayer( yol2);

}Then nothing is displayed.

Do you have any idea?

Regards



أكثر...
 
أعلى