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 IGN sur GpsGateServer


Sujet :

IGN API Géoportail

  1. #1
    Nouveau Candidat au Club
    Inscrit en
    Janvier 2008
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 2
    Points : 1
    Points
    1
    Par défaut API IGN sur GpsGateServer
    Bonjour
    Après presque 5 mois de recherche sans savoir trop ou commencer, je me suis lancé dans le forum, en espérant des réponses de votre part.
    Actuellement je travaille sur le suivi des véhicules de mon entreprise, avec l’application GpsGateServer, ceci étant la localisation est faite avec Google Map, pour ma part je veux travailler avec IGN Map. Pour Google Map l’application GpsGateServer me demande deux fichiers, un fichier en format KML et un autre qui est Plugin.js. Je ne sais pas comment ni si on trouve les mêmes fichiers pour le développement de API ign. Merci de bien vouloir m’avancer sur ce sujet.

  2. #2
    Expert confirmé
    Homme Profil pro
    Ingénieur cartographe
    Inscrit en
    Avril 2009
    Messages
    3 173
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Ingénieur cartographe
    Secteur : Service public

    Informations forums :
    Inscription : Avril 2009
    Messages : 3 173
    Points : 4 224
    Points
    4 224
    Par défaut Suivi de flotte
    Tout d'abord : IGN Map ce n'est pas l'API IGN Javascript du Géoportail (c'est un freeware)

    Ceci écrit, l'API peut effectivement servir à faire cela. L'excellent exemple donné par Mick Helley est à suivre.

    J'ai ajouté (c'est pas encore en ligne) un exemple très simple simulant du suivi, le voici :

    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
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"  debug="true">
    <head>
        <title>geoportalMap_mobile.html</title>
        <!-- IE8 compatibility mode -->
        <!--[if IE 8]>
        <meta http-equiv="X-UA-Compatible" content="IE=7"/>
        <![endif]-->
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico" />
        <script type="text/javascript"     src="http://api.ign.fr/geoportail/api?v=1.0beta4&amp;key=VOTRE_CLEF&amp;instance=viewer&amp;includeEngine=false&amp;"><!-- --></script>
        <script type="text/javascript">
        <!--
        var iMob= 0, nMob= 0;
        var gMobs= [];
        var timer= null;
        var ssm= null;
        // the viewer variable is declared by the API through the instance parameter
        viewer= null;
        var kbControl= null;
    
        /**
         * Function: feedInputs
         * Build a store of {<OpenLayers.Feature.Vector>} into global variable gMobs.
         */
        function feedInputs() {
            gMobs= [
                /*V*/[
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.423373591239743,48.844188646209666),
                    {id:'1', name:'V', speed:0, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4237650967149036,48.845796630568245),
                    {id:'1', name:'V', speed:30, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4224470282818635,48.84605714200064),
                    {id:'1', name:'V', speed:31, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4202676478034704,48.84626375451598),
                    {id:'1', name:'V', speed:32, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4195368375831703,48.84633561973872),
                    {id:'1', name:'V', speed:33, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4179447153175184,48.84647036703133),
                    {id:'1', name:'V', speed:34, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.417566260024863,48.84629070397451),
                    {id:'1', name:'V', speed:35, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4175532098423576,48.845428321301746),
                    {id:'1', name:'V', speed:35, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.41763151093739,48.84365864019203),
                    {id:'1', name:'V', speed:34, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.417566260024863,48.84629070397451),
                    {id:'1', name:'V', speed:35, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4175532098423576,48.845428321301746),
                    {id:'1', name:'V', speed:35, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.41763151093739,48.84365864019203),
                    {id:'1', name:'V', speed:34, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.418492822982743,48.843568808663626),
                    {id:'1', name:'V', speed:33, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4209984580237696,48.84475458483866),
                    {id:'1', name:'V', speed:32, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4217423184265745,48.84438627557218),
                    {id:'1', name:'V', speed:31, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4229820857645827,48.84332626353691),
                    {id:'1', name:'V', speed:30, type:1}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.423373591239743,48.844188646209666),
                    {id:'1', name:'V', speed:0, type:1})
                ],
                /*W*/[
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.423373591239743,48.844188646209666),
                    {id:'2', name:'W', speed:30, type:2}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4232952901447113,48.843640673886355),
                    {id:'2', name:'W', speed:31, type:2}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4229037846695505,48.8435867749693),
                    {id:'2', name:'W', speed:32, type:2}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4219380711641545,48.844359326113654),
                    {id:'2', name:'W', speed:33, type:2}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4210245583887806,48.84482645006139),
                    {id:'2', name:'W', speed:34, type:2}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4202415474384593,48.84518577617504),
                    {id:'2', name:'W', speed:35, type:2}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.418310120427668,48.84608409145916),
                    {id:'2', name:'W', speed:36, type:2}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.418127417872593,48.84633561973872),
                    {id:'2', name:'W', speed:37, type:2}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4176576113024004,48.84642545126712),
                    {id:'2', name:'W', speed:38, type:2}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.4159610875767052,48.84660511432395),
                    {id:'2', name:'W', speed:39, type:2}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.415204176991395,48.846856642603505),
                    {id:'2', name:'W', speed:40, type:2}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.414134062025956,48.84709020457737),
                    {id:'2', name:'W', speed:41, type:2}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.413977459835892,48.84644341757281),
                    {id:'2', name:'W', speed:42, type:2}),
                new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(2.413925259105871,48.84425152827955),
                    {id:'2', name:'W', speed:43, type:2})
                ]
            ];
            nMob= gMobs[0].length;
            for (var m= 1; m<gMobs.length; m++) {
                nMob= Math.min(nMob, gMobs[m].length);
            }
        }
    
        /**
         * Function: onBeforeFeatureAddedListener
         * Build moving feature's style on feature insert callback before drawing the feature.
         *
         * Parameters:
         * o - {<OpenLayers.Feature.Vector>} the context embedding the newly inserted feature.
         *
         * Returns:
         * {Boolean} true if Ok, false otherwise (context or feature is null).
         */
        function onBeforeFeatureAddedListener(o) {
            if (!o || !o.feature) {return false;}
            if (o.feature.geometry.CLASS_NAME.match('\.Point$')) {
                o.feature.style= OpenLayers.Util.applyDefaults(
                    {
                        cursor:'pointer',
                        externalGraphic:'img/ign_vehicule.gif',
                        graphicWidth:22,
                        graphicHeight:22,
                        graphicOpacity:1.0,
                        graphicXOffset:-22,
                        graphicYOffset:-22
                    },
                    OpenLayers.Feature.Vector.style["default"]);
            } else if (o.feature.geometry.CLASS_NAME.match('\.LineString$')) {
                o.feature.style= OpenLayers.Util.applyDefaults(
                    {
                        strokeColor:o.feature.attributes.type==1? 'yellow':'red',
                        strokeOpacity:1.0,
                        strokeWidth:3,
                        strokeLinecap:'square',
                        strokeDashstyle:'dot'
                    },
                    OpenLayers.Feature.Vector.style["default"]);
            }
            return true;
        }
    
        /**
         * Function: onFeatureAddedListener
         * Creates the popup linked with the moving feature.
         *      If the feature is out of bounds then the popup is hidden to prevent errors.
         *
         * Parameters:
         * o - {<OpenLayers.Feature.Vector>} the context embedding the newly added feature.
         *
         * Returns:
         * {Boolean} true if Ok, false otherwise (context or feature is null).
         */
        function onFeatureAddedListener(o) {
            if (!o || !o.feature) {return false;}
            if (!o.feature.popup && o.feature.geometry.CLASS_NAME.match('\.Point$')) {
                o.feature.popup= new OpenLayers.Popup.FramedCloud(
                    "chicken",
                    o.feature.geometry.getBounds().getCenterLonLat(),
                    null,
                    "<div style='"+
                                "background-color:#FFFF00;"+
                                "font-size:.75em;"+
                                "font-family:\"Courier New, monospace\";"+
                                "font-weight:bold;"+
                                "color:#000000;"+
                                "'>" +
                        o.feature.attributes['name']+
                    "</div>" +
                    "<div>"+OpenLayers.i18n("speed.label")+" : " +o.feature.attributes['speed']+ " km/h</div>",
                    null,
                    false);
                o.feature.popup.panMapIfOutOfView= false;//true by default in OpenLayers.Popup.FramedCloud
                o.feature.popup.autoSize= true;
                o.feature.popup.maxSize= new OpenLayers.Size(200,200);
                o.feature.popup.minSize= new OpenLayers.Size(100,100);
                o.feature.popup.contentDiv.style.overflow= 'auto';
            }
            if (o.feature.popup) {
                if (OpenLayers.Util.indexOf(o.feature.layer.map.popups,o.feature.popup)==-1 &&
                    viewer.getMap().getExtent().containsLonLat(o.feature.popup.lonlat,false)) {
                    o.feature.layer.map.addPopup(o.feature.popup);
                }
                if (!o.feature.layer.visibility) {
                    o.feature.popup.hide();
                } else {
                    o.feature.popup.show();
                }
            }
            return true;
        }
    
        /**
         * Function: onBeforeFeatureRemovedListener
         * Hide feature's popup when deleting feature.
         *
         * Parameters:
         * o - {<OpenLayers.Feature.Vector>} the context embedding the feature to delete.
         *
         * Returns:
         * {Boolean} true if Ok, false otherwise (context or feature is null).
         */
        function onBeforeFeatureRemovedListener(o) {
            if (!o || !o.feature) {return false;}
            if (o.feature.popup) {
                o.feature.popup.hide();
            }
            return true;
        }
    
        /**
         * Function: onFeatureRemovedListener
         * Callback invoked when the feature is revoved. Do nothing for the mmoment.
         * Parameters:
         * o - {<OpenLayers.Feature.Vector>} the context embedding the feature to delete.
         *
         * Returns:
         * {Boolean} true if Ok, false otherwise (context or feature is null).
         */
        function onFeatureRemovedListener(o) {
            if (!o || !o.feature) {return false;}
            return true;
        }
    
        /**
         * Function: loadMobiles
         * Simulate inputs from a real monitoring systems.
         *      The moving feature track is displayed along with the feature itself.
         */
        function loadMobiles() {
            if (timer) { clearTimeout(timer); timer= null; }
            if (!(ssm && ssm.checked)) { return; }
            if (iMob==nMob) {
                this.destroyFeatures();
                ssm.checked= false;
                iMob= 0;
                return;
            }
            var f= null, of= null;
            var t= null;
            for (var m= 0; m<2; m++) {
                f= gMobs[m][iMob].clone();//simulate input stream ...
                f.geometry.transform(this.getNativeProjection(),this.map.getProjection());
                of= this.getFeatureById(f.attributes.id,function(f){return f.attributes.id});
                if (of!=null) {
                    this.destroyFeatures([of]);
                    t= this.getFeatureById('trajectory'+f.attributes.id,function(f){return f.attributes.id});
                } else {
                    // trajectoire
                    t= new OpenLayers.Feature.Vector(
                            new OpenLayers.Geometry.LineString(),
                            {id:'trajectory'+f.attributes.id,type:f.attributes.type});
                    this.addFeatures([t]);
                }
                t.geometry.addComponent(f.geometry);
                this.addFeatures([f]);
                this.drawFeature(f);
                this.drawFeature(t);
            }
            iMob++;
            timer= setTimeout(OpenLayers.Function.bind(loadMobiles,this),2000);//2s
        }
    
        function initGeoportalMap() {
            // add translations
            Geoportal.Lang.add(
                {
                    'new.instance.failed':
                    {
                        'de':"Karte konnte nicht erstellt werden",
                        'en':"Map creation failed",
                        'es':"Mapa creación no",
                        'fr':"Création de la carte échouée",
                        'it':"Mappa creazione non"
                    },
                    'example_title':
                    {
                        'de':"Überwachung von bewegten Objekten - Simulation",
                        'en':"Monitoring of a moving object - Simulation",
                        'es':"Seguimiento de un objeto en movimiento - Simulación",
                        'fr':"Suivi de véhicules - Simulation",
                        'it':"Controllo di un oggetto in movimento - Simulazione"
                    },
                    'example_explain':
                    {
                        'de':"Die verwendung von setTimeout() funktion, um die überwachung von bewegten objekten.",
                        'en':"Use of setTimeout() function to simulate the monitoring of a moving object.",
                        'es':"El uso de setTimeout() para simular el seguimiento de un objeto en movimiento.",
                        'fr':"Utilisation d'un setTimeout() pour simuler le suivi temps réel de la position d'un mobile.",
                        'it':"L'uso di setTimeout() per simulare la funzione di controllo di un oggetto in movimento."
                    },
                    'ssb':
                    {
                        'de':"Starten / Stoppen der bewegungen von objekten",
                        'en':"Starting / Stopping the objects' movements",
                        'es':"Puesta en marcha / Detener el movimiento de objetos",
                        'fr':"Jouer / Stopper la progression des mobiles",
                        'it':"Avvio / Arresto del movimento di oggetti"
                    },
                    'mobile.name':
                    {
                        'de':"Autos",
                        'en':"Cars",
                        'es':"Coches",
                        'fr':"Véhicules",
                        'it':"Auto"
                    },
                    'speed.label':
                    {
                        'de':"Speed",
                        'en':"Speed",
                        'es':"Velocidad",
                        'fr':"Vitesse",
                        'it':"Velocità"
                    }
                }
            );
    
            var ssmlbl= OpenLayers.Util.getElement('ssmLabel');
            var language= OpenLayers.Lang.getCode();
            var re= new RegExp("^"+language);
            var slct= OpenLayers.Util.getElement('gpChooseLang');
            slct.onfocus= function() {
                if (kbControl) {
                    if (kbControl.active) {
                        kbControl.deactivate();
                    }
                }
            };
            slct.onblur= function() {
                if (kbControl) {
                    if (!kbControl.active) {
                        kbControl.activate();
                    }
                }
            };
            slct.onchange= function() {
                viewer.getMap().setLocale(this.options[this.selectedIndex].value);
                OpenLayers.Util.getElement('example_title').innerHTML= OpenLayers.i18n('example_title');
                OpenLayers.Util.getElement('example_explain').innerHTML= OpenLayers.i18n('example_explain');
                ssmlbl.innerHTML= OpenLayers.i18n('ssb');
                this.blur();
            };
            for (var i= 0; i<slct.options.length; i++) {
                if (slct.options[i].value.match(re)) {
                    slct.options[i].selected= true;
                }
            }
            OpenLayers.Util.getElement('example_title').innerHTML= OpenLayers.i18n('example_title');
            OpenLayers.Util.getElement('example_explain').innerHTML= OpenLayers.i18n('example_explain');
            ssmlbl.innerHTML= OpenLayers.i18n('ssb');
    
            if (typeof(geoportalLoadviewer)!='function') {
                OpenLayers.Console.error(OpenLayers.i18n('new.instance.failed'));
                return;
            }
            feedInputs();
            geoportalLoadviewer("viewerDiv", "normal", 'FXX', null, null, location.protocol+'//'+location.host+location.pathname.match(/(.*)\/test\/[^/]+/)[1]+'/proxy/proxy.pl'+'?url=');
            if (viewer) {
                viewer.addGeoportalLayers(
                    ['ORTHOIMAGERY.ORTHOPHOTOS:WMSC', 'GEOGRAPHICALGRIDSYSTEMS.MAPS:WMSC'],
                    {
                        'GEOGRAPHICALGRIDSYSTEMS.MAPS:WMSC':{
                            visibility:false,
                            displayInLayerSwitcher:false
                        },
                        global:{
                            visibility:true
                        }
                    });
    
                var mobile= new OpenLayers.Layer.Vector(
                    'mobile.name',
                    {
                        projection:OpenLayers.Projection.CRS84,
                        getFeatureById:function(featureId) {
                            var fid= arguments.length==2?
                                arguments[1]
                            :   function(f){return f.id};
                            var feature= null;
                            for (var i= 0, len= this.features.length; i<len; ++i) {
                                if (fid(this.features[i]) == featureId) {
                                    feature= this.features[i];
                                    break;
                                }
                            }
                            return feature;
                        },
                        eventListeners:{
                            "beforefeatureadded"  :onBeforeFeatureAddedListener,
                            "featureadded"        :onFeatureAddedListener,
                            "beforefeatureremoved":onBeforeFeatureRemovedListener,
                            "featureremoved"      :onFeatureRemovedListener
                        }
                    });
                viewer.getMap().addLayer(mobile);
                viewer.getMap().addControl(new OpenLayers.Control.LoadingPanel());
                viewer.getMap().setCenterAtLonLat("2°25'16.8\"E", "48°50'42.3\"", 16);
                ssm= OpenLayers.Util.getElement('ssm');
                ssm.onchange= function() {
                    if (ssm.checked) {
                        setTimeout(OpenLayers.Function.bind(loadMobiles,mobile,10));
                    }
                };
            }
        }
          -->
        </script>
        <style type="text/css">
        <!--
        h1 {
            text-align:center;
            font-size:0.75em;
            font-style: italic;
        }
        div#example_explain {
            margin:0px 0px 10px 0px;
            border: thin solid #595E61;
            width:800px;
            position:relative;
            left:0px;
            top:0px;
            text-align:justify;
            font-size: 0.75em;
            font-style: italic;
            color: #595E61;
        }
          -->
        </style>
    </head>
    <body onload="initGeoportalMap();">
        <h1 id="example_title"></h1>
        <form style="border:0;margin:0;padding:0;" name="gpStartStopMobile" action="#">
            <select style="font-size:0.75em;" id="gpChooseLang" name="gpChooseLang" size="1">
                <option value="de">Deutsch</option>
                <option value="en">English</option>
                <option value="es">Español</option>
                <option value="fr">Français</option>
                <option value="it">Italiano</option>
            </select>
            <input id="ssm" type="checkbox" name="ssm"/>
            <label for="ssm" id="ssmLabel"></label>
        </form>
        <div id="viewerDiv" style="width:800px;height:600px;"></div>
        <div id="example_explain"></div>
    </body>
    </html>
    Le coeur est le module loadMobiles() qui appelle la méthode feedInputs() qui elle simule des inputs de positions.

    En espérant que cela t'aidera.

  3. #3
    Nouveau Candidat au Club
    Inscrit en
    Janvier 2008
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 2
    Points : 1
    Points
    1
    Par défaut
    Citation Envoyé par dgrichard Voir le message

    L'excellent exemple donné par Mick Helley est à suivre.

    J'ai ajouté (c'est pas encore en ligne) un exemple très simple simulant du suivi, le voici :

    Merci de m’avoir répondu, il se trouve que dans mon projet il ne s’agit pas de faire entièrement l’application qui permet de suivre les véhicules, je vous envoie un bout de code de googleMAP qu’il faut remplacer pour avoir le suivi avec la géoportail d’IGN

    // detect Google
    if (this._options.enableGMap && (typeof(GMap) != 'undefined' && typeof(G_API_VERSION) != 'undefined' &&
    typeof(GLatLng) != 'undefined'))
    {
    map.addLayers([
    new OpenLayers.Layer.Google("Google Map", { type: G_NORMAL_MAP, isBaseLayer: true }),
    new OpenLayers.Layer.Google("Google Hybrid", { type: G_HYBRID_MAP, isBaseLayer: true }),
    new OpenLayers.Layer.Google("Google Satellite", { type: G_SATELLITE_MAP, isBaseLayer: true }),
    new OpenLayers.Layer.Google("Google Terrain", { type: G_PHYSICAL_MAP, isBaseLayer: true }),
    //
    new OpenLayers.Layer.Google("Google MapMaker Map", { type: G_MAPMAKER_NORMAL_MAP, isBaseLayer:
    true }),
    new OpenLayers.Layer.Google("Google MapMaker Hybrid", { type: G_MAPMAKER_HYBRID_MAP, isBaseLayer:
    true })
    ]);
    }

  4. #4
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2009
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2009
    Messages : 13
    Points : 16
    Points
    16
    Par défaut Substituer une API carto à une autre
    Bonsoir,
    et merci de préférer les services IGN.
    Pour la substitution du code ce n'est pas tout à fait aussi simple que vous le dites; il faut non seulement modifier cet appel des couches, mais aussi modifier l'appel du service en passant la clé attribuée lors de l'acceptation de la demande de contrat que vous devrez faire
    ici :

    Je vous rassure tout de suite, bien qu'il faille donner une adresse de facturation, l'utilisation de l'API beta test est gratuite dans de très larges limites (voir conditions générales d'utilisation).

    Le code de base est fourni par votre contrat ; il fourni a priori les couches de base de photos et cartes.
    Vous souhaiterez sans doute ajouter la couche spécifique du réseau routier bien qu'il figure déjà sur le fond de cartes, de manière à en disposer aussi sur le fond photos.

    Vous trouverez toute la doc nécessaire ici :

    L'ajout des couches est documenté là :

    N'hésitez pas si vous avez des questions plus précises.
    Bien cordialement

Discussions similaires

  1. Affichage sur l'API IGN
    Par FranckStephane dans le forum IGN API Géoportail
    Réponses: 2
    Dernier message: 13/08/2013, 15h06
  2. url pour JSON Out sur api.ign
    Par nicolas.h dans le forum IGN API Géoportail
    Réponses: 2
    Dernier message: 24/09/2012, 15h40
  3. Problème rayon sur l'API IGN
    Par julien.vassal dans le forum IGN API Géoportail
    Réponses: 4
    Dernier message: 21/09/2012, 21h35
  4. besoin d'aide API IGN (sur Google sites)
    Par zebulon57 dans le forum IGN API Géoportail
    Réponses: 1
    Dernier message: 11/05/2011, 17h41
  5. API IGN et API Google sur même page
    Par laguite51 dans le forum IGN API Géoportail
    Réponses: 5
    Dernier message: 20/04/2010, 02h25

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