Dear User,
   I have a search option(Google map search) in my map. When I drag the
marker to any other location I get the feature info activated.

var drag=new OpenLayers.Control.DragFeature(vectorLayer,{    
            onComplete:function(e) {    
                var lonlat =
map.getLonLatFromPixel(map.getControlsByClass("OpenLayers.Control.MousePosition")[0].lastXy).transform(new
OpenLayers.Projection("EPSG:900913"), new
OpenLayers.Projection("EPSG:4326"));     
                alert(lonlat);
                var roadidPicker = new OpenLayers.Control.WMSGetFeatureInfo({
                url: 'http://localhost:8080/geoserver/aditya/wms', 
                
                title: 'identify features on click',
                //layers: [BBMP],
                queryVisible: true,
                });
                roadidPicker.infoFormat = 'application/vnd.ogc.gml';
                roadidPicker.events.register("getfeatureinfo", this, 
pickRoadid);
                //alert (taa);
                map.addControl(roadidPicker);
                roadidPicker.activate();
            
            }
        });
 function pickRoadid(e) {       
        var val = e.features[0].attributes.ward_name;
        alert('pickRoadid');
        alert(val);
        //alert('ward_namehihi: '+val);
        if (e.features && e.features.length) {
            var ward_no = e.features[0].attributes.ward_no;
            alert(ward_no);
            return ward_no;
        }
        return val;
    }

Requesting help to make the same functionality active when the marker loads
on the map after search.


Aditya Kumar

India Urban Space Foundation



-----
GIS Developer
India Urban Space Foundation
--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Featureinfo-when-marker-load-on-map-tp5055589.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to