How to get the neighborhood through geolocation?

Asked

Viewed 492 times

1

All other fields return normally through geolocation, only the neighborhood comes blank. What is wrong?

inserir a descrição da imagem aqui

  • Maybe he just doesn’t have neighborhood information in his locality? Already tested elsewhere or has to confront with another application using WP geo location service?

  • I have tested in other places, but most do not return the neighborhood,I think only one returned ,but it was a locality of the United States, but I find it strange not to return, because until the number and the name of the street returns, but the neighborhood does not. Before I was actually trying to use the google api, but I’m having trouble reading the json c# it returns

  • As it worked for some locality, the problem is probably that they do not have neighborhood information for the locations you are searching for. This would not be so strange, since in BR, the post office monopolize public information. This not to mention that monopolis are explicitly prohibited by the constitution... but this is another problem hehehe...

1 answer

1

You should use District for neighborhood and not Neighborhood, but it depends on the location. has places in the United States that it returns Neighborhood. I use it like this:

Bairro = string.IsNullOrEmpty(result.Locations[0].Address.Neighborhood) ? result.Locations[0].Address.District : result.Locations[0].Address.Neighborhood;
  • I tried to use the District here but it returns empty too

Browser other questions tagged

You are not signed in. Login or sign up in order to post.