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

 Delphi Discussion :

Problème dans un TWebBrowser


Sujet :

Delphi

  1. #1
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut Problème dans un TWebBrowser
    Bonjour,

    J'utilise dans une application un TWebBrowser pour afficher une carte du monde Googlemap grâce à un script.
    Il semble que depuis un jour ou deux, celui-ci ne fonctionne plus.
    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
    HTMLStr: AnsiString = //Java scrip for Google map
    '<html> '+
    '<head> '+
    '<meta http-equiv="X-UA-Compatible" content="IE=edge" />'+
    '<meta name="viewport" content="initial-scale=1.0, user-scalable=yes" /> '+
    '<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> '+
    '<script type="text/javascript"> '+
    '  var map;'+
    '  var polyline = [];'+
    '  var markersArray = [];'+
    '  var Circle = { '+
    '  path: google.maps.SymbolPath.CIRCLE ,'+
    '  fillColor: "Red",'+
    '  fillOpacity: 1.0,'+
    '  scale: 3,'+
    '  strokeColor:"Black",'+
    '  strokeWeight: 1 '+
    '};'+
    ''+
    ''+
    '  function initialize() {'+
    '  var myLatLng = new google.maps.LatLng(48.0,2.0);'+
    '  var mapOptions = {'+
    '    zoom: 5,'+
    '    center: myLatLng,'+
    '    mapTypeId: google.maps.MapTypeId.TERRAIN'+
    '  };'+
    '  map = new google.maps.Map(document.getElementById("map_canvas"),'+
    '      mapOptions);'+
    '}'+
    ''+
    ' function DrawTrack(FromLat,FromLng,ToLat,ToLng){'+
    ' var geo_path = new Array();'+
    '     var geo_path = [new google.maps.LatLng(FromLat,FromLng),new google.maps.LatLng(ToLat,ToLng)];'+
    ' var Track = new google.maps.Polyline({'+
    '     path: geo_path,'+
    '     strokeColor: "#FF0000",'+
    '     strokeOpacity: 1.0,'+
    '     strokeWeight: 2'+
    ' });'+
    ' polyline.push(Track);'+
    ' Track.setMap (map);'+
    '}'+
    ''+
    ''+
    ' function RemoveTrack(){' +
    '  if (polyline){' +
    '    for(i in polyline){' +
    '      polyline[i].setMap(null);' +
    '    }' +
    '     polyline.length =0;' +
    '   }' +
    '}' +
    ''+
    'function ClearMarkers() {  '+
    '  if (markersArray) {        '+
    '    for (i in markersArray) {  '+
    '      markersArray[i].setMap(null); '+
    '    } '+
    '  } '+
    ' Bounds = new google.maps.LatLngBounds();'+
    '}  '+
    ''+
    'var Bounds = new google.maps.LatLngBounds(); '+
    '  function PutMarker(Lat, Lang, Msg) { '+
    '   var latlng = new google.maps.LatLng(Lat,Lang);'+
    '   var marker = new google.maps.Marker({'+
    '      position: latlng,'+
    '      icon: Circle,'+
    '      map: map,'+
    '      title: Msg'+
    '  });'+
    ' markersArray.push(marker); '+
    ' Bounds.extend(latlng);'+
    ' map.fitBounds(Bounds);'+
    '}'+
    ''+
    ''+
    ''+'</script> '+
    '</head> '+
    '<body onload="initialize()"> '+
    '  <div id="map_canvas" style="width:100%; height:100%"></div> '+
    '</body> '+
    '</html> ';
    J'ai lu quelque part que l'API avait été modifiée...
    Pourriez vous m'aider à corriger ce qui ne fonctionne pas, l'étendue de mes connaissances étant très limité.

    Merci
    Cordialement
    Pierre

  2. #2
    Rédacteur/Modérateur

    Avatar de Roland Chastain
    Homme Profil pro
    Enseignant
    Inscrit en
    Décembre 2011
    Messages
    4 072
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Moselle (Lorraine)

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Décembre 2011
    Messages : 4 072
    Points : 15 462
    Points
    15 462
    Billets dans le blog
    9
    Par défaut
    Bonjour !

    Je me demande si ce n'est pas le même problème qui est décrit dans cette discussion, auquel cas vous pourriez peut-être vous inspirer de la solution proposée.
    Mon site personnel consacré à MSEide+MSEgui : msegui.net

  3. #3
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut
    Merci de la réponse,

    N'étant pas germanophone, j'ai quelques difficultés à comprendre le contenu même avec les traducteurs en lignes.

    Cordialement
    Pierre

  4. #4
    Rédacteur/Modérateur

    Avatar de Roland Chastain
    Homme Profil pro
    Enseignant
    Inscrit en
    Décembre 2011
    Messages
    4 072
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Moselle (Lorraine)

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Décembre 2011
    Messages : 4 072
    Points : 15 462
    Points
    15 462
    Billets dans le blog
    9
    Par défaut
    Pardon pour la réponse probablement inutile.

    A tout hasard, si vous ajoutez cette ligne, ça ne change rien ?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    HTMLStr: AnsiString = //Java scrip for Google map
    '<!DOCTYPE html>'+ // <----
    '<html> '+
    Mon site personnel consacré à MSEide+MSEgui : msegui.net

  5. #5
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut
    Merci Roland,

    Malheureusement, même si je n'ai plus de message d'erreur, le TWebBrowser reste désespérément vide.

    Cordialement
    Pierre

  6. #6
    Rédacteur/Modérateur

    Avatar de Roland Chastain
    Homme Profil pro
    Enseignant
    Inscrit en
    Décembre 2011
    Messages
    4 072
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Moselle (Lorraine)

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Décembre 2011
    Messages : 4 072
    Points : 15 462
    Points
    15 462
    Billets dans le blog
    9
    Par défaut
    Citation Envoyé par Pierre95 Voir le message
    Malheureusement, même si je n'ai plus de message d'erreur, le TWebBrowser reste désespérément vide.
    Tout compte fait, n'est-ce pas plutôt dans un forum JavaScript qu'il faudrait poser la question ? Parce que j'ai essayé de coller votre code dans une page HTML et de l'ouvrir dans mon navigateur : là aussi l'écran reste blanc. Ou tout simplement chercher un script qui fonctionne, pour remplacer le script actuel ?

    P.-S. J'ai essayé avec succès, dans Google Chrome, les exemples de ce tutoriel. Maintenant je ne sais pas si les fonctionnalités que vous souhaitez s'y trouvent. Au fait, pourrait-on savoir quel code Delphi vous utilisez ?
    Mon site personnel consacré à MSEide+MSEgui : msegui.net

  7. #7
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut
    Bonjour,

    Merci de l’intérêt que vous portez à mon problème.
    Voici le code Delphi utilisé par mon application:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    WbBrMap.Navigate('about:blank');
      if Assigned(WebBrowser1.Document) then
      begin
        aStream                        := TMemoryStream.Create;
        try
          aStream.WriteBuffer(Pointer(HTMLStr)^, Length(HTMLStr));
          aStream.Seek(0, soFromBeginning);
          (WbBrMap.Document as IPersistStreamInit).Load(TStreamAdapter.
                                                            Create(aStream));
        finally
          aStream.Free;
        end;
      end;
    Ce code fonctionnait parfaitement jusqu'au récents changements de l'API Googlemap.

    Merci encore

    Codialement
    Pierre

  8. #8
    Rédacteur/Modérateur

    Avatar de SergioMaster
    Homme Profil pro
    Développeur informatique retraité
    Inscrit en
    Janvier 2007
    Messages
    15 043
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 67
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur informatique retraité
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2007
    Messages : 15 043
    Points : 40 957
    Points
    40 957
    Billets dans le blog
    62
    Par défaut
    Citation Envoyé par Roland Chastain Voir le message
    Ou tout simplement chercher un script qui fonctionne, pour remplacer le script actuel ?
    Bonjour,

    c'est le meilleur conseil que l'on puisse donner. J'ai le souvenir d'un Codeway Tour (2010) au cours duquel T.Laborde avait abordé ce thème et nous avis fourni sur clé USB le composant webgooglemaps . Pour nous en expliquer le principe (si mes souvenirs sont encore bons) il était allé via google chrome sur la "carte google" et avait récupéré le code source de la page affichée. Le tout avait ensuite été mis comme constante dans un fichier avec quelques autres valeurs .

    j'ai encore cette clé , voici l'unité dont je parle
    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
    unit UWebGoogleMapsConst;
     
    interface
     
    const
      HTML_FILE_NAME = 'webgooglemaps.html';
      JAVASCRIPT     = 'JavaScript';
      NORMAL_MAP     = 'G_NORMAL_MAP';
      SATELLITE_MAP  = 'G_SATELLITE_MAP';
      HYBRID_MAP     = 'G_HYBRID_MAP';
      PHYSICAL_MAP   = 'G_PHYSICAL_MAP';
      GIF_RESSOURCE_NAME = 'LOADER';
      FORMAT_GIF         = 'GIF';
      DEFAULT_ZOOM       = 10;
      DEFAULT_LATITUDE   = 48.856578; // Paris Latitude
      DEFAULT_LONGITUDE  = 2.351828; // Paris Longitude
      DEFAULT_WIDTH      = 100;
      DEFAULT_HEIGHT     = 100;
     
      HTML_FILE  =  '<html>' + #13 +
                    '  <head>' + #13 +
                    '    <style type="text/css">' + #13 +
                    '      * { margin: 0px; }' + #13 +
                    '      @import url("http://www.google.com/uds/css/gsearch.css");' + #13 +
                    '      @import url("http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css");' + #13 +
                    '    </style>' + #13 +
                    '    <script src="http://maps.google.com/maps?file=api&v=%apiversion%&key=<%apikey%>" type="text/javascript"></script>' + #13 +
                    '    <script src="http://www.google.com/uds/api?file=uds.js&amp;v=1.0" type="text/javascript"></script>' + #13 +
                    '    <script src="http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js" type="text/javascript"></script>' + #13 +
                    '    <script type="text/javascript"> ' + #13 +
                    '    //<![CDATA[' + #13 +
                    '      var map;' + #13 +
                    '      var allmarkers = [];' + #13 +
                    '      var LargeMapControl3D = new GLargeMapControl3D();' + #13 +
                    '      var LargeMapControl = new GLargeMapControl();' + #13 +
                    '      var SmallMapControl = new GSmallMapControl();' + #13 +
                    '      var SmallZoomControl3D = new GSmallZoomControl3D();' + #13 +
                    '      var SmallZoomControl = new GSmallZoomControl();' + #13 +
                    '      var ScaleControl = new GScaleControl();' + #13 +
                    '      var MapTypeControl = new GMapTypeControl();' + #13 +
                    '      var HierarchicalMapTypeControl = new GHierarchicalMapTypeControl();' + #13 +
                    '      var OverviewMapControl = new GOverviewMapControl();' + #13 +
                    '      var NavLabelControl = new GNavLabelControl();' + #13 +
                    '      var LocalSearchBar = new google.maps.LocalSearch();' + #13 +
                    ' ' + #13 +
                    '      function addLocalSearchBar(Position,PosX,PosY) {' + #13 +
                    '        var gpossize = new GSize(PosX,PosY);' + #13 +
                    '        switch(Position)' + #13 +
                    '        {' + #13 +
                    '        case 0:' + #13 +
                    '          map.addControl(LocalSearchBar, new GControlPosition(G_ANCHOR_TOP_RIGHT, gpossize));' + #13 +
                    '          break' + #13 +
                    '        case 1:' + #13 +
                    '          map.addControl(LocalSearchBar, new GControlPosition(G_ANCHOR_TOP_LEFT, gpossize));' + #13 +
                    '          break' + #13 +
                    '        case 2:' + #13 +
                    '          map.addControl(LocalSearchBar, new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, gpossize));' + #13 +
                    '          break' + #13 +
                    '        case 3:' + #13 +
                    '          map.addControl(LocalSearchBar, new GControlPosition(G_ANCHOR_BOTTOM_LEFT, gpossize));' + #13 +
                    '          break' + #13 +
                    '        }' + #13 +
                    '      }' + #13 +
                    ' ' + #13 +
                    '      function addControl(ctrlType) {' + #13 +
                    '        switch(ctrlType)' + #13 +
                    '        {' + #13 +
                    '        case 0:' + #13 +
                    '          map.addControl(LargeMapControl3D)' + #13 +
                    '          break' + #13 +
                    '        case 1:' + #13 +
                    '          map.addControl(LargeMapControl);' + #13 +
                    '          break' + #13 +
                    '        case 2:' + #13 +
                    '          map.addControl(SmallMapControl);' + #13 +
                    '          break' + #13 +
                    '        case 3:' + #13 +
                    '          map.addControl(SmallZoomControl3D);' + #13 +
                    '          break' + #13 +
                    '        case 4:' + #13 +
                    '          map.addControl(SmallZoomControl);' + #13 +
                    '          break' + #13 +
                    '        case 5:' + #13 +
                    '          map.addControl(ScaleControl);' + #13 +
                    '          break' + #13 +
                    '        case 6:' + #13 +
                    '          map.addControl(MapTypeControl);' + #13 +
                    '          break' + #13 +
                    '        case 7:' + #13 +
                    '          map.addControl(HierarchicalMapTypeControl);' + #13 +
                    '          break' + #13 +
                    '        case 8:' + #13 +
                    '          map.addControl(OverviewMapControl);' + #13 +
                    '          break' + #13 +
                    '        case 9:' + #13 +
                    '          map.addControl(NavLabelControl);' + #13 +
                    '          break' + #13 +
                    '        }' + #13 +
                    '      }' + #13 +
                    ' ' + #13 +
                    '      function removeControl(ctrlType) {' + #13 +
                    '        switch(ctrlType)' + #13 +
                    '        {' + #13 +
                    '        case 0:' + #13 +
                    '          map.removeControl(LargeMapControl3D)' + #13 +
                    '          break' + #13 +
                    '        case 1:' + #13 +
                    '          map.removeControl(LargeMapControl);' + #13 +
                    '          break' + #13 +
                    '        case 2:' + #13 +
                    '          map.removeControl(SmallMapControl);' + #13 +
                    '          break' + #13 +
                    '        case 3:' + #13 +
                    '          map.removeControl(SmallZoomControl3D);' + #13 +
                    '          break' + #13 +
                    '        case 4:' + #13 +
                    '          map.removeControl(SmallZoomControl);' + #13 +
                    '          break' + #13 +
                    '        case 5:' + #13 +
                    '          map.removeControl(ScaleControl);' + #13 +
                    '          break' + #13 +
                    '        case 6:' + #13 +
                    '          map.removeControl(MapTypeControl);' + #13 +
                    '          break' + #13 +
                    '        case 7:' + #13 +
                    '          map.removeControl(HierarchicalMapTypeControl);' + #13 +
                    '          break' + #13 +
                    '        case 8:' + #13 +
                    '          map.removeControl(OverviewMapControl);' + #13 +
                    '          break' + #13 +
                    '        case 9:' + #13 +
                    '          map.removeControl(NavLabelControl);' + #13 +
                    '          break' + #13 +
                    '        }' + #13 +
                    '      }' + #13 +
                    ' ' + #13 +
                    '      function createMapMarker(lat, lng, html, image, drag, hidden) {' + #13 +
                    '        var point = new GLatLng(parseFloat(lat),parseFloat(lng));' + #13 +
                    '        if (image=="") {' + #13 +
                    '          var markerOptions = { title: html , draggable:drag , hide:hidden };' + #13 +
                    '        }' + #13 +
                    '        else {' + #13 +
                    '          var defineicon = new GIcon(G_DEFAULT_ICON);' + #13 +
                    '          defineicon.image = image;' + #13 +
                    '          var markerOptions = { title: html , icon:defineicon , draggable:drag , hide:hidden };' + #13 +
                    '        }' + #13 +
                    '        var marker = new GMarker(point, markerOptions);' + #13 +
                    '        allmarkers.push(marker);' + #13 +
                    '        GEvent.addListener(marker, "click", function() {' + #13 +
                    '               ptmarker=marker.getLatLng()' + #13 +
                    '               IdMarker=-1;' + #13 +
                    '               for (var i = 0; i < allmarkers.length; i++){' + #13 +
                    '                 if (allmarkers[i]==marker) {' + #13 +
                    '                   IdMarker=i;' + #13 +
                    '                 }' + #13 +
                    '               }' + #13 +
                    '               lat=parseFloat(ptmarker.lat());' + #13 +
                    '               lng=parseFloat(ptmarker.lng());' + #13 +
                    '               title=marker.getTitle();' + #13 +
                    '               external.ExternalClickMarker(title,IdMarker,lat,lng);' + #13 +
                    '        });' + #13 +
                    '        GEvent.addListener(marker, "dragstart", function() {' + #13 +
                    '               ptmarker=marker.getLatLng()' + #13 +
                    '               for (var i = 0; i < allmarkers.length; i++){' + #13 +
                    '                 if (allmarkers[i]==marker) {' + #13 +
                    '                   IdMarker=i;' + #13 +
                    '                 }' + #13 +
                    '               }' + #13 +
                    '               lat=parseFloat(ptmarker.lat());' + #13 +
                    '               lng=parseFloat(ptmarker.lng());' + #13 +
                    '               title=marker.getTitle();' + #13 +
                    '               external.ExternalDragStartMarker(title,IdMarker,lat,lng);' + #13 +
                    '        });' + #13 +
                    '        GEvent.addListener(marker, "dragend", function() {' + #13 +
                    '               ptmarker=marker.getLatLng()' + #13 +
                    '               for (var i = 0; i < allmarkers.length; i++){' + #13 +
                    '                 if (allmarkers[i]==marker) {' + #13 +
                    '                   IdMarker=i;' + #13 +
                    '                 }' + #13 +
                    '               }' + #13 +
                    '               lat=parseFloat(ptmarker.lat());' + #13 +
                    '               lng=parseFloat(ptmarker.lng());' + #13 +
                    '               title=marker.getTitle();' + #13 +
                    '               external.ExternalDragEndMarker(title,IdMarker,lat,lng);' + #13 +
                    '        });' + #13 +
                    '        map.addOverlay(marker);' + #13 +
                    '        return marker;' + #13 +
                    '      }' + #13 +
                    ' ' + #13 +
                    '      function deleteMapMarker(IdMarker) {' + #13 +
                    '        if (IdMarker<allmarkers.length) {' + #13 +
                    '          map.removeOverlay(allmarkers[IdMarker]);' + #13 +
                    '          allmarkers.splice(IdMarker,1);' + #13 +
                    '        }' + #13 +
                    '        else {' + #13 +
                    '          external.ExternalGoogleMapsError(6);' + #13 +
                    '        }' + #13 +
                    '      }' + #13 +
                    ' ' + #13 +
                    '      function openMarkerInfoWindowHtml(IdMarker, html) {' + #13 +
                    '        if (IdMarker<allmarkers.length) {' + #13 +
                    '          var marker = allmarkers[IdMarker];' + #13 +
                    '          marker.openInfoWindowHtml(html);' + #13 +
                    '        }' + #13 +
                    '        else {' + #13 +
                    '          external.ExternalGoogleMapsError(6);' + #13 +
                    '        }' + #13 +
                    '      }' + #13 +
                    ' ' + #13 +
                    '      function closeMarkerInfoWindowHtml(IdMarker) {' + #13 +
                    '        if (IdMarker<allmarkers.length) {' + #13 +
                    '          var marker = allmarkers[IdMarker];' + #13 +
                    '          marker.closeInfoWindow();' + #13 +
                    '        }' + #13 +
                    '        else {' + #13 +
                    '          external.ExternalGoogleMapsError(6);' + #13 +
                    '        }' + #13 +
                    '      }' + #13 +
                    ' ' + #13 +
                    '      function deleteAllMapMarker() {' + #13 +
                    '        map.clearOverlays();' + #13 +
                    '        allmarkers.splice(0,allmarkers.length);' + #13 +
                    '      }' + #13 +
                    ' ' + #13 +
                    '      function enableDragging() {' + #13 +
                    '        map.enableDragging();' + #13 +
                    '      }' + #13 +
                    ' ' + #13 +
                    '      function disableDragging() {' + #13 +
                    '        map.disableDragging();' + #13 +
                    '      }' + #13 +
                    ' ' + #13 +
                    '      function load_map(id, lat, lng, zoom) {' + #13 +
                    '        if (GBrowserIsCompatible()) {' + #13 +
                    '          map = new GMap2(document.getElementById(id));' + #13 +
                    '          var point = new GLatLng(parseFloat(lat),parseFloat(lng));' + #13 +
                    '          map.setCenter(point, zoom);' + #13 +
                    '          map.setMapType(%maptype%);' + #13 +
                    '          GEvent.addListener(map, "click", function(overlay, latlng) {' + #13 +
                    '               if (latlng) {' + #13 +
                    '                  lat=parseFloat(latlng.lat());' + #13 +
                    '                  lng=parseFloat(latlng.lng());' + #13 +
                    '                  external.ExternalClickMap(lat,lng);' + #13 +
                    '               }' + #13 +
                    '          });' + #13 +
                    '          GEvent.addListener(map, "maptypechanged", function() {' + #13 +
                    '               TypeMap=map.getCurrentMapType();'+ #13 +
                    '               var NameTypeMap="";' + #13 +
                    '               switch(TypeMap)' + #13 +
                    '               {' + #13 +
                    '               case G_NORMAL_MAP:' + #13 +
                    '                 NameTypeMap="G_NORMAL_MAP";' + #13 +
                    '                 break' + #13 +
                    '               case G_SATELLITE_MAP:' + #13 +
                    '                 NameTypeMap="G_SATELLITE_MAP";' + #13 +
                    '                 break' + #13 +
                    '               case G_HYBRID_MAP:' + #13 +
                    '                 NameTypeMap="G_HYBRID_MAP";' + #13 +
                    '                 break' + #13 +
                    '               case G_PHYSICAL_MAP:' + #13 +
                    '                 NameTypeMap="G_PHYSICAL_MAP";' + #13 +
                    '                 break' + #13 +
                    '               }' + #13 +
                    '               external.ExternalMapTypeChanged(NameTypeMap);' + #13 +
                    '          });' + #13 +
                    '          GEvent.addListener(map, "zoomend", function(oldLevel, newLevel) {' + #13 +
                    '               external.ExternalZoomChange(oldLevel,newLevel);' + #13 +
                    '          });' + #13 +
                    '          GEvent.addListener(map, "movestart", function() {' + #13 +
                    '               ptcenter=map.getCenter();' + #13 +
                    '               lat=parseFloat(ptcenter.lat());' + #13 +
                    '               lng=parseFloat(ptcenter.lng());' + #13 +
                    '               external.ExternalMoveStart(lat,lng);' + #13 +
                    '          });' + #13 +
                    '          GEvent.addListener(map, "moveend", function() {' + #13 +
                    '               ptcenter=map.getCenter();' + #13 +
                    '               lat=parseFloat(ptcenter.lat());' + #13 +
                    '               lng=parseFloat(ptcenter.lng());' + #13 +
                    '               external.ExternalMoveEnd(lat,lng);' + #13 +
                    '          });' + #13 +
                    '          GEvent.addListener(map, "tilesloaded", function() {' + #13 +
                    '               external.ExternalMapTilesLoad();' + #13 +
                    '          });' + #13 +
                    '          GEvent.addListener(map, "mousemove", function(point) {' + #13 +
                    '               lat=parseFloat(point.lat());' + #13 +
                    '               lng=parseFloat(point.lng());' + #13 +
                    '               external.ExternalMapMouseMove(lat,lng);' + #13 +
                    '          });' + #13 +
                    '        }' + #13 +
                    '        else {' + #13 +
                    '          external.ExternalGoogleMapsError(5);' + #13 +
                    '        }' + #13 +
                    '      }' + #13 +
                    '      //]]>' + #13 +
                    '      </script>' + #13 +
                    '    </head>' + #13 +
                    '    <body onunload="GUnload()">' + #13 +
                    '      <div id="map_canvas" style="width: %width%px; height: %height%px;"></div>' + #13 +
                    '      <script type="text/javascript">' + #13 +
                    '      setTimeout("load_IEmap(''map_canvas'',%latitude%,%longitude%,%zoom%)", 500);' + #13 +
                    '      </script>' + #13 +
                    '    </body>' + #13 +
                    '    <!--[if gte IE 6]>' + #13 +
                    '    <script type="text/javascript">' + #13 +
                    '    //<![CDATA[' + #13 +
                    '     function load_IEmap(id, lat, lng, zoom) {' + #13 +
                    '       load_map(id, lat, lng, zoom);' + #13 +
                    '     }' + #13 +
                    '  //]]>' + #13 +
                    '  </script>' + #13 +
                    '  <![endif]-->' + #13 +
                    '</html>';
     
    implementation
     
    end.
    lorsque c'était frais dans ma tête , j'ai utilisé ce composant avec succès depuis google a changé tout ça , donc je pense que ce n'est plus fonctionnel tel quel , dommage
    Dommage également la démarche utilisée est certainement quelque part sur cette clé mais je ne la retrouve pas
    MVP Embarcadero
    Delphi installés : D3,D7,D2010,XE4,XE7,D10 (Rio, Sidney), D11 (Alexandria), D12 (Athènes)
    SGBD : Firebird 2.5, 3, SQLite
    générateurs États : FastReport, Rave, QuickReport
    OS : Window Vista, Windows 10, Windows 11, Ubuntu, Androïd

  9. #9
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut
    Merci à vous,

    Je reposte ce message dans le forum Java Script.

    Bien cordialement
    Pierre

  10. #10
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut
    Bonjour,

    Le problème a été résolu ici : http://www.developpez.net/forums/d15...nctionne-plus/

    Sujet clos

    Merci à tous

    Cordialement
    Pierre

  11. #11
    Rédacteur/Modérateur

    Avatar de Roland Chastain
    Homme Profil pro
    Enseignant
    Inscrit en
    Décembre 2011
    Messages
    4 072
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Moselle (Lorraine)

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Décembre 2011
    Messages : 4 072
    Points : 15 462
    Points
    15 462
    Billets dans le blog
    9
    Par défaut
    Merci pour le retour.

    Si jamais vous souhaitiez contribuer à la rubriques Sources ou à la FAQ, vous avez les liens en haut de la page.
    Mon site personnel consacré à MSEide+MSEgui : msegui.net

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Problèmes avec un TWebBrowser dans une DLL
    Par bellamyjc dans le forum Composants VCL
    Réponses: 2
    Dernier message: 12/01/2005, 22h35
  2. problème dans l'hebergement
    Par Redouane dans le forum ASP
    Réponses: 9
    Dernier message: 31/12/2003, 23h34
  3. Quel est le problème dans ce code ?
    Par Luther13 dans le forum C
    Réponses: 12
    Dernier message: 26/08/2003, 16h09
  4. Problème dans analisys Manager
    Par ien_ien23 dans le forum MS SQL Server
    Réponses: 7
    Dernier message: 11/07/2003, 14h38
  5. Problème dans requête avec count()
    Par BadFox dans le forum Requêtes
    Réponses: 3
    Dernier message: 08/07/2003, 18h02

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