[OpenLayers-Users] How many layers can I use with "OpenLayers.Control.WMSGetFeatureInfo"

Karina Guardado kguardado at gmail.com
Mon Dec 10 14:34:09 PST 2012


I forgot to ask if it s better to use select from text file where I have
one php application and when just click on one point I get the information
but the issue is that I can not change the popup style with css, because it
uses a print option with a tab separation and I
need to show a table with css style but have not idea how to do it here is
the code of my file.

 var  infecos = new OpenLayers.Layer.Text( \"infecos\", {location:
\"textsedesecos.php\"},
             \"http://myhost/cgi-bin/mapserv?MAP=/myfolder/mymapfile.map\");


this the textsedesecos.php file
<?php
    $host = "myhost";
       $user = "myuser";
        $pass = "mypass";
        $db = "mydb";


        // open a connection to the database server
         $connection = pg_connect ("host=$host dbname=$db user=$user
password=$pass");
        if (!$connection)
        {
            die("Could not open connection to database server");
        }


 $querystring="select name, descr, muni, codmuni, dpto, x(the_geom) as x,
y(the_geom) as y from ucsf_final2";


$res = pg_query($connection, $querystring);



 print("point" . "\t" . "title" . "\t" . "description" . "\t" . "iconSize"
. "\t" . "icon". "\n");

while ($thisrec = pg_fetch_array($res)) {

   $x = $thisrec['x'];

   $y = $thisrec['y'];
   $name = $thisrec['name'];

    $descr = $thisrec['descr'];

   $muni = $thisrec['muni'];
   $codmuni = $thisrec['codmuni'];
   $dpto = $thisrec['dpto'];




   print("$y,$x" . "\t" . "Nombre: $name" . "\t" .
"Descripción:$descr<br>Municipio:$muni<br>Codigo:$codmuni<br>Departamento:$dpto"
. "\t" . "14,14" . "\t" . "htt://myhost/ecos_blue24.png" .  "\n");
   }




?>

On Mon, Dec 10, 2012 at 4:21 PM, Karina Guardado <kguardado at gmail.com>wrote:

> Do you have an example please using  this part where you mention "the
> layers property on the control (not documented
> but see the source code) to specify a hidden layer by which the query is
> done on". Also if you have a link to an example how to use the Post method
> please.
>
> Thank you so much for your help
>
>
> On Mon, Dec 10, 2012 at 4:01 PM, Phil Scadden <p.scadden at gns.cri.nz>wrote:
>
>> Depends on how you are using WMSGetFeatureInfo. The WMSGetFeatureInfo
>> control does a GET.  You could use a click handler and explicitly do a
>> request.POST.
>>
>> However, back to the structure -- I understand the need to have
>> different layers with different colours (though it looks to me like you
>> could achieve the same thing with an SLD). The question though is
>> whether the wmsgetfeatureInfo has to made against the same layer as you
>> are displaying. Use the layers property on the control (not documented
>> but see the source code) to specify a hidden layer by which the query is
>> done on.
>>
>> Notice: This email and any attachments are confidential. If received in
>> error please destroy and immediately notify us. Do not copy or disclose the
>> contents.
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>
>
>
> --
> M.Sc. Karina Guardado
> Celular: (503) 7115 2898
>
>
>
>


-- 
M.Sc. Karina Guardado
Celular: (503) 7115 2898
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121210/a66a7f7a/attachment-0001.html>


More information about the Users mailing list