Getting Latitude and Longitude from Google Places search api using Javascript

前端 未结 5 648
小鲜肉
小鲜肉 2020-12-30 22:22

How do I get the longitude and latitude from the searched location with the google maps place search box api.

Im using the same code as the google demo - https://de

5条回答
  •  借酒劲吻你
    2020-12-30 22:53

    navigator.geolocation.getCurrentPosition(success => {
    
      console.log(success) // `have the lat and long`
    
    }, failure =>{
    
    //`enter code here if failed`
    
    });
    

提交回复
热议问题