[fusion-users] Mapserver - Select features from custom overlay

firework alex_taillon at msn.com
Tue Oct 25 22:18:00 EDT 2011


Hi, 

I'm trying to select a feature added to a custom vector overlay layer using
OpenLayers functions. When I'm using the select tools it is always querying
the baselayer from a mapserver source and returns even if I trying
specifying the vector layer as the selection active layer it uses the wms
mapserver query.  

Basically, I would like to set the overlay layer active. I can't get the
event triggered...

Please help! 

Post when using the select widget

layers	                   
mapname	MAP
maxfeatures	-1
session	4ea76b91d8780
spatialfilter	POLYGON((blabblabla))
variant	INTERSECTS

Respond

{"hasSelection":false,"layers":[]}

Code

    // get the map and map widget
    var mapWidget = Fusion.getMapById('Map');
    var maps = mapWidget.getAllMaps();
    var map = maps[0];
	
    map.registerForEvent(Fusion.Event.MAP_SELECTION_ON, selectionOn);
    map.registerForEvent(Fusion.Event.MAP_SELECTION_OFF, selectionOff);

    // create a vector layer called "OL_Features"
    var vectorLayer = new OpenLayers.Layer.Vector('OL_Features);

    // add the marker layer to the OL Map.
    mapWidget.oMapOL.addLayer(vectorLayer);
	
	var feature = new OpenLayers.Feature.Vector(
		new OpenLayers.Geometry.Point(X,Y),
		{some:'data'},
		{externalGraphic: './images/marker.png', graphicHeight: 21, graphicWidth:
25}
	);

	mapWidget.setActiveLayer(mapWidget.oMapOL);
       //mapWidget.setActiveLayer(vectorLayer);

	vectorLayer.addFeatures(feature);


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Mapserver-Select-features-from-custom-overlay-tp6931355p6931355.html
Sent from the Fusion Users mailing list archive at Nabble.com.


More information about the fusion-users mailing list