I'm in the process of developing a web application that utilizes OpenLayer 6.5. I need to dynamically mark certain locations without storing ".geojson" files on the server. Any suggestions on how I can achieve this?
When attempting to create a VectorSource from a JavaScript GeoJson object, I keep getting incorrect location data! Can you help me identify what's causing this issue in the code below?
var GeoJSONObject = {
type: "FeatureCollection",
features: [
{
type: "Feature",
properties: {},
geometry: {
type: "Point",
coordinates: [
70.33447265624999,
55.541064956111036
]
}
}
]
};
var vectorSource = new ol.source.Vector({
features: new ol.format.GeoJSON().readFeatures(GeoJSONObject)
});
var vectorLayer = new ol.layer.Vector({
renderMode: 'image',
source: vectorSource,
visible: true,
title: "Plant",
style: new ol.style.Style({
image: circleStyle
})
});
map.addLayer(vectorLayer);