AW: [OpenLayers-Users] Re: How to test if a point is within WMS layer?

Arnd Wippermann arnd.wippermann at web.de
Thu Jan 26 16:50:28 EST 2012


Instead of wfs you can use a WMS GetFeatureInfo Request.

I use this approach to determine which country the user clicked.

Arnd

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von maw269
Gesendet: Donnerstag, 26. Januar 2012 22:42
An: openlayers-users at lists.osgeo.org
Betreff: [OpenLayers-Users] Re: How to test if a point is within WMS layer?

So I created a test polygon in GeoServer called test:allPoly and a test
geometry point in OL called 'point'. Currently the point is outside the
polygon but the wfstest layer still shows up. Shouldn't the wfs polygon be
'filtered out' with the code below?

var wfstest = new OpenLayers.Layer.Vector("Flood Vector Test", {
	strategies: [new OpenLayers.Strategy.BBOX()], visibility: false,
	protocol: new OpenLayers.Protocol.WFS({
		url:  url,	
		featurePrefix: "test",
		featureType: "allPoly",

		version: "1.1.0",
		srsName: "EPSG:900913"
		}),
            filters: [new OpenLayers.Filter.Spatial({
		type: OpenLayers.Filter.Spatial.INTERSECTS,
		value: point}) 
		]
});	

--
View this message in context:
http://osgeo-org.1560.n6.nabble.com/How-to-test-if-a-point-is-within-WMS-lay
er-tp4341265p4341763.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list