Get city name from latitude and longitude [duplicate] - google-maps-api-3

This question already has answers here:
Google Geocoding v2 API stopped working suddenly
(2 answers)
Closed 9 years ago.
I was actually making use of
http://maps.google.com/maps/geo?json&ll=13.02761,77.59317 to get the city name.
It was all working till last week.
But now when I try this URL it gives me:
{
"Status": {
"code": 610,
"request": "geocode"
}
}
Where I am not able to get the city name.
This was working like a charm till some days back.
What I understand by 610 code is:
G_GEO_BAD_KEY:The given key is either invalid or does not match the domain for which it was given.
I am not able to understand what went wrong? Initially I wasn't passing any key.
Can somebody please help me out with this as my app is already published in the market and now I am facing this issue.
Thanks in advance,
Sunaina

try this. i've never heard of ll
http://maps.googleapis.com/maps/api/geocode/json?latlng=13.02761,77.59317&sensor=true

Related

Correct phone number format on Amplify Auth / Cognito?

I'm trying to signup to a site I created with AWS Amplify. I added Auth and clicked to allow signing in with both email and phone number. However, when I try creating an account, I get an error saying the phone number format is incorrect. So far I've tried:
+17184625510
7184625510
718-462-5510
etc
but I consistently get the following error. Any help would be appreciated!
According to AWS Cognito, The phone number must be in E.164 format. eg. "+12065550100".
This is a known bug in the Amplify UI which you can read more about in the corresponding GitHub Issue where there is also a proposed workaround for the problem that you can try until the problem is fixed.
The problem is that the +1 that is entered as a default for the country code is undefined in the code. Everything currently works if you switch from +1 to another country code (or to another country code and back to +1 again). If your users are not in the +1 region they probably won't notice, otherwise take a look at the workaround.

Skyscanner API does not return data for flight search

I am playing around with the Skyscanner API from their webpage in Postman (opens in a new tab, or in the Postman desktop app) and testing the endpoint for browsing flights. This is what the API says in their page:
And this is what I am trying - browsing for flights from Stockholm Arlanda Airport (ARN-sky) to Heathrow (LHR-sky), on the date 22nd July (around 4 days from now) for first leg, and 25th for return, but as you can see, I am not getting any result. The URL I am trying is this.
Any idea what am I doing wrong, and how to fix it?
Please, mind that you present an image regarding an endpoint to Browse Quotes, but you are trying to consume an endpoint to Browse Routes.
Assuming that you actually want to browse routes, I believe the problem may be this:
The endpoint is of the form:
GET /browseroutes/v1.0/{country}/{currency}/{locale}/{originPlace}/{destinationPlace}/{outboundPartialDate}/{inboundPartialDate}
You are writing a URL like:
.../browseroutes/v1.0/FR/eur/en-US/us/ARN-sky/LHR-sky/2021-07-22/2021-07-25?apikey=<api-key>
So it seems that you are actually specifying:
originPlace = us
destinationPlace = ARN-sky
But I think you wanted to define:
originPlace = ARN-sky
destinationPlace = LHR-sky
To solve this, you may remove the /us member, thus writing: http://partners.api.skyscanner.net/apiservices/browseroutes/v1.0/FR/eur/en-US/ARN-sky/LHR-sky/2021-07-22/2021-07-25?apikey=api-key
(Please, replace the api-key value by an actual API key)
This URL already returns a valid 200 OK result :)

How to remove defacto duplicates returned by here autocomplete API

I am fetching data from the here autocomplete rest endpoint. It works fine, but for example searching for berlin returns me 3 results, which are (at least in my usecase) defacto the same ... I assume berlin is found as state, city and area or something, but since this will be the same area I consider it to be duplicates ...
I tried playing around with the resultType-attribute, but using area gives the same behavior. If I use city I have to enter all letters of berlin to get the suggestion ...
you can try resultType=city&country=DEU&query=Ber with country filter you need not to enter all the letters of berlin to get the suggestion and all with no duplicate.
https://developer.here.com/documentation/geocoder-autocomplete/dev_guide/topics/resource-suggest.html
Hope this helps !
I have to the new version coming out in a few weeks and it seems this issue is fixed:
Current:
Current behavior for HERE autocomplete
View of upcoming version:
Preview of latest behavior for HERE autocomplete

Google Maps API V3 - only showing a blank map when using the geocoder [duplicate]

This question already has an answer here:
'item.geometry.location.kb' and 'item.geometry.location.jb' returning undefined
(1 answer)
Closed 3 months ago.
So I have some javascript that uses the google maps API V3 and uses the geocoder to obtain co ordinates from an address and display a map at those coordinates. It was working totally fine, but then I check it again a few days ago, and now instead of showing the proper map, it just shows a blank blue map, and doesnt let you zoom in or out or move the map. There doesnt appear to be any javascript errors or errors returning from google maps, so not really sure what could be causing this...
Heres an example of the problem: Click Here
Anyone have any ideas on what might be causing this?
You are using undocumented properties:
var center = results[0].geometry.location.Xa - 0.0062;
var centerCoord = new google.maps.LatLng(center, results[0].geometry.location.Ya);
(geometry.Xa, geometry.Ya)
That is guaranteed to fail at some point when the version of the API changes.
Use the documented properties (geometry.lat(), geometry.lng())

trouble with example google maps code

executing this:
$curl "http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false"
returns this:
{
"results" : [],
"status" : "ZERO_RESULTS"
}
Why doesn't it work?
Cheers!
Not sure, but I get the same results when I hit that URL directly in the browser. It may have something to do with that being the sample address that is shown in Geocoding Responses section of the Google Maps API Web Services Dev Guide. Maybe they turned it off because it was getting overloaded?
I even tried a version of that address that has been URL encoded:
http://maps.googleapis.com/maps/api/geocode/json?address=1600%20Amphitheatre%20Parkway%2C%20Mountain%20View%2C%20CA&sensor=false
but get the same result as the original attempt.
I can tell you that if you go directly to http://maps.google.com/maps and key in: 1600 Amphitheatre Parkway, Mountain View, CA, you do get results.
At any rate, your URL is basically formatted correctly and should work. Try a different address, formatted the same way, and you will get results. This worked fine for me:
http://maps.googleapis.com/maps/api/geocode/json?address=Wrigley+Field&sensor=false
Some follow up, I'm not sure where you were trying to run your code, but if it was in a jsFiddle, you may be interested in this question: JQuery won't get json?

Resources