Маркеры рисуются с помощью poi:
Код: Выделить всё
var pois = new OpenLayers.Layer.Text( "Узлы (маркеры)",
						{ location: "get_layers.php?mode=GetNodesMarkers", 
						projection: map.displayProjection
						});
			map.addLayer(pois);Код: Выделить всё
var lineLayer = new OpenLayers.Layer.Vector("Линии"); 
			map.addLayer(lineLayer);                    
			map.addControl(new OpenLayers.Control.DrawFeature(lineLayer, OpenLayers.Handler.Path));
	
			var points = new Array(
				new OpenLayers.Geometry.Point(47, 32.24),
				new OpenLayers.Geometry.Point(45, 33),
				new OpenLayers.Geometry.Point(49, 35)
			);
			var line = new OpenLayers.Geometry.LineString(points);
			line.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));
			var style = { 
				strokeColor: '#0000ff', 
				strokeOpacity: 0.5,
				strokeWidth: 5
			};
			var lineFeature = new OpenLayers.Feature.Vector(line, null, style);
			alert(lineFeature.id);
			lineLayer.addFeatures([lineFeature]);Код: Выделить всё
function onPopupClose(evt) {
				selectControl.unselect(selectedFeature);
			}
			function onFeatureSelect(feature) {			
				selectedFeature = feature;
				id = feature.id;				
				var lonlat = map.getLonLatFromPixel(map.getControlsByClass("OpenLayers.Control.MousePosition")[0].lastXy);
				popup = new OpenLayers.Popup.FramedCloud("chicken", 
														lonlat,
														null,
														"<div style='font-size:.8em'>" +CableLineText_arr[id] +"</div>",
														null, true, onPopupClose);
				feature.popup = popup;
				map.addPopup(popup);
			}
			function onFeatureUnselect(feature) {
				map.removePopup(feature.popup);
				feature.popup.destroy();
				feature.popup = null;
			}Код: Выделить всё
selectControl = new OpenLayers.Control.SelectFeature(lineLayer,
					{onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});
			drawControls = {
						select: selectControl
					};            
            for(var key in drawControls) {
                map.addControl(drawControls[key]);
            }Код: Выделить всё
var control = drawControls[key];	
control.activate();Если убрать control.activate(); , то все наоборот: при клике на маркере - поп-ап отображается, при клике на линии - ничего.
Вопрос: как же их помирить, чтобы одновременно работали поп-апы и для маркера, и для узлов?
Заранее спасибо!
П.С. Пример поп-апа брался отсюда: http://openlayers.org/dev/examples/sele ... popup.html
