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

APIs Google Discussion :

Google Maps ne fonctionne plus ! [Google Maps]


Sujet :

APIs Google

  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 Google Maps ne fonctionne plus !
    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
    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,
    hormis le fait qu'il faut récupérer l'API à l'adresse http://maps.googleapis.com/maps/api/js depuis pas mal de temps, je ne vois pas trop de contre indication au fonctionnement de ton code et ce compte tenu de ce que tu présentes.

    J'ai lu quelque part que l'API avait été modifiée...
    ils sont sans arrêt entrain de corriger des bugs ou d'améliorer l'API sans, il est vrai, sans trop en documenter les modifications.

    Il semble que depuis un jour ou deux, celui-ci ne fonctionne plus.
    peut être qu’un peu plus de précision sur le "ne fonctionne plus"...

  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
    Bonjour et merci pour votre réponse,

    J'ai modifié l'URL en :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    '<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false">'
    Depuis aujourd'hui, elle fonctionne, alors que lors de mon premier message j'obtenais un message:

    Script error.

    An error has occurred in the script on this page.

    Line:1

    Char.1

    Error: Could not get the display property. Invalid argument.

    Code:0

    URL: http://maps.gstatic.com/maps-api-v3/api/ js/ 20/ 0/ onion.js

    Do you want to continue running scripts on this page?

    yes.no
    Le problème est résolu chez moi, mais chez mes utilisateurs, il persiste.
    Voici le message affiché avec le script suivant:

    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
    '<html> '+
    '<head> '+
    '<meta name="viewport" content="initial-scale=1.0, user-scalable=yes" /> '+
    '<script type="text/javascript" src="http://maps.googleapis.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> ';
    Copie d'écran:
    Nom : CPS_Error.png
Affichages : 1606
Taille : 61,7 Ko

    Merci encore de votre intérêt.

    Cordialement
    Pierre

  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
    tiens et de 2 en peu de temps, n'aurais tu pas un soucis du même tonneau que celui de pc75?
    Dysfonctionnement sous IE8

  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 de cette réponse.

    Je teste la solution proposée dans le lien et reviens vers vous.

    Cordialement
    Pierre

  6. #6
    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
    Bonsoir,

    C'était bien l'origine du problème.
    Celui est résolu grâce à vous.

    Merci beaucoup

    Cordialement
    Pierre

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

Discussions similaires

  1. [Google Calendar API V3] Passage de local a serveur ne fonctionne plus
    Par fabs570 dans le forum Bibliothèques et frameworks
    Réponses: 0
    Dernier message: 14/08/2014, 12h36
  2. Géolocalisation google qui ne fonctionne plus
    Par sam01 dans le forum Langage
    Réponses: 3
    Dernier message: 11/10/2013, 18h06
  3. principe de fonctionnement google map
    Par abir001 dans le forum APIs Google
    Réponses: 0
    Dernier message: 17/06/2010, 18h53
  4. [Web Service][API Google Maps] Ne fonctionne pas en ligne
    Par PRACH dans le forum Bibliothèques et frameworks
    Réponses: 4
    Dernier message: 07/12/2009, 10h30
  5. [JSP][Tomcat]Changement de context -> JSP fonctionne plus
    Par mathieu dans le forum Servlets/JSP
    Réponses: 7
    Dernier message: 01/03/2004, 08h01

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