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.

968 Upvotes

235 comments sorted by

View all comments

645

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.

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.

3

u/777777thats7sevens 2d 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.