Google Maps API - geocoding accuracy chart?

后端 未结 3 2277
逝去的感伤
逝去的感伤 2021-02-20 06:22

Where in the Google Maps API docs can I find a table explaining the accuracy values of Geocode lookups?

Has the range of values changed in between V2 and V3

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-20 07:11

    Here are the real status answers from geocoder:

    You can output the status inside your geocoding function:

    myMap.geocoder.geocode( 
        { address: someAdress } ), 
        function ( responses, status ) { 
            console.log( status );
        }
    );
    

    When passing the status, you can switch those four values:

        switch ( status )
        {
            case 'ROOFTOP' :
                var precision = 'precise';
                break;
            case 'RANGE_INTERPOLATED' :
                var precision = 'interpolated';
                break;
            case 'APPROXIMATE' :
                var precision = 'approximately';
                break;
            case 'ZERO_RESULTS' :
                var precision = 'no address';
                break;
        }
    

提交回复
热议问题