[OpenLayers-Users] JQuery Mobile - Use WMSGetFeatureInfo in place of built in features

Mark Volz volzmark at yahoo.com
Thu Dec 29 21:08:32 EST 2011


Eric, and others.


Thank you for your help.  According to Firebug, I am now requesting WMSGetFeatureInfo on a click event.


My next question to the group is that the results are not showing up yet.  I wonder if that has something to do with the request for a regular html page as opposed to a JSON object, or if there is anything else that I need to do to get the results to show up. 


Here is the code that I modified to mobile-base:

    //var selectControl = new OpenLayers.Control.SelectFeature(sprintersLayer, {
    //    autoActivate:true,
    //    onSelect: onSelectFeatureFunction});

    var selectControl = new OpenLayers.Control.WMSGetFeatureInfo({
        url: 'http://demo.opengeo.org/geoserver/wms', 
        title: 'Identify features by clicking',
        layers: [water],
        queryVisible: true,
        autoActivate:true
    });

Mark



________________________________
 From: Eric Lemoine <eric.lemoine at camptocamp.com>
To: Mark Volz <volzmark at yahoo.com> 
Cc: "openlayers-users at lists.osgeo.org" <openlayers-users at lists.osgeo.org> 
Sent: Wednesday, December 28, 2011 1:46 PM
Subject: Re: [OpenLayers-Users] JQuery Mobile - Use WMSGetFeatureInfo in place of built in features
 



On Wednesday, December 28, 2011, Mark Volz <volzmark at yahoo.com> wrote:
> Hello,
> I am trying to configure the JQuery Mobile application so that instead of a click identifying the built in sprinters layer, it will identify using WMSGetFeatureInfo instead.  How do I assign the click event to WMSGetFeatureInfo?

WMSGetFeatureInfo works on touchstart/touchend on touch devices. So you shouldn't need anything specific to make the WMSGetFeatureInfo control work.

> Is it in controls or somewhere else?
>        controls: [
>             new OpenLayers.Control.Attribution(),
>             new OpenLayers.Control.TouchNavigation({
>                 dragPanOptions: {
>                     enableKinetic: true
>                 }
>             }),
>             click: new 

Remove "click:". The "controls" property references an array of controls.

Openlayers.Control.WMSGetFeatureInfo({
>                 url: 'http://demo.opengeo.org/geoserver/wms',
>                 title: 'Identify features by clicking',
>                 layers: [water],
>                 queryVisible: true
>             }),   
>             geolocate
>             //infoControls
>             //selectControl
>         ],


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20111229/712772db/attachment-0001.html


More information about the Users mailing list