I am using angular-openlayers-directive to build my project.
I try to rewrite the example of geojson part cause I will get point information dynamically. So I made the source part of geojson inside instead of loading from json file. However, the position of my code is totally different as I expect.
The result suppose to show a point at that coordinate I set. But the point is like at the [0, 0]. If I change the to use loading from the json file, that will work.
I have no idea why the coordinate change so much. If anyone know the reason why, please let me know! I will appreciate that.
The following is my code:
source: {
type: "GeoJSON",
projection: 'EPSG:4326',
geojson: {
object: {
type: "FeatureCollection",
features: [{
type: "Feature",
id: "TWN",
properties: {
name: "Taiwan"
},
geometry: {
type: "Point",
coordinates: [25.038507, 121.525527]
}
}]
}
}
//url: 'json/ESP.geo.json'
}