IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

IGN API Géoportail Discussion :

API Géoportail / ArcGIS Server


Sujet :

IGN API Géoportail

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2015
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2015
    Messages : 29
    Points : 6
    Points
    6
    Par défaut API Géoportail / ArcGIS Server
    Bonjour à tous,

    J'aurais besoin de votre aide tout d'abord au sujet de l'import de données depuis un ArcGIS Server :

    1/ Sachant que j'ai mes données hébergées sur un ArcGIS Server (url suivant "http://d-idg.info.ratp:6080/arcgis/rest/services/"), je voudrais
    savoir comment récupérer les données de celui-ci afin d'y faire appel dans mon code. J'ai essayer de rajouter les données du Sandre ("http://services.sandre.eaufrance.fr/geo/zonage-shp"), cependant il n'y a que des tuiles rouges qui s'affichent...

    2/ Comment faire apparaitre ces données à partir d'une symbologie créée au préalable sur un .mxd ArcGIS ?

    Je me pose également les questions suivantes :

    3/ Pour l'instant, j'ai réussi à ajouter une mini-carte de situation dans la toolbox de mon viewerDiv. Cependant j'aimerais placer cette mini-carte en dehors du viewer. Est-ce possible et comment faire?

    4/ J'ai créé deux boutons "Ajout vecteur" et "Ajout Raster" en dehors du viewer. J'aimerais savoir comment faire en sorte que l'utilisateur puisse parcourir ses fichiers en cliquant sur un bouton, et que la couche s'affiche dans le viewer et soit rajoutée à l'onglet "Couches".

    Merci d'avance !

  2. #2
    Membre éclairé Avatar de elias couppe
    Homme Profil pro
    Développeur Web
    Inscrit en
    Décembre 2014
    Messages
    407
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Décembre 2014
    Messages : 407
    Points : 786
    Points
    786
    Par défaut Voir les exemples API
    Tant de questions !

    Je vais pour le moment me contenter d'essayer de répondre aux questions 3 et 4.

    Pour la question 3 :
    Je vous invite à regarder cet exemple de l'API, qui sort la minimap du viewer.
    Le code concerné côté javascript :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
        
    // Big overview map :
        var worldMap2= getGeoportalLayer('WLD','GEOGRAPHICALGRIDSYSTEMS.MAPS');
        iv.addComponent(
            "Geoportal.Component.Navigation.OverviewMap",
            {
                div:OpenLayers.Util.getElement('bigOvDiv'),
                size: new OpenLayers.Size(200, 150),
                minRatio: 8,   //default: 8
                maxRatio: 8,   //default: 32
                layers:[worldMap2],
                mapOptions: {
                    // le overviewMap est un OpenLayers.Map il ne connait pas la propriete
                    // nativeResolutions pour ses couches et par défaut, il utilise
                    // des résolutions WGS84
                    resolutions:worldMap2.options.nativeResolutions
                }
            }
        );
    Le code concerné côté html :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <div id="bigOvDiv"></div>
    Pour la question 4 :
    Encore une fois, un exemple de l'API semple s'approcher de ce que vous voulez faire :
    http://api.ign.fr/tech-docs-js/examp...ctorLayer.html

    Pour les deux premières questions, nous tenterons de vous répondre ultérieurement !

    Bon week-end,

    Elias

  3. #3
    Membre chevronné Avatar de gcebelieu
    Homme Profil pro
    Ingénieur Géographe et Cartographe
    Inscrit en
    Novembre 2010
    Messages
    1 106
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur Géographe et Cartographe
    Secteur : Service public

    Informations forums :
    Inscription : Novembre 2010
    Messages : 1 106
    Points : 1 843
    Points
    1 843
    Par défaut
    Bonjour,

    Openlayers (et donc l'api géoportail) permet de charger une couche Arcgis server 9.3. Cf. exemple :

    http://dev.openlayers.org/examples/arcgis93rest.html

    La serveur du sandre est un serveur WMS. Pour cela, il faut s'inspirer des exemples WMS de la galerie API :

    http://api.ign.fr/tech-docs-js/examp...simple6.2.html

    (qui utilise justement un serveur du SANDRE).

  4. #4
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2015
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2015
    Messages : 29
    Points : 6
    Points
    6
    Par défaut
    Merci beaucoup pour vos réponses. J'ai réussi à m'en sortir pour ce qui est de la mini map et des boutons
    J'ai quelques autres questions:
    1/ Est-il possible de regrouper des couches par dossier de couches (par exemple faire un dossier "cartes anciennes" dans l'arborescence qui regroupe les cartes d'état-major et carte topo de 1906) ? Si oui, comment ?
    2/ Est-il possible de mettre en fond de plan de ma mini map celui de la mini map du site Géoportail ?
    3/ Comment mettre une échelle numérique du type "1/1000" en plus de l'échelle graphique existant actuellement ?

    En ce qui concerne la récupération de données sur un serveur WMS, j'ai réussi à utiliser celui du SANDRE. Cependant, utilisant ArcGIS 10.1, je ne pense pas que l'exemple pour ArcGis server 9.3 s'applique à mon cas... Pour l'instant, voici mon code pour ajouter des données depuis mon ArcGis Server:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    overlays:{
    		'wms':[{
    			name:"RATP",
    			url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    			options:{
    				params:{//WMS parameters:
    				layers:'station_surfacique',
    			        format:'image/png',
    				transparent:'true'
    			        },
    		        }
    		}]
    	}
    4/ Aucune donnée ne s'affiche actuellement. Comme ce sont des données vecteur, que dois-je mettre dans "format" ?

    Merci d'avance !

  5. #5
    Membre confirmé Avatar de lboulanger
    Femme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2014
    Messages
    262
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Octobre 2014
    Messages : 262
    Points : 529
    Points
    529
    Par défaut
    Bonjour,

    Pour répondre à vos premières questions.

    Citation Envoyé par Sworks Voir le message
    1/ Est-il possible de regrouper des couches par dossier de couches (par exemple faire un dossier "cartes anciennes" dans l'arborescence qui regroupe les cartes d'état-major et carte topo de 1906) ? Si oui, comment ?

    3/ Comment mettre une échelle numérique du type "1/1000" en plus de l'échelle graphique existant actuellement ?
    Il me semble que ces composants ne sont pas proposés directement par l'API Géoportail.
    Vous pouvez en revanche les construire vous-même :
    Par exemple, pour regrouper les couches : vous pouvez modifier le contrôle du gestionnaire de couches (Geoportal.Control.LayerSwitcher).
    Ou encore, vous pouvez créer votre propre contrôle pour ajouter une échelle numérique : en capturant l'évènement de changement de zoom, puis en calculant l'échelle correspondante (cette page pourrait vous aider) que vous afficherez ensuite dans une div que vous aurez créée.


    Citation Envoyé par Sworks Voir le message
    2/ Est-il possible de mettre en fond de plan de ma mini map celui de la mini map du site Géoportail ?
    C'est possible de changer le fond de plan de la mini map, il vous suffit d'indiquer la couche que vous souhaitez afficher dans l'option "layers" de ce composant. Par exemple, si on reprend le code de l'exemple API, on a :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    // Big overview map :
       var worldMap2= getGeoportalLayer('WLD', 'GEOGRAPHICALGRIDSYSTEMS.MAPS');
        iv.addComponent(
            "Geoportal.Component.Navigation.OverviewMap",
            {
                div:OpenLayers.Util.getElement('bigOvDiv'),
                size: new OpenLayers.Size(200, 150),
                minRatio: 8,   //default: 8
                maxRatio: 8,   //default: 32
                layers:[worldMap2],
                mapOptions: {
                    // le overviewMap est un OpenLayers.Map il ne connait pas la propriete
                    // nativeResolutions pour ses couches et par défaut, il utilise
                    // des résolutions WGS84
                    resolutions:worldMap2.options.nativeResolutions
                }
            }
        );
    C'est la variable worldMap2 qu'il faut modifier.

    Dans le cas du Géoportail, c'est la donnée GEOGRAPHICALGRIDSYSTEMS.MAPS.OVERVIEW qui s'affiche dans la mini-map.
    Cette ressource n'est actuellement pas disponible pour des contrats API, mais nous avons transmis votre besoin.

  6. #6
    Membre confirmé Avatar de lboulanger
    Femme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2014
    Messages
    262
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Octobre 2014
    Messages : 262
    Points : 529
    Points
    529
    Par défaut
    Dans le cas du Géoportail, c'est la donnée GEOGRAPHICALGRIDSYSTEMS.MAPS.OVERVIEW qui s'affiche dans la mini-map.
    Cette ressource n'est actuellement pas disponible pour des contrats API, mais nous avons transmis votre besoin.
    Une astuce en attendant pourrait être d'utiliser la couche Plan IGN, qui est disponible (GEOGRAPHICALGRIDSYSTEMS.PLANIGN), en la bloquant au niveau de zoom 6 par exemple.

  7. #7
    Membre confirmé Avatar de lboulanger
    Femme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2014
    Messages
    262
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Octobre 2014
    Messages : 262
    Points : 529
    Points
    529
    Par défaut
    Citation Envoyé par lboulanger Voir le message
    Une astuce en attendant pourrait être d'utiliser la couche Plan IGN, qui est disponible (GEOGRAPHICALGRIDSYSTEMS.PLANIGN), en la bloquant au niveau de zoom 6 par exemple.
    Votre besoin a été pris en compte : la couche affichée dans la mini-carte du Géoportail peut maintenant être ajoutée à une licence géoservices sur l’Espace pro.
    La ressource s’appelle « WMTS-Géoportail - Mini-carte ».

  8. #8
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2015
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2015
    Messages : 29
    Points : 6
    Points
    6
    Par défaut
    Votre besoin a été pris en compte : la couche affichée dans la mini-carte du Géoportail peut maintenant être ajoutée à une licence géoservices sur l’Espace pro.
    La ressource s’appelle « WMTS-Géoportail - Mini-carte ».
    Merci beaucoup pour l'accès à la mini carte !

    Par contre comment faire pour bloquer le zoom sur cette dernière ? J'ai essayé ça sans succès :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
                  var worldMap= getGeoportalLayer('FXX','GEOGRAPHICALGRIDSYSTEMS.MAPS.OVERVIEW', { opacity:1.0, maxZoomLevel:6 });
                            iv.addComponent(
                                "Geoportal.Component.Navigation.OverviewMap",
                                {
                                    div:OpenLayers.Util.getElement('bigOvDiv'),
                                    size: new OpenLayers.Size(200, 150),
                                    minRatio: 8,   //default: 8
                                    maxRatio: 32,   //default: 32
                                    layers:[worldMap],
                                    mapOptions: {
                                        // le overviewMap est un OpenLayers.Map il ne connait pas la propriete
                                        // nativeResolutions pour ses couches et par défaut, il utilise
                                        // des résolutions WGS84
                                        resolutions:worldMap.options.nativeResolutions
                                    }
                                }
                            );

  9. #9
    Membre confirmé Avatar de lboulanger
    Femme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2014
    Messages
    262
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Octobre 2014
    Messages : 262
    Points : 529
    Points
    529
    Par défaut
    Bonjour,

    En réalité, le zoom maximal est à spécifier dans le paramètre "mapOptions", puisque c'est directement une option de la carte du contrôle OverviewMap.
    Comme ceci :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
          var worldMap= getGeoportalLayer('FXX','GEOGRAPHICALGRIDSYSTEMS.MAPS.OVERVIEW', { opacity:1.0, maxZoomLevel:6 });
                            iv.addComponent(
                                "Geoportal.Component.Navigation.OverviewMap",
                                {
                                    div:OpenLayers.Util.getElement('bigOvDiv'),
                                    size: new OpenLayers.Size(200, 150),
                                    minRatio: 8,   //default: 8
                                    maxRatio: 32,   //default: 32
                                    layers:[worldMap],
                                    mapOptions: {
                                        // le overviewMap est un OpenLayers.Map il ne connait pas la propriete
                                        // nativeResolutions pour ses couches et par défaut, il utilise
                                        // des résolutions WGS84
                                        resolutions:worldMap.options.nativeResolutions,
                                        minZoomLevel:2,
                                        maxZoomLevel:6
                                    }
                                }
                            );
    A vous de décider ensuite quels niveaux de zoom correspondent le mieux à votre besoin.

    Pour plus d'informations sur les contrôles, n'hésitez pas à consulter les documentations de l'API :
    - sur les contrôles en général
    - sur l'ajout de contrôles à votre carte
    - ainsi que les documentations techniques d'OpenLayers et du Géoportail pour le détail des options et paramètres.

  10. #10
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2015
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2015
    Messages : 29
    Points : 6
    Points
    6
    Par défaut
    Bonjour,

    J'ai rencontré un nouveau problème avec l'import de données depuis un serveur ArcGis.
    J'arrive à afficher les données que je veux sur l'API, cependant il est impossible de cliquer sur les éléments afin d'ouvrir une pop-up avec leurs attributs (alors qu'en ajoutant des KML par exemple, cela est possible).
    En gros, c'est l'équivalent du bouton "Identifier" sur ArcGis.

    Y-a-il quelque chose à paramétrer dans le code pour obtenir une pop-up avec les attributs au clic sur l'élément ?
    Ou bien, faut-il créer soi-même un bouton ? Si c'est le cas, je ne vois pas du tout comment faire...

    Je vous remercie d'avance

  11. #11
    Membre confirmé Avatar de acarme
    Femme Profil pro
    Ingénieur d'études en Géomatique
    Inscrit en
    Avril 2013
    Messages
    237
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur d'études en Géomatique
    Secteur : Service public

    Informations forums :
    Inscription : Avril 2013
    Messages : 237
    Points : 522
    Points
    522
    Par défaut
    Citation Envoyé par Sworks Voir le message
    Bonjour,

    J'ai rencontré un nouveau problème avec l'import de données depuis un serveur ArcGis.
    J'arrive à afficher les données que je veux sur l'API, cependant il est impossible de cliquer sur les éléments afin d'ouvrir une pop-up avec leurs attributs (alors qu'en ajoutant des KML par exemple, cela est possible).
    En gros, c'est l'équivalent du bouton "Identifier" sur ArcGis.

    Y-a-il quelque chose à paramétrer dans le code pour obtenir une pop-up avec les attributs au clic sur l'élément ?
    Ou bien, faut-il créer soi-même un bouton ? Si c'est le cas, je ne vois pas du tout comment faire...

    Je vous remercie d'avance
    Cela correspond à l'opération GetFeatureInfo d'un service WMS, vous pouvez vous inspirer de cet exemple : http://api.ign.fr/tech-docs-js/examp...p_simple9.html
    qui ouvre une infobulle au click

  12. #12
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2015
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2015
    Messages : 29
    Points : 6
    Points
    6
    Par défaut
    Merci pour ta réponse

    J'ai suivi l'exemple que tu m'as donné mais je n'arrive pas à obtenir le même résultat. Voilà ce que j'obtiens en image (ce n'est pas l'aspect visuel qui pose problème, mais plutôt celui fonctionnel car j'ai beau cocher/décocher la case puis cliquer sur mes objets, il y a juste un sablier qui apparait rapidement quand c'est coché, mais pas d'info-bulle) :
    Nom : capture-ecran-api.JPG
