ต้องการGet locationของdeviceลงใน google place search boxครับ
ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา ต้องการGet locationของdeviceลงใน google place search boxครับ
ต้องการGet locationของdeviceลงใน google place search boxครับ
ตอนนี้ผมสามารถทำได้แล้วครับ แต่ได้เฉพาะบPC แต่เวลาไปเปิดบนเบราเซอร์ของAndroidหรือiOS ไม่สามารถใช้ได้ครับ อยากทำให้สามารถใช้ได้ทุกแพลตฟอร์มครับ ขอคำแนะนำด้วยครัล
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" > <html> <head> <meta charset= "utf-8" > <meta name= "viewport" content= "width=device-width, initial-scale=1, shrink-to-fit=no" > <meta name= "description" content= "" > <meta name= "author" content= "" > <title>Trip Planner</title> <!-- Bootstrap core CSS --> <link href= "bootstrap/css/bootstrap.min.css" rel= "stylesheet" > <!-- Custom styles for this template --> <link href= "css/trip-css.css" rel= "stylesheet" > <script src= "bootstrap/css/bootstrap.min.css" ></script> <style> #bg { position: fixed; top: -50%; left: -50%; width: 200%; height: 200%; } #bg img { position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto; min-width: 50%; min-height: 50%; } .col-md-6 { background-color: #FFFFFF; } </style> </head> <body style= "padding-top: 50px" > <div id= "bg" > <img src= "Image/bg.png" alt= "" > </div> <!-- Navigation --> <nav class = "navbar navbar-expand-lg navbar-dark bg-dark fixed-top" > <div class = "container" > <a class = "navbar-brand" href= "#" >Trip Planner</a> <button class = "navbar-toggler" type= "button" data-toggle= "collapse" data-target= "#navbarResponsive" aria-controls= "navbarResponsive" aria-expanded= "false" aria-label= "Toggle navigation" > <span class = "navbar-toggler-icon" ></span> </button> <div class = "collapse navbar-collapse" id= "navbarResponsive" > <ul class = "navbar-nav ml-auto" > <li class = "nav-item active" > <li class = "nav-item" > <a class = "nav-link" href= "#" >Welcome</a> </li> </ul> </div> </div> </nav> <div class = "container" > <div class = "row" > <div class = "col-lg-3" > <script type= "text/javascript" > ( function () { var po = document.createElement( 'script' ); po.type = 'text/javascript' ; po.async = true; var s = document.getElementsByTagName( 'script' )[0]; s.parentNode.insertBefore(po, s); })(); </script> <script type= "text/javascript" > function canSubmit() { return true; } </script> </div> <div class = "col-md-6" style= "margin-top: 5%" > <form class = "form-signin" role= "form" id= "login" action= "search" method= "post" onclick= "canSubmit()" > <div id= "status" ></div> <center><h1 class = "form-signin-heading" style= "margin-top: 10%" >User Registration</h1></center> <br><br> <p style= "color: red; font-size: 12px" >Please login here if don't have account gmail !!</p> Name : <input type= "text" id= "inputFullname" class = "form-control" name= "person.username" required autofocus> E-mail : <input type= "email" id= "inputEmail" class = "form-control" name= "person.email" required ><br> <p style= "font-size: 12px; color: #0000ee" >login with google. Click</p> <button class = "g-signin " data-scope= "https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email" data-clientId= "462831984997-47o8udcnaagao8mpi6lvp8gb423qlq47.apps.googleusercontent.com" data-accesstype= "offline" data-callback= "mycoddeSignIn" data-theme= "dark" data-cookiepolicy= "single_host_origin" > </button> <br> <center><button type= "submit" class = "btn btn-default" style= "text-align: left; margin-top: 5%; margin-bottom: 5%" >Login</button></center> </form> </div> <div class = "col-lg-3" > </div> </div> </div> <script type= "text/javascript" > var gpclass = ( function (){ //Defining Class Variables here var response = undefined; return { mycoddeSignIn: function (response){ // The user is signed in if (response[ 'access_token' ]) { //Get User Info from Google Plus API gapi.client.load( 'plus' , 'v1' ,this.getUserInformation); } else if (response[ 'error' ]) { } }, getUserInformation: function (){ var request = gapi.client.plus.people.get( { 'userId' : 'me' } ); request.execute( function (profile) { var email = profile[ 'emails' ].filter( function (v) { return v.type === 'account' ; // Filter out the primary email })[0].value; var fName = profile.displayName; $( "#inputFullname" ).val(fName); $( "#inputEmail" ).val(email); }); } }; //End of Return })(); function mycoddeSignIn(gpSignInResponse){ gpclass.mycoddeSignIn(gpSignInResponse); } </script> <!-- Bootstrap core JavaScript --> <script src= "vendor/jquery/jquery.min.js" ></script> <script src= "vendor/bootstrap/js/bootstrap.bundle.min.js" ></script> <script src= "js/index.js" ></script> </body> </html> |

คำแนะนำ และการใช้งาน
สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก
- ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
ขอบคุณทุกการสนับสนุน
![]()