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 :

Géolocation client à ajouter mark place


Sujet :

APIs Google

  1. #1
    Membre du Club
    Homme Profil pro
    Collégien
    Inscrit en
    Février 2013
    Messages
    39
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Saône (Franche Comté)

    Informations professionnelles :
    Activité : Collégien
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Février 2013
    Messages : 39
    Points : 42
    Points
    42
    Par défaut Géolocation client à ajouter mark place
    je besoin de vous les devs
    j'ai une page d'inscription des utilisateur
    mais mon problem est de récupérer leur location on google maps
    mais pas leur curent location mais il faut que utilisateur met une mark sur la place qu'il veut
    est retourner les cordonnes de cet endroit choisi

  2. #2
    Membre du Club
    Homme Profil pro
    Collégien
    Inscrit en
    Février 2013
    Messages
    39
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Saône (Franche Comté)

    Informations professionnelles :
    Activité : Collégien
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Février 2013
    Messages : 39
    Points : 42
    Points
    42
    Par défaut
    voila un exemple de code mais il besoin de modification
    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
    <!DOCTYPE html>
    <html>
    <head>
    <script
    src="http://maps.googleapis.com/maps/api/js">
    </script>
     
    <script>
    var map;
    var myCenter=new google.maps.LatLng(51.508742,-0.120850);
     
    function initialize()
    {
    var mapProp = {
      center:myCenter,
      zoom:5,
      mapTypeId:google.maps.MapTypeId.ROADMAP
      };
     
      map = new google.maps.Map(document.getElementById("googleMap"),mapProp);
     
      google.maps.event.addListener(map, 'click', function(event) {
        placeMarker(event.latLng);
      });
    }
     
    function placeMarker(location) {
      var marker = new google.maps.Marker({
        position: location,
        map: map,
      });
      var infowindow = new google.maps.InfoWindow({
        content: 'Latitude: ' + location.lat() + '<br>Longitude: ' + location.lng()
      });
      infowindow.open(map,marker);
    }
     
    google.maps.event.addDomListener(window, 'load', initialize);
    </script>
    </head>
     
    <body>
    <div id="googleMap" style="width:500px;height:380px;"></div>
     
    </body>
    </html>

  3. #3
    Modérateur

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

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 089
    Points : 44 660
    Points
    44 660
    Par défaut
    Bonjour,
    mais mon problem est de récupérer leur location on google maps
    je ne comprends pas c'est exactement ce que fait le code que tu nous montres !?!

  4. #4
    Membre du Club
    Homme Profil pro
    Collégien
    Inscrit en
    Février 2013
    Messages
    39
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Saône (Franche Comté)

    Informations professionnelles :
    Activité : Collégien
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Février 2013
    Messages : 39
    Points : 42
    Points
    42
    Par défaut débutant problèmes passage de paramétrés
    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
    <!DOCTYPE html>
    <html>
    <head>
    <script
    src="http://maps.googleapis.com/maps/api/js">
    </script>
     
    <script>
    var lat=51.508742;
    var long=120850;
    var map;
     
     
    function initialize()
    {
    if(navigator.geolocation){
        navigator.geolocation.getCurrentPosition(function(position){
     
            lat=position.coords.latitude;
            long=position.coords.longitude;
     
        });
     
    }
     
     
    var myCenter=new google.maps.LatLng(lat,long);
    var mapProp = {
      center:myCenter,
      zoom:5,
      mapTypeId:google.maps.MapTypeId.ROADMAP
      };
     
      map = new google.maps.Map(document.getElementById("googleMap"),mapProp);
     
      google.maps.event.addListener(map, 'click', function(event) {
        placeMarker(event.latLng);
      });
    }
     
    function placeMarker(location) {
      var marker = new google.maps.Marker({
        position: location,
        map: map,
      });
      var infowindow = new google.maps.InfoWindow({
        content: 'Latitude: ' + location.lat() + '<br>Longitude: ' + location.lng()
      });
      infowindow.open(map,marker);
    }
     
    google.maps.event.addDomListener(window, 'load', initialize);
    </script>
    </head>
     
    <body>
    <div id="googleMap" style="width:500px;height:380px;"></div>
     
    </body>
    </html>

  5. #5
    Modérateur

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

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 089
    Points : 44 660
    Points
    44 660
    Par défaut
    oui et alors

Discussions similaires

  1. Réponses: 3
    Dernier message: 15/01/2013, 10h16
  2. Recherche client + ajout si n'existe pas
    Par Webby1234 dans le forum Access
    Réponses: 1
    Dernier message: 12/05/2008, 19h49
  3. ajout suppression logo client
    Par Davik dans le forum IHM
    Réponses: 3
    Dernier message: 01/06/2006, 10h38
  4. [Client mail] Problème lors de l'ajout des comptes
    Par Leobaillard dans le forum Web & réseau
    Réponses: 9
    Dernier message: 19/11/2005, 17h12
  5. Réponses: 10
    Dernier message: 31/05/2005, 10h41

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