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

JavaScript Discussion :

Positionnement d'un modal popup extender


Sujet :

JavaScript

  1. #1
    Membre habitué
    Inscrit en
    Août 2008
    Messages
    1 596
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 1 596
    Points : 175
    Points
    175
    Par défaut Positionnement d'un modal popup extender
    Bonjour, j'ai un popup extender dans ma page,j'ai un probleme quand je le deplace il ne se fixe pas dans l'endroit ou je l'ai placé il change de place automatiqument meme si le drag est a true.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" CancelControlID="cancel"
        DropShadow="true" TargetControlID="Button1" PopupControlID="Panel1" PopupDragHandleControlID="Panel1"
        Drag="true" BackgroundCssClass="ModalPopupBG">
    </asp:ModalPopupExtender>
    <asp:Panel ID="Panel1" Style="display: none" runat="server">
        <div class="HellowWorldPopup">
    ....
    Code css : 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
    .ModalPopupBG
    {
        background-color: transparent;
    }
     
    .HellowWorldPopup
    {
        width:400px;
        height: 400px;
        margin:0 auto;
        padding:0;
        position: absolute;
        z-index: 0;
        -webkit-box-shadow:2px 2px 3px rgba(0, 0, 0, 0.5);
        -moz-box-shadow:2px 2px 3px rgba(0, 0, 0, 0.5);
        -o-box-shadow:2px 2px 3px rgba(0, 0, 0, 0.5);
        -khtml-box-shadow:2px 2px 3px rgba(0, 0, 0, 0.5);
        -webkit-border-radius:5px;border-radius:5px;
        -moz-border-radius:5px;
        -o-border-radius:5px;
        -khtml-border-radius:5px; 
        background: white;  
        cursor:move; 
    }
     
    PopupHeader{
    font-weight:bolder;
    margin:0;
    padding:20px 0;
    display: block;
    line-height:20px;
    text-align:center;
    color : Black;
    }

    Une idée ?

  2. #2
    Rédacteur

    Avatar de Bovino
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juin 2008
    Messages
    23 647
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2008
    Messages : 23 647
    Points : 91 418
    Points
    91 418
    Billets dans le blog
    20
    Par défaut
    Merci de lire et appliquer : Important : Les règles incontournables d'utilisation de ce forum.

    Ton code serveur ne nous sert à rien, ce n'est pas ASP qui s'exécute dans le navigateur mais JavaScript, dont on ne voit pas une once. En l'état, il est impossible de t'aider.
    Pas de question technique par MP !
    Tout le monde peut participer à developpez.com, vous avez une idée, contactez-moi !
    Mes formations video2brain : La formation complète sur JavaScriptJavaScript et le DOM par la pratiquePHP 5 et MySQL : les fondamentaux
    Mon livre sur jQuery
    Module Firefox / Chrome d'intégration de JSFiddle et CodePen sur le forum

  3. #3
    Membre habitué
    Inscrit en
    Août 2008
    Messages
    1 596
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 1 596
    Points : 175
    Points
    175
    Par défaut
    MON MODAL s'affiche quand je clique sur le bouton droit de la souris :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    google.maps.event.addListener(map, 'rightclick', function (event) {
                if (directionsDisplay.getDirections() == null) {
                    clearOverlays();
                    clearForm();
                    placeMarker(event.latLng);
                }
                else {
                    loadItineraire(directionsDisplay.getDirections());
                }
     
            });
    c'est tout ce que j'ai comme javascript

  4. #4
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    16 959
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 16 959
    Points : 44 122
    Points
    44 122
    Par défaut
    Bonjour,
    c'est tout ce que j'ai comme javascript
    même pas la définition de la fonction loadItineraire

  5. #5
    Membre habitué
    Inscrit en
    Août 2008
    Messages
    1 596
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 1 596
    Points : 175
    Points
    175
    Par défaut
    le code que j'ai posté en haut c'est le seul lié a la modal, voila le fichier en entier

    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
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902
    903
    904
    905
    906
    907
    908
    909
    910
    911
    912
    913
    914
    915
    916
    917
    918
    919
    920
    921
    922
    923
    924
    925
    926
    927
    928
    929
    930
    931
    932
    933
    934
    935
    936
    937
    938
    939
    940
    941
    942
    943
    944
    945
    946
    947
    948
    949
    950
    951
    952
    953
    954
    955
    956
    957
    958
    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    969
    970
    971
    972
    973
    974
    975
    976
    977
    978
    979
    980
    981
    982
    983
    984
    985
    986
    987
    988
    989
    990
    991
    992
    993
    994
    995
    996
    997
    998
    999
    1000
    1001
    1002
    1003
    1004
    1005
    1006
    1007
    1008
    1009
    1010
    1011
    1012
    1013
    1014
    1015
    1016
    1017
    1018
    1019
    1020
    1021
    1022
    1023
    1024
    1025
    1026
    1027
    1028
    1029
    1030
    1031
    1032
    1033
    1034
    1035
    1036
    1037
    1038
    1039
    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    1048
    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    1057
    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    1067
    1068
    1069
    1070
    1071
    1072
    1073
    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    var geocoder;
    var map;
    var oImage;
    var markers = Array();
    var infos = Array();
    var rendererOptions = {
        draggable: true
    };
    var directionsDisplay;
    var directionsService = new google.maps.DirectionsService();
     
    var flagInitialisation = false;
     
    function initialize() {
    flagInitialisation =  true;
        // Check connexion
            var status = navigator.onLine;
            if (status) {
            } else {
                alert("Pas de connexion internet");
            }
     
     
        // prepare Geocoder
            geocoder = new google.maps.Geocoder();
     
            directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions);
     
            // set initial position (ville)
            var myLatlng = new google.maps.LatLng(34.2500000, -6.5833330);
     
            var myOptions = { // default map options
                zoom: 14,
                center: myLatlng,
                mapTypeId: google.maps.MapTypeId.ROADMAP,
     
                panControl: true,
                panControlOptions: {
                    position: google.maps.ControlPosition.TOP_RIGHT
                },
                zoomControl: true,
                zoomControlOptions: {
                    style: google.maps.ZoomControlStyle.LARGE,
                    position: google.maps.ControlPosition.RIGHT_TOP
                },
                scaleControl: true,
                streetViewControl: true,
                streetViewControlOptions: {
                    position: google.maps.ControlPosition.LEFT_BOTTOM
                },
     
                mapTypeControl: true,
                mapTypeControlOptions: {
                style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
                position: google.maps.ControlPosition.BOTTOM_CENTER
                }
            };
     
            map = new google.maps.Map(document.getElementById('gmap_canvas'), myOptions);
            directionsDisplay.setMap(map);
     
            google.maps.event.addListener(directionsDisplay, 'directions_changed', function () {
                computeTotalDistance(directionsDisplay.getDirections());
            });
     
            google.maps.event.addListener(map, 'rightclick', function (event) {
                if (directionsDisplay.getDirections() == null) {
                    clearOverlays();
                    clearForm();
                    placeMarker(event.latLng);
                }
                else {
                    loadItineraire(directionsDisplay.getDirections());
                }
     
            });
     
    }
    function findAllAddress(tabStation) {
        clearOverlays();
        var n = tabStation.length;
     
     
        for (var i = 0; i < n; i++) {
            findAddress2(tabStation[i][0], tabStation[i][1], tabStation[i][2], tabStation[i][3]);
            }
    }
    function findAddress2(adresse, name, lt, lg) {
     
        var lat = parseFloat(lt.replace(',','.'));
        var lng = parseFloat(lg.replace(',','.'));
     
        var latlng = new google.maps.LatLng(lat, lng);
     
        var address = adresse;  
     
        // script uses our 'geocoder' in order to find location by address name
        geocoder.geocode({ 'latLng': latlng }, function (results, status) {
        if (status == google.maps.GeocoderStatus.OK ) { // && !flagInitialisation and, if everything is ok
     
                // we will center map
                var addrLocation = latlng;
                map.setCenter(addrLocation);
     
                // store current coordinates into hidden variables
                document.getElementById('lat').value = lat;
                document.getElementById('lng').value = lng;
     
                // and then - add new custom marker and Infowindow
                var addrMarker = new google.maps.Marker({
     
                    position: addrLocation,
                    map: map,
                    title: results[0].formatted_address
                    //animation: google.maps.Animation.BOUNCE
                });
     
                iconFile = 'https://maps.gstatic.com/mapfiles/ms2/micons/gas.png';          
                addrMarker.setIcon(iconFile) ;
     
                var infowindow = new google.maps.InfoWindow({
                content: '<DIV STYLE="line-height:1.35;overflow:hidden;white-space:nowrap;"><DIV STYLE=overflow:auto; width:50px; height:50px><font style="color:#000;">' + name +
                '<br /></font></div></div>'
     
                });
     
                google.maps.event.addListener(addrMarker, 'click', function (data) {
                                infowindow.open(map, addrMarker);
                });
     
     
                markers.push(addrMarker);
     
                addrMarker.indice = markers.length - 1;
     
                // suppression du marker sur dblclick
                google.maps.event.addListener(addrMarker, 'dblclick', function (data) {
                    this.setMap(null);
                    var ind = this.indice;
                    markers.splice(ind, 1);
                    // r?©ajuste les indices des autres marqueurs
                    for (; markers[ind]; ind++) {
                        markers[ind].indice = ind;
                    }
                });
            } 
             else{
          // on traite l'erreur OVER_QUERY_LIMIT
          if( status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT){
            // relance la requete
            setTimeout( function(){
              findAddress2(adresse, name, lt, lg); // rappel fonction avec meme param
            }, 200);
          }
          }
        });
    }
     
     
    function loadItineraire(result) {//directionsDisplay.getDirections()
     
        var itineraire = result.routes[0].legs[0];
     
        document.getElementById('latitude').value = itineraire.end_location.lat();
        document.getElementById('longitude').value = itineraire.end_location.lng(); //formatted_address
        codeLatLng(itineraire.end_location.lat(), itineraire.end_location.lng(), 'adresse');
     
        document.getElementById('LatOrg').value = itineraire.start_location.lat();
        document.getElementById('LongOrg').value = itineraire.start_location.lng(); //formatted_address
        codeLatLng(itineraire.start_location.lat(), itineraire.start_location.lng(), 'txtorigine');
     
        computeTotalDistance(result);
     
        showForm();
    }
     
     
    function codeLatLng(lt, lg, where) {
     
        var lat = parseFloat(lt);
        var lng = parseFloat(lg);
        var latlng = new google.maps.LatLng(lat, lng);
        geocoder.geocode({ 'latLng': latlng }, function (results, status) {
            var oElem = document.getElementById(where);
            // action suivant resultat
            if (status == google.maps.GeocoderStatus.OK) {
                var str = results[0].formatted_address;
                oElem.innerHTML = str;
                oElem.style.color = 'black';
            }
            else {
                oElem.innerHTML = "Geocoder failed due to: " + status;
                oElem.style.color = 'red';
            }
        });
    }
     
    function computeTotalDistance(result) {
        var total = 0;
        var myroute = result.routes[0];
        for (var i = 0; i < myroute.legs.length; i++) {
            total += myroute.legs[i].distance.value;
        }
        total = total / 1000.0;
        document.getElementById('total').innerHTML = 'Distance du PK origine : '+ total + ' km';
    }
     
     
    function placeMarker(location) {
     
        showForm();
     
        var point = new google.maps.Marker({ //on créé le marqueur
            position: location,
            map: map,
            title: "Coordonnées"
        });
        //iconFile = 'http://maps.google.com/mapfiles/ms/icons/green-dot.png';          
        //point.setIcon(iconFile) 
     
        var infowindow = new google.maps.InfoWindow({
     
            content: '<DIV STYLE="line-height:1.35;overflow:hidden;white-space:nowrap;"><DIV STYLE=overflow:auto; width:50px; height:50px><font style="color:#000;"><b>Latitude : </b>' + location.lat() +
                '<br /><b>Longitude : </b>' + location.lng() + '</font></div></div>'
     
        });
        infowindow.open(map, point);
        markers.push(point);
     
        document.getElementById('latitude').value = location.lat();
        document.getElementById('longitude').value = location.lng(); //formatted_address
        codeLatLng(location.lat(), location.lng(), 'adresse');
     
    }
     
    function checkconnection() {
        var status = navigator.onLine;
        if (status) {
            //alert("online");
        } else {
            alert("Pas de connexion internet");
        }
    }
    function clearForm() {
        document.getElementById('nmStation').value = '';
        document.getElementById('emplacement').value = '';
        document.getElementById('LatOrg').value = '';
        document.getElementById('LongOrg').value = '';
        document.getElementById('txtorigine').value = '';
        document.getElementById('observ').innerHTML = '';
        document.getElementById('total').innerHTML = '';
    document.getElementById('Axe').value = '';
    }
     
    // clear overlays function
    function clearOverlays() {
     
        if (markers) {
            for (i in markers) {
                markers[i].setMap(null);
            }
            markers = [];
            infos = [];
        }
        if (directionsDisplay.getDirections() != null) {
            directionsDisplay.setMap(null);
            directionsDisplay = new google.maps.DirectionsRenderer();
        }
        //initialize();
    }
     
    // clear infos function
    function clearInfos() {
        if (infos) {
            for (i in infos) {
                if (infos[i].getMap()) {
                    infos[i].close();
                }
            }
        }
    }
    function getImage(titre, objet) {
            // Définition de la zone à imprimer 
            var zone = document.getElementById(objet).innerHTML;
     
            // Ouverture du popup 
            var fen = window.open("", "", "height=600, width=800,toolbar=0, menubar=0, scrollbars=1, resizable=1,status=0, location=0, left=10, top=10");
     
            // style du popup 
            fen.document.body.style.color = '#000000';
            fen.document.body.style.backgroundColor = '#FFFFFF';
            fen.document.body.style.padding = "20px";
     
            // Ajout des données a imprimer 
            fen.document.title = titre;
            fen.document.body.innerHTML += " " + zone + " ";
     
            // Impression du popup 
            fen.window.print();
     
            //Fermeture du popup 
            fen.window.close();
            return true;
    }
     
    // find address function 
    function findAddress(adresse ,nom ,lat,lgt,emplacement,prop,TP,statut,auto,ddauto,dfauto,superficie,redevance,somme,corresps,observs) {
     
        clearOverlays();
        var address = adresse;  
     
        // script uses our 'geocoder' in order to find location by address name
        geocoder.geocode({ 'address': address }, function (results, status) {
            if (status == google.maps.GeocoderStatus.OK) { // and, if everything is ok
     
                // we will center map
                var addrLocation = results[0].geometry.location;
                map.setCenter(addrLocation);
     
                // store current coordinates into hidden variables
                document.getElementById('lat').value = results[0].geometry.location.$a;
                document.getElementById('lng').value = results[0].geometry.location.ab;
     
                // and then - add new custom marker and Infowindow
                var addrMarker = new google.maps.Marker({
     
                    position: addrLocation,
                    map: map,
                    title: results[0].formatted_address,
                    //animation: google.maps.Animation.BOUNCE
                });
                /* +
                
                */
                var infowindow = new google.maps.InfoWindow({
     
                    content: '<DIV STYLE="line-height:1.35;overflow:hidden;white-space:nowrap;"><DIV STYLE=overflow:auto; width:250px; height:150px><img src="Scripts/station.jpg" /><br /><font style="color:#000;"><b>Nom : </b>' + nom +
                '<br /><b>Latitude/longitude : </b>' + lat + '/' + lgt + '<br /><b>Emplacement :</b> ' + emplacement +
                '<br /><b>Personne autorisée : </b>' + prop + '<br /><b>Type : </b>' + TP + '<br /><b>Adresse : </b>' + adresse +
                '<br /><b>Situation : </b>' + statut+'<br /><b>Autorisation : </b>' + auto+ '<b> DU : </b>'+ddauto+'<b> Au </b>'+dfauto+
                '<br /><b>Superficie : </b>' + superficie+'m² <br /><b>Redevance : </b>' + redevance+'Dh <br /><b>Somme : </b>' + somme + '<br /><b>Correspondances : </b>' + corresps + '<br /><b>Observations : </b>' + observs +'</font></div></div>'
     
                });
     
                infowindow.open(map, addrMarker);
     
                markers.push(addrMarker);
     
                addrMarker.indice = markers.length - 1;
     
                // suppression du marker sur dblclick
                google.maps.event.addListener(addrMarker, 'dblclick', function (data) {
                var ind = this.indice;
                    if (confirm("Voulez-vous supprimer cette station ?")) { // Clic sur OK
                        deleteStation2();
                        this.setMap(null);
                        //var ind = this.indice;
                        markers.splice(ind, 1);
                        // réajuste les indices des autres marqueurs
                        for (; markers[ind]; ind++) {
                            markers[ind].indice = ind;
                        }
                    }
                    else {
                        this.setMap(null);
                        //var ind = this.indice;
                        markers.splice(ind, 1);
                        // réajuste les indices des autres marqueurs
                        for (; markers[ind]; ind++) {
                            markers[ind].indice = ind;
                        }
                    }
                });
                if (directionsDisplay.getDirections() != null) {
                    directionsDisplay.setMap(null);
                    directionsDisplay = new google.maps.DirectionsRenderer();
                }
     
            } else {
                alert('Geocode was not successful for the following reason: ' + address);
     
            }
        });
    }
     
    function localiser(adresse ,nom ,lat,lgt,emplacement,prop,TP,statut,auto,ddauto,dfauto,superficie,redevance,somme,corresps,observs) {
     
        clearOverlays();
        var address = adresse;  
     
        // script uses our 'geocoder' in order to find location by address name
        geocoder.geocode({ 'address': address }, function (results, status) {
            if (status == google.maps.GeocoderStatus.OK) { // and, if everything is ok
     
                // we will center map
                var addrLocation = results[0].geometry.location;
                map.setCenter(addrLocation);
     
                // store current coordinates into hidden variables
                document.getElementById('lat').value = results[0].geometry.location.$a;
                document.getElementById('lng').value = results[0].geometry.location.ab;
     
                // and then - add new custom marker and Infowindow
                var addrMarker = new google.maps.Marker({
     
                    position: addrLocation,
                    map: map,
                    title: results[0].formatted_address,
                    //animation: google.maps.Animation.BOUNCE
                });
                /* +
                
                */
                var infowindow = new google.maps.InfoWindow({
     
                    content: '<DIV STYLE="line-height:1.35;overflow:hidden;white-space:nowrap;"><DIV STYLE=overflow:auto; width:250px; height:150px><img src="Scripts/station.jpg" /><br /><font style="color:#000;"><b>Nom : </b>' + nom +
                '<br /><b>Latitude/longitude : </b>' + lat + '/' + lgt + '<br /><b>Emplacement :</b> ' + emplacement +
                '<br /><b>Personne autorisée : </b>' + prop + '<br /><b>Type : </b>' + TP + '<br /><b>Adresse : </b>' + adresse +
                '<br /><b>Situation : </b>' + statut+'</font></div></div>'
     
                });
     
                infowindow.open(map, addrMarker);
     
                markers.push(addrMarker);
     
                addrMarker.indice = markers.length - 1;
     
                // suppression du marker sur dblclick
                google.maps.event.addListener(addrMarker, 'dblclick', function (data) {
                var ind = this.indice;
                    if (confirm("Voulez-vous supprimer cette station ?")) { // Clic sur OK
                        deleteStation2();
                        this.setMap(null);
                        //var ind = this.indice;
                        markers.splice(ind, 1);
                        // réajuste les indices des autres marqueurs
                        for (; markers[ind]; ind++) {
                            markers[ind].indice = ind;
                        }
                    }
                    else {
                        this.setMap(null);
                        //var ind = this.indice;
                        markers.splice(ind, 1);
                        // réajuste les indices des autres marqueurs
                        for (; markers[ind]; ind++) {
                            markers[ind].indice = ind;
                        }
                    }
                });
                if (directionsDisplay.getDirections() != null) {
                    directionsDisplay.setMap(null);
                    directionsDisplay = new google.maps.DirectionsRenderer();
                }
     
            } else {
                alert('Geocode was not successful for the following reason: ' + address);
     
            }
        });
    }
     
    function deleteStation2() {
        PageMethods.deleteStation(document.getElementById('ddlAdr').value, OnComplete);
    }
    function OnComplete(result) {
        alert(result);
    }
     
    // find custom places function
    function findPlaces() {
     
        var lat = document.getElementById('lat').value;
        var lng = document.getElementById('lng').value;
        var cur_location = new google.maps.LatLng(lat, lng);
     
        // prepare request to Places
        var request = {
            location: cur_location,
            radius: 5000,
            types: ['gas_station']
        };
        // send request
        service = new google.maps.places.PlacesService(map);
        service.nearbySearch(request, createMarkers);
     
    }
     
     
    // create markers (from 'findPlaces' function)
    function createMarkers(results, status) {
        if (status == google.maps.places.PlacesServiceStatus.OK) {
     
            // if we have found something - clear map (overlays)
            clearOverlays();
     
            // and create new markers by search result
            for (var i = 0; i < results.length; i++) {
                createMarker(results[i]);
            }
        } else if (status == google.maps.places.PlacesServiceStatus.ZERO_RESULTS) {
            alert('Sorry, nothing is found');
        }
    }
     
    // creare single marker function
    function createMarker(obj) {
     
        // prepare new Marker object
        var mark = new google.maps.Marker({
            position: obj.geometry.location,
            map: map,
            title: obj.name
        });
        markers.push(mark);
     
        // prepare info window
        var infowindow = new google.maps.InfoWindow({
        content: '<img src="' + obj.icon + '" /><br /><font style="color:#000;">' + obj.name +
            '<br />Adresse: ' + obj.vicinity + '</font>'
        });
     
        // add event handler to current marker
        google.maps.event.addListener(mark, 'click', function() {
            clearInfos();
            infowindow.open(map, mark);
        });
        infos.push(infowindow);
    }
     
     
    function findAllAddress(tabStation) {
        clearOverlays();
        var n = tabStation.length;
     
     
        for (var i = 0; i < n; i++) {
            findAddress2(tabStation[i][0], tabStation[i][1], tabStation[i][2], tabStation[i][3]);
            }
    }
     
     
    function FindOrigine() {
        if (directionsDisplay.getDirections() == null) {
        showForm();
            var address = document.getElementById('txtorigine').value;
     
            // script uses our 'geocoder' in order to find location by address name
            geocoder.geocode({ 'address': address }, function (results, status) {
                if (status == google.maps.GeocoderStatus.OK) { // and, if everything is ok
     
                    // we will center map
                    var OrigineLocation = results[0].geometry.location;
                    map.setCenter(OrigineLocation);
     
                    // store current coordinates into hidden variables
                    document.getElementById('LatOrg').value = results[0].geometry.location.lat();
                    document.getElementById('LongOrg').value = results[0].geometry.location.lng();
                }
            });
     
            tracerItineraire();
        }
        else{
        initialize();
                var address = document.getElementById('txtorigine').value;
     
            // script uses our 'geocoder' in order to find location by address name
            geocoder.geocode({ 'address': address }, function (results, status) {
                if (status == google.maps.GeocoderStatus.OK) { // and, if everything is ok
     
                    // we will center map
                    var OrigineLocation = results[0].geometry.location;
                    map.setCenter(OrigineLocation);
     
                    // store current coordinates into hidden variables
                    document.getElementById('LatOrg').value = results[0].geometry.location.lat();
                    document.getElementById('LongOrg').value = results[0].geometry.location.lng();
                }
            });
     
            tracerItineraire();
        }
    }
     
    function FindAdressPK() {
        showForm();
                    clearOverlays();clearForm();
            var myLatlng = new google.maps.LatLng(document.getElementById('latitude').value, document.getElementById('longitude').value);
     
                    placeMarker(myLatlng);showForm();
     
     
    }
     
    function FindPK() {
        clearOverlays();clearForm();
                showForm();
            var address = document.getElementById('adresse').value;
     
            // script uses our 'geocoder' in order to find location by address name
            geocoder.geocode({ 'address': address }, function (results, status) {
                if (status == google.maps.GeocoderStatus.OK) { // and, if everything is ok
     
                    // we will center map
                    var PKLocation = results[0].geometry.location;
                    map.setCenter(PKLocation);
     
                    // store current coordinates into hidden variables
                    document.getElementById('latitude').value = results[0].geometry.location.lat();
                    document.getElementById('longitude').value = results[0].geometry.location.lng();
     
     
     
        var point = new google.maps.Marker({ //on créé le marqueur
            position: PKLocation,
            map: map,
            title: "Coordonnées",
            animation: google.maps.Animation.BOUNCE
        });
     
        var infowindow = new google.maps.InfoWindow({
     
            content: '<DIV STYLE="line-height:1.35;overflow:hidden;white-space:nowrap;"><DIV STYLE=overflow:auto; width:50px; height:50px><font style="color:#000;"><b>Latitude : </b>' + PKLocation.lat() +
                '<br /><b>Longitude : </b>' + PKLocation.lng() + '</font></div></div>'
     
        });
        infowindow.open(map, point);
        markers.push(point);
        infos.push(infowindow);
                }
            });
    showForm();
    }
     
    function tracerItineraire() {
        clearOverlays();
     
        var polyOptions = {
            strokeColor: 'red',
            strokeOpacity: 0.45,
            strokeWeight: 5
        };
     
        directionsDisplay.setOptions({ polylineOptions: polyOptions });
     
      var start = document.getElementById("txtorigine").value;
      var end = new google.maps.LatLng(document.getElementById("latitude").value, document.getElementById("longitude").value);
      var request = {
        origin:start,
        destination:end,
        travelMode: google.maps.TravelMode.DRIVING
      };
      directionsService.route(request, function(result, status) {
        if (status == google.maps.DirectionsStatus.OK) {
          directionsDisplay.setDirections(result);
        }
      });
    }
     
     
    function showForm(){
       $find('ModalPopupExtender1').show();
    }
    //Itinéraire
    function calcRoute(waypoints) {
        var start = waypoints[0]; alert(waypoints[0]);
        var end = waypoints[1];
        var waypts = [];
        //var checkboxArray = document.getElementById('waypoints');
        for (var i = 2; i < waypoints.length; i++) {
            //if (waypoints.options[i].selected == true) {
                waypts.push({
                    location: waypoints[i],//.value
                    stopover: true
                }); 
            //}
        }
     
        var request = {
            origin: start,
            destination: end,
            waypoints: waypts,
            optimizeWaypoints: true,
            travelMode: google.maps.TravelMode.DRIVING
        }; 
        directionsService.route(request, function (response, status) {
            if (status == google.maps.DirectionsStatus.OK) {
                directionsDisplay.setDirections(response); 
            }
        });
    }
     
     
    function OnKeyPress(args) {
        if (args.keyCode == Sys.UI.Key.esc) {
            $find("ModalPopupExtender1").hide();
        }
    }
     
    function showImage() {
        var sHtml = '';
     
        // Donnees carte
        var centre = map.getCenter(),
              zoom = map.getZoom(),
              size = map.getDiv(),
              maptype = map.getMapTypeId();
     
        var oDoc = window.open('', 'PRINT_MAP', "height=" + size.offsetHeight + ", width=" + size.offsetWidth + ",toolbar=0, menubar=0, scrollbars=1, resizable=1,status=0, location=0, left=10, top=10"); var strHTML = '';
     
        // init URL de l'image
        var imageURL = ['http://maps.googleapis.com/maps/api/staticmap?']; 
        imageURL.push('center=' + centre.toUrlValue());
        imageURL.push('zoom=' + zoom);
        imageURL.push('size=' + size.offsetWidth + 'x' + size.offsetHeight);
        if (maptype !== 'roadmap') {
            imageURL.push('maptype=' + maptype);
        }
        //================= Si markers===================================//
        if (markers.length != 0) {
            marker = new Array();
     
                for (var i = 0; i < markers.length; i++) {
                    marker.push('markers=color:red|' + markers[i].position.lat().toFixed(6) + ',' + markers[i].position.lng().toFixed(6));
                }
                    marker = marker.join('&');
                    imageURL.push(marker);
        }
     
     
        //================= Si itineraire===============================//
        if (directionsDisplay.directions) {
            var oRecup = directionsDisplay.directions.routes[0];
     
            var i, nbLegs = oRecup.legs.length;
            // marker de debut
            imageURL.push('markers=label:A|color:green|' + oRecup.legs[0].start_location.toUrlValue());
            // marker de fin
            imageURL.push('markers=label:B|color:red|' + oRecup.legs[nbLegs - 1].end_location.toUrlValue());
            // traitement des wayPoints
            for (i = 1; i < nbLegs; i++) {
                imageURL.push('markers=color:green|' + oRecup.legs[i].start_location.toUrlValue());
            }
            // l'itinأ©raire encrytأ©
            imageURL.push('path=weight:6|color:red|enc:' + oRecup.overview_polyline.points);
     
        }
            // La finalisation de l'image constituée
            //imageURL.push('scale=2');
            imageURL.push('sensor=false');
            imageURL = imageURL.join('&');
            // affiche l'image
            //oImage.src = imageURL;
     
            sHtml += '<!doctype html><html><head><h4 style="text-align:center"></h4>';
            sHtml += '</head><body onload="self.print()">';
     
            if(markers.length==1){
            var contenu = '';
            if (infos) {
            for (i in infos) {
                contenu = infos[i].getContent();
                }
            }
     
            sHtml += '<div><table><tr><td><img src="' + imageURL + '"></td><td style="width:20%">'+
            '<DIV STYLE="line-height:1.35;overflow:hidden;white-space:nowrap;"><DIV STYLE=overflow:auto; width:250px; '+
            'height:150px><br /><font style="color:#000;">'+contenu+'</font></div></div></td></tr></table></div>';
            }
            else {
            sHtml += '<img src="' + imageURL + '">';
            }
            sHtml += strHTML;
            sHtml += '</body></html>';
            oDoc.document.open();
            oDoc.document.write(sHtml);
            oDoc.document.close();
            oDoc.focus();
    }
     
     
    function Localisation(adresse ,nom ,lat,lgt,emplacement,prop,TP,statut,auto,ddauto,dfauto,superficie,redevance,somme,corresps,observs) {
     
        var lt = parseFloat(lat.replace(',','.'));
        var lg = parseFloat(lgt.replace(',','.'));
     
        var latlng = new google.maps.LatLng(lt, lg);
     
        clearOverlays();
        var address = adresse;  
     
        // script uses our 'geocoder' in order to find location by address name
        geocoder.geocode({ 'latLng': latlng }, function (results, status) {
            if (status == google.maps.GeocoderStatus.OK) { // and, if everything is ok
     
                // we will center map
                var addrLocation = latlng;
                map.setCenter(addrLocation);
     
                // store current coordinates into hidden variables
                document.getElementById('lat').value = lt;
                document.getElementById('lng').value = lg;
     
                // and then - add new custom marker and Infowindow
                var addrMarker = new google.maps.Marker({
     
                    position: addrLocation,
                    map: map,
                    title: results[0].formatted_address
                    //animation: google.maps.Animation.BOUNCE
                });
                /* +
                
                */
                var result = '<DIV STYLE="line-height:1.35;overflow:hidden;white-space:nowrap;"><DIV STYLE=overflow:auto; width:250px; height:150px><img src="Scripts/station.jpg" /><br /><font style="color:#000;">';
                if(nom !=''){result += '<b>Nom : </b>' + nom ;}
                if(emplacement!=''){result += '<br /><b>Emplacement :</b> ' + emplacement;}
                if(prop!=''){result += '<br /><b>Personne autorisée : </b>' + prop + '<br /><b>Type : </b>' + TP ;}
                if(adresse!=''){result += '<br /><b>Adresse : </b>' + adresse ;}
                if(statut!=''){result += '<br /><b>Situation : </b>' + statut ;}
                if(auto!=''){result += '<br /><b>Autorisation : </b>' + auto+ '<b> DU : </b>'+ddauto+'<b> Au </b>'+dfauto ;}
                if(superficie!='0'){result += '<br /><b>Superficie : </b>' + superficie +' m²';}
                if(redevance!='0'){result += '<br /><b>Redevance : </b>' + redevance+ ' Dh';}
                if(somme!=''){result += '<br /><b>Somme : </b>' + somme ;}
                if(corresps!=''){result += '<br /><b>Correspondances : </b>' + corresps ;}
                if(observs!=''){result += '<br /><b>Observations : </b>' + observs ;}
     
     
                var infowindow = new google.maps.InfoWindow({
     
                    content: result + '<br /><b>Latitude/longitude : </b>' + lat + '/' + lgt +  '</font></div></div>'
     
                });
     
                infowindow.open(map, addrMarker);
     
                infos.push(infowindow);
     
                markers.push(addrMarker);
     
                addrMarker.indice = markers.length - 1;
     
                // suppression du marker sur dblclick
                google.maps.event.addListener(addrMarker, 'dblclick', function (data) {
                var ind = this.indice;
                    if (confirm("Voulez-vous supprimer cette station ?")) { // Clic sur OK
                        deleteStation2();
                        this.setMap(null);
                        //var ind = this.indice;
                        markers.splice(ind, 1);
                        // réajuste les indices des autres marqueurs
                        for (; markers[ind]; ind++) {
                            markers[ind].indice = ind;
                        }
                    }
                    else {
                        this.setMap(null);
                        //var ind = this.indice;
                        markers.splice(ind, 1);
                        // réajuste les indices des autres marqueurs
                        for (; markers[ind]; ind++) {
                            markers[ind].indice = ind;
                        }
                    }
                });
                if (directionsDisplay.getDirections() != null) {
                    directionsDisplay.setMap(null);
                    directionsDisplay = new google.maps.DirectionsRenderer();
                }
     
            } else {
                alert('Geocode was not successful for the following reason: ' + address);
     
            }
        });
     
    }
     
    function LocalisationModal(adresse ,nom ,lat,lgt,emplacement,prop,TP,statut,auto,ddauto,dfauto,superficie,redevance,somme,corresps,observs) {
     
        var bcgDiv = document.getElementById("divBackground");
        var imgDiv = document.getElementById("divImage");
        var gmap_canvas = document.getElementById("gmap_canvas");
     
        bcgDiv.style.display = "block";
        imgDiv.style.display = "block";
        gmap_canvas.style.display = "block";
     
        initialize();
     
        var lt = parseFloat(lat.replace(',','.'));
        var lg = parseFloat(lgt.replace(',','.'));
     
        var latlng = new google.maps.LatLng(lt, lg);
     
        clearOverlays();
        var address = adresse;  
     
        // script uses our 'geocoder' in order to find location by address name
        geocoder.geocode({ 'latLng': latlng }, function (results, status) {
            if (status == google.maps.GeocoderStatus.OK) { // and, if everything is ok
     
                // we will center map
                var addrLocation = latlng;
                map.setCenter(addrLocation);
     
                // store current coordinates into hidden variables
                document.getElementById('lat').value = lt;
                document.getElementById('lng').value = lg;
     
                // and then - add new custom marker and Infowindow
                var addrMarker = new google.maps.Marker({
     
                    position: addrLocation,
                    map: map,
                    title: results[0].formatted_address
                    //animation: google.maps.Animation.BOUNCE
                });
                /* +
                
                */
                var result = '<DIV STYLE="line-height:1.35;overflow:hidden;white-space:nowrap;"><DIV STYLE=overflow:auto; width:250px; height:150px><img src="Scripts/station.jpg" /><br /><font style="color:#000;">';
                if(nom !=''){result += '<b>Nom : </b>' + nom ;}
                if(emplacement!=''){result += '<br /><b>Emplacement :</b> ' + emplacement;}
                if(prop!=''){result += '<br /><b>Personne autorisée : </b>' + prop + '<br /><b>Type : </b>' + TP ;}
                if(adresse!=''){result += '<br /><b>Adresse : </b>' + adresse ;}
                if(statut!=''){result += '<br /><b>Situation : </b>' + statut ;}
                if(auto!=''){result += '<br /><b>Autorisation : </b>' + auto+ '<b> DU : </b>'+ddauto+'<b> Au </b>'+dfauto ;}
                if(superficie!='0'){result += '<br /><b>Superficie : </b>' + superficie +' m²';}
                if(redevance!='0'){result += '<br /><b>Redevance : </b>' + redevance+ ' Dh';}
                if(somme!=''){result += '<br /><b>Somme : </b>' + somme ;}
                if(corresps!=''){result += '<br /><b>Correspondances : </b>' + corresps ;}
                if(observs!=''){result += '<br /><b>Observations : </b>' + observs ;}
     
     
                var infowindow = new google.maps.InfoWindow({
     
                    content: result + '<br /><b>Latitude/longitude : </b>' + lat + '/' + lgt +  '</font></div></div>'
     
                });
     
                infowindow.open(map, addrMarker);
     
                infos.push(infowindow);
     
                markers.push(addrMarker);
     
                addrMarker.indice = markers.length - 1;
     
                // suppression du marker sur dblclick
                google.maps.event.addListener(addrMarker, 'dblclick', function (data) {
                var ind = this.indice;
                    if (confirm("Voulez-vous supprimer cette station ?")) { // Clic sur OK
                        deleteStation2();
                        this.setMap(null);
                        //var ind = this.indice;
                        markers.splice(ind, 1);
                        // réajuste les indices des autres marqueurs
                        for (; markers[ind]; ind++) {
                            markers[ind].indice = ind;
                        }
                    }
                    else {
                        this.setMap(null);
                        //var ind = this.indice;
                        markers.splice(ind, 1);
                        // réajuste les indices des autres marqueurs
                        for (; markers[ind]; ind++) {
                            markers[ind].indice = ind;
                        }
                    }
                });
                if (directionsDisplay.getDirections() != null) {
                    directionsDisplay.setMap(null);
                    directionsDisplay = new google.maps.DirectionsRenderer();
                }
     
            } else {
                alert('Geocode was not successful for the following reason: ' + address);
     
            }
        });
     
    }
     
    function LocalisationAff(adresse ,nom ,lat,lgt,emplacement,prop,TP,statut,auto,ddauto,dfauto,superficie,redevance, origine,somme,corresps,observs) {
     
        var lt = parseFloat(lat.replace(',','.'));
        var lg = parseFloat(lgt.replace(',','.'));
     
        var latlng = new google.maps.LatLng(lt, lg);
     
        clearOverlays();
        var address = adresse;  
     
        // script uses our 'geocoder' in order to find location by address name
        geocoder.geocode({ 'latLng': latlng }, function (results, status) {
            if (status == google.maps.GeocoderStatus.OK) { // and, if everything is ok
     
                // we will center map
                var addrLocation = latlng;
                map.setCenter(addrLocation);
     
                // store current coordinates into hidden variables
                document.getElementById('lat').value = lt;
                document.getElementById('lng').value = lg;
     
                // and then - add new custom marker and Infowindow
                var addrMarker = new google.maps.Marker({
     
                    position: addrLocation,
                    map: map,
                    title: results[0].formatted_address
                    //animation: google.maps.Animation.BOUNCE
                });
                /* +
                
                */
                var result = '<DIV STYLE="line-height:1.35;overflow:hidden;white-space:nowrap;"><DIV STYLE=overflow:auto; width:250px; height:150px><img src="Scripts/station.jpg" /><br /><font style="color:#000;">';
                if(nom !=''){result += '<b>Nom : </b>' + nom ;}
                if(emplacement!=''){result += '<br /><b>Emplacement :</b> ' + emplacement;}
                if(prop!=''){result += '<br /><b>Personne autorisée : </b>' + prop + '<br /><b>Type : </b>' + TP ;}
                if(adresse!=''){result += '<br /><b>Adresse : </b>' + adresse ;}
                if(statut!=''){result += '<br /><b>Situation : </b>' + statut ;}
                if(auto!=''){result += '<br /><b>Autorisation : </b>' + auto+ '<b> DU : </b>'+ddauto+'<b> Au </b>'+dfauto ;}
                if(superficie!='0'){result += '<br /><b>Superficie : </b>' + superficie +' m²';}
                if(redevance!='0'){result += '<br /><b>Redevance : </b>' + redevance +' Dh' ;}
                if(origine!=''){result += '<br /><b>Origine : </b>' + origine;}
                if(somme!=''){result += '<br /><b>Somme : </b>' + somme ;}
                if(corresps!=''){result += '<br /><b>Correspondances : </b>' + corresps ;}
                if(observs!=''){result += '<br /><b>Observations : </b>' + observs ;}
     
     
                var infowindow = new google.maps.InfoWindow({
     
                    content: result + '<br /><b>Latitude/longitude : </b>' + lat + '/' + lgt +  '</font></div></div>'
     
                });
     
                infowindow.open(map, addrMarker);
     
                markers.push(addrMarker);
     
                addrMarker.indice = markers.length - 1;
     
                // suppression du marker sur dblclick
                google.maps.event.addListener(addrMarker, 'dblclick', function (data) {
                var ind = this.indice;
                    if (confirm("Voulez-vous supprimer cette station ?")) { // Clic sur OK
                        deleteStation2();
                        this.setMap(null);
                        //var ind = this.indice;
                        markers.splice(ind, 1);
                        // réajuste les indices des autres marqueurs
                        for (; markers[ind]; ind++) {
                            markers[ind].indice = ind;
                        }
                    }
                    else {
                        this.setMap(null);
                        //var ind = this.indice;
                        markers.splice(ind, 1);
                        // réajuste les indices des autres marqueurs
                        for (; markers[ind]; ind++) {
                            markers[ind].indice = ind;
                        }
                    }
                });
                if (directionsDisplay.getDirections() != null) {
                    directionsDisplay.setMap(null);
                    directionsDisplay = new google.maps.DirectionsRenderer();
                }
     
            } else {
                alert('Geocode was not successful for the following reason: ' + address);
     
            }
        });
     
    }

  6. #6
    Rédacteur

    Avatar de Bovino
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juin 2008
    Messages
    23 647
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2008
    Messages : 23 647
    Points : 91 418
    Points
    91 418
    Billets dans le blog
    20
    Par défaut
    Hum, chic, moi qui m'ennuyait un peu ce matin, voilà 1082 LOC à déguster !

    le code que j'ai posté en haut c'est le seul lié a la modal
    Certes, mais la question, à la base, c'est
    Positionnement d'un modal popup extender
    et dans "le code posté en haut", il n'y a absolument rien qui puisse se rapporter au "positionnement d'une modale".
    D'autre part, la notion de "modal extender" n'existe pas en JavaScript...
    Pas de question technique par MP !
    Tout le monde peut participer à developpez.com, vous avez une idée, contactez-moi !
    Mes formations video2brain : La formation complète sur JavaScriptJavaScript et le DOM par la pratiquePHP 5 et MySQL : les fondamentaux
    Mon livre sur jQuery
    Module Firefox / Chrome d'intégration de JSFiddle et CodePen sur le forum

  7. #7
    Membre habitué
    Inscrit en
    Août 2008
    Messages
    1 596
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 1 596
    Points : 175
    Points
    175
    Par défaut
    et que dois je faire ?

Discussions similaires

  1. [DEBUTANT] Modal popup extender ne s'affiche pas
    Par nakk01 dans le forum ASP.NET
    Réponses: 1
    Dernier message: 05/09/2010, 14h55
  2. Fenetre Modal Popup
    Par Knightrider dans le forum Windows Forms
    Réponses: 2
    Dernier message: 26/08/2009, 12h08
  3. Upload dans modal popup
    Par smp82 dans le forum ASP.NET
    Réponses: 0
    Dernier message: 06/05/2009, 12h15
  4. Positionner et personnaliser une Popup
    Par killer69 dans le forum C#
    Réponses: 6
    Dernier message: 05/02/2008, 19h16

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