How to draw a line with pop-up in OpenLayers? For markers with pop-up i do so:
var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
var markers = new OpenLayers.Layer.Markers( "Markers" );
map.addLayer(markers);
map.events.register("click", map , function(e){
var opx = map.getLonLatFromPixel(e.xy) ;
var marker = new OpenLayers.Marker(lonLat);
markers.addMarker(marker);
marker.events.register("click", marker, function(e){
popup = new OpenLayers.Popup.FramedCloud("chicken",
marker.lonlat,
new OpenLayers.Size(200, 200),
"example popup",
null, true);
map.addPopup(popup);
});
});
Best Answer
Solved:
Pop-up functions: