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

FARANA Zdenek Zdenek.FARANA at frequentis.com
Wed Apr 27 10:08:44 EDT 2011


Hi!

You have to think carefully about mobile devices constraints. If you assume
your application will be displayed on tablet, popups can be ok. Otherwise, it
makes sense to use jquery mobile dialogs as a popup replacement.

Regards,

Zdenek Farana
Frequentis Czech Republic

-----Original Message-----
From: openlayers-dev-bounces at lists.osgeo.org
[mailto:openlayers-dev-bounces at lists.osgeo.org] On Behalf Of Eric Lemoine
Sent: Wednesday, April 27, 2011 7:06 AM
To: maw269
Cc: dev at openlayers.org
Subject: Re: [OpenLayers-Dev] OL w/ JQuery Mobile - WMSGetFeatureInfo & Popup

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
_______________________________________________
Dev mailing list
Dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-dev


More information about the Dev mailing list