[OpenLayers-Users] Re: WMSGetFeatureInfo + xy mouse coordinates, can this be done?

Planet)x andrew.stewart at reddeer.ca
Thu Mar 3 13:10:51 EST 2011


I did end up switching to WFS for this .. it seems to be working good now.
Here is my code -

Appreciate all the help with this.



   //Hydrant
   var test_hydrants = new OpenLayers.Layer.Vector("Hydrant", {
   
                minScale : 5000,
                maxScale : 99,
                styleMap: new OpenLayers.StyleMap(style_vector),

   

        // init strategy : fixed=WFS query once, Cluster=Point feature group
within a tolerance
        // speeding up drawing process
        
        strategies: [new OpenLayers.Strategy.BBOX()],

        // WFS 1.0.0 (for GeoMedia WebMap 6.0)
        protocol: new OpenLayers.Protocol.WFS({
            url: wfs,
            featureType: "Hydrants",
            featureNS: "http://www.intergraph.com/geomedia/gml",
            featurePrefix: "gmgml",
            srsName: "EPSG:3776",
            //filter: filter,
            geometryName: "Geometry",
            version: "1.1.0"
        })
    });
    

       //Add Vector Layers to Map
       map.addLayer(test_hydrants);
       
        var selectControl = new OpenLayers.Control.SelectFeature(
                [test_hydrants],
                {
                    clickout: false, toggle: false,
                    multiple: false, hover: true
                }
            );


        map.addControl(selectControl);
            selectControl.activate();
            
            test_hydrants.events.on({
                "featureselected": function(e) {
                    tooltip.destroy();
	                tooltip = new Ext.ToolTip({
                    html: 'Hydrant' + '
' +  'wt' + e.feature.attributes.ATS_Desc + '-' +
e.feature.attributes.trig_Label_INF_Hydrant + '
' + '(' + e.feature.attributes.Year_Install + ')',
                    dismissDelay: 3000
                    });
                    tooltip.targetXY = [(x_pos + -50),(y_pos - 70)];
                    tooltip.show();
                }
            });


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Re-WMSGetFeatureInfo-xy-mouse-coordinates-can-this-be-done-tp6077238p6085809.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list