What is the correct way to fetch vector features from the server using GeoJson?
{
"type" : "FeatureCollection",
"features" : [ {
"type" : "Point",
"coordinates" : {
"x" : 14.8802,
"y" : 22.1043,
"z" : "NaN",
"m" : "NaN"
},
"properties" : {
"date" : 1472936467273,
"device" : null,
"longitude" : 14.8802,
"latitude" : 22.1043,
"mi_PRINX" : 1,
"id" : 1
}
}]
}
The map shows no points.
var dynamicFeatures = new ol.layer.Vector({
source: new ol.source.Vector({
format: new ol.format.GeoJSON(),
url: "http://localhost:9090/map/layers"
})
});
// Map
this.mapObject = new ol.Map({
target: 'map',
controls: [],
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
dynamicFeatures
],
view: new ol.View({
center: [949282, 6002552],
zoom: 4
})
});
URL is correct.
Could it be because the z and m values? these are generated automatically from the server...
Regards, Ido