[OpenLayers-Users] question about select feature

Karina Guardado kguardado at gmail.com
Mon Mar 1 12:52:32 EST 2010


Hi Erick thanks for your help and the examples you gave me I have used one
that is getfeatureinfo-popup.html and when I click the popup box open but
there is an error message

msWMSFeatureInfo(): WMS server error. Requested layer(s) are not queryable.

You know I'm workin with Mapserver and reading on the Mapserver website I
found I need some parameters in my mapfile layer in order to make it work
but I can't make it work so here is my layer code please if you could help
me to find the problem or maybe is another problem so could you give me some
ideas.

LAYER
     CONNECTIONTYPE postgis
      NAME "puntos"
      METADATA
        "wfs_title"    "puntos"
        "gml_include_items" "all"
        "gml_featureid" "cod_punto"
        "wms_feature_info_mime_type"  "text/html"
        "wms_title"    "puntos"
        "wms_srs"             "EPSG:4326"
        "wms_name"            "puntos"
         "wms_server_version"  "1.1.1"
         "wms_format"          "image/gif"

      END
        CONNECTION "host=myhost port=5432 dbname=mydb password=mypasswd
user=myuser"
      PROJECTION
         "init=epsg:4326"
      END
       DATA "geom from punto using unique geom using SRID=-1"
      DUMP TRUE
      STATUS ON
      MINSCALE 1
      MAXSCALE 900000
      TEMPLATE "puntos.html"
      HEADER "puntos.html"
      FOOTER "puntos.html"
     TYPE POINT
     CLASS
       STYLE
        SYMBOL 'CIRCLE'
         SIZE 11
         OUTLINECOLOR 0 0 0
         COLOR 255 0 0
        MINSIZE 1
        MAXSIZE 100
      END
     END
END


On Mon, Mar 1, 2010 at 1:13 AM, Eric Lemoine <eric.lemoine at camptocamp.com>wrote:

> On Tuesday, February 23, 2010, Karina Guardado <kguardado at gmail.com>
> wrote:
> > Hello everybody,
> >
> > I have 2 layers that are point type and I want users to be able to click
> on one point (of any layer) and get the information(attributes) related to
> that point. Here is my code
> >
> >  var estaciones = new OpenLayers.Layer.WMS("estaciones",
> > "http://myurl/cgi-bin/mapserv?MAP=/var/www/amss_wms2.map",
> >                 {layers:'estaciones', transparent:
> "true",format:"image/gif"});
> >
> >     var puntos = new OpenLayers.Layer.WMS("puntos",
> >                 "
> http://myurl/cgi-bin/mapserv?MAP=/var/www/amss_wms2.mapl",
> >                 {layers:'puntos', transparent:
> "true",format:"image/gif"});
> >
> > so far what I was using was a text layer to generate a marker and then
> get the information  as follows:
> >
> > var  infpuntos = new OpenLayers.Layer.Text( "infpuntos", {location:
> "textpunto.php"},
> >                        "
> http://myurl/cgi-bin/mapserv?MAP=/var/www/amss_wms2.map");
> >
> > var  infestaciones = new OpenLayers.Layer.Text( "infestaciones",
> {location: "textpunto.php"},    "
> http://myurl/cgi-bin/mapserv?MAP=/var/www/amss_wms2.map");
> >
> > but I would like that users could be able to click on one point and get
> the information without using this text markers. I found information about
> vector and gml layers with text format but I would like to know how to use
> them to work with more than one layer  or if there are other solutions that
> someone could recomend.
>
> Hi. Have you considered using the WMSGetFeatureInfo control? You can
> check out the getfeatureinfo-control example
> <
> http://trac.openlayers.org/browser/trunk/openlayers/examples/getfeatureinfo-control.html
> >.
>
> Cheers,
>
>
> --
> 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/20100301/2d3e7f04/attachment.html


More information about the Users mailing list