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 :

Géolocalisation ne marche plus


Sujet :

JavaScript

  1. #1
    Membre à l'essai
    Homme Profil pro
    Inscrit en
    Avril 2013
    Messages
    63
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Avril 2013
    Messages : 63
    Points : 23
    Points
    23
    Par défaut Géolocalisation ne marche plus
    Bonjour;
    Depuis un certain temps, la géolocalisation ne fonctionne pas chez moi ??
    J'ai essayés les démos existants, qui marchaient avant, maintenant ça marche pas ??

    Merci d'avance pour votre aide.

  2. #2
    Membre actif

    Profil pro
    Inscrit en
    Juillet 2012
    Messages
    183
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2012
    Messages : 183
    Points : 274
    Points
    274
    Par défaut
    Quel est le contexte exacte dans lequel tu testes la geolocalisation ?
    du code ?
    Quel device (appareil) utilisé ?

  3. #3
    Membre à l'essai
    Homme Profil pro
    Inscrit en
    Avril 2013
    Messages
    63
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Avril 2013
    Messages : 63
    Points : 23
    Points
    23
    Par défaut
    Salut ami, m'excuse pour le retard, et merci pour la réponse.
    En faite, aujourd'hui, j'ai un autre comportement:
    Par internet, ça marche. mais en local (avec apache) ça marche pas.

    J'ai utilisé la même page que j'ai copié dans le dossier du serveur local; après je lance localhost/pagedegeolocalisation.

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

    Informations forums :
    Inscription : Avril 2013
    Messages : 63
    Points : 23
    Points
    23
    Par défaut
    Bien sur en gardant la connexion internet pour charger l'api ...

  5. #5
    Membre actif

    Profil pro
    Inscrit en
    Juillet 2012
    Messages
    183
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2012
    Messages : 183
    Points : 274
    Points
    274
    Par défaut
    Citation Envoyé par yassinbean Voir le message
    Salut ami, m'excuse pour le retard, et merci pour la réponse.
    En faite, aujourd'hui, j'ai un autre comportement:
    Par internet, ça marche. mais en local (avec apache) ça marche pas.

    J'ai utilisé la même page que j'ai copié dans le dossier du serveur local; après je lance localhost/pagedegeolocalisation.
    Tu sais ce que c'est que du code ?
    Ben poste le ici

  6. #6
    Membre à l'essai
    Homme Profil pro
    Inscrit en
    Avril 2013
    Messages
    63
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Avril 2013
    Messages : 63
    Points : 23
    Points
    23
    Par défaut
    C'est pas mon code, c'est une démo que j'ai trouvée sur internet

    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
    <!DOCTYPE html>
    <html>
      <head>
        <title>Google Maps JavaScript API v3 Example: Map Geolocation</title>
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
        <meta charset="utf-8">
    	<link href="default.css" rel="stylesheet">
        <!--
        Include the maps javascript with sensor=true because this code is using a
        sensor (a GPS locator) to determine the user's location.
        See: https://developers.google.com/apis/maps/documentation/javascript/basics#SpecifyingSensor
        -->
        <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"></script>
     
        <script>
          var map;
     
          function initialize() {
            var mapOptions = {
              zoom: 6,
              mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            map = new google.maps.Map(document.getElementById('map-canvas'),
                mapOptions);
     
            // Try HTML5 geolocation
            if(navigator.geolocation) {
              navigator.geolocation.getCurrentPosition(function(position) {
                var pos = new google.maps.LatLng(position.coords.latitude,
                                                 position.coords.longitude);
     
                var infowindow = new google.maps.InfoWindow({
                  map: map,
                  position: pos,
                  content: 'Location found using HTML5.'
                });
     
                map.setCenter(pos);
              }, function() {
                handleNoGeolocation(true);
              });
            } else {
              // Browser doesn't support Geolocation
              handleNoGeolocation(false);
            }
          }
     
          function handleNoGeolocation(errorFlag) {
            if (errorFlag) {
              var content = 'Error: The Geolocation service failed.';
            } else {
              var content = 'Error: Your browser doesn\'t support geolocation.';
            }
     
            var options = {
              map: map,
              position: new google.maps.LatLng(60, 105),
              content: content
            };
     
            var infowindow = new google.maps.InfoWindow(options);
            map.setCenter(options.position);
          }
     
          google.maps.event.addDomListener(window, 'load', initialize);
        </script>
      </head>
      <body>
        <div id="map-canvas"></div>
      </body>
    </html>

  7. #7
    Membre à l'essai
    Homme Profil pro
    Inscrit en
    Avril 2013
    Messages
    63
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Avril 2013
    Messages : 63
    Points : 23
    Points
    23
    Par défaut
    Mais, c'est pas le problème.

    Des fois ça marche, des fois ça marche pas, c'est instable.

    Par exemple aujourd'hui, ça marche pas du tout ; j'ai essayé plusieurs exemples que j'ai trouvé sur internet.

Discussions similaires

  1. Projet qui marche sous Eclipse ne marche plus en JAR
    Par leminipouce dans le forum Eclipse Java
    Réponses: 7
    Dernier message: 26/10/2005, 18h59
  2. [SEND TO]Menu contextuel "send to" ne marche plus
    Par Hoegaarden dans le forum Windows XP
    Réponses: 8
    Dernier message: 13/10/2005, 11h41
  3. [FOP] Le generation de PDF ne marche plus
    Par Sherkhan dans le forum Tomcat et TomEE
    Réponses: 4
    Dernier message: 23/03/2005, 08h26
  4. [CR] Mes rapports (.PDF) ne marche plus depuis acrobat 7
    Par theflamme dans le forum SAP Crystal Reports
    Réponses: 2
    Dernier message: 10/01/2005, 15h21
  5. ma fonction marche plus sur le serveur...
    Par CDRIK dans le forum Général JavaScript
    Réponses: 5
    Dernier message: 18/10/2004, 04h24

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