[OpenLayers-Dev] OL w/ JQuery Mobile - WMSGetFeatureInfo & Popup

Eric Lemoine eric.lemoine at camptocamp.com
Wed Apr 27 01:05:50 EDT 2011


On Tuesday, April 26, 2011, maw269 <maw269 at gmail.com> wrote:
> Hello,
> The OL mobile code sprint cranked out some awesome results! I've been able
> to successfully utilize the OL w/ JQuery Mobile example
> (http://www.openlayers.org/dev/examples/mobile-jq.html). It is soo smooth.
> Now I am trying to port my WMSGetFeatureInfo and popup code to my mobile
> page. Can someone please help me to do this? I want to be able to touch WMS
> features and get their attributes in a popup.
> My current popup/wmsfeature code (from my desktop version) looks like this:
>
> // Begin: Add Popups with getFeatureInfo info :-)
> var maximumSize = new OpenLayers.Size(200, 200);
>
> var myPopupClass = new OpenLayers.Class
> (
>         OpenLayers.Popup.FramedCloud,
>         {
>                 'autoSize': true,
>                 'maxSize': new OpenLayers.Size(500,500)
>         }
> );
>
> var info = new OpenLayers.Control.WMSGetFeatureInfo
> ({
>         url: 'http://mydomain.com/geoserver/wms',
>         layerUrls: [('http://mydomain.com/geoserver/gwc/service/wms')],
>         layers: [dncObs, dncNav, dncPlaces, dncSoundings],
>         queryVisible: true,
>         eventListeners:
>         {
>                 getfeatureinfo: function(event)
>                 {
>                         if (event.text.search("Type") != -1)
>                         {
>                                 var myPopup = new myPopupClass
>                                 (
>                                         "chicken",
>                                         map.getLonLatFromPixel(event.xy),
>                                         null,
>                                         event.text,
>                                         null,
>                                         true
>                                 );
>                                 map.addPopup(myPopup);
>                         }
>                 }
>         }
> });
> map.addControl(info);
> info.activate();
> // End: Add Popup
>
>
> How do I make this work in the JQuery Mobile version?

Hi. What doesn't work exactly? The popup isn't displayed? Here we
haven't tried to use the OpenLayers popup in mobile apps. With jQuery
Mobile we've been using Dialogs for displaying query results.

-- 
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


More information about the Dev mailing list