Nous utilisons des cookies pour vous garantir la meilleure expérience sur notre site. Si vous continuez à utiliser ce dernier, nous considèrerons que vous acceptez l'utilisation des cookies. J'ai compris ! ou En savoir plus !.
banniere

Le portail francophone de la géomatique


Toujours pas inscrit ? Mot de passe oublié ?
Nom d'utilisateur    Mot de passe              Toujours pas inscrit ?   Mot de passe oublié ?

Annonce

Printemps des cartes 2024

#1 Mon 17 August 2009 17:50

nicolas.leclerc
Participant actif
Date d'inscription: 8 Apr 2009
Messages: 78

[Geoext, Mapserver] Non affichage d'une infobulle

Bonjour à tous !

Je me tourne vers vous car j'ai un petit souci à afficher mes données dans une infobulle. Lorsque je clique sur l'objet en question celui ci n'est pas réactif.

Mes couches s'affichent parfaitement, seules les légendes des couches wfs ne s'affichent pas ( je ne pense pas que ce soit lié mais sait on jamais.)

Je débug avec firebug mais celui ci ne m'indique aucune erreur.

voici mon mapfile:

Code:

MAP
  EXTENT 435588.53125 195662.25 464301.09375 215013.421875
  IMAGECOLOR 255 255 255
  SIZE 600 600
  STATUS ON
  SHAPEPATH "/var/www/portail_aurh_commerce/raster"
  NAME "TEST"
  IMAGETYPE PNG24
  SYMBOLSET "/var/www/symbols/symbols.sym"
WEB
IMAGEPATH "/var/www/portail_aurh_commerce/temp"

IMAGEURL "/portail_aurh_commerce/temp/"
TEMPLATE "/var/www/portail_aurh_commerce.php"
METADATA

    "wms_title"            "WMS"

    "wms_onlineresource"   "http://192.168.25.108/cgi-bin/mapserv?map=/var/www/portail_aurh_commerce/commerce.map"   

    "wms_srs"              "EPSG:27561" 



    "wfs_title"            "WFS"

    "wfs_onlineresource"   "http://192.168.25.108/cgi-bin/mapserv?map=/var/www/portail_aurh_commerce/commerce.map"

    "wfs_srs"              "EPSG:27561"


END # Metadata
END # Web
  
PROJECTION

  "init=epsg:27561" 

END # Projection


LAYER

  NAME "rasterlh"

  METADATA

    "wms_title"    "rasterlh"

  END # Metadata

  TYPE RASTER

  STATUS ON

  DATA "c_lh_ext_ign_scan25_2008.tif"

  PROJECTION

    "init=epsg:27561"

  END # Projection

  CLASS

    NAME "Fond CODAH raster"

    STYLE

      COLOR 0 255 0

      OUTLINECOLOR 120 120 120

    END # Style

  END # Class

END # Layer



LAYER

  NAME "Fond_communal"

  METADATA

    "wfs_title"    "Fond_communal"

    "gml_featureid" "NAME"     

    "gml_include_items" "all"  

  END


  TYPE POLYGON

  CONNECTION "user=****** password=******* dbname=******* host=192.168.25.108"
  CONNECTIONTYPE POSTGIS
  DATA "the_geom from ext_ign_bdtop_2008_commune as foo using unique gid using SRID=27561"
  PROJECTION

    "init=epsg:27561"

  END # Projection

  STATUS ON

  DUMP TRUE        

  CLASS

    NAME "Fond_communal"

    STYLE

      COLOR 255 0 0
      OUTLINECOLOR 120 120 120 

    END

    TEMPLATE "/var/www/portail_aurh_commerce.php"

  END

END # Layer

LAYER
    NAME "commerce"
  
    METADATA
    "wfs_title"    "commerce"  

    "gml_featureid" "NAME"     

    "gml_include_items" "all"  

    END # Metadata
 
 PROJECTION

    "init=epsg:27561"

  END # Projection
    
    DUMP TRUE 
    CONNECTION "user=***** password=****** dbname=****** host=192.168.25.108"
    CONNECTIONTYPE POSTGIS
    DATA "the_geom from lz1_aurh_ccih_cce_07_proximite as foo using unique gid using SRID=27561"
    STATUS ON
    TYPE POINT
    

CLASS
NAME "commerce"
STYLE

      COLOR 255 0 0
SYMBOL 'star'
SIZE 2

    END
    END # Class  
END # Layer


END # mapfile

et mon code HTML:

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">

  <head>

    <title>Cartographie - Section commerce</title>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

        <link rel="shortcut icon" href="favicon.gif" />

    <link rel="stylesheet" media="screen" type="text/css" title="Design" href="../css/portail_aurh_carto.css" />

        <script src="./javascript/ext-3.0.0/adapter/ext/ext-base.js" type="text/javascript"></script>
        <script src="./javascript/ext-3.0.0/ext-all.js"  type="text/javascript"></script>
        <link rel="stylesheet" type="text/css" href="./javascript/ext-3.0.0/resources/css/ext-all.css"></link>
        <script src="./javascript/OpenLayers/OpenLayers.js" type="text/javascript"></script>
        <script src="./javascript/GeoExt/script/GeoExt.js" type="text/javascript"></script>
        <link rel="stylesheet" type="text/css" href="./javascript/GeoExt/resources/css/geoext-all-debug.css"></link>
        <link rel="stylesheet" type="text/css" href="./javascript/GeoExt/resources/css/popup.css"></link>

<script type="text/javascript">
    Ext.onReady(function() {
       
            var map = new OpenLayers.Map(
                           { 

            projection : new OpenLayers.Projection("EPSG:27561"),

            maxExtent:   new OpenLayers.Bounds(432393,196190,452240,212693),

        units:'meters',

            maxResolution: 'auto',
            

controls: [

                        new OpenLayers.Control.PanZoomBar(),

                        new OpenLayers.Control.MouseToolbar(),

                        new OpenLayers.Control.KeyboardDefaults(),
       ]


    });



            var wms = new OpenLayers.Layer.WMS(
            "Fond CODAH raster",
            "http://192.168.25.108/cgi-bin/mapserv?map=/var/www/portail_aurh_commerce/commerce.map",
            {layers: "rasterlh"},{buffer: 0},{projection:"EPSG:27561",singleTile: true, opacity: 1, isBaseLayer : true}
);


             var wfs = new OpenLayers.Layer.WFS( 
          "Fond communal", 
             "http://192.168.25.108/cgi-bin/mapserv?map=/var/www/portail_aurh_commerce/commerce.map", 
          {typename: 'Fond_communal'},{extractAttributes: true},{layers: "Fond_communal"},{projection:"EPSG:27561"}


);

             var wfs1 = new OpenLayers.Layer.WFS( 
          "Commerce", 
             "http://192.168.25.108/cgi-bin/mapserv?map=/var/www/portail_aurh_commerce/commerce.map", 
          {typename: 'commerce'},{extractAttributes: true},{layers: "commerce"},{projection:"EPSG:27561"}
);

map.addLayer(wms);
map.addLayer(wfs);
map.addLayer(wfs1);
 

    wfs1.events.on({
            featureselected: function(e) {      
            if(typeof(popup) != "undefined"){
                popup.destroy();
            }
            var content = "<b>"+e.feature.attributes.ADR_VOI+
                          "</b><br /> Lon : "+e.feature.attributes.CCE_ACT+
                          "<br /> Lat : "+e.feature.attributes.CCE_ENS;
 
            popup = new GeoExt.Popup({
                title       : 'commerces'
                ,feature    : e.feature
                ,width      : 200
                ,html       : content
                ,collapsible: true
                ,anchored   : true
            });        
            popup.show();
        }
    });

var mapPanel = new GeoExt.MapPanel({
    renderTo: 'map',
    height: 800,
    width: 1015,
    map: map,

    title: 'Consultation dynamique - Section commerce'
});


var legend = new GeoExt.LegendPanel ({
    renderTo : 'legend',
    height: 400,
    width: 260,
    layerStore: mapPanel.layers,
    title: 'Légende'
});


var layerList = new GeoExt.tree.LayerContainer({
    text: 'Layers',
    layerStore: mapPanel.layers,
    leaf: false,
    expanded: true
});


var layerTree = new Ext.tree.TreePanel({
    title: 'Couches disponibles',
    renderTo: 'layerTree',
    height: 400,
    width: 260,
    root: layerList
});



    });
</script>
</head>
<body>
<div id="map"></div>
<div id='layerTree'></div>
<div id="legend"></div>

</body>
</html>

merci d'avance

Nicolas

Hors ligne

 

#2 Tue 18 August 2009 17:58

nicolas.leclerc
Participant actif
Date d'inscription: 8 Apr 2009
Messages: 78

Re: [Geoext, Mapserver] Non affichage d'une infobulle

Bonjour,

personne n'aurait une autre méthode que firebug pour débugger

merci d'avance

Nicolas

Hors ligne

 

#3 Thu 01 April 2010 16:18

mafilek
Juste Inscrit !
Date d'inscription: 10 Mar 2010
Messages: 8

Re: [Geoext, Mapserver] Non affichage d'une infobulle

bonjour mon probleme ete le chemin de fichier map dans le scripte

Dernière modification par mafilek (Thu 01 April 2010 16:32)

Hors ligne

 

Pied de page des forums

Powered by FluxBB