[Spanish] Re: Problema con popup en capa MapServer
Laurent Vaïsse
lvaisse at gmail.com
Thu Oct 21 13:46:23 EDT 2010
Tu Mapfile esta bien, solo averigua que la ruta hacia tu TEMPLATE
blank.html este bien.
En este archivo template, ahi escribes en puro html y llamas a tus
attributos entre corchetes con el nombre del campo que queres mostrar en el
popup por ejemplo [nombre_departamento]
tambien recuerda que en tu mapfile, en el select de la DATA, tienen que ir
esos campos que llamas.. no solamente el campo the_geom
Saludso
On Thu, Oct 21, 2010 at 11:35 AM, florencia.bujan <florita026 en gmail.com>wrote:
>
> Hola Laurent,
>
> Muchas gracias nuevamente por tu respuesta, cada vez me acerco más a la
> solución.
> Te cuento que ahora logro que se despliegue un popup al hacer click sobre
> una capa obtneida desde mi postgis, lo que me falta es mostrar en ese popup
> la información de la geodatabase.
>
> Por lo que estuve leyendo, la capa debe tener un template que va a ser lo
> que va a mostrar supongo. Luego de solucionar algunos problemas gracias al
> firebug llegué a que se me despliegue un popup pero con la información de
> mi
> template, y no la de la geodatabase.
> ¿Qué es lo que va dentro del template al cual hace referencia la capa?
>
> Gracias por tu cooperación, me ha sido de gran utilidad.
> Saludos,
> Florencia
>
> Te paso el código por las dudas:
>
> ------- INIT OPENLAYERS ---------
> var layerRegional = new OpenLayers.Layer.WMS("Departamentos",
> "http://localhost/cgi-bin/mapserv.exe?map=../htdocs/GISManager/mapa2.map",
> {layers:'Departamentos', format:'image/png'},
> {isBaseLayer:true, visibility:true, transparent:true,
> displayInLayerSwitcher: false });
> map.addLayer(layerRegional);
>
> var highlight = new OpenLayers.Layer.Vector("Highlighted Features", {
> displayInLayerSwitcher: false,
> isBaseLayer: false
> });
>
> map.addLayers([highlight]);
>
> info = new OpenLayers.Control.WMSGetFeatureInfo({
> url:
> 'http://localhost/cgi-bin/mapserv.exe?map=../htdocs/GISManager/mapa2.map',
> title: 'Identify features by clicking',
> layers: [layerRegional],
> queryVisible: true,
> eventListeners: {
> getfeatureinfo: function(event) {
> map.addPopup(new OpenLayers.Popup.FramedCloud(
> "chicken",
> map.getLonLatFromPixel(event.xy),
> null,
> event.text,
> null,
> true
> ));
> }
> }
> });
> map.addControl(info);
> info.activate();
>
>
>
> ---------- ARCHIVO .MAP -----------
> MAP
> ...
> WEB
> METADATA
> "wms_title" " Sistema de Información
> Geográfica"
> "wms_onlineresource"
> "http://localhost/cgi-bin/mapserv.exe?map=../htdocs/GISManager/mapa2.map&"
> "wms_srs" "EPSG:4326"
> "wms_transparent" "true"
> "labelcache_map_edge_buffer" "-10"
> "gml_include_items" "all"
> "wms_feature_info_mime_type" "text/html"
> "gml_feature_info_mime_type" "text/html"
> END
> END
>
> PROJECTION
> "init=EPSG:4326"
> END
>
> # Capa de Departamentos
> LAYER
> CONNECTIONTYPE postgis
> NAME "Departamentos"
>
> STATUS on
> PROCESSING "LABEL_NO_CLIP=ON"
>
> CONNECTION "user=*** password=*** dbname=*** host=***"
> DATA "the_geom FROM departamentos as departamentos using
> unique gid using
> SRID=-1"
> DUMP True
> TYPE POLYGON
>
> METADATA
> "wfs_title" "Departamentos"
> "wms_title" "Departamentos"
> "wms_srs" "EPSG:4326"
> "wms_name" "Departamentos"
> "wms_server_version" "1.1.1"
> "wms_format" "image/gif"
> "gml_include_items" "all"
> "wms_include_items" "all"
> END
> TEMPLATE "blank.html"
>
> CLASS
> STYLE
> COLOR 0 99 0
> OUTLINECOLOR 0 0 0
> END
> END
> END
> END
>
>
>
> -------- Template Blank.html -----------
> <html>
> <head>
> </head>
> <body>
> <div>
> Probando
> </div>
>
> <div></div>
> </body>
> </html>
>
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/Problema-con-popup-en-capa-MapServer-tp5655608p5659568.html
> Sent from the OSGeo Spanish Local Chapter mailing list archive at
> Nabble.com.
> _______________________________________________
> Spanish mailing list
> Spanish en lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/spanish
>
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://lists.osgeo.org/pipermail/spanish/attachments/20101021/5397f4f5/attachment.html
More information about the Spanish
mailing list