[OpenLayers-Users] WMSGetFeatureInfo + xy mouse coordinates,
can this be done?
Alexandre Dube
adube at mapgears.com
Tue Mar 1 14:22:57 EST 2011
What map server are you using to serve your WMS layer ? You could its
community if there is an equivalent to "tolerance" like in MapServer.
Regards,
Alexandre
On 11-03-01 02:15 PM, Andrew Stewart wrote:
> Thanks again for the help... I think I will try the first point you
> suggested by using a BBOX strategy. Now I have assigned a min/max
> scale through my Web Services WFS but this does not seem to come
> across as the WFS layer shows up immediately after loading the map. Do
> I have to specify the min/maxextent of the actual WFS layer itself
> when declaring it?
> My whole issue with the WMS layer is.. it works super fast and I can
> literally turn on/off these 2000+ points in 5 seconds flat.. except
> when I am doing a WMSGetFeatureInfo the mouse must be situated in the
> exact center of the point or no feature info is returned.. thus I was
> trying to use the WFS way and symbol becuase no matter how much the
> mouse touches the WFS symbol the feautre info was getting returned
> properly, wish the WMS worked that way :/
>
> ------------------------------------------------------------------------
> *From:* openlayers-users-bounces at lists.osgeo.org
> [mailto:openlayers-users-bounces at lists.osgeo.org] *On Behalf Of
> *Alexandre Dube
> *Sent:* March 01, 2011 12:03 PM
> *To:* openlayers-users at lists.osgeo.org
> *Subject:* Re: [OpenLayers-Users] WMSGetFeatureInfo + xy mouse
> coordinates, can this be done?
>
> Several thousands is too much indeed. You could :
>
> * use the BBOX strategy instead of Fixed to request for features in
> the current extent only
> * have a WMS layer on zoomed out scales and switch to WFS on zoomed
> in scales, but you wouldn't be able to interact with your WMS as you
> do with your vector features...
> * take a look at the GetFeature control and see if that could do the
> trick (currently not working, but look at the code to get the idea) :
> http://dev.openlayers.org/releases/OpenLayers-2.10/examples/getfeature-wfs.html
> * setup an OGC filter to your vector layer to get only specific
> features (if your data have some kind of attribute you could filter
> on), and make only specific features display on specific zoom levels.
> I already did something like that, see an example here :
> http://bs-dev2.mapgears.com/webmap/
>
> Best regards,
>
> Alexandre
>
>
> On 11-03-01 01:35 PM, Andrew Stewart wrote:
>> Actually I modified the strategies to be -
>>
>> strategies: [
>>
>> newOpenLayers.Strategy.Fixed(),
>>
>> newOpenLayers.Strategy.Cluster()
>>
>> ],
>>
>> Now I am getting the points showing up but there is still quite a
>> delay in loading / zooming etc. Is there anyway I can optimize this
>> further by limiting features etc?
>>
>>
>> ------------------------------------------------------------------------
>> *From:* openlayers-users-bounces at lists.osgeo.org
>> [mailto:openlayers-users-bounces at lists.osgeo.org] *On Behalf Of
>> *Andrew Stewart
>> *Sent:* March 01, 2011 11:31 AM
>> *To:* openlayers-users at lists.osgeo.org
>> *Subject:* RE: [OpenLayers-Users] WMSGetFeatureInfo + xy mouse
>> coordinates, can this be done?
>>
>> So I am having success with point features below 100.. but is it also
>> possible to use this with many point features (several thousand?)
>> My code below is trying to use the cluster strategy.. previously it
>> was Fixed but that causes my map to freeze when loading the several
>> thousand points. But when I switch to cluster nothing happens and no
>> points appear, any advice on what I'm doing wrong?
>> //Hydrant
>> var test_hydrants = new OpenLayers.Layer.Vector("Hydrant", {
>>
>> strategies: [new OpenLayers.Strategy.Cluster()],
>>
>> 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);
>>
>>
>> ------------------------------------------------------------------------
>> *From:* openlayers-users-bounces at lists.osgeo.org
>> [mailto:openlayers-users-bounces at lists.osgeo.org] *On Behalf Of
>> *Alexandre Dube
>> *Sent:* March 01, 2011 7:52 AM
>> *To:* openlayers-users at lists.osgeo.org
>> *Subject:* Re: [OpenLayers-Users] WMSGetFeatureInfo + xy mouse
>> coordinates, can this be done?
>>
>> 50~ shouldn't be a problem. IMHO, it would be a good idea to make
>> the switch to WFS.
>>
>> Cheers,
>>
>> Alexandre
>>
>> On 11-03-01 09:39 AM, Andrew Stewart wrote:
>>>
>>> Ok thanks.. So basically if my web service does not support tolerance (which I'm pretty sure is the case) then there is not much I can do with openlayers to fix this problem.. Besides possibly changing my features into markers from my WFS and giving those markers tooltips/hotspots but not sure what the performance would be on that since I need sometimes 50+ markers.
>>>
>>>
>>> -----Original Message-----
>>> From:openlayers-users-bounces at lists.osgeo.org [mailto:openlayers-users-bounces at lists.osgeo.org] On Behalf Of Alexandre Dube
>>> Sent: March 01, 2011 6:49 AM
>>> To:openlayers-users at lists.osgeo.org
>>> Subject: Re: [OpenLayers-Users] WMSGetFeatureInfo + xy mouse coordinates, can this be done?
>>>
>>> Hi,
>>>
>>> That could be setup in your web mapping service. If you use MapServer,
>>> you could set the Layer object definition "TOLERANCE" parameter for that.
>>>
>>> Regards,
>>>
>>> Alexandre
>>>
>>> [1]http://mapserver.org/mapfile/layer.html (search for "TOLERANCE")
>>>
>>>
>>> On 11-02-28 10:02 PM, Planet)x wrote:
>>>> I have a slight problem which has to do with my WMS mainly but wondering if
>>>> there is a way to program around it. Well problem is I can increase the
>>>> symbol size for points on my Web service but the geometry of the point
>>>> (centroid) remains the same. Therefore when using a
>>>> OpenLayers.Control.WMSGetFeatureInfo the feature info is never returned
>>>> until I move the mouse directly in the middle of the point feature (and also
>>>> lines unfortunately). Question is can I somehow force the mouse to be moved
>>>> to the center of the point when it nears a symbol.. and is there anyway to
>>>> actually get the entire coordinates for the symbol so I can use them to do
>>>> the featureinfo somehow? Not sure if this makes sense or if there is another
>>>> approach I can utilize to do this.. appreciate any advice!
>>>>
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>>
>> --
>> Alexandre Dubé
>> Mapgears
>> www.mapgears.com
>> ------------------------------------------------------------------------
>> [This message has been scanned for security content threats and viruses.]
>>
>> [The City of Red Deer I.T. Services asks that you please consider the
>> environment before printing this e-mail.]
>> ------------------------------------------------------------------------
>> This e-mail is intended for the original recipient(s) only. If you
>> have received it in error, please advise the sender and delete this
>> message.
>> ------------------------------------------------------------------------
>> [This message has been scanned for security content threats and viruses.]
>>
>> [The City of Red Deer I.T. Services asks that you please consider the
>> environment before printing this e-mail.]
>> ------------------------------------------------------------------------
>> This e-mail is intended for the original recipient(s) only. If you
>> have received it in error, please advise the sender and delete this
>> message.
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
> --
> Alexandre Dubé
> Mapgears
> www.mapgears.com
>
> ------------------------------------------------------------------------
> [This message has been scanned for security content threats and viruses.]
>
> [The City of Red Deer I.T. Services asks that you please consider the
> environment before printing this e-mail.]
> ------------------------------------------------------------------------
> This e-mail is intended for the original recipient(s) only. If you
> have received it in error, please advise the sender and delete this
> message.
>
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
--
Alexandre Dubé
Mapgears
www.mapgears.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110301/a6b13311/attachment.html
More information about the Users
mailing list