I am looking to display a world map using the default OpenLayers
WMS, along with a single point on it that will have interactive events like onhover. Below is my code snippet:
var options = {
projection: new OpenLayers.Projection("EPSG:900913"),
maxResolution: 6000
};
map = new OpenLayers.Map('map', options);
var wmsLayer = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{layers: 'basic'}
);
var vectors = new OpenLayers.Layer.Vector("Vector Layer");
point = new OpenLayers.Geometry.Point(20.088844299316406, 51.8321709083475);
vectors.addFeatures([new OpenLayers.Feature.Vector(point)]);
map.addLayers([wmsLayer, vectors]);
map.zoomToMaxExtent();
However, I am encountering an issue where the point is being displayed incorrectly, near Africa at coordinates (0, 0) instead of its designated location. Question: Why is this happening and how can I rectify it? My goal is to accurately position the point on the map. Strangely, when I log the point's lat and lon in the console, they appear as expected, yet it still appears in the wrong place...