Affichages : 431
Taille : 164,6 Ko

    Voici mon code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
              <head>
                <title>Géoportail</title>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    			<link rel="stylesheet" type="text/css" href="geoportalMap_config.css" />
                <script type="text/javascript" src="http://api.ign.fr/geoportail/api/js/latest/GeoportalExtended.js"><!-- --></script> 
              </head>
    		  
              <body>
    			<!-- Titre de la page -->
    			<h1 id="title">GéOPoRTAiL</h1>
    		  
    		    <!-- Bouton de centrage sur Paris qui fait appel à la fonction javascript "centrageParis" -->
    	        <input class="boutoncentrage" type="button" value="Centrage sur Paris" onclick="centrageParis();" />
    
    			<!-- Aide pour l'utilisation de l'API -->
    			<div id="aide">
    			<p>
    			    <a href="./Manuel_utilisateur.docx">Aide</a>			   
    			</p>
    			</div>
    			
    			
    		    <!-- div contenant la partie cartographique, remplie via le Javascript -->
                <div id="viewerDiv"></div>
    			<!-- div contenant la mini map -->
    			<div id="bigOvDiv"></div>
    			
    			<table>
                  <tr>
     
                    <td>
                      <form action="javascript:(void)0">
                        <label for="getFeatureToggle">
                          <input type="checkbox" id="getFeatureToggle"/>
                            <span>Cochez pour identifier des éléments</span>
                        </label>
                        <br/>
                        <textarea id="getFeatureResults" rows="25" cols="80"></textarea>
                        <br/>
                        <input type="button" id="getFeatureClean" value="Vider !"/>
                      </form>
                    </td>
                  </tr>
                </table>
    			
    	<!--   SCRIPT   -->
    	<script type="text/javascript">
    	        
    	iv= null; //variable globale qui aura pour valeur le retour de la méthode "Geoportal.Load()"
    
    			
    	function attachGetFeatureInfoControl() {
                // fabrication de l'id de la barre d'outils dans le layerSwitcher :
                // "basic_<LayerSwitcherId>_<LayerId>"
                var lsid= "" ;
                var lss= this.map.getControlsByClass("Geoportal.Control.LayerSwitcher") ;
                lsid= lss[0].id+"_" ;
                //this===layer
                var blc= this.map.getControlsBy('id', 'basic_'+lsid+this.id)[0];
                if (!blc) { return; }
                var wic= new OpenLayers.Control.WMSGetFeatureInfo({
                    url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
                    layers:['0'],//'0','1','2','3','4','5','6','7','8','9','10'
                    title:"Identifier les « " + '0'.name + " »",
                    type:OpenLayers.Control.TYPE_BUTTON,
                    queryVisible:true,
                    maxFeatures:1,
                    eventListeners:{
                        getfeatureinfo:function(event) {
                            //this===control
                            if (event.text) {
                                this.map.addPopup(new
                                    OpenLayers.Popup.FramedCloud(
                                        "chicken",
                                        this.map.getLonLatFromPixel(event.xy),
                                        null,
                                        event.text,
                                        null,
                                        true,
                                        function(){
                                            console.log("close manually");
                                            this.destroy();
                                        }
                                    )
                                );
                            }
                        }
                    }
                });
                
                blc.addControls([wic]);
                // by default, it's activated !
                wic.activate();
            }
    			
    			
    /**
     * Function: initialisationCarte
     * Load the viewer and add components (graticules and overview map). 
     * Called on "onload" event.
     */			
    			
    			function initialisationCarte() {
    			
    			     iv= Geoportal.load( //permet de charger la carte
                                 // identifiant du conteneur de la carte
                                 'viewerDiv',
                                 // clé API
    			     ['i60lnbtlh5fdza48mta2chie'],
                                 {// centre de la carte
                                                // longitude:
                                                lon:2.339,
                                                // latitude:
                                                lat:48.859
                                 },
                                 //zoom entre 0 et 20
                                 14,
                                 //options du loader
                                 {
                                 	type:'js', //javascript
    				viewerClass: Geoportal.Viewer.Default, //type du visualiseur
    				onView: ajoutElements, //appel de la fonction qui sera executée au chargement de la carte
     			        theme: {
    	    		                     name: 'black',
    	    		                     styles:[{css: 'http://api.ign.fr/geoportail/api/js/latest/theme/black/style.css'}]
    	    	                    },
    	    	                    //couches Géoportail que l'on souhaite avoir dans l'onglet "Couches"
    				    //se référer à ce site pour plus d'informations sur les couches: http://api.ign.fr/tech-docs-js/fr/webmaster/layers.html
    				    layers: [
    	    					'GEOGRAPHICALGRIDSYSTEMS.MAPS',
    	    					'GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40',
    	    					'ORTHOIMAGERY.ORTHOPHOTOS',
    	    					'GEOGRAPHICALGRIDSYSTEMS.PLANIGN',
    	    					'CADASTRALPARCELS.PARCELS',
    	    					'GEOGRAPHICALGRIDSYSTEMS.1900TYPEMAPS',
    	    					'GEOGRAPHICALNAMES.NAMES',
    	    					'HYDROGRAPHY.HYDROGRAPHY',
    	    					'LANDCOVER.FORESTAREAS',
    	    					'LANDCOVER.FORESTINVENTORY.V2',
    						'TRANSPORTNETWORKS.ROADS',
    						'BUILDINGS.BUILDINGS',
    						'ORTHOIMAGERY.ORTHOPHOTOS2000-2005',
    	    					],
    				   //options des couches Géoportail	
    	    	                    layersOptions: {
    	    					'GEOGRAPHICALGRIDSYSTEMS.MAPS':{opacity:1,visibility:false},
    	    					'GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40':{opacity:1,visibility:false},
    	    					'ORTHOIMAGERY.ORTHOPHOTOS':{opacity:1,visibility:false},
    	    					'GEOGRAPHICALGRIDSYSTEMS.PLANIGN':{opacity:1,visibility:true},
    	    					'CADASTRALPARCELS.PARCELS':{opacity:1,visibility:false},
    	    					'GEOGRAPHICALGRIDSYSTEMS.1900TYPEMAPS':{opacity:1,visibility:false},
    	    					'GEOGRAPHICALNAMES.NAMES':{opacity:1,visibility:false},
    	    					'HYDROGRAPHY.HYDROGRAPHY':{opacity:1,visibility:false},
    	    					'LANDCOVER.FORESTAREAS':{opacity:1,visibility:false},
    	    					'LANDCOVER.FORESTINVENTORY.V2':{opacity:1,visibility:false},
    						'TRANSPORTNETWORKS.ROADS':{opacity:1,visibility:false},
    						'BUILDINGS.BUILDINGS':{opacity:1,visibility:false},
    						'ORTHOIMAGERY.ORTHOPHOTOS2000-2005':{opacity:1,visibility:false},
    	    					},
    	    	                    //couches externes au Géoportail
    								overlays:{
    								    'wms':[{
    								    		name:"station_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{// parametres WMS
    								    				layers:'0', //ID de la couche sur le serveur ArcGIS
    								    				transparent:'true'
    								    			},
    								    			options:{//options de la couche WMS
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[ //logo de la RATP qui s'affiche en bas à droite de la carte quand il y a des données RATP
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													// add GetFeatureInfo on WMS layer just after
    													// the layer has been added to the map
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"quai_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'1',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"ouvrage_technique_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'2',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"interstation_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'3',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"emergence_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'4',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"defaut_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'5',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"station_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'6',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"quai_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'7',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								     		name:"ouvrage_technique_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'8',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"interstation_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'9',
    								    				transparent:'true',
    								    				
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"emergence_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'10',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	],
    								    },                                        
    	    					}
    						);	
    
    			}
    	
    /**
     *
     * Function: ajoutElements
     * Add components to the viewer: graticules and overview map
     * Called on 'Geoportal.load.onview' event
     *
     */	
    	
    			function ajoutElements() {
    		
    			            viewer = iv.getViewer();
    						map = viewer.getMap();
    							
    								
    						// ajout de projections au bandeau du bas pour afficher les coordonnées de la souris
                            var controlProjection = map.getControlsByClass("Geoportal.Control.Projections")[0] ; 
                            console.log(controlProjection) ;
                            var projs = [ 
    					    	new OpenLayers.Projection("EPSG:4326"), //WGS84
    					        new OpenLayers.Projection("IGNF:LAMB93"), //Lambert93
    					    ] ;
                            controlProjection.displayProjections = projs ;
                            controlProjection.redraw() ;
    					
    			            //Ajout d'échelle graphique
    			            //iv.addComponent('Geoportal.Control.GraphicScale');
    			            
    						//Ajout du catalogue de couches
    						
    			            // Modif CSS de l'échelle graphique
    			            /*var echelle = document.getElementsByClassName('gpControlGraphicScale')[1];
    			            echelle.style.position = "relative";
    			            echelle.style.top = "280px";
    						echelle.style.right = "0px";
    			            echelle.style.left = "1057px";
    			            echelle.style.backgroundColor ="white";
    						echelle.style.color = "black";
    						echelle.style.border = "solid 2px black";*/				
    						     
    			            //Récupération de la barre d'outils 
    						var tbx= viewer.getMap().getControlsByClass("Geoportal.Control.ToolBox")[0]; 
    						var panel= new Geoportal.Control.Panel({
    							div:OpenLayers.Util.getElement(tbx.id+"_search")
    						});
    						viewer.getMap().addControls([panel]);
    						
    						//Ajout du contrôle d'impression
    						var nv= viewer.getMap().getControlsByClass("Geoportal.Control.NavToolbar")[0]; 
    						nv.addControls([new Geoportal.Control.PrintMap()]);
    						
    						//Ajout des outils de mesure
    						var measurebar= new Geoportal.Control.MeasureToolbar({ 
    							div: OpenLayers.Util.getElement(tbx.id+"_measure"), 
    							displaySystem:(viewer.getMap().getProjection().getProjName()=="longlat"?"geographic":"metric"), 
    							targetElement: OpenLayers.Util.getElement(tbx.id+"_meares"),
    						}); 
    	                    viewer.getMap().addControl(measurebar);
    											
    	                    //Ajout de la LayerToolbar (outils d'ajout de couche vecteur et raster)
    	                    var tOpts= {div: OpenLayers.Util.getElement(tbx.id+"_addlyr")};
    	                    	tOpts= OpenLayers.Util.extend(tOpts,{
    	                    		addVectorLayerOptions:{
    	                    		supportedClasses:[ //formats de fichiers supportés
    	                    			"OpenLayers.Format.KML",
    	                    			"Geoportal.Format.GPX",
    	                    			"OpenLayers.Format.OSM",
    	                    			"OpenLayers.Layer.GeoRSS",
    	                    			"OpenLayers.Layer.WFS"
    	                    		],
    	                    		styleMapTemplates:{
    	                    			"OpenLayers.Layer.GeoRSS":new OpenLayers.StyleMap(
    	                    			new OpenLayers.Style(
    	                    			OpenLayers.Util.applyDefaults({
    	                    				"graphic":true,
    	                    				"externalGraphic":Geoportal.Util.getImagesLocation()+"xy-target.gif",
    	                    				"graphicOpacity":1.0,
    	                    				"graphicWidth":25,
    	                    				"graphicHeight":25,
    	                    				"graphicXOffset":-12.5,
    	                    				"graphicYOffset":-12.5
    	                    			},OpenLayers.Feature.Vector.style["default"])
    	                    			)
    	                    			)
    	                    		},
    	                    		layerVectorOptions:{
    	                    			global:{}
    	                    		}
    	                    		},
    	                    
    	                    		addImageLayerOptions:{
    	                    		layerImageOptions:{
    	                    			singleTile:false
    	                    		}
    	                    		}
    	                    
    	                    	});
    	                    	var LayerToolbar= new Geoportal.Control.LayerToolbar(tOpts);
    	                    	viewer.getMap().addControl(LayerToolbar);
                            
                            //Ajout de l'outil de recherche par noms de lieux
                            var GeoNames= new Geoportal.Control.LocationUtilityService.GeoNames(
                              new Geoportal.Layer.OpenLS.Core.LocationUtilityService( 
                                  "PositionOfInterest:OPENLS;Geocode",
                                  { 
                                   maximumResponses:100,
                                    formatOptions: {
                                    }
                                  }
                              ),{
                                  drawLocation:true,
                                  setZoom: Geoportal.Control.LocationUtilityService.GeoNames.setZoomForBDNyme,
                                  autoCompleteOptions: {} //autocomplétion 
                                }
                            );
                            panel.addControls([GeoNames]);
                            
                            //Ajout du contrôle de recherche par adresses
                            var Geocode= new Geoportal.Control.LocationUtilityService.Geocode(
                              new Geoportal.Layer.OpenLS.Core.LocationUtilityService( 
                                  "StreetAddress:OPENLS;Geocode",
                                    { 
                                      maximumResponses:100,
                                      formatOptions: {
                                      }
                                    }
                                 ),{
                                      drawLocation:true,
                                      setZoom: Geoportal.Control.LocationUtilityService.GeoNames.setZoomForBDNyme,
                                      autoCompleteOptions: {}
                                    }
                            );
                            panel.addControls([Geocode]);
    						
    						// Ajout de la mini map
    						var miniMap= getGeoportalLayer('FXX','GEOGRAPHICALGRIDSYSTEMS.MAPS.OVERVIEW');
                            iv.addComponent(
                                "Geoportal.Component.Navigation.OverviewMap",
                                {
                                    div:OpenLayers.Util.getElement('bigOvDiv'),
                                    size: new OpenLayers.Size(200, 150),
                                    minRatio: 8,   //default: 8
                                    maxRatio: 32,   //default: 32
                                    layers:[miniMap],
                                    mapOptions: {
                                        resolutions:miniMap.options.nativeResolutions,
    									minZoomLevel:2,
                                        maxZoomLevel:8
                                    }
                                }
                            );
    						
    						// GetFeature WMS
    								var wfsGFCtrl= new OpenLayers.Control.GetFeature({
                                                protocol: new OpenLayers.Protocol.WFS({
                                                    url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
                                                    featurePrefix:'ms',
                                                    featureNS:'http://mapserver.gis.umn.edu/mapserver',
                                                    geometryName:'msGeometry',
                                                    //featureType:['rgp', 'sit_rbf', 'sit_rdf', 'rn'],
                                                    featureType:['rnType', 'sit_rbfType', 'sit_rdfType'],
                                                    //srsName:'EPSG:4326',
                                                    //version:'1.0.0',
                                                    formatOptions:{
                                                        // WARNING: because of EPSG:4326 in Mapserver
                                                        //          WFS 1.1.0 (axis order) :
                                                        //          xy must be false in WFS 1.1.0 and
                                                        //          true in WFS 1.0.0 !
                                                        xy:true,
                                                        // keep coordinates as sent :
                                                        //internalProjection:this.getViewer().getMap().getProjection().clone(),
                                                        //externalProjection:new OpenLayers.Projection('EPSG:4326')
                                                    }
                                                }),
                                                // select by bbox only
                                                box:true,
                                                click:false,
                                                clickout:false,
                                                eventListeners:{
                                                    'featuresselected': function(e) {
                                                        gfResults.value+= '\n/* --- */\n' + gfGeoJSON.write(e.features,true);
                                                    }
                                                }
                                            });
                                            this.getViewer().getMap().addControl(wfsGFCtrl);
                                            // open layer switcher
                                            this.getViewer().openLayersPanel(true);
                                        
                                            var e= OpenLayers.Util.getElement('getFeatureToggle');
                                            e.onclick= function() {
                                                // context is input checkbox
                                                if (this.checked) {
                                                    wfsGFCtrl.activate();
                                                } else {
                                                    wfsGFCtrl.deactivate();
                                                }
                                            };
                                            e= OpenLayers.Util.getElement('getFeatureClean');
                                            e.onclick= function() {
                                                gfResults.value= '';
                                            };
                                        
                                            // open layer switcher advanced panel
                                            var wmss= this.getViewer().getMap().getLayersByClass('OpenLayers.Layer.WMS');
                                            var ptcs= this.getViewer().getMap().getControlsByClass('Geoportal.Control.PanelToggle');
                                            for (var i= 0, n= wmss.length; i<n; i++) {
                                                for (var j= 0, l= ptcs.length; j<l; j++) {
                                                    if (ptcs[j].id.indexOf(wmss[i].id)!=-1) {
                                                        ptcs[j].panel.activateControl(ptcs[j]);
                                                        break;
                                                    }
                                                }
                                            }
    											
    			}			
    			
    /**
     * Function: getGeoportalLayer
     * Build a Geoportal's layer.
     *
     * Parameters:
     * territory - {String} one of the Geoportal's territory.
     * name - {String} Geoportal's layer standard name.
     *
     * Returns:
     * {<OpenLayers.Layer>} the ready to use Geoportal's layer.
     */
    			function getGeoportalLayer ( territory, name ) {
                    var lyrPrms= map.catalogue.getLayerParameters(territory, name);
                    lyrPrms.options.territory= territory;
                    lyrPrms.options.isBaseLayer= true;
                    lyrPrms.options.opacity= 1.0;
                    var lyr= new lyrPrms.classLayer(
                        lyrPrms.options.name,
                        lyrPrms.url,
                        lyrPrms.params,
                        lyrPrms.options);
                    return lyr;
                }
    				
    /**
     * Function: centrageParis
     * Fonction de centrage sur Paris, déclenchée au clic bouton dédié
     * Avec la méthode setCenterAtLonLat (longitude, latitude, zoom)
     */			
    			
    		    function centrageParis() {
    				viewer.getMap().setCenterAtLonLat(2.3457,48.8571,13);
    		    }
    			
    			//Exécute la fonction initialisationCarte au chargement de la page Web
                window.onload= initialisationCarte;
    	
                   </script>
    
              </body>
            </html>
    Je pense que le lien ne doit pas se faire entre mes objets et le GetFeatureInfo...

  13. #13
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2015
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2015
    Messages : 29
    Points : 6
    Points
    6
    Par défaut
    Merci pour ta réponse

    J'ai suivi l'exemple que tu m'as donné, mais je n'arrive pas à obtenir de résultat lorsque je sélectionne un objet (aucune info-bulle ne s'affiche, alors qu'il y a un rapide sablier qui apparait au clic).
    Voici une capture d'écran du résultat (l'aspect visuel ne pose pas problème, mais c'est l'aspect fonctionnel car aucune info-bulle ne s'affiche pour l'instant) :
    Nom : capture-ecran-api.JPG
Affichages : 389
Taille : 164,6 Ko

    Voici mon code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
              <head>
                <title>Géoportail</title>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    			<link rel="stylesheet" type="text/css" href="geoportalMap_config.css" />
                <script type="text/javascript" src="http://api.ign.fr/geoportail/api/js/latest/GeoportalExtended.js"><!-- --></script> 
              </head>
    		  
              <body>
    			<!-- Titre de la page -->
    			<h1 id="title">GéOPoRTAiL</h1>
    		  
    		    <!-- Bouton de centrage sur Paris qui fait appel à la fonction javascript "centrageParis" -->
    	        <input class="boutoncentrage" type="button" value="Centrage sur Paris" onclick="centrageParis();" />
    
    			<!-- Aide pour l'utilisation de l'API -->
    			<div id="aide">
    			<p>
    			    <a href="./Manuel_utilisateur.docx">Aide</a>			   
    			</p>
    			</div>
    			
    			
    		    <!-- div contenant la partie cartographique, remplie via le Javascript -->
                <div id="viewerDiv"></div>
    			<!-- div contenant la mini map -->
    			<div id="bigOvDiv"></div>
    			
    			<table>
                  <tr>
     
                    <td>
                      <form action="javascript:(void)0">
                        <label for="getFeatureToggle">
                          <input type="checkbox" id="getFeatureToggle"/>
                            <span>Cochez pour identifier des éléments</span>
                        </label>
                        <br/>
                        <textarea id="getFeatureResults" rows="25" cols="80"></textarea>
                        <br/>
                        <input type="button" id="getFeatureClean" value="Vider !"/>
                      </form>
                    </td>
                  </tr>
                </table>
    			
    			<!--   SCRIPT   -->
    			<script type="text/javascript">
    	        
    			iv= null; //variable globale qui aura pour valeur le retour de la méthode "Geoportal.Load()"
    
    			
    			function attachGetFeatureInfoControl() {
                // fabrication de l'id de la barre d'outils dans le layerSwitcher :
                // "basic_<LayerSwitcherId>_<LayerId>"
                var lsid= "" ;
                var lss= this.map.getControlsByClass("Geoportal.Control.LayerSwitcher") ;
                lsid= lss[0].id+"_" ;
                //this===layer
                var blc= this.map.getControlsBy('id', 'basic_'+lsid+this.id)[0];
                if (!blc) { return; }
                var wic= new OpenLayers.Control.WMSGetFeatureInfo({
                    url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
                    layers:['0'],//'0','1','2','3','4','5','6','7','8','9','10'
                    title:"Identifier les « " + '0'.name + " »",
                    type:OpenLayers.Control.TYPE_BUTTON,
                    queryVisible:true,
                    maxFeatures:1,
                    eventListeners:{
                        getfeatureinfo:function(event) {
                            //this===control
                            if (event.text) {
                                this.map.addPopup(new
                                    OpenLayers.Popup.FramedCloud(
                                        "chicken",
                                        this.map.getLonLatFromPixel(event.xy),
                                        null,
                                        event.text,
                                        null,
                                        true,
                                        function(){
                                            console.log("close manually");
                                            this.destroy();
                                        }
                                    )
                                );
                            }
                        }
                    }
                });
                
                blc.addControls([wic]);
                // by default, it's activated !
                wic.activate();
            }
    			
    			
    /**
     * Function: initialisationCarte
     * Load the viewer and add components (graticules and overview map). 
     * Called on "onload" event.
     */			
    			
    			function initialisationCarte() {
    			
    						iv= Geoportal.load( //permet de charger la carte
                                 // identifiant du conteneur de la carte
                                 'viewerDiv',
                                 // clé API
    							 ['i60lnbtlh5fdza48mta2chie'],
                                 {// centre de la carte
                                                // longitude:
                                                lon:2.339,
                                                // latitude:
                                                lat:48.859
                                 },
                                 //zoom entre 0 et 20
                                 14,
                                 //options du loader
                                 {
                                 	type:'js', //javascript
    								viewerClass: Geoportal.Viewer.Default, //type du visualiseur
    								onView: ajoutElements, //appel de la fonction qui sera executée au chargement de la carte
     							    theme: {
    	    		                        name: 'black',
    	    		                        styles:[{css: 'http://api.ign.fr/geoportail/api/js/latest/theme/black/style.css'}]
    	    	                    },
    	    	                    //couches Géoportail que l'on souhaite avoir dans l'onglet "Couches"
    								//se référer à ce site pour plus d'informations sur les couches: http://api.ign.fr/tech-docs-js/fr/webmaster/layers.html
    								layers: [
    	    							'GEOGRAPHICALGRIDSYSTEMS.MAPS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40',
    	    							'ORTHOIMAGERY.ORTHOPHOTOS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.PLANIGN',
    	    							'CADASTRALPARCELS.PARCELS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.1900TYPEMAPS',
    	    							'GEOGRAPHICALNAMES.NAMES',
    	    							'HYDROGRAPHY.HYDROGRAPHY',
    	    							'LANDCOVER.FORESTAREAS',
    	    							'LANDCOVER.FORESTINVENTORY.V2',
    									'TRANSPORTNETWORKS.ROADS',
    									'BUILDINGS.BUILDINGS',
    									'ORTHOIMAGERY.ORTHOPHOTOS2000-2005',
    	    							],
    								//options des couches Géoportail	
    	    	                    layersOptions: {
    	    							'GEOGRAPHICALGRIDSYSTEMS.MAPS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40':{opacity:1,visibility:false},
    	    							'ORTHOIMAGERY.ORTHOPHOTOS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.PLANIGN':{opacity:1,visibility:true},
    	    							'CADASTRALPARCELS.PARCELS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.1900TYPEMAPS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALNAMES.NAMES':{opacity:1,visibility:false},
    	    							'HYDROGRAPHY.HYDROGRAPHY':{opacity:1,visibility:false},
    	    							'LANDCOVER.FORESTAREAS':{opacity:1,visibility:false},
    	    							'LANDCOVER.FORESTINVENTORY.V2':{opacity:1,visibility:false},
    									'TRANSPORTNETWORKS.ROADS':{opacity:1,visibility:false},
    									'BUILDINGS.BUILDINGS':{opacity:1,visibility:false},
    									'ORTHOIMAGERY.ORTHOPHOTOS2000-2005':{opacity:1,visibility:false},
    	    							},
    	    	                    //couches externes au Géoportail
    								overlays:{
    								    'wms':[{
    								    		name:"station_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{// parametres WMS
    								    				layers:'0', //ID de la couche sur le serveur ArcGIS
    								    				transparent:'true'
    								    			},
    								    			options:{//options de la couche WMS
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[ //logo de la RATP qui s'affiche en bas à droite de la carte quand il y a des données RATP
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													// add GetFeatureInfo on WMS layer just after
    													// the layer has been added to the map
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"quai_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'1',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"ouvrage_technique_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'2',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"interstation_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'3',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"emergence_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'4',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"defaut_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'5',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"station_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'6',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"quai_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'7',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"ouvrage_technique_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'8',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"interstation_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'9',
    								    				transparent:'true',
    								    				
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"emergence_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'10',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	],
    								    },                                        
    	    					}
    						);	
    
    			}
    	
    /**
     *
     * Function: ajoutElements
     * Add components to the viewer: graticules and overview map
     * Called on 'Geoportal.load.onview' event
     *
     */	
    	
    			function ajoutElements() {
    		
    			            viewer = iv.getViewer();
    						map = viewer.getMap();
    							
    								
    						// ajout de projections au bandeau du bas pour afficher les coordonnées de la souris
                            var controlProjection = map.getControlsByClass("Geoportal.Control.Projections")[0] ; 
                            console.log(controlProjection) ;
                            var projs = [ 
    					    	new OpenLayers.Projection("EPSG:4326"), //WGS84
    					        new OpenLayers.Projection("IGNF:LAMB93"), //Lambert93
    					    ] ;
                            controlProjection.displayProjections = projs ;
                            controlProjection.redraw() ;
    					
    			            //Ajout d'échelle graphique
    			            //iv.addComponent('Geoportal.Control.GraphicScale');
    			            
    						//Ajout du catalogue de couches
    						
    			            // Modif CSS de l'échelle graphique
    			            /*var echelle = document.getElementsByClassName('gpControlGraphicScale')[1];
    			            echelle.style.position = "relative";
    			            echelle.style.top = "280px";
    						echelle.style.right = "0px";
    			            echelle.style.left = "1057px";
    			            echelle.style.backgroundColor ="white";
    						echelle.style.color = "black";
    						echelle.style.border = "solid 2px black";*/				
    						     
    			            //Récupération de la barre d'outils 
    						var tbx= viewer.getMap().getControlsByClass("Geoportal.Control.ToolBox")[0]; 
    						var panel= new Geoportal.Control.Panel({
    							div:OpenLayers.Util.getElement(tbx.id+"_search")
    						});
    						viewer.getMap().addControls([panel]);
    						
    						//Ajout du contrôle d'impression
    						var nv= viewer.getMap().getControlsByClass("Geoportal.Control.NavToolbar")[0]; 
    						nv.addControls([new Geoportal.Control.PrintMap()]);
    						
    						//Ajout des outils de mesure
    						var measurebar= new Geoportal.Control.MeasureToolbar({ 
    							div: OpenLayers.Util.getElement(tbx.id+"_measure"), 
    							displaySystem:(viewer.getMap().getProjection().getProjName()=="longlat"?"geographic":"metric"), 
    							targetElement: OpenLayers.Util.getElement(tbx.id+"_meares"),
    						}); 
    	                    viewer.getMap().addControl(measurebar);
    											
    	                    //Ajout de la LayerToolbar (outils d'ajout de couche vecteur et raster)
    	                    var tOpts= {div: OpenLayers.Util.getElement(tbx.id+"_addlyr")};
    	                    	tOpts= OpenLayers.Util.extend(tOpts,{
    	                    		addVectorLayerOptions:{
    	                    		supportedClasses:[ //formats de fichiers supportés
    	                    			"OpenLayers.Format.KML",
    	                    			"Geoportal.Format.GPX",
    	                    			"OpenLayers.Format.OSM",
    	                    			"OpenLayers.Layer.GeoRSS",
    	                    			"OpenLayers.Layer.WFS"
    	                    		],
    	                    		styleMapTemplates:{
    	                    			"OpenLayers.Layer.GeoRSS":new OpenLayers.StyleMap(
    	                    			new OpenLayers.Style(
    	                    			OpenLayers.Util.applyDefaults({
    	                    				"graphic":true,
    	                    				"externalGraphic":Geoportal.Util.getImagesLocation()+"xy-target.gif",
    	                    				"graphicOpacity":1.0,
    	                    				"graphicWidth":25,
    	                    				"graphicHeight":25,
    	                    				"graphicXOffset":-12.5,
    	                    				"graphicYOffset":-12.5
    	                    			},OpenLayers.Feature.Vector.style["default"])
    	                    			)
    	                    			)
    	                    		},
    	                    		layerVectorOptions:{
    	                    			global:{}
    	                    		}
    	                    		},
    	                    
    	                    		addImageLayerOptions:{
    	                    		layerImageOptions:{
    	                    			singleTile:false
    	                    		}
    	                    		}
    	                    
    	                    	});
    	                    	var LayerToolbar= new Geoportal.Control.LayerToolbar(tOpts);
    	                    	viewer.getMap().addControl(LayerToolbar);
                            
                            //Ajout de l'outil de recherche par noms de lieux
                            var GeoNames= new Geoportal.Control.LocationUtilityService.GeoNames(
                              new Geoportal.Layer.OpenLS.Core.LocationUtilityService( 
                                  "PositionOfInterest:OPENLS;Geocode",
                                  { 
                                   maximumResponses:100,
                                    formatOptions: {
                                    }
                                  }
                              ),{
                                  drawLocation:true,
                                  setZoom: Geoportal.Control.LocationUtilityService.GeoNames.setZoomForBDNyme,
                                  autoCompleteOptions: {} //autocomplétion 
                                }
                            );
                            panel.addControls([GeoNames]);
                            
                            //Ajout du contrôle de recherche par adresses
                            var Geocode= new Geoportal.Control.LocationUtilityService.Geocode(
                              new Geoportal.Layer.OpenLS.Core.LocationUtilityService( 
                                  "StreetAddress:OPENLS;Geocode",
                                    { 
                                      maximumResponses:100,
                                      formatOptions: {
                                      }
                                    }
                                 ),{
                                      drawLocation:true,
                                      setZoom: Geoportal.Control.LocationUtilityService.GeoNames.setZoomForBDNyme,
                                      autoCompleteOptions: {}
                                    }
                            );
                            panel.addControls([Geocode]);
    						
    						// Ajout de la mini map
    						var miniMap= getGeoportalLayer('FXX','GEOGRAPHICALGRIDSYSTEMS.MAPS.OVERVIEW');
                            iv.addComponent(
                                "Geoportal.Component.Navigation.OverviewMap",
                                {
                                    div:OpenLayers.Util.getElement('bigOvDiv'),
                                    size: new OpenLayers.Size(200, 150),
                                    minRatio: 8,   //default: 8
                                    maxRatio: 32,   //default: 32
                                    layers:[miniMap],
                                    mapOptions: {
                                        resolutions:miniMap.options.nativeResolutions,
    									minZoomLevel:2,
                                        maxZoomLevel:8
                                    }
                                }
                            );
    						
    						// GetFeature WMS
    								var wfsGFCtrl= new OpenLayers.Control.GetFeature({
                                                protocol: new OpenLayers.Protocol.WFS({
                                                    url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
                                                    featurePrefix:'ms',
                                                    featureNS:'http://mapserver.gis.umn.edu/mapserver',
                                                    geometryName:'msGeometry',
                                                    //featureType:['rgp', 'sit_rbf', 'sit_rdf', 'rn'],
                                                    featureType:['rnType', 'sit_rbfType', 'sit_rdfType'],
                                                    //srsName:'EPSG:4326',
                                                    //version:'1.0.0',
                                                    formatOptions:{
                                                        // WARNING: because of EPSG:4326 in Mapserver
                                                        //          WFS 1.1.0 (axis order) :
                                                        //          xy must be false in WFS 1.1.0 and
                                                        //          true in WFS 1.0.0 !
                                                        xy:true,
                                                        // keep coordinates as sent :
                                                        //internalProjection:this.getViewer().getMap().getProjection().clone(),
                                                        //externalProjection:new OpenLayers.Projection('EPSG:4326')
                                                    }
                                                }),
                                                // select by bbox only
                                                box:true,
                                                click:false,
                                                clickout:false,
                                                eventListeners:{
                                                    'featuresselected': function(e) {
                                                        gfResults.value+= '\n/* --- */\n' + gfGeoJSON.write(e.features,true);
                                                    }
                                                }
                                            });
                                            this.getViewer().getMap().addControl(wfsGFCtrl);
                                            // open layer switcher
                                            this.getViewer().openLayersPanel(true);
                                        
                                            var e= OpenLayers.Util.getElement('getFeatureToggle');
                                            e.onclick= function() {
                                                // context is input checkbox
                                                if (this.checked) {
                                                    wfsGFCtrl.activate();
                                                } else {
                                                    wfsGFCtrl.deactivate();
                                                }
                                            };
                                            e= OpenLayers.Util.getElement('getFeatureClean');
                                            e.onclick= function() {
                                                gfResults.value= '';
                                            };
                                        
                                            // open layer switcher advanced panel
                                            var wmss= this.getViewer().getMap().getLayersByClass('OpenLayers.Layer.WMS');
                                            var ptcs= this.getViewer().getMap().getControlsByClass('Geoportal.Control.PanelToggle');
                                            for (var i= 0, n= wmss.length; i<n; i++) {
                                                for (var j= 0, l= ptcs.length; j<l; j++) {
                                                    if (ptcs[j].id.indexOf(wmss[i].id)!=-1) {
                                                        ptcs[j].panel.activateControl(ptcs[j]);
                                                        break;
                                                    }
                                                }
                                            }
    											
    			}			
    			
    /**
     * Function: getGeoportalLayer
     * Build a Geoportal's layer.
     *
     * Parameters:
     * territory - {String} one of the Geoportal's territory.
     * name - {String} Geoportal's layer standard name.
     *
     * Returns:
     * {<OpenLayers.Layer>} the ready to use Geoportal's layer.
     */
    			function getGeoportalLayer ( territory, name ) {
                    var lyrPrms= map.catalogue.getLayerParameters(territory, name);
                    lyrPrms.options.territory= territory;
                    lyrPrms.options.isBaseLayer= true;
                    lyrPrms.options.opacity= 1.0;
                    var lyr= new lyrPrms.classLayer(
                        lyrPrms.options.name,
                        lyrPrms.url,
                        lyrPrms.params,
                        lyrPrms.options);
                    return lyr;
                }
    				
    /**
     * Function: centrageParis
     * Fonction de centrage sur Paris, déclenchée au clic bouton dédié
     * Avec la méthode setCenterAtLonLat (longitude, latitude, zoom)
     */			
    			
    		    function centrageParis() {
    				viewer.getMap().setCenterAtLonLat(2.3457,48.8571,13);
    		    }
    			
    			//Exécute la fonction initialisationCarte au chargement de la page Web
                window.onload= initialisationCarte;
    	
                   </script>
    
              </body>
            </html>
    Je pense que le lien ne doit pas se faire entre les objets et le GetFeatureInfo...

  14. #14
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2015
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2015
    Messages : 29
    Points : 6
    Points
    6
    Par défaut
    J'ai suivi l'exemple, mais je n'arrive pas à obtenir de résultat lorsque je clique sur mes objets, et donc pas d'info-bulle...
    En fait, quand je coche la case puis clique sur un objet, un sablier apparait rapidement mais rien ne s'affiche (le lien ne doit pas se faire).

    Voici mon code (voir en rouge ce que j'ai rajouté pour les infos-bulles) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
              <head>
                <title>Géoportail</title>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    			<link rel="stylesheet" type="text/css" href="geoportalMap_config.css" />
                <script type="text/javascript" src="http://api.ign.fr/geoportail/api/js/latest/GeoportalExtended.js"><!-- --></script> 
              </head>
    		  
              <body>
    			<!-- Titre de la page -->
    			<h1 id="title">GéOPoRTAiL</h1>
    		  
    		    <!-- Bouton de centrage sur Paris qui fait appel à la fonction javascript "centrageParis" -->
    	        <input class="boutoncentrage" type="button" value="Centrage sur Paris" onclick="centrageParis();" />
    
    			<!-- Aide pour l'utilisation de l'API -->
    			<div id="aide">
    			<p>
    			    <a href="./Manuel_utilisateur.docx">Aide</a>			   
    			</p>
    			</div>
    			
    			
    		    <!-- div contenant la partie cartographique, remplie via le Javascript -->
                <div id="viewerDiv"></div>
    			<!-- div contenant la mini map -->
    			<div id="bigOvDiv"></div>
    			
    			<table>
                  <tr>
     
                    <td>
                      <form action="javascript:(void)0">
                        <label for="getFeatureToggle">
                          <input type="checkbox" id="getFeatureToggle"/>
                            <span>Cochez pour identifier des éléments</span>
                        </label>
                        <br/>
                        <textarea id="getFeatureResults" rows="25" cols="80"></textarea>
                        <br/>
                        <input type="button" id="getFeatureClean" value="Vider !"/>
                      </form>
                    </td>
                  </tr>
                </table>
    			
    			<!--   SCRIPT   -->
    			<script type="text/javascript">
    	        
    			iv= null; //variable globale qui aura pour valeur le retour de la méthode "Geoportal.Load()"
    
    			
    			function attachGetFeatureInfoControl() {
                // fabrication de l'id de la barre d'outils dans le layerSwitcher :
                // "basic_<LayerSwitcherId>_<LayerId>"
                var lsid= "" ;
                var lss= this.map.getControlsByClass("Geoportal.Control.LayerSwitcher") ;
                lsid= lss[0].id+"_" ;
                //this===layer
                var blc= this.map.getControlsBy('id', 'basic_'+lsid+this.id)[0];
                if (!blc) { return; }
                var wic= new OpenLayers.Control.WMSGetFeatureInfo({
                    url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
                    layers:['0'],//'0','1','2','3','4','5','6','7','8','9','10'
                    title:"Identifier les « " + '0'.name + " »",
                    type:OpenLayers.Control.TYPE_BUTTON,
                    queryVisible:true,
                    maxFeatures:1,
                    eventListeners:{
                        getfeatureinfo:function(event) {
                            //this===control
                            if (event.text) {
                                this.map.addPopup(new
                                    OpenLayers.Popup.FramedCloud(
                                        "chicken",
                                        this.map.getLonLatFromPixel(event.xy),
                                        null,
                                        event.text,
                                        null,
                                        true,
                                        function(){
                                            console.log("close manually");
                                            this.destroy();
                                        }
                                    )
                                );
                            }
                        }
                    }
                });
                
                blc.addControls([wic]);
                // by default, it's activated !
                wic.activate();
            }
    			
    			
    /**
     * Function: initialisationCarte
     * Load the viewer and add components (graticules and overview map). 
     * Called on "onload" event.
     */			
    			
    			function initialisationCarte() {
    			
    						iv= Geoportal.load( //permet de charger la carte
                                 // identifiant du conteneur de la carte
                                 'viewerDiv',
                                 // clé API
    							 ['i60lnbtlh5fdza48mta2chie'],
                                 {// centre de la carte
                                                // longitude:
                                                lon:2.339,
                                                // latitude:
                                                lat:48.859
                                 },
                                 //zoom entre 0 et 20
                                 14,
                                 //options du loader
                                 {
                                 	type:'js', //javascript
    								viewerClass: Geoportal.Viewer.Default, //type du visualiseur
    								onView: ajoutElements, //appel de la fonction qui sera executée au chargement de la carte
     							    theme: {
    	    		                        name: 'black',
    	    		                        styles:[{css: 'http://api.ign.fr/geoportail/api/js/latest/theme/black/style.css'}]
    	    	                    },
    	    	                    //couches Géoportail que l'on souhaite avoir dans l'onglet "Couches"
    								//se référer à ce site pour plus d'informations sur les couches: http://api.ign.fr/tech-docs-js/fr/webmaster/layers.html
    								layers: [
    	    							'GEOGRAPHICALGRIDSYSTEMS.MAPS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40',
    	    							'ORTHOIMAGERY.ORTHOPHOTOS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.PLANIGN',
    	    							'CADASTRALPARCELS.PARCELS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.1900TYPEMAPS',
    	    							'GEOGRAPHICALNAMES.NAMES',
    	    							'HYDROGRAPHY.HYDROGRAPHY',
    	    							'LANDCOVER.FORESTAREAS',
    	    							'LANDCOVER.FORESTINVENTORY.V2',
    									'TRANSPORTNETWORKS.ROADS',
    									'BUILDINGS.BUILDINGS',
    									'ORTHOIMAGERY.ORTHOPHOTOS2000-2005',
    	    							],
    								//options des couches Géoportail	
    	    	                    layersOptions: {
    	    							'GEOGRAPHICALGRIDSYSTEMS.MAPS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40':{opacity:1,visibility:false},
    	    							'ORTHOIMAGERY.ORTHOPHOTOS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.PLANIGN':{opacity:1,visibility:true},
    	    							'CADASTRALPARCELS.PARCELS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.1900TYPEMAPS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALNAMES.NAMES':{opacity:1,visibility:false},
    	    							'HYDROGRAPHY.HYDROGRAPHY':{opacity:1,visibility:false},
    	    							'LANDCOVER.FORESTAREAS':{opacity:1,visibility:false},
    	    							'LANDCOVER.FORESTINVENTORY.V2':{opacity:1,visibility:false},
    									'TRANSPORTNETWORKS.ROADS':{opacity:1,visibility:false},
    									'BUILDINGS.BUILDINGS':{opacity:1,visibility:false},
    									'ORTHOIMAGERY.ORTHOPHOTOS2000-2005':{opacity:1,visibility:false},
    	    							},
    	    	                    //couches externes au Géoportail
    								overlays:{
    								    'wms':[{
    								    		name:"station_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{// parametres WMS
    								    				layers:'0', //ID de la couche sur le serveur ArcGIS
    								    				transparent:'true'
    								    			},
    								    			options:{//options de la couche WMS
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[ //logo de la RATP qui s'affiche en bas à droite de la carte quand il y a des données RATP
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													// add GetFeatureInfo on WMS layer just after
    													// the layer has been added to the map
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"quai_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'1',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"ouvrage_technique_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'2',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"interstation_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'3',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"emergence_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'4',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"defaut_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'5',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"station_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'6',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"quai_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'7',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"ouvrage_technique_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'8',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"interstation_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'9',
    								    				transparent:'true',
    								    				
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"emergence_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'10',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	],
    								    },                                        
    	    					}
    						);	
    
    			}
    	
    /**
     *
     * Function: ajoutElements
     * Add components to the viewer: graticules and overview map
     * Called on 'Geoportal.load.onview' event
     *
     */	
    	
    			function ajoutElements() {
    		
    			            viewer = iv.getViewer();
    						map = viewer.getMap();
    						
    						//Limiter la navigation dans la carte à une emprise et un zoom minimal prédéfinis
    						viewer.getMap().restrictedExtent= OpenLayers.Bounds.fromArray([1.8,48.6,3,49.1]).transform(OpenLayers.Projection.CRS84,viewer.getMap().getProjection());
    						viewer.getMap().minZoomLevel=11;
    						
    						// ajout de projections au bandeau du bas pour afficher les coordonnées de la souris
                            var controlProjection = map.getControlsByClass("Geoportal.Control.Projections")[0] ; 
                            console.log(controlProjection) ;
                            var projs = [ 
    					    	new OpenLayers.Projection("EPSG:4326"), //WGS84
    					        new OpenLayers.Projection("IGNF:LAMB93"), //Lambert93
    					    ] ;
                            controlProjection.displayProjections = projs ;
                            controlProjection.redraw() ;
    					
    			            //Ajout d'échelle graphique
    			            //iv.addComponent('Geoportal.Control.GraphicScale');
    			            
    						//Ajout du catalogue de couches
    						
    			            // Modif CSS de l'échelle graphique
    			            /*var echelle = document.getElementsByClassName('gpControlGraphicScale')[1];
    			            echelle.style.position = "relative";
    			            echelle.style.top = "280px";
    						echelle.style.right = "0px";
    			            echelle.style.left = "1057px";
    			            echelle.style.backgroundColor ="white";
    						echelle.style.color = "black";
    						echelle.style.border = "solid 2px black";*/				
    						     
    			            //Récupération de la barre d'outils 
    						var tbx= viewer.getMap().getControlsByClass("Geoportal.Control.ToolBox")[0]; 
    						var panel= new Geoportal.Control.Panel({
    							div:OpenLayers.Util.getElement(tbx.id+"_search")
    						});
    						viewer.getMap().addControls([panel]);
    						
    						//Ajout du contrôle d'impression
    						var nv= viewer.getMap().getControlsByClass("Geoportal.Control.NavToolbar")[0]; 
    						nv.addControls([new Geoportal.Control.PrintMap()]);
    						
    						//Ajout des outils de mesure
    						var measurebar= new Geoportal.Control.MeasureToolbar({ 
    							div: OpenLayers.Util.getElement(tbx.id+"_measure"), 
    							displaySystem:(viewer.getMap().getProjection().getProjName()=="longlat"?"geographic":"metric"), 
    							targetElement: OpenLayers.Util.getElement(tbx.id+"_meares"),
    						}); 
    	                    viewer.getMap().addControl(measurebar);
    											
    	                    //Ajout de la LayerToolbar (outils d'ajout de couche vecteur et raster)
    	                    var tOpts= {div: OpenLayers.Util.getElement(tbx.id+"_addlyr")};
    	                    	tOpts= OpenLayers.Util.extend(tOpts,{
    	                    		addVectorLayerOptions:{
    	                    		supportedClasses:[ //formats de fichiers supportés
    	                    			"OpenLayers.Format.KML",
    	                    			"Geoportal.Format.GPX",
    	                    			"OpenLayers.Format.OSM",
    	                    			"OpenLayers.Layer.GeoRSS",
    	                    			"OpenLayers.Layer.WFS"
    	                    		],
    	                    		styleMapTemplates:{
    	                    			"OpenLayers.Layer.GeoRSS":new OpenLayers.StyleMap(
    	                    			new OpenLayers.Style(
    	                    			OpenLayers.Util.applyDefaults({
    	                    				"graphic":true,
    	                    				"externalGraphic":Geoportal.Util.getImagesLocation()+"xy-target.gif",
    	                    				"graphicOpacity":1.0,
    	                    				"graphicWidth":25,
    	                    				"graphicHeight":25,
    	                    				"graphicXOffset":-12.5,
    	                    				"graphicYOffset":-12.5
    	                    			},OpenLayers.Feature.Vector.style["default"])
    	                    			)
    	                    			)
    	                    		},
    	                    		layerVectorOptions:{
    	                    			global:{}
    	                    		}
    	                    		},
    	                    
    	                    		addImageLayerOptions:{
    	                    		layerImageOptions:{
    	                    			singleTile:false
    	                    		}
    	                    		}
    	                    
    	                    	});
    	                    	var LayerToolbar= new Geoportal.Control.LayerToolbar(tOpts);
    	                    	viewer.getMap().addControl(LayerToolbar);
                            
                            //Ajout de l'outil de recherche par noms de lieux
                            var GeoNames= new Geoportal.Control.LocationUtilityService.GeoNames(
                              new Geoportal.Layer.OpenLS.Core.LocationUtilityService( 
                                  "PositionOfInterest:OPENLS;Geocode",
                                  { 
                                   maximumResponses:100,
                                    formatOptions: {
                                    }
                                  }
                              ),{
                                  drawLocation:true,
                                  setZoom: Geoportal.Control.LocationUtilityService.GeoNames.setZoomForBDNyme,
                                  autoCompleteOptions: {} //autocomplétion 
                                }
                            );
                            panel.addControls([GeoNames]);
                            
                            //Ajout du contrôle de recherche par adresses
                            var Geocode= new Geoportal.Control.LocationUtilityService.Geocode(
                              new Geoportal.Layer.OpenLS.Core.LocationUtilityService( 
                                  "StreetAddress:OPENLS;Geocode",
                                    { 
                                      maximumResponses:100,
                                      formatOptions: {
                                      }
                                    }
                                 ),{
                                      drawLocation:true,
                                      setZoom: Geoportal.Control.LocationUtilityService.GeoNames.setZoomForBDNyme,
                                      autoCompleteOptions: {}
                                    }
                            );
                            panel.addControls([Geocode]);
    						
    						// Ajout de la mini map
    						var miniMap= getGeoportalLayer('FXX','GEOGRAPHICALGRIDSYSTEMS.MAPS.OVERVIEW');
                            iv.addComponent(
                                "Geoportal.Component.Navigation.OverviewMap",
                                {
                                    div:OpenLayers.Util.getElement('bigOvDiv'),
                                    size: new OpenLayers.Size(200, 150),
                                    minRatio: 8,   //default: 8
                                    maxRatio: 32,   //default: 32
                                    layers:[miniMap],
                                    mapOptions: {
                                        resolutions:miniMap.options.nativeResolutions,
    									minZoomLevel:2,
                                        maxZoomLevel:8
                                    }
                                }
                            );
    						
    						// GetFeature WMS
    								var wfsGFCtrl= new OpenLayers.Control.GetFeature({
                                                protocol: new OpenLayers.Protocol.WFS({
                                                    url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
                                                    featurePrefix:'ms',
                                                    featureNS:'http://mapserver.gis.umn.edu/mapserver',
                                                    geometryName:'msGeometry',
                                                    //featureType:['rgp', 'sit_rbf', 'sit_rdf', 'rn'],
                                                    featureType:['rnType', 'sit_rbfType', 'sit_rdfType'],
                                                    //srsName:'EPSG:4326',
                                                    //version:'1.0.0',
                                                    formatOptions:{
                                                        // WARNING: because of EPSG:4326 in Mapserver
                                                        //          WFS 1.1.0 (axis order) :
                                                        //          xy must be false in WFS 1.1.0 and
                                                        //          true in WFS 1.0.0 !
                                                        xy:true,
                                                        // keep coordinates as sent :
                                                        //internalProjection:this.getViewer().getMap().getProjection().clone(),
                                                        //externalProjection:new OpenLayers.Projection('EPSG:4326')
                                                    }
                                                }),
                                                // select by bbox only
                                                box:true,
                                                click:false,
                                                clickout:false,
                                                eventListeners:{
                                                    'featuresselected': function(e) {
                                                        gfResults.value+= '\n/* --- */\n' + gfGeoJSON.write(e.features,true);
                                                    }
                                                }
                                            });
                                            this.getViewer().getMap().addControl(wfsGFCtrl);
                                            // open layer switcher
                                            this.getViewer().openLayersPanel(true);
                                        
                                            var e= OpenLayers.Util.getElement('getFeatureToggle');
                                            e.onclick= function() {
                                                // context is input checkbox
                                                if (this.checked) {
                                                    wfsGFCtrl.activate();
                                                } else {
                                                    wfsGFCtrl.deactivate();
                                                }
                                            };
                                            e= OpenLayers.Util.getElement('getFeatureClean');
                                            e.onclick= function() {
                                                gfResults.value= '';
                                            };
                                        
                                            // open layer switcher advanced panel
                                            var wmss= this.getViewer().getMap().getLayersByClass('OpenLayers.Layer.WMS');
                                            var ptcs= this.getViewer().getMap().getControlsByClass('Geoportal.Control.PanelToggle');
                                            for (var i= 0, n= wmss.length; i<n; i++) {
                                                for (var j= 0, l= ptcs.length; j<l; j++) {
                                                    if (ptcs[j].id.indexOf(wmss[i].id)!=-1) {
                                                        ptcs[j].panel.activateControl(ptcs[j]);
                                                        break;
                                                    }
                                                }
                                            }
    											
    			}			
    			
    /**
     * Function: getGeoportalLayer
     * Build a Geoportal's layer.
     *
     * Parameters:
     * territory - {String} one of the Geoportal's territory.
     * name - {String} Geoportal's layer standard name.
     *
     * Returns:
     * {<OpenLayers.Layer>} the ready to use Geoportal's layer.
     */
    			function getGeoportalLayer ( territory, name ) {
                    var lyrPrms= map.catalogue.getLayerParameters(territory, name);
                    lyrPrms.options.territory= territory;
                    lyrPrms.options.isBaseLayer= true;
                    lyrPrms.options.opacity= 1.0;
                    var lyr= new lyrPrms.classLayer(
                        lyrPrms.options.name,
                        lyrPrms.url,
                        lyrPrms.params,
                        lyrPrms.options);
                    return lyr;
                }
    				
    /**
     * Function: centrageParis
     * Fonction de centrage sur Paris, déclenchée au clic bouton dédié
     * Avec la méthode setCenterAtLonLat (longitude, latitude, zoom)
     */			
    			
    		    function centrageParis() {
    				viewer.getMap().setCenterAtLonLat(2.3457,48.8571,13);
    		    }
    			
    			//Exécute la fonction initialisationCarte au chargement de la page Web
                window.onload= initialisationCarte;
    	
                   </script>
    
              </body>
            </html>
    Par ailleurs, j'avais une autre question:
    Je voudrais limiter l'emprise et le zoom de ma carte, de manière à ne pas pouvoir zoomer plus en arrière et s'écarter de la région parisienne.
    J'ai donc rajouté les deux lignes suivantes (voir aussi en vert dans la totalité du code précé:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    viewer.getMap().restrictedExtent= OpenLayers.Bounds.fromArray([1.8,48.6,3,49.1]).transform(OpenLayers.Projection.CRS84,viewer.getMap().getProjection());
    	   viewer.getMap().minZoomLevel=11;
    Cependant, lorsque j'arrive sur ma carte et me déplace directement, je suis envoyé à un endroit non souhaité.
    Alors que lorsque je fais un zoom avant ou arrière puis me déplace, il n'y a pas de problème...

    Merci

  15. #15
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2015
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2015
    Messages : 29
    Points : 6
    Points
    6
    Par défaut
    J'ai suivi l'exemple, mais je n'arrive pas à obtenir de résultat lorsque je clique sur mes objets, et donc pas d'info-bulle...
    En fait, quand je coche la case puis clique sur un objet, un sablier apparait rapidement mais rien ne s'affiche (le lien ne doit pas se faire).

    Voici mon code (voir en rouge ce que j'ai rajouté pour les infos-bulles) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
              <head>
                <title>Géoportail</title>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    			<link rel="stylesheet" type="text/css" href="geoportalMap_config.css" />
                <script type="text/javascript" src="http://api.ign.fr/geoportail/api/js/latest/GeoportalExtended.js"><!-- --></script> 
              </head>
    		  
              <body>
    			<!-- Titre de la page -->
    			<h1 id="title">GéOPoRTAiL</h1>
    		  
    		    <!-- Bouton de centrage sur Paris qui fait appel à la fonction javascript "centrageParis" -->
    	        <input class="boutoncentrage" type="button" value="Centrage sur Paris" onclick="centrageParis();" />
    
    			<!-- Aide pour l'utilisation de l'API -->
    			<div id="aide">
    			<p>
    			    <a href="./Manuel_utilisateur.docx">Aide</a>			   
    			</p>
    			</div>
    			
    			
    		    <!-- div contenant la partie cartographique, remplie via le Javascript -->
                <div id="viewerDiv"></div>
    			<!-- div contenant la mini map -->
    			<div id="bigOvDiv"></div>
    			
    			<table>
                  <tr>
     
                    <td>
                      <form action="javascript:(void)0">
                        <label for="getFeatureToggle">
                          <input type="checkbox" id="getFeatureToggle"/>
                            <span>Cochez pour identifier des éléments</span>
                        </label>
                        <br/>
                        <textarea id="getFeatureResults" rows="25" cols="80"></textarea>
                        <br/>
                        <input type="button" id="getFeatureClean" value="Vider !"/>
                      </form>
                    </td>
                  </tr>
                </table>
    			
    			<!--   SCRIPT   -->
    			<script type="text/javascript">
    	        
    			iv= null; //variable globale qui aura pour valeur le retour de la méthode "Geoportal.Load()"
    
    			
    			function attachGetFeatureInfoControl() {
                // fabrication de l'id de la barre d'outils dans le layerSwitcher :
                // "basic_<LayerSwitcherId>_<LayerId>"
                var lsid= "" ;
                var lss= this.map.getControlsByClass("Geoportal.Control.LayerSwitcher") ;
                lsid= lss[0].id+"_" ;
                //this===layer
                var blc= this.map.getControlsBy('id', 'basic_'+lsid+this.id)[0];
                if (!blc) { return; }
                var wic= new OpenLayers.Control.WMSGetFeatureInfo({
                    url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
                    layers:['0'],//'0','1','2','3','4','5','6','7','8','9','10'
                    title:"Identifier les « " + '0'.name + " »",
                    type:OpenLayers.Control.TYPE_BUTTON,
                    queryVisible:true,
                    maxFeatures:1,
                    eventListeners:{
                        getfeatureinfo:function(event) {
                            //this===control
                            if (event.text) {
                                this.map.addPopup(new
                                    OpenLayers.Popup.FramedCloud(
                                        "chicken",
                                        this.map.getLonLatFromPixel(event.xy),
                                        null,
                                        event.text,
                                        null,
                                        true,
                                        function(){
                                            console.log("close manually");
                                            this.destroy();
                                        }
                                    )
                                );
                            }
                        }
                    }
                });
                
                blc.addControls([wic]);
                // by default, it's activated !
                wic.activate();
            }
    			
    			
    /**
     * Function: initialisationCarte
     * Load the viewer and add components (graticules and overview map). 
     * Called on "onload" event.
     */			
    			
    			function initialisationCarte() {
    			
    						iv= Geoportal.load( //permet de charger la carte
                                 // identifiant du conteneur de la carte
                                 'viewerDiv',
                                 // clé API
    							 ['i60lnbtlh5fdza48mta2chie'],
                                 {// centre de la carte
                                                // longitude:
                                                lon:2.339,
                                                // latitude:
                                                lat:48.859
                                 },
                                 //zoom entre 0 et 20
                                 14,
                                 //options du loader
                                 {
                                 	type:'js', //javascript
    								viewerClass: Geoportal.Viewer.Default, //type du visualiseur
    								onView: ajoutElements, //appel de la fonction qui sera executée au chargement de la carte
     							    theme: {
    	    		                        name: 'black',
    	    		                        styles:[{css: 'http://api.ign.fr/geoportail/api/js/latest/theme/black/style.css'}]
    	    	                    },
    	    	                    //couches Géoportail que l'on souhaite avoir dans l'onglet "Couches"
    								//se référer à ce site pour plus d'informations sur les couches: http://api.ign.fr/tech-docs-js/fr/webmaster/layers.html
    								layers: [
    	    							'GEOGRAPHICALGRIDSYSTEMS.MAPS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40',
    	    							'ORTHOIMAGERY.ORTHOPHOTOS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.PLANIGN',
    	    							'CADASTRALPARCELS.PARCELS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.1900TYPEMAPS',
    	    							'GEOGRAPHICALNAMES.NAMES',
    	    							'HYDROGRAPHY.HYDROGRAPHY',
    	    							'LANDCOVER.FORESTAREAS',
    	    							'LANDCOVER.FORESTINVENTORY.V2',
    									'TRANSPORTNETWORKS.ROADS',
    									'BUILDINGS.BUILDINGS',
    									'ORTHOIMAGERY.ORTHOPHOTOS2000-2005',
    	    							],
    								//options des couches Géoportail	
    	    	                    layersOptions: {
    	    							'GEOGRAPHICALGRIDSYSTEMS.MAPS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40':{opacity:1,visibility:false},
    	    							'ORTHOIMAGERY.ORTHOPHOTOS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.PLANIGN':{opacity:1,visibility:true},
    	    							'CADASTRALPARCELS.PARCELS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.1900TYPEMAPS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALNAMES.NAMES':{opacity:1,visibility:false},
    	    							'HYDROGRAPHY.HYDROGRAPHY':{opacity:1,visibility:false},
    	    							'LANDCOVER.FORESTAREAS':{opacity:1,visibility:false},
    	    							'LANDCOVER.FORESTINVENTORY.V2':{opacity:1,visibility:false},
    									'TRANSPORTNETWORKS.ROADS':{opacity:1,visibility:false},
    									'BUILDINGS.BUILDINGS':{opacity:1,visibility:false},
    									'ORTHOIMAGERY.ORTHOPHOTOS2000-2005':{opacity:1,visibility:false},
    	    							},
    	    	                    //couches externes au Géoportail
    								overlays:{
    								    'wms':[{
    								    		name:"station_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{// parametres WMS
    								    				layers:'0', //ID de la couche sur le serveur ArcGIS
    								    				transparent:'true'
    								    			},
    								    			options:{//options de la couche WMS
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[ //logo de la RATP qui s'affiche en bas à droite de la carte quand il y a des données RATP
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													// add GetFeatureInfo on WMS layer just after
    													// the layer has been added to the map
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"quai_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'1',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"ouvrage_technique_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'2',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"interstation_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'3',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"emergence_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'4',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"defaut_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'5',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"station_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'6',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"quai_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'7',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"ouvrage_technique_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'8',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"interstation_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'9',
    								    				transparent:'true',
    								    				
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"emergence_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'10',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	],
    								    },                                        
    	    					}
    						);	
    
    			}
    	
    /**
     *
     * Function: ajoutElements
     * Add components to the viewer: graticules and overview map
     * Called on 'Geoportal.load.onview' event
     *
     */	
    	
    			function ajoutElements() {
    		
    			            viewer = iv.getViewer();
    						map = viewer.getMap();
    						
    						//Limiter la navigation dans la carte à une emprise et un zoom minimal prédéfinis
    						viewer.getMap().restrictedExtent= OpenLayers.Bounds.fromArray([1.8,48.6,3,49.1]).transform(OpenLayers.Projection.CRS84,viewer.getMap().getProjection());
    						viewer.getMap().minZoomLevel=11;
    						
    						// ajout de projections au bandeau du bas pour afficher les coordonnées de la souris
                            var controlProjection = map.getControlsByClass("Geoportal.Control.Projections")[0] ; 
                            console.log(controlProjection) ;
                            var projs = [ 
    					    	new OpenLayers.Projection("EPSG:4326"), //WGS84
    					        new OpenLayers.Projection("IGNF:LAMB93"), //Lambert93
    					    ] ;
                            controlProjection.displayProjections = projs ;
                            controlProjection.redraw() ;
    					
    			            //Ajout d'échelle graphique
    			            //iv.addComponent('Geoportal.Control.GraphicScale');
    			            
    						//Ajout du catalogue de couches
    						
    			            // Modif CSS de l'échelle graphique
    			            /*var echelle = document.getElementsByClassName('gpControlGraphicScale')[1];
    			            echelle.style.position = "relative";
    			            echelle.style.top = "280px";
    						echelle.style.right = "0px";
    			            echelle.style.left = "1057px";
    			            echelle.style.backgroundColor ="white";
    						echelle.style.color = "black";
    						echelle.style.border = "solid 2px black";*/				
    						     
    			            //Récupération de la barre d'outils 
    						var tbx= viewer.getMap().getControlsByClass("Geoportal.Control.ToolBox")[0]; 
    						var panel= new Geoportal.Control.Panel({
    							div:OpenLayers.Util.getElement(tbx.id+"_search")
    						});
    						viewer.getMap().addControls([panel]);
    						
    						//Ajout du contrôle d'impression
    						var nv= viewer.getMap().getControlsByClass("Geoportal.Control.NavToolbar")[0]; 
    						nv.addControls([new Geoportal.Control.PrintMap()]);
    						
    						//Ajout des outils de mesure
    						var measurebar= new Geoportal.Control.MeasureToolbar({ 
    							div: OpenLayers.Util.getElement(tbx.id+"_measure"), 
    							displaySystem:(viewer.getMap().getProjection().getProjName()=="longlat"?"geographic":"metric"), 
    							targetElement: OpenLayers.Util.getElement(tbx.id+"_meares"),
    						}); 
    	                    viewer.getMap().addControl(measurebar);
    											
    	                    //Ajout de la LayerToolbar (outils d'ajout de couche vecteur et raster)
    	                    var tOpts= {div: OpenLayers.Util.getElement(tbx.id+"_addlyr")};
    	                    	tOpts= OpenLayers.Util.extend(tOpts,{
    	                    		addVectorLayerOptions:{
    	                    		supportedClasses:[ //formats de fichiers supportés
    	                    			"OpenLayers.Format.KML",
    	                    			"Geoportal.Format.GPX",
    	                    			"OpenLayers.Format.OSM",
    	                    			"OpenLayers.Layer.GeoRSS",
    	                    			"OpenLayers.Layer.WFS"
    	                    		],
    	                    		styleMapTemplates:{
    	                    			"OpenLayers.Layer.GeoRSS":new OpenLayers.StyleMap(
    	                    			new OpenLayers.Style(
    	                    			OpenLayers.Util.applyDefaults({
    	                    				"graphic":true,
    	                    				"externalGraphic":Geoportal.Util.getImagesLocation()+"xy-target.gif",
    	                    				"graphicOpacity":1.0,
    	                    				"graphicWidth":25,
    	                    				"graphicHeight":25,
    	                    				"graphicXOffset":-12.5,
    	                    				"graphicYOffset":-12.5
    	                    			},OpenLayers.Feature.Vector.style["default"])
    	                    			)
    	                    			)
    	                    		},
    	                    		layerVectorOptions:{
    	                    			global:{}
    	                    		}
    	                    		},
    	                    
    	                    		addImageLayerOptions:{
    	                    		layerImageOptions:{
    	                    			singleTile:false
    	                    		}
    	                    		}
    	                    
    	                    	});
    	                    	var LayerToolbar= new Geoportal.Control.LayerToolbar(tOpts);
    	                    	viewer.getMap().addControl(LayerToolbar);
                            
                            //Ajout de l'outil de recherche par noms de lieux
                            var GeoNames= new Geoportal.Control.LocationUtilityService.GeoNames(
                              new Geoportal.Layer.OpenLS.Core.LocationUtilityService( 
                                  "PositionOfInterest:OPENLS;Geocode",
                                  { 
                                   maximumResponses:100,
                                    formatOptions: {
                                    }
                                  }
                              ),{
                                  drawLocation:true,
                                  setZoom: Geoportal.Control.LocationUtilityService.GeoNames.setZoomForBDNyme,
                                  autoCompleteOptions: {} //autocomplétion 
                                }
                            );
                            panel.addControls([GeoNames]);
                            
                            //Ajout du contrôle de recherche par adresses
                            var Geocode= new Geoportal.Control.LocationUtilityService.Geocode(
                              new Geoportal.Layer.OpenLS.Core.LocationUtilityService( 
                                  "StreetAddress:OPENLS;Geocode",
                                    { 
                                      maximumResponses:100,
                                      formatOptions: {
                                      }
                                    }
                                 ),{
                                      drawLocation:true,
                                      setZoom: Geoportal.Control.LocationUtilityService.GeoNames.setZoomForBDNyme,
                                      autoCompleteOptions: {}
                                    }
                            );
                            panel.addControls([Geocode]);
    						
    						// Ajout de la mini map
    						var miniMap= getGeoportalLayer('FXX','GEOGRAPHICALGRIDSYSTEMS.MAPS.OVERVIEW');
                            iv.addComponent(
                                "Geoportal.Component.Navigation.OverviewMap",
                                {
                                    div:OpenLayers.Util.getElement('bigOvDiv'),
                                    size: new OpenLayers.Size(200, 150),
                                    minRatio: 8,   //default: 8
                                    maxRatio: 32,   //default: 32
                                    layers:[miniMap],
                                    mapOptions: {
                                        resolutions:miniMap.options.nativeResolutions,
    									minZoomLevel:2,
                                        maxZoomLevel:8
                                    }
                                }
                            );
    						
    						// GetFeature WMS
    								var wfsGFCtrl= new OpenLayers.Control.GetFeature({
                                                protocol: new OpenLayers.Protocol.WFS({
                                                    url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
                                                    featurePrefix:'ms',
                                                    featureNS:'http://mapserver.gis.umn.edu/mapserver',
                                                    geometryName:'msGeometry',
                                                    //featureType:['rgp', 'sit_rbf', 'sit_rdf', 'rn'],
                                                    featureType:['rnType', 'sit_rbfType', 'sit_rdfType'],
                                                    //srsName:'EPSG:4326',
                                                    //version:'1.0.0',
                                                    formatOptions:{
                                                        // WARNING: because of EPSG:4326 in Mapserver
                                                        //          WFS 1.1.0 (axis order) :
                                                        //          xy must be false in WFS 1.1.0 and
                                                        //          true in WFS 1.0.0 !
                                                        xy:true,
                                                        // keep coordinates as sent :
                                                        //internalProjection:this.getViewer().getMap().getProjection().clone(),
                                                        //externalProjection:new OpenLayers.Projection('EPSG:4326')
                                                    }
                                                }),
                                                // select by bbox only
                                                box:true,
                                                click:false,
                                                clickout:false,
                                                eventListeners:{
                                                    'featuresselected': function(e) {
                                                        gfResults.value+= '\n/* --- */\n' + gfGeoJSON.write(e.features,true);
                                                    }
                                                }
                                            });
                                            this.getViewer().getMap().addControl(wfsGFCtrl);
                                            // open layer switcher
                                            this.getViewer().openLayersPanel(true);
                                        
                                            var e= OpenLayers.Util.getElement('getFeatureToggle');
                                            e.onclick= function() {
                                                // context is input checkbox
                                                if (this.checked) {
                                                    wfsGFCtrl.activate();
                                                } else {
                                                    wfsGFCtrl.deactivate();
                                                }
                                            };
                                            e= OpenLayers.Util.getElement('getFeatureClean');
                                            e.onclick= function() {
                                                gfResults.value= '';
                                            };
                                        
                                            // open layer switcher advanced panel
                                            var wmss= this.getViewer().getMap().getLayersByClass('OpenLayers.Layer.WMS');
                                            var ptcs= this.getViewer().getMap().getControlsByClass('Geoportal.Control.PanelToggle');
                                            for (var i= 0, n= wmss.length; i<n; i++) {
                                                for (var j= 0, l= ptcs.length; j<l; j++) {
                                                    if (ptcs[j].id.indexOf(wmss[i].id)!=-1) {
                                                        ptcs[j].panel.activateControl(ptcs[j]);
                                                        break;
                                                    }
                                                }
                                            }
    											
    			}			
    			
    /**
     * Function: getGeoportalLayer
     * Build a Geoportal's layer.
     *
     * Parameters:
     * territory - {String} one of the Geoportal's territory.
     * name - {String} Geoportal's layer standard name.
     *
     * Returns:
     * {<OpenLayers.Layer>} the ready to use Geoportal's layer.
     */
    			function getGeoportalLayer ( territory, name ) {
                    var lyrPrms= map.catalogue.getLayerParameters(territory, name);
                    lyrPrms.options.territory= territory;
                    lyrPrms.options.isBaseLayer= true;
                    lyrPrms.options.opacity= 1.0;
                    var lyr= new lyrPrms.classLayer(
                        lyrPrms.options.name,
                        lyrPrms.url,
                        lyrPrms.params,
                        lyrPrms.options);
                    return lyr;
                }
    				
    /**
     * Function: centrageParis
     * Fonction de centrage sur Paris, déclenchée au clic bouton dédié
     * Avec la méthode setCenterAtLonLat (longitude, latitude, zoom)
     */			
    			
    		    function centrageParis() {
    				viewer.getMap().setCenterAtLonLat(2.3457,48.8571,13);
    		    }
    			
    			//Exécute la fonction initialisationCarte au chargement de la page Web
                window.onload= initialisationCarte;
    	
                   </script>
    
              </body>
            </html>
    Par ailleurs, j'avais une autre question:
    Je voudrais limiter l'emprise et le zoom de ma carte, de manière à ne pas pouvoir zoomer plus en arrière et s'écarter de la région parisienne.
    J'ai donc rajouté les deux lignes suivantes (voir aussi en vert dans la totalité du code précédent):
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    viewer.getMap().restrictedExtent= OpenLayers.Bounds.fromArray([1.8,48.6,3,49.1]).transform(OpenLayers.Projection.CRS84,viewer.getMap().getProjection());
    	   viewer.getMap().minZoomLevel=11;
    Cependant, lorsque j'arrive sur ma carte et me déplace directement, je suis envoyé à un endroit non souhaité.
    Alors que lorsque je fais un zoom avant ou arrière puis me déplace, il n'y a pas de problème...

    Merci
    Images attachées Images attachées  

  16. #16
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2015
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2015
    Messages : 29
    Points : 6
    Points
    6
    Par défaut
    J'ai suivi l'exemple, mais je n'arrive pas à obtenir de résultat lorsque je clique sur mes objets, et donc pas d'info-bulle...
    En fait, quand je coche la case puis clique sur un objet, un sablier apparait rapidement mais rien ne s'affiche (le lien ne doit pas se faire).

    Voici mon code (voir en rouge ce que j'ai rajouté pour les infos-bulles) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
              <head>
                <title>Géoportail</title>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    			<link rel="stylesheet" type="text/css" href="geoportalMap_config.css" />
                <script type="text/javascript" src="http://api.ign.fr/geoportail/api/js/latest/GeoportalExtended.js"><!-- --></script> 
              </head>
    		  
              <body>
    			<!-- Titre de la page -->
    			<h1 id="title">GéOPoRTAiL</h1>
    		  
    		    <!-- Bouton de centrage sur Paris qui fait appel à la fonction javascript "centrageParis" -->
    	        <input class="boutoncentrage" type="button" value="Centrage sur Paris" onclick="centrageParis();" />
    
    			<!-- Aide pour l'utilisation de l'API -->
    			<div id="aide">
    			<p>
    			    <a href="./Manuel_utilisateur.docx">Aide</a>			   
    			</p>
    			</div>
    			
    			
    		    <!-- div contenant la partie cartographique, remplie via le Javascript -->
                <div id="viewerDiv"></div>
    			<!-- div contenant la mini map -->
    			<div id="bigOvDiv"></div>
    			
    			<table>
                  <tr>
     
                    <td>
                      <form action="javascript:(void)0">
                        <label for="getFeatureToggle">
                          <input type="checkbox" id="getFeatureToggle"/>
                            <span>Cochez pour identifier des éléments</span>
                        </label>
                        <br/>
                        <textarea id="getFeatureResults" rows="25" cols="80"></textarea>
                        <br/>
                        <input type="button" id="getFeatureClean" value="Vider !"/>
                      </form>
                    </td>
                  </tr>
                </table>
    			
    			<!--   SCRIPT   -->
    			<script type="text/javascript">
    	        
    			iv= null; //variable globale qui aura pour valeur le retour de la méthode "Geoportal.Load()"
    
    			
    			function attachGetFeatureInfoControl() {
                // fabrication de l'id de la barre d'outils dans le layerSwitcher :
                // "basic_<LayerSwitcherId>_<LayerId>"
                var lsid= "" ;
                var lss= this.map.getControlsByClass("Geoportal.Control.LayerSwitcher") ;
                lsid= lss[0].id+"_" ;
                //this===layer
                var blc= this.map.getControlsBy('id', 'basic_'+lsid+this.id)[0];
                if (!blc) { return; }
                var wic= new OpenLayers.Control.WMSGetFeatureInfo({
                    url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
                    layers:['0'],//'0','1','2','3','4','5','6','7','8','9','10'
                    title:"Identifier les « " + '0'.name + " »",
                    type:OpenLayers.Control.TYPE_BUTTON,
                    queryVisible:true,
                    maxFeatures:1,
                    eventListeners:{
                        getfeatureinfo:function(event) {
                            //this===control
                            if (event.text) {
                                this.map.addPopup(new
                                    OpenLayers.Popup.FramedCloud(
                                        "chicken",
                                        this.map.getLonLatFromPixel(event.xy),
                                        null,
                                        event.text,
                                        null,
                                        true,
                                        function(){
                                            console.log("close manually");
                                            this.destroy();
                                        }
                                    )
                                );
                            }
                        }
                    }
                });
                
                blc.addControls([wic]);
                // by default, it's activated !
                wic.activate();
            }
    			
    			
    /**
     * Function: initialisationCarte
     * Load the viewer and add components (graticules and overview map). 
     * Called on "onload" event.
     */			
    			
    			function initialisationCarte() {
    			
    						iv= Geoportal.load( //permet de charger la carte
                                 // identifiant du conteneur de la carte
                                 'viewerDiv',
                                 // clé API
    							 ['i60lnbtlh5fdza48mta2chie'],
                                 {// centre de la carte
                                                // longitude:
                                                lon:2.339,
                                                // latitude:
                                                lat:48.859
                                 },
                                 //zoom entre 0 et 20
                                 14,
                                 //options du loader
                                 {
                                 	type:'js', //javascript
    								viewerClass: Geoportal.Viewer.Default, //type du visualiseur
    								onView: ajoutElements, //appel de la fonction qui sera executée au chargement de la carte
     							    theme: {
    	    		                        name: 'black',
    	    		                        styles:[{css: 'http://api.ign.fr/geoportail/api/js/latest/theme/black/style.css'}]
    	    	                    },
    	    	                    //couches Géoportail que l'on souhaite avoir dans l'onglet "Couches"
    								//se référer à ce site pour plus d'informations sur les couches: http://api.ign.fr/tech-docs-js/fr/webmaster/layers.html
    								layers: [
    	    							'GEOGRAPHICALGRIDSYSTEMS.MAPS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40',
    	    							'ORTHOIMAGERY.ORTHOPHOTOS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.PLANIGN',
    	    							'CADASTRALPARCELS.PARCELS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.1900TYPEMAPS',
    	    							'GEOGRAPHICALNAMES.NAMES',
    	    							'HYDROGRAPHY.HYDROGRAPHY',
    	    							'LANDCOVER.FORESTAREAS',
    	    							'LANDCOVER.FORESTINVENTORY.V2',
    									'TRANSPORTNETWORKS.ROADS',
    									'BUILDINGS.BUILDINGS',
    									'ORTHOIMAGERY.ORTHOPHOTOS2000-2005',
    	    							],
    								//options des couches Géoportail	
    	    	                    layersOptions: {
    	    							'GEOGRAPHICALGRIDSYSTEMS.MAPS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40':{opacity:1,visibility:false},
    	    							'ORTHOIMAGERY.ORTHOPHOTOS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.PLANIGN':{opacity:1,visibility:true},
    	    							'CADASTRALPARCELS.PARCELS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.1900TYPEMAPS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALNAMES.NAMES':{opacity:1,visibility:false},
    	    							'HYDROGRAPHY.HYDROGRAPHY':{opacity:1,visibility:false},
    	    							'LANDCOVER.FORESTAREAS':{opacity:1,visibility:false},
    	    							'LANDCOVER.FORESTINVENTORY.V2':{opacity:1,visibility:false},
    									'TRANSPORTNETWORKS.ROADS':{opacity:1,visibility:false},
    									'BUILDINGS.BUILDINGS':{opacity:1,visibility:false},
    									'ORTHOIMAGERY.ORTHOPHOTOS2000-2005':{opacity:1,visibility:false},
    	    							},
    	    	                    //couches externes au Géoportail
    								overlays:{
    								    'wms':[{
    								    		name:"station_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{// parametres WMS
    								    				layers:'0', //ID de la couche sur le serveur ArcGIS
    								    				transparent:'true'
    								    			},
    								    			options:{//options de la couche WMS
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[ //logo de la RATP qui s'affiche en bas à droite de la carte quand il y a des données RATP
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													// add GetFeatureInfo on WMS layer just after
    													// the layer has been added to the map
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"quai_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'1',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"ouvrage_technique_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'2',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"interstation_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'3',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"emergence_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'4',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"defaut_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'5',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"station_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'6',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"quai_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'7',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"ouvrage_technique_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'8',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"interstation_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'9',
    								    				transparent:'true',
    								    				
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	{
    								    		name:"emergence_lineaire",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{
    								    				layers:'10',
    								    				transparent:'true'
    								    			},
    								    			options:{
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: false,
    								    				originators:[
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	],
    								    },                                        
    	    					}
    						);	
    
    			}
    	
    /**
     *
     * Function: ajoutElements
     * Add components to the viewer: graticules and overview map
     * Called on 'Geoportal.load.onview' event
     *
     */	
    	
    			function ajoutElements() {
    		
    			            viewer = iv.getViewer();
    						map = viewer.getMap();
    						
    						//Limiter la navigation dans la carte à une emprise et un zoom minimal prédéfinis
    						viewer.getMap().restrictedExtent= OpenLayers.Bounds.fromArray([1.8,48.6,3,49.1]).transform(OpenLayers.Projection.CRS84,viewer.getMap().getProjection());
    						viewer.getMap().minZoomLevel=11;
    						
    						// ajout de projections au bandeau du bas pour afficher les coordonnées de la souris
                            var controlProjection = map.getControlsByClass("Geoportal.Control.Projections")[0] ; 
                            console.log(controlProjection) ;
                            var projs = [ 
    					    	new OpenLayers.Projection("EPSG:4326"), //WGS84
    					        new OpenLayers.Projection("IGNF:LAMB93"), //Lambert93
    					    ] ;
                            controlProjection.displayProjections = projs ;
                            controlProjection.redraw() ;
    					
    			            //Ajout d'échelle graphique
    			            //iv.addComponent('Geoportal.Control.GraphicScale');
    			            
    						//Ajout du catalogue de couches
    						
    			            // Modif CSS de l'échelle graphique
    			            /*var echelle = document.getElementsByClassName('gpControlGraphicScale')[1];
    			            echelle.style.position = "relative";
    			            echelle.style.top = "280px";
    						echelle.style.right = "0px";
    			            echelle.style.left = "1057px";
    			            echelle.style.backgroundColor ="white";
    						echelle.style.color = "black";
    						echelle.style.border = "solid 2px black";*/				
    						     
    			            //Récupération de la barre d'outils 
    						var tbx= viewer.getMap().getControlsByClass("Geoportal.Control.ToolBox")[0]; 
    						var panel= new Geoportal.Control.Panel({
    							div:OpenLayers.Util.getElement(tbx.id+"_search")
    						});
    						viewer.getMap().addControls([panel]);
    						
    						//Ajout du contrôle d'impression
    						var nv= viewer.getMap().getControlsByClass("Geoportal.Control.NavToolbar")[0]; 
    						nv.addControls([new Geoportal.Control.PrintMap()]);
    						
    						//Ajout des outils de mesure
    						var measurebar= new Geoportal.Control.MeasureToolbar({ 
    							div: OpenLayers.Util.getElement(tbx.id+"_measure"), 
    							displaySystem:(viewer.getMap().getProjection().getProjName()=="longlat"?"geographic":"metric"), 
    							targetElement: OpenLayers.Util.getElement(tbx.id+"_meares"),
    						}); 
    	                    viewer.getMap().addControl(measurebar);
    											
    	                    //Ajout de la LayerToolbar (outils d'ajout de couche vecteur et raster)
    	                    var tOpts= {div: OpenLayers.Util.getElement(tbx.id+"_addlyr")};
    	                    	tOpts= OpenLayers.Util.extend(tOpts,{
    	                    		addVectorLayerOptions:{
    	                    		supportedClasses:[ //formats de fichiers supportés
    	                    			"OpenLayers.Format.KML",
    	                    			"Geoportal.Format.GPX",
    	                    			"OpenLayers.Format.OSM",
    	                    			"OpenLayers.Layer.GeoRSS",
    	                    			"OpenLayers.Layer.WFS"
    	                    		],
    	                    		styleMapTemplates:{
    	                    			"OpenLayers.Layer.GeoRSS":new OpenLayers.StyleMap(
    	                    			new OpenLayers.Style(
    	                    			OpenLayers.Util.applyDefaults({
    	                    				"graphic":true,
    	                    				"externalGraphic":Geoportal.Util.getImagesLocation()+"xy-target.gif",
    	                    				"graphicOpacity":1.0,
    	                    				"graphicWidth":25,
    	                    				"graphicHeight":25,
    	                    				"graphicXOffset":-12.5,
    	                    				"graphicYOffset":-12.5
    	                    			},OpenLayers.Feature.Vector.style["default"])
    	                    			)
    	                    			)
    	                    		},
    	                    		layerVectorOptions:{
    	                    			global:{}
    	                    		}
    	                    		},
    	                    
    	                    		addImageLayerOptions:{
    	                    		layerImageOptions:{
    	                    			singleTile:false
    	                    		}
    	                    		}
    	                    
    	                    	});
    	                    	var LayerToolbar= new Geoportal.Control.LayerToolbar(tOpts);
    	                    	viewer.getMap().addControl(LayerToolbar);
                            
                            //Ajout de l'outil de recherche par noms de lieux
                            var GeoNames= new Geoportal.Control.LocationUtilityService.GeoNames(
                              new Geoportal.Layer.OpenLS.Core.LocationUtilityService( 
                                  "PositionOfInterest:OPENLS;Geocode",
                                  { 
                                   maximumResponses:100,
                                    formatOptions: {
                                    }
                                  }
                              ),{
                                  drawLocation:true,
                                  setZoom: Geoportal.Control.LocationUtilityService.GeoNames.setZoomForBDNyme,
                                  autoCompleteOptions: {} //autocomplétion 
                                }
                            );
                            panel.addControls([GeoNames]);
                            
                            //Ajout du contrôle de recherche par adresses
                            var Geocode= new Geoportal.Control.LocationUtilityService.Geocode(
                              new Geoportal.Layer.OpenLS.Core.LocationUtilityService( 
                                  "StreetAddress:OPENLS;Geocode",
                                    { 
                                      maximumResponses:100,
                                      formatOptions: {
                                      }
                                    }
                                 ),{
                                      drawLocation:true,
                                      setZoom: Geoportal.Control.LocationUtilityService.GeoNames.setZoomForBDNyme,
                                      autoCompleteOptions: {}
                                    }
                            );
                            panel.addControls([Geocode]);
    						
    						// Ajout de la mini map
    						var miniMap= getGeoportalLayer('FXX','GEOGRAPHICALGRIDSYSTEMS.MAPS.OVERVIEW');
                            iv.addComponent(
                                "Geoportal.Component.Navigation.OverviewMap",
                                {
                                    div:OpenLayers.Util.getElement('bigOvDiv'),
                                    size: new OpenLayers.Size(200, 150),
                                    minRatio: 8,   //default: 8
                                    maxRatio: 32,   //default: 32
                                    layers:[miniMap],
                                    mapOptions: {
                                        resolutions:miniMap.options.nativeResolutions,
    									minZoomLevel:2,
                                        maxZoomLevel:8
                                    }
                                }
                            );
    						
    						// GetFeature WMS
    								var wfsGFCtrl= new OpenLayers.Control.GetFeature({
                                                protocol: new OpenLayers.Protocol.WFS({
                                                    url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
                                                    featurePrefix:'ms',
                                                    featureNS:'http://mapserver.gis.umn.edu/mapserver',
                                                    geometryName:'msGeometry',
                                                    //featureType:['rgp', 'sit_rbf', 'sit_rdf', 'rn'],
                                                    featureType:['rnType', 'sit_rbfType', 'sit_rdfType'],
                                                    //srsName:'EPSG:4326',
                                                    //version:'1.0.0',
                                                    formatOptions:{
                                                        // WARNING: because of EPSG:4326 in Mapserver
                                                        //          WFS 1.1.0 (axis order) :
                                                        //          xy must be false in WFS 1.1.0 and
                                                        //          true in WFS 1.0.0 !
                                                        xy:true,
                                                        // keep coordinates as sent :
                                                        //internalProjection:this.getViewer().getMap().getProjection().clone(),
                                                        //externalProjection:new OpenLayers.Projection('EPSG:4326')
                                                    }
                                                }),
                                                // select by bbox only
                                                box:true,
                                                click:false,
                                                clickout:false,
                                                eventListeners:{
                                                    'featuresselected': function(e) {
                                                        gfResults.value+= '\n/* --- */\n' + gfGeoJSON.write(e.features,true);
                                                    }
                                                }
                                            });
                                            this.getViewer().getMap().addControl(wfsGFCtrl);
                                            // open layer switcher
                                            this.getViewer().openLayersPanel(true);
                                        
                                            var e= OpenLayers.Util.getElement('getFeatureToggle');
                                            e.onclick= function() {
                                                // context is input checkbox
                                                if (this.checked) {
                                                    wfsGFCtrl.activate();
                                                } else {
                                                    wfsGFCtrl.deactivate();
                                                }
                                            };
                                            e= OpenLayers.Util.getElement('getFeatureClean');
                                            e.onclick= function() {
                                                gfResults.value= '';
                                            };
                                        
                                            // open layer switcher advanced panel
                                            var wmss= this.getViewer().getMap().getLayersByClass('OpenLayers.Layer.WMS');
                                            var ptcs= this.getViewer().getMap().getControlsByClass('Geoportal.Control.PanelToggle');
                                            for (var i= 0, n= wmss.length; i<n; i++) {
                                                for (var j= 0, l= ptcs.length; j<l; j++) {
                                                    if (ptcs[j].id.indexOf(wmss[i].id)!=-1) {
                                                        ptcs[j].panel.activateControl(ptcs[j]);
                                                        break;
                                                    }
                                                }
                                            }
    											
    			}			
    			
    /**
     * Function: getGeoportalLayer
     * Build a Geoportal's layer.
     *
     * Parameters:
     * territory - {String} one of the Geoportal's territory.
     * name - {String} Geoportal's layer standard name.
     *
     * Returns:
     * {<OpenLayers.Layer>} the ready to use Geoportal's layer.
     */
    			function getGeoportalLayer ( territory, name ) {
                    var lyrPrms= map.catalogue.getLayerParameters(territory, name);
                    lyrPrms.options.territory= territory;
                    lyrPrms.options.isBaseLayer= true;
                    lyrPrms.options.opacity= 1.0;
                    var lyr= new lyrPrms.classLayer(
                        lyrPrms.options.name,
                        lyrPrms.url,
                        lyrPrms.params,
                        lyrPrms.options);
                    return lyr;
                }
    				
    /**
     * Function: centrageParis
     * Fonction de centrage sur Paris, déclenchée au clic bouton dédié
     * Avec la méthode setCenterAtLonLat (longitude, latitude, zoom)
     */			
    			
    		    function centrageParis() {
    				viewer.getMap().setCenterAtLonLat(2.3457,48.8571,13);
    		    }
    			
    			//Exécute la fonction initialisationCarte au chargement de la page Web
                window.onload= initialisationCarte;
    	
                   </script>
    
              </body>
            </html>
    Par ailleurs, j'avais une autre question:
    Je voudrais limiter l'emprise et le zoom de ma carte, de manière à ne pas pouvoir dézoomer et s'écarter de la région parisienne.
    J'ai donc rajouté les deux lignes suivantes (voir aussi en vert dans la totalité du code précédent):
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    viewer.getMap().restrictedExtent= OpenLayers.Bounds.fromArray([1.8,48.6,3,49.1]).transform(OpenLayers.Projection.CRS84,viewer.getMap().getProjection());
    	   viewer.getMap().minZoomLevel=11;
    Cependant, lorsque j'arrive sur ma carte et me déplace directement, je suis envoyé à un endroit non souhaité.
    Alors que lorsque je fais un zoom avant ou arrière puis me déplace, il n'y a pas de problème...

  17. #17
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2015
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2015
    Messages : 29
    Points : 6
    Points
    6
    Par défaut
    Citation Envoyé par acarme Voir le message
    Cela correspond à l'opération GetFeatureInfo d'un service WMS, vous pouvez vous inspirer de cet exemple : http://api.ign.fr/tech-docs-js/examp...p_simple9.html
    qui ouvre une infobulle au click
    J'ai suivi l'exemple, mais je n'arrive pas à obtenir de résultat lorsque je clique sur mes objets, et donc pas d'info-bulle...
    En fait, quand je coche la case puis clique sur un objet, un sablier apparait rapidement mais rien ne s'affiche (le lien ne doit pas se faire).

    Voici mon code (voir en rouge ce que j'ai rajouté pour les infos-bulles) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    			<script type="text/javascript">
    	        
    			iv= null; //variable globale qui aura pour valeur le retour de la méthode "Geoportal.Load()"
    
    			
    			function attachGetFeatureInfoControl() {
                // fabrication de l'id de la barre d'outils dans le layerSwitcher :
                // "basic_<LayerSwitcherId>_<LayerId>"
                var lsid= "" ;
                var lss= this.map.getControlsByClass("Geoportal.Control.LayerSwitcher") ;
                lsid= lss[0].id+"_" ;
                //this===layer
                var blc= this.map.getControlsBy('id', 'basic_'+lsid+this.id)[0];
                if (!blc) { return; }
                var wic= new OpenLayers.Control.WMSGetFeatureInfo({
                    url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
                    layers:['0'],//'0','1','2','3','4','5','6','7','8','9','10'
                    title:"Identifier les « " + '0'.name + " »",
                    type:OpenLayers.Control.TYPE_BUTTON,
                    queryVisible:true,
                    maxFeatures:1,
                    eventListeners:{
                        getfeatureinfo:function(event) {
                            //this===control
                            if (event.text) {
                                this.map.addPopup(new
                                    OpenLayers.Popup.FramedCloud(
                                        "chicken",
                                        this.map.getLonLatFromPixel(event.xy),
                                        null,
                                        event.text,
                                        null,
                                        true,
                                        function(){
                                            console.log("close manually");
                                            this.destroy();
                                        }
                                    )
                                );
                            }
                        }
                    }
                });
                
                blc.addControls([wic]);
                // by default, it's activated !
                wic.activate();
            }
    			
    			
    /**
     * Function: initialisationCarte
     * Load the viewer and add components (graticules and overview map). 
     * Called on "onload" event.
     */			
    			
    			function initialisationCarte() {
    			
    						iv= Geoportal.load( //permet de charger la carte
                                 // identifiant du conteneur de la carte
                                 'viewerDiv',
                                 // clé API
    							 ['myapikey'],
                                 {// centre de la carte
                                                // longitude:
                                                lon:2.339,
                                                // latitude:
                                                lat:48.859
                                 },
                                 //zoom entre 0 et 20
                                 14,
                                 //options du loader
                                 {
                                 	type:'js', //javascript
    								viewerClass: Geoportal.Viewer.Default, //type du visualiseur
    								onView: ajoutElements, //appel de la fonction qui sera executée au chargement de la carte
     							    theme: {
    	    		                        name: 'black',
    	    		                        styles:[{css: 'http://api.ign.fr/geoportail/api/js/latest/theme/black/style.css'}]
    	    	                    },
    	    	                    //couches Géoportail que l'on souhaite avoir dans l'onglet "Couches"
    								//se référer à ce site pour plus d'informations sur les couches: http://api.ign.fr/tech-docs-js/fr/webmaster/layers.html
    								layers: [
    	    							'GEOGRAPHICALGRIDSYSTEMS.MAPS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40',
    	    							'ORTHOIMAGERY.ORTHOPHOTOS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.PLANIGN',
    	    							'CADASTRALPARCELS.PARCELS',
    	    							'GEOGRAPHICALGRIDSYSTEMS.1900TYPEMAPS',
    	    							],
    								//options des couches Géoportail	
    	    	                    layersOptions: {
    	    							'GEOGRAPHICALGRIDSYSTEMS.MAPS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40':{opacity:1,visibility:false},
    	    							'ORTHOIMAGERY.ORTHOPHOTOS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.PLANIGN':{opacity:1,visibility:true},
    	    							'CADASTRALPARCELS.PARCELS':{opacity:1,visibility:false},
    	    							'GEOGRAPHICALGRIDSYSTEMS.1900TYPEMAPS':{opacity:1,visibility:false},
    	    							},
    	    	                    //couches externes au Géoportail
    								overlays:{
    								    'wms':[{
    								    		name:"station_surfacique",
    								    		url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
    								    		options:{
    								    			params:{// parametres WMS
    								    				layers:'0', //ID de la couche sur le serveur ArcGIS
    								    				transparent:'true'
    								    			},
    								    			options:{//options de la couche WMS
    								    				minZoomLevel: 13,
    								    				maxZoomLevel:20,
    								    				opacity:1,
    								    				visibility: true,
    								    				originators:[ //logo de la RATP qui s'affiche en bas à droite de la carte quand il y a des données RATP
    								    					{
    								    						logo:'RATP',
    								    						pictureUrl: './RATP.jpg',
    								    						url: 'http://ratp.fr/'
    								    					}
    								    				],
    													// add GetFeatureInfo on WMS layer just after
    													// the layer has been added to the map
    													afterAdd:attachGetFeatureInfoControl
    								    			}
    								    		}
    								    	},
    								    	
    								    	],
    								    },                                        
    	    					}
    						);	
    
    			}
    	
    /**
     *
     * Function: ajoutElements
     * Add components to the viewer: graticules and overview map
     * Called on 'Geoportal.load.onview' event
     *
     */	
    	
    			function ajoutElements() {
    		
    			            viewer = iv.getViewer();
    						map = viewer.getMap();
    						
    						//Limiter la navigation dans la carte à une emprise et un zoom minimal prédéfinis
    						viewer.getMap().restrictedExtent= OpenLayers.Bounds.fromArray([1.8,48.6,3,49.1]).transform(OpenLayers.Projection.CRS84,viewer.getMap().getProjection());
    						viewer.getMap().minZoomLevel=11;
    						
    						// ajout de projections au bandeau du bas pour afficher les coordonnées de la souris
                            var controlProjection = map.getControlsByClass("Geoportal.Control.Projections")[0] ; 
                            console.log(controlProjection) ;
                            var projs = [ 
    					    	new OpenLayers.Projection("EPSG:4326"), //WGS84
    					        new OpenLayers.Projection("IGNF:LAMB93"), //Lambert93
    					    ] ;
                            controlProjection.displayProjections = projs ;
                            controlProjection.redraw() ;
    								           	
    						     
    			            //Récupération de la barre d'outils 
    						var tbx= viewer.getMap().getControlsByClass("Geoportal.Control.ToolBox")[0]; 
    						var panel= new Geoportal.Control.Panel({
    							div:OpenLayers.Util.getElement(tbx.id+"_search")
    						});
    						viewer.getMap().addControls([panel]);
    						
    	                    viewer.getMap().addControl(measurebar);
    											
    
                       			// Ajout de la mini map
    						var miniMap= getGeoportalLayer('FXX','GEOGRAPHICALGRIDSYSTEMS.MAPS.OVERVIEW');
                            iv.addComponent(
                                "Geoportal.Component.Navigation.OverviewMap",
                                {
                                    div:OpenLayers.Util.getElement('bigOvDiv'),
                                    size: new OpenLayers.Size(200, 150),
                                    minRatio: 8,   //default: 8
                                    maxRatio: 32,   //default: 32
                                    layers:[miniMap],
                                    mapOptions: {
                                        resolutions:miniMap.options.nativeResolutions,
    									minZoomLevel:2,
                                        maxZoomLevel:8
                                    }
                                }
                            );
    						
    						// GetFeature WMS
    								var wfsGFCtrl= new OpenLayers.Control.GetFeature({
                                                protocol: new OpenLayers.Protocol.WFS({
                                                    url:"http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer",
                                                    featurePrefix:'ms',
                                                    featureNS:'http://mapserver.gis.umn.edu/mapserver',
                                                    geometryName:'msGeometry',
                                                    //featureType:['rgp', 'sit_rbf', 'sit_rdf', 'rn'],
                                                    featureType:['rnType', 'sit_rbfType', 'sit_rdfType'],
                                                    //srsName:'EPSG:4326',
                                                    //version:'1.0.0',
                                                    formatOptions:{
                                                        // WARNING: because of EPSG:4326 in Mapserver
                                                        //          WFS 1.1.0 (axis order) :
                                                        //          xy must be false in WFS 1.1.0 and
                                                        //          true in WFS 1.0.0 !
                                                        xy:true,
                                                        // keep coordinates as sent :
                                                        //internalProjection:this.getViewer().getMap().getProjection().clone(),
                                                        //externalProjection:new OpenLayers.Projection('EPSG:4326')
                                                    }
                                                }),
                                                // select by bbox only
                                                box:true,
                                                click:false,
                                                clickout:false,
                                                eventListeners:{
                                                    'featuresselected': function(e) {
                                                        gfResults.value+= '\n/* --- */\n' + gfGeoJSON.write(e.features,true);
                                                    }
                                                }
                                            });
                                            this.getViewer().getMap().addControl(wfsGFCtrl);
                                            // open layer switcher
                                            this.getViewer().openLayersPanel(true);
                                        
                                            var e= OpenLayers.Util.getElement('getFeatureToggle');
                                            e.onclick= function() {
                                                // context is input checkbox
                                                if (this.checked) {
                                                    wfsGFCtrl.activate();
                                                } else {
                                                    wfsGFCtrl.deactivate();
                                                }
                                            };
                                            e= OpenLayers.Util.getElement('getFeatureClean');
                                            e.onclick= function() {
                                                gfResults.value= '';
                                            };
                                        
                                            // open layer switcher advanced panel
                                            var wmss= this.getViewer().getMap().getLayersByClass('OpenLayers.Layer.WMS');
                                            var ptcs= this.getViewer().getMap().getControlsByClass('Geoportal.Control.PanelToggle');
                                            for (var i= 0, n= wmss.length; i<n; i++) {
                                                for (var j= 0, l= ptcs.length; j<l; j++) {
                                                    if (ptcs[j].id.indexOf(wmss[i].id)!=-1) {
                                                        ptcs[j].panel.activateControl(ptcs[j]);
                                                        break;
                                                    }
                                                }
                                            }
    											
    			}			
    			
    /**
     * Function: getGeoportalLayer
     * Build a Geoportal's layer.
     *
     * Parameters:
     * territory - {String} one of the Geoportal's territory.
     * name - {String} Geoportal's layer standard name.
     *
     * Returns:
     * {<OpenLayers.Layer>} the ready to use Geoportal's layer.
     */
    			function getGeoportalLayer ( territory, name ) {
                    var lyrPrms= map.catalogue.getLayerParameters(territory, name);
                    lyrPrms.options.territory= territory;
                    lyrPrms.options.isBaseLayer= true;
                    lyrPrms.options.opacity= 1.0;
                    var lyr= new lyrPrms.classLayer(
                        lyrPrms.options.name,
                        lyrPrms.url,
                        lyrPrms.params,
                        lyrPrms.options);
                    return lyr;
                }
    				
    /**
     * Function: centrageParis
     * Fonction de centrage sur Paris, déclenchée au clic bouton dédié
     * Avec la méthode setCenterAtLonLat (longitude, latitude, zoom)
     */			
    			
    		    function centrageParis() {
    				viewer.getMap().setCenterAtLonLat(2.3457,48.8571,13);
    		    }
    			
    			//Exécute la fonction initialisationCarte au chargement de la page Web
                window.onload= initialisationCarte;
    	
                   </script>
    
              </body>
            </html>
    Par ailleurs, j'avais une autre question:
    Je voudrais limiter l'emprise et le zoom de ma carte, de manière à ne pas pouvoir dézoomer et s'écarter de la région parisienne.
    J'ai donc rajouté les deux lignes suivantes (voir aussi en vert dans la totalité du code précédent):
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    viewer.getMap().restrictedExtent= OpenLayers.Bounds.fromArray([1.8,48.6,3,49.1]).transform(OpenLayers.Projection.CRS84,viewer.getMap().getProjection());
    	   viewer.getMap().minZoomLevel=11;
    Cependant, lorsque j'arrive sur ma carte et me déplace directement, je suis envoyé à un endroit non souhaité.
    Alors que lorsque je fais un zoom avant ou arrière puis me déplace, il n'y a pas de problème...

  18. #18
    Membre confirmé Avatar de acarme
    Femme Profil pro
    Ingénieur d'études en Géomatique
    Inscrit en
    Avril 2013
    Messages
    237
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur d'études en Géomatique
    Secteur : Service public

    Informations forums :
    Inscription : Avril 2013
    Messages : 237
    Points : 522
    Points
    522
    Par défaut
    Bonjour,

    serait-il possible d'accéder à votre page?
    Sinon, pouvez-vous nous transmettre les erreurs et requêtes (avec firebug par exemple)?

  19. #19
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2015
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2015
    Messages : 29
    Points : 6
    Points
    6
    Par défaut
    Citation Envoyé par acarme Voir le message
    Bonjour,

    serait-il possible d'accéder à votre page?
    Sinon, pouvez-vous nous transmettre les erreurs et requêtes (avec firebug par exemple)?
    Voici les éléments remontés par firebug:

    - erreurs: "NetworkError: 400 Mauvaise Requête - http://d-idg.info.ratp:6080/arcgis/services/ouvrages_cc49/MapServer/WMSServer"
    - avertissements:
    Blocage d'une requête multi-origines (Cross-Origin Request) : la politique « Same Origin » ne permet pas de consulter la ressource distante située sur http://d-idg.info.ratp:6080/arcgis/s...rver/WMSServer. Raison : l'en-tête CORS « Access-Control-Allow-Origin » est manquant.
    Blocage d'une requête multi-origines (Cross-Origin Request) : la politique « Same Origin » ne permet pas de consulter la ressource distante située sur http://d-idg.info.ratp:6080/arcgis/s...rver/WMSServer. Raison : échec de la requête CORS.
    Blocage d'une requête multi-origines (Cross-Origin Request) : la politique « Same Origin » ne permet pas de consulter la ressource distante située sur http://d-idg.info.ratp:6080/arcgis/s...rver/WMSServer. Raison : l'en-tête CORS « Access-Control-Allow-Origin » est manquant.
    Blocage d'une requête multi-origines (Cross-Origin Request) : la politique « Same Origin » ne permet pas de consulter la ressource distante située sur http://d-idg.info.ratp:6080/arcgis/s...rver/WMSServer. Raison : échec de la requête CORS.
    Blocage d'une requête multi-origines (Cross-Origin Request) : la politique « Same Origin » ne permet pas de consulter la ressource distante située sur http://d-idg.info.ratp:6080/arcgis/s...rver/WMSServer. Raison : l'en-tête CORS « Access-Control-Allow-Origin » est manquant.
    Blocage d'une requête multi-origines (Cross-Origin Request) : la politique « Same Origin » ne permet pas de consulter la ressource distante située sur http://d-idg.info.ratp:6080/arcgis/s...rver/WMSServer. Raison : échec de la requête CORS.

    - requête:
    Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Encoding gzip, deflate
    Accept-Language fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
    Access-Control-Request-He... content-type,x-requested-with
    Access-Control-Request-Me... POST
    Cache-Control no-cache
    Connection keep-alive
    Host d-idg.info.ratp:6080
    Origin http://localhost
    Pragma no-cache
    User-Agent Mozilla/5.0 (Windows NT 5.1; rv:40.0) Gecko/20100101 Firefox/40.0

    -réponse:
    Connection close
    Content-Language fr
    Content-Length 983
    Content-Type text/html;charset=utf-8
    Date Fri, 14 Aug 2015 08:53:52 GMT

  20. #20
    Membre confirmé Avatar de acarme
    Femme Profil pro
    Ingénieur d'études en Géomatique
    Inscrit en
    Avril 2013
    Messages
    237
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur d'études en Géomatique
    Secteur : Service public

    Informations forums :
    Inscription : Avril 2013
    Messages : 237
    Points : 522
    Points
    522
    Par défaut
    Merci pour les infos, est-ce que vous pouvez nous fournir les paramètres des requêtes (onglet paramètres au lieu de entêtes) ?

Discussions similaires

  1. Bienvenue sur le forum IGN API Géoportail
    Par achaumet dans le forum IGN API Géoportail
    Réponses: 3
    Dernier message: 21/09/2021, 16h52
  2. API Géoportail plein écran
    Par oncle sam dans le forum IGN API Géoportail
    Réponses: 6
    Dernier message: 19/12/2009, 12h56
  3. Concours de la meilleure application à partir de l'API Géoportail
    Par JP-Lagrange dans le forum IGN API Géoportail
    Réponses: 0
    Dernier message: 19/11/2009, 11h25
  4. Prix Api Géoportail pour accés fermé
    Par julien75000 dans le forum IGN API Géoportail
    Réponses: 2
    Dernier message: 17/07/2009, 17h20
  5. API Office Communication Server 2007?
    Par Ezekhiel dans le forum Général Dotnet
    Réponses: 5
    Dernier message: 03/10/2007, 09h36

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo