1

I'm really tired from looking into https://developers.google.com/maps/. I have no luck or I am blind i have no clue how to solve my problem.

So I want use reverse geocoding for more specific data in address_component:

https://maps.googleapis.com/maps/api/geocode/json?latlng=49.5014564,18.8833393&result_type=administrative_area_level_1&key=api_key - this works perfect, but I have no idea how to set optional result_type using geocoder API

     

 

    geocoder.geocode ({
           Location: latlng,
           Result_type: "administrative_area_level_1" // ???? i just don't know
           }, 
           Function (results, status) 
           {
              // check status etc...
           } });

Thx for advice, or hint or whatever.

xomena
  • 31,125
  • 6
  • 88
  • 117
Kyre
  • 373
  • 1
  • 4
  • 10
  • 1. javascript is case sensitive (Function != function, Location != location). 2. there is no Result_type in the [GeocoderRequest](https://developers.google.com/maps/documentation/javascript/reference#GeocoderRequest). Search SO for an answer on how to parse the results to get the result with the type administrative_area_level_1. Possible duplicate of [google maps geocoder to return state](https://stackoverflow.com/questions/6778205/google-maps-geocoder-to-return-state) – geocodezip Aug 24 '17 at 22:36
  • 1. ok, I know debugger tells me 2. I know how to parse result, but that is not important when result doesn't contains data what i need. **Solution exist** in Optional parameters in a reverse geocoding request [link](https://developers.google.com/maps/documentation/geocoding/intro) , but if i am right Google Maps JavaScript API V3 does not contains possibilities for result_type property. -- – Kyre Aug 25 '17 at 09:46
  • My only option is try to call request again via some http get request on maps google api, but without using GeocoderRequest. Basically i can use this url, in JS code: https://maps.googleapis.com/maps/api/geocode/json?latlng=49.5014564,18.8833393&result_type=administrative_area_level_1&key=api_key – Kyre Aug 25 '17 at 10:00

1 Answers1

3

The feature request has already been filed in Google issue tracker:

https://issuetracker.google.com/issues/35826518

As you can see the answer from Google engineering was:

result_type filtering can be achieved by simply dropping results that don't match desired types. While it'd be convenient to have this in the JavaScript API, it is not truly necessary.

You can star the feature request to add your vote and subscribe to further notifications.

xomena
  • 31,125
  • 6
  • 88
  • 117