我在OpenLayers的Google层顶部的纬度/经度中添加了矢量点。当我平移地图时,点正在移动。如果我将Google图层替换为WGS84中的图层,则不会发生这种情况。我怎样才能解决这个问题?
map = new OpenLayers.Map('map');
map.addControl(new OpenLayers.Control.LayerSwitcher());
var gmap = new OpenLayers.Layer.Google(
"Google Streets",
{numZoomLevels: 20}
);
var pointLayer = new OpenLayers.Layer.Vector("Point Layer");
map.addLayers([gmap,pointLayer]);
map.setCenter(new OpenLayers.LonLat(16.373056, 48.208333), 5);
var point = new OpenLayers.Geometry.Point(16.373056, 48.208333);
var pointFeature = new OpenLayers.Feature.Vector(point,null,null);
pointLayer.addFeatures([pointFeature]);
我尝试遵循http://docs.openlayers.org/library/spherical_mercator.html,但没有成功。
我的问题与在同一页面上使用Jquery有关。如果我检索到所有对Jquery的引用,效果很好。