这里正在使用谷歌标记并获取纬度和经度值并使用开放层标记显示谷歌地点标记这是一段代码
function googleMarker(name, lat, lng, address, types, iconImage)
{
var nameLength = name.length;
nameLength = nameLength+120;
var lonLat = new OpenLayers.LonLat( lng ,lat ).transform(new OpenLayers.Projection("EPSG:4326"),map.getProjectionObject());
trackMarkers = new OpenLayers.Layer.Markers("Markers");
var size = new OpenLayers.Size(20, 20);
var offset = new OpenLayers.Pixel(-(size.w / 2), -(size.h / 2));
var icon = new OpenLayers.Icon(iconImage, size, offset);
map.addLayer(trackMarkers);
trackMarker = new OpenLayers.Marker(lonLat, icon);
trackMarkers.addMarker(trackMarker);
trackMarker.events.register('click', trackMarker, function(evt)
{
popup = new OpenLayers.Popup.FramedCloud("featurePopup",lonLat, null,'<div style="color:#FF0000;">'+name+","+address + '</div>', null, null);
map.addPopup(popup);
});
}
这是解析并投影到开放图层上的问题,我面临的问题是如何在选择下一个标记并单击地图之前删除先前启用的弹出窗口,此弹出窗口应该被关闭。