Why is this variable undefined or not returned?

前端 未结 2 656
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-26 03:33

I have the following code:

/*
 * converts a string to geolocation and returns it
 */

function stringToLatLng(string){
    if(typeof string == \"string\"){
              


        
2条回答
  •  再見小時候
    2021-01-26 04:09

    var latitude = results[0].geometry.location.lat();
    var longitude = results[0].geometry.location.lng();
    

    ref: Javascript geocoding from address to latitude and longitude numbers not working

提交回复
热议问题