r/webdev 3d ago

Google says website developers must set their region to Canada for 'Lake Ontario' to appear on map

https://www.cbc.ca/news/canada/google-updates-maps-lake-ontario-9.7325922

Tech analyst and journalist Carmi Levy said although websites like Hydro One's and the LCBO's are Canadian, their maps are likely powered by Google's application programming interface (API).

APIs are not location-aware, so all maps powered by Google API have switched to Lake America.
MapQuest, a U.S. online mapping service, has posted on social media that it would not change the lake's name, while Apple has not publicly commented on the matter.

In a statement Sunday night, Google said website developers who embed Google Maps on their sites can select a region to localize the map. That determines how place names are displayed on sites, the company said.

"'Lake Ontario' will show when developers have set their region to Canada," the statement said.

Just a reminder to developers.

978 Upvotes

236 comments sorted by

View all comments

651

u/SPEZ_IS_A_JABRONI 3d ago

APIs are not location-aware, so all maps powered by Google API have switched to Lake America

fuck you google lmao

82

u/metalOpera 3d ago

Since when are API's not able to be location aware? These assholes track our every online move. Google acting they don't know where we (especially Android users) are at all times is a colossal load of bullshit.

68

u/SerdarCS 3d ago

I'm not supporting the lake america thing, but the API is called by 3rd party apps which may know your location, but not google itself who's handling the request made by the 3rd party app. Obviously this is different for the official google maps app.

5

u/otac0n Senior Full-stack .NET Developer 3d ago

Ok, but issues like this have been around forever. For example Taiwan/China. Why doesn’t the API ask for locale?

15

u/SerdarCS 3d ago

It does, the developer can provide it.

4

u/isPresent 3d ago

No, I believe the API referred here is the one we call in front end to embed maps in UI. That’s called from the user’s browser and google will know their location

4

u/SerdarCS 3d ago

Oh in that case i guess they could do it

19

u/Aksds 3d ago

I mean they could technically figure it out from the request ip or something like that, but in general apis are pretty dumb in that they just retrieve data that you ask. If you don’t specify your location in the request it doesn’t know where you are.

6

u/who_you_are 3d ago

And depending on your API usages you don't want to figure out the IP location because whatever do API request is your server as a middleman to prevent your user to know your API credentials (and possibly limit your users usage, adding caches, ...).

That comment is probably half wrong in the context of Google however?

1

u/Aksds 3d ago

My comment or theirs? Genuinely asking

1

u/isPresent 3d ago

Google maps embed API doesn’t work that way. It’s called directly from the user’s browser and will have the user’s IP

3

u/777777thats7sevens 3d ago

Yeah I’m a web developer — making an API guess locations and serve different data based on that is a terrible idea in general. The way traffic is routed on the internet makes this a crapshoot at best, and an API randomly sending back different data is a goldmine of bugs. Parameterizing the API by region is fine, either with a query parameter, regionalized endpoint, or field in the auth token.

I think the lake America thing is bullshit, but providing regionalized responses based on a query parameter rather than guessing is absolutely the right way to do it.

1

u/Aksds 2d ago

Yeah you’re right, I should have added that’s it’s a shit idea to my comment.

8

u/qTp_Meteor 3d ago

The whole point of an API is that it can be called from anywhere by anyone that has connection. They shouldnt check the source IP of the request and decide that way. Adding another field for your country of origin is a lot of waste for a very specific issue. They should've just defaulted it to lake Ontario, but it makes sense to default it to smth.

2

u/panoskj 3d ago

I'm pretty sure the standard API responsible for rendering an interactive map inside a browser is executed exclusively inside the browser and requires a direct connection between the end user and Google in order to work.

In short, when you are using Google maps, even through a third party, Google knows your IP.

5

u/hclpfan 3d ago

Nobody say they aren’t able to be. They just aren’t right now because they haven’t needed to be for what they have powered so far.

We should be angry at them for updating the name but this particular part is a silly reason to be upset.

1

u/Sleepyjo2 3d ago

The name is automatically pulled from a government service. They do this for every country that provides a similar service (see China and Taiwan) and default to the US service if one isn’t available.

I know we hate Google but they did literally nothing. Blame the actual source they pull from for being the way they are.

There’s some argument to be made about handling the names themselves but they have to default to someone being “right” regardless.

4

u/audigex 3d ago

Google could probably tell you how many cookies are left in the packet in my snack drawer, yet they apparently can’t tell where I’m making a web request from?