{"action":"closed","issue":{"url":"https://api.github.com/repos/filipedeschamps/cep-promise/issues/59","repository_url":"https://api.github.com/repos/filipedeschamps/cep-promise","labels_url":"https://api.github.com/repos/filipedeschamps/cep-promise/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/filipedeschamps/cep-promise/issues/59/comments","events_url":"https://api.github.com/repos/filipedeschamps/cep-promise/issues/59/events","html_url":"https://github.com/filipedeschamps/cep-promise/issues/59","id":185165642,"number":59,"title":"Integração com google","user":{"login":"leorjbrz","id":16035841,"avatar_url":"https://avatars.githubusercontent.com/u/16035841?v=3","gravatar_id":"","url":"https://api.github.com/users/leorjbrz","html_url":"https://github.com/leorjbrz","followers_url":"https://api.github.com/users/leorjbrz/followers","following_url":"https://api.github.com/users/leorjbrz/following{/other_user}","gists_url":"https://api.github.com/users/leorjbrz/gists{/gist_id}","starred_url":"https://api.github.com/users/leorjbrz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leorjbrz/subscriptions","organizations_url":"https://api.github.com/users/leorjbrz/orgs","repos_url":"https://api.github.com/users/leorjbrz/repos","events_url":"https://api.github.com/users/leorjbrz/events{/privacy}","received_events_url":"https://api.github.com/users/leorjbrz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"MarcoWorms","id":7863230,"avatar_url":"https://avatars.githubusercontent.com/u/7863230?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcoWorms","html_url":"https://github.com/MarcoWorms","followers_url":"https://api.github.com/users/MarcoWorms/followers","following_url":"https://api.github.com/users/MarcoWorms/following{/other_user}","gists_url":"https://api.github.com/users/MarcoWorms/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoWorms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoWorms/subscriptions","organizations_url":"https://api.github.com/users/MarcoWorms/orgs","repos_url":"https://api.github.com/users/MarcoWorms/repos","events_url":"https://api.github.com/users/MarcoWorms/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoWorms/received_events","type":"User","site_admin":false},"assignees":[{"login":"MarcoWorms","id":7863230,"avatar_url":"https://avatars.githubusercontent.com/u/7863230?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcoWorms","html_url":"https://github.com/MarcoWorms","followers_url":"https://api.github.com/users/MarcoWorms/followers","following_url":"https://api.github.com/users/MarcoWorms/following{/other_user}","gists_url":"https://api.github.com/users/MarcoWorms/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoWorms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoWorms/subscriptions","organizations_url":"https://api.github.com/users/MarcoWorms/orgs","repos_url":"https://api.github.com/users/MarcoWorms/repos","events_url":"https://api.github.com/users/MarcoWorms/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoWorms/received_events","type":"User","site_admin":false}],"milestone":null,"comments":39,"created_at":"2016-10-25T16:18:59Z","updated_at":"2016-12-08T13:09:48Z","closed_at":"2016-12-08T13:09:48Z","body":"Apenas uma sugestão de uma terceira opção de busca utilizando o google\nExemplo:\n\n```\n//https://developers.google.com/maps/documentation/javascript/examples/geocoding-reverse\nreturn $http.get('//maps.googleapis.com/maps/api/geocode/json', {\n    params: {\n        address: '20560160',\n        language: 'pt-BR',\n        components: 'country:BR',\n        location_type: 'ROOFTOP',\n        result_type: 'street_address',\n        sensor: false\n    }\n});\n```\n\nExemplo de retorno do google:\n\n```\n$scope.logradouro = {};\nvar arrAddress = $item.address_components;\nfor (var i = 0; i < arrAddress.length; i++) {\n    if (arrAddress[i].types[0] === \"route\") { $scope.logradouro.logradouro = arrAddress[i].long_name }\n    if (arrAddress[i].types[0] === \"street_number\") { $scope.logradouro.numero = arrAddress[i].long_name }\n    if (arrAddress[i].types[0] === \"sublocality\" || (arrAddress[i].types.length > 0 && arrAddress[i].types[1] == \"sublocality\")) { $scope.logradouro.bairro = arrAddress[i].long_name }\n    if (arrAddress[i].types[0] === \"locality\") { $scope.logradouro.cidade = arrAddress[i].long_name }\n    if (arrAddress[i].types[0] === \"administrative_area_level_1\") { $scope.logradouro.uf = arrAddress[i].short_name }\n    if (arrAddress[i].types[0] === \"postal_code\") { $scope.logradouro.cep = arrAddress[i].long_name; console.log(arrAddress[i]); }\n}\n```\n\nVejam se conseguem usar o openstreetmap tbm, mas achei os parametros meio furados, traz dados diversos... tem que debulhar\n//http://wiki.openstreetmap.org/wiki/Nominatim#Parameters\n\nabraços!\n"}}
{"actor":{"display_login":"filipedeschamps"}}