我试图为标记创建弹出窗口。但它在地图的其他地方显示,如图所示。在这种情况下有点困惑。请给我解决方案。
JS
我试过的代码
var newlonLat = new OpenLayers.LonLat( Lon1, Lat1 )
.transform( new OpenLayers.Projection("EPSG:4326"),
map.getProjectionObject() // to Spherical Mercator Projection
);
var zoom=9;
var newmarkers = new OpenLayers.Layer.Markers( "Markers" );
map.addLayer(newmarkers);
newmarkers.addMarker(new OpenLayers.Marker(newlonLat));
map.setCenter (newlonLat, zoom);
popup = new OpenLayers.Popup("chicken",
new OpenLayers.LonLat(Lon1, Lat1),
new OpenLayers.Size(200,200),
"example popup",
true);
map.addPopup(popup);