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 Thu 23 April 2020 17:55

vistel237
Participant occasionnel
Lieu: France
Date d'inscription: 23 Apr 2020
Messages: 19

Web SIG

Développement d'applications Web SIG (édition de fonctionnalités sur le Web) à l'aide de Geoserver, Openlayers, GeoExt, Postgis


Bonjour à vous alors je viens de découvrir les SIG et je me rencompte que c'est un domaine vraiment intéressant alors j'ai donc pris pour projet de réaliser un site web sig avec de fonctionnaliser et donc j'ai fait un peu de lecture et de visionnage sur Youtube et j'ai trouvé une série de vidéos formations que je suis en train de suivre seulement voila il travaille avec TOM4 et moi avec laragon et donc après avoir effectué le code comme le montre la formation j'ai une page blanche je me permets de vous mettre le code

Code:

Web GIS
     

Ext.Loader.setConfig({
    enabled: true,
    disableCaching: false,
    paths: {
        GeoExt: "http://localhost:80/openlayer/libs/geoext2-2.1.0/src/GeoExt"
    }
});

Ext.require([
   
    'GeoExt.tree.OverlayLayerContainer',
    'GeoExt.tree.BaseLayerContainer',
    'GeoExt.data.LayerTreeModel',
   
]);

   Ext.onReady(function() {
       
   Ext.QuickTips.init();

        var bounds = new OpenLayers.Bounds(
                    68.1862489922762, 6.75556607519684,
                    97.4152926679075, 37.0766772569498
                );
         
    var options = {
                  maxExtent: bounds,
                   // maxResolution:  0.222,
                    projection: "EPSG:4326",
                    allOverlays: true,
                    units: 'degrees',
                    //center: new OpenLayers.LonLat(23,77),
                    zoom: 5,
                    //controls:[new OpenLayers.Control.MouseDefaults()]                                            
                };
                
                
                var map = new OpenLayers.Map('map', options);
                
                var Yaounde = new OpenLayers.Layer.WMS(
                    "Yaounde", "http://localhost:9090/geoserver/YDE/wms",
                    {
                        LAYERS: 'spatial:yde',
                        STYLES: '',
                        format: 'image/png',
                        tiled: true,
                        transparent: true
                      //  tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom
                    },
                    {
                //    tileOptions: {maxGetUrlLength: 2048},
                    displayInLayerSwitcher: true,
                    isBaseLayer: false,
                    //singleTile: true,
                    transitionEffect: 'resize'
                    }
                );
                
                var National = new OpenLayers.Layer.WMS(
                    "Nationale", "http://localhost:9090/geoserver/YDE/wms",
                    {
                        LAYERS: 'spatial:national',
                        STYLES: '',
                        format: 'image/png',
                        //cql_filter: 'state_name == "BIHAR"',
                       tiled: true,
                        transparent: true
                      //  tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom
                    },
                    {
                //    tileOptions: {maxGetUrlLength: 2048},
                    displayInLayerSwitcher: true,
                    isBaseLayer: false,
                    //singleTile: true,
                    transitionEffect: 'resize'
                    }
                );
                
            map.addLayers([Yaounde,National]);

 var mapPanel = Ext.create('GeoExt.panel.Map', {
           // title: 'Mappanel',
            map: map,
            region: 'center',
            stateful: true,
           // stateId: 'mappanel',
            dockedItems: [{
                xtype: 'toolbar',
                dock: 'top',
                items: [{
                    text: 'Current center of the map',
                    handler: function(){
                        var c = GeoExt.panel.Map.guess().map.getCenter();
                        Ext.Msg.alert(this.getText(), c.toString());
                    }
                }]
            }]
        });            
    
var store = Ext.create('Ext.data.TreeStore', {
            model: 'GeoExt.data.LayerTreeModel',
            root: {
                expanded: true,
                children: [
                    {
                        plugins: [{
                            ptype: 'gx_layercontainer',
                            store: mapPanel.layers
                        }],
                        expanded: true
                    }, {
                        plugins: ['gx_baselayercontainer'],
                        expanded: true,
                        text: "Base Maps"
                    }, {
                        plugins: ['gx_overlaylayercontainer'],
                        expanded: true
                    }
                ]
            }
        });
      //  var layer;
          var tree = Ext.create('GeoExt.tree.Panel', {
            border: true,
            region: "west",
            title: "Layers",
            width: 250,
            split: true,
            collapsible: true,
           // collapseMode: "mini",
            autoScroll: true,
            store: store,
            rootVisible: false,
            lines: false,
        });
        
        var north = Ext.create('Ext.panel.Panel', {
                title: "My First Web GIS page",
                 region: 'north',
                });
     
var viewport = Ext.create('Ext.Viewport', {
            layout: "fit",
            hideBorders: true,
            items: {
                layout: "border",
                deferredRender: false,
                items: [mapPanel, north, tree]
            }
        });

    
});

et donc mon log du navigateur m'affiche

GET http://localhost/openlayer/libs/ext-4.2.1.883/examples/shared/include-ext.js net::ERR_ABORTED 404 (Not Found)
first_page.html:17 GET http://localhost/openlayer/libs/ext-4.2.1.883/examples/shared/options-toolbar.js net::ERR_ABORTED 404 (Not Found)
first_page.html:20 GET http://localhost/openlayer/libs/ext-4.2.1.883/examples/shared/example.css net::ERR_ABORTED 404 (Not Found)
DevTools failed to parse SourceMap: chrome-extension://gighmmpiobklfepjocnamgkkbiglidom/include.preload.js.map
first_page.html:16 GET http://localhost/openlayer/libs/ext-4.2.1.883/examples/shared/include-ext.js net::ERR_ABORTED 404 (Not Found)
first_page.html:17 GET http://localhost/openlayer/libs/ext-4.2.1.883/examples/shared/options-toolbar.js net::ERR_ABORTED 404 (Not Found)
first_page.html:20 GET http://localhost/openlayer/libs/ext-4.2.1.883/examples/shared/example.css net::ERR_ABORTED 404 (Not Found)
first_page.html:26 Uncaught ReferenceError: Ext is not defined
    at first_page.html:26


S'il vous plait besoin d'aide
PS:desole pour la longueur du texte
Merci d'avance pour vos reponses

Hors ligne

 

Pied de page des forums

Powered by FluxBB