I am working on openlayers 3 and want to implement a search function that gets the name of the place and positions the marker on the map. I can get the coordinates, but when I want to add a marker to the map, I always get different places for this. The entry marker does not fit in the actual map coordinates.
Here is the code I was working on:
function addmarker(lat, long, pointerimgsrc){ var iconFeature = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.transform([lat, long], 'EPSG:4326', 'EPSG:3857')), name: 'NULL' }); var iconStyle = new ol.style.Style({ image: new ol.style.Icon(({ anchor: [0.5, 46], anchorXUnits: 'fraction', anchorYUnits: 'pixels', opacity: 0.75,
I hope that I clearly explained my problem, awaiting a solution. Thank you so much for your time and support.
source share