Skip to content

Conversation

nyalldawson
Copy link
Collaborator

@nyalldawson nyalldawson commented Sep 17, 2025

A nice quality-of-life improvement for 4.0!

Now eg if you start a new project by loading a OSM layer, we zoom to the user's country instead of the globe. This is done by
checking the user's operating system locale country and matching to the QGIS world map dataset. There's no location services,
reverse geocoding, ip matching or anything privacy sensitive happening!

If the first loaded layer is NOT a basemap then we retain the existing logic of zooming to its extent instead.

Peek.2025-09-17.13-46.mp4

So eg if you start a new project by loading a OSM layer, we zoom
to the user's country instead of the globe. This is done by
checking the user's operating system locale country and matching
to the QGIS world map dataset. There's no location services,
reverse geocoding, ip matching or anything privacy sensitive
happening!
@github-actions github-actions bot added this to the 4.0.0 milestone Sep 17, 2025
Copy link
Contributor

github-actions bot commented Sep 17, 2025

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit d82ecca)

🍎 MacOS Qt6 builds

Download MacOS Qt6 builds of this PR for testing.
This installer is not signed, control+click > open the app to avoid the warning
(Built from commit d82ecca)

@uclaros
Copy link
Contributor

uclaros commented Sep 17, 2025

This will obviously not be very handy for:

  • non-global basemap layers
  • users with a 'generic' locale set up, (ie not their country, just using enUS)
  • users working on global projects or projects outside their country

I think I'd rather have a default extent for new projects, similar to how we have default crs for new projects.

@nirvn
Copy link
Contributor

nirvn commented Sep 17, 2025

@uclaros , I think there's space for both ideas. Even a user configurable default extent setting would benefit from a nicer default than the whole world as a starting point :)

@nyalldawson
Copy link
Collaborator Author

This will obviously not be very handy for:
non-global basemap layers

Only global basemaps get the flag, there's no risk there

users with a 'generic' locale set up, (ie not their country, just using enUS)
users working on global projects or projects outside their country
I think I'd rather have a default extent for new projects, similar to how we have default crs for new projects.

Those aren't mutually exclusive. This is intended to improve the immediate out-of-the-box user experience, and doesn't rely on any user configuration or knowledge at all. Sure, it doesn't work in all situations... But it's a safe move that WILL improve the situation for a lot of new users.

(A user configured default new project extent will only be useful for experienced users, or those with corporate deployments setting this for them)

We can always extend later with location services based refined default location, if we decide that it's appropriate and has no user privacy risks.

@uclaros
Copy link
Contributor

uclaros commented Sep 18, 2025

Only global basemaps get the flag, there's no risk there

This is true for google 3d tiles, but I can see that any xyz_ vectortile and wms get the flag too.

This is intended to improve the immediate out-of-the-box user experience, and doesn't rely on any user configuration or knowledge at all. Sure, it doesn't work in all situations... But it's a safe move that WILL improve the situation for a lot of new users.

To me, this is removing the minor inconvenience of having to zoom for some users while introducing the minor inconvenience of having to zoom out and potentially zoom in again for some others.

The good thing is that users with enUS will not be affected after all, since QT calls the country United States instead of United States of America (there are other naming mismatches there but for countries with smaller/no user base).
But even if the name matched, Hawaii will still cause a globe zoom! :)

@agiudiceandrea
Copy link
Member

To me, this is removing the minor inconvenience of having to zoom for some users while introducing the minor inconvenience of having to zoom out and potentially zoom in again for some others.

I'm not very keen on introducing this new default behaviour either. I also worry that it could also be an issue for people in illegally occupied or disputed territories.

@nyalldawson
Copy link
Collaborator Author

@uclaros @agiudiceandrea I would very much like to hear your proposed solutions to improve the first run user experience in this regard. Do you have alternative ideas to advance?

@kungzlatan
Copy link

why not just have pop up that ask the user if he want to zoom or not ?

@uclaros
Copy link
Contributor

uclaros commented Sep 18, 2025

@uclaros @agiudiceandrea I would very much like to hear your proposed solutions to improve the first run user experience in this regard. Do you have alternative ideas to advance?

I find that zooming to the first opened dataset's extent is good and expected behavior.
What we could change, instead of trying to guess what the user's area of interest is, we could continue to treat the project as empty if only basemap layers are added.

  • new project
  • user adds basemap -> zoom to globe/basemap extent if available
  • user adds a data layer -> zoom to layer's extent
  • user adds more layers -> do nothing

Two more things that could slightly improve the experience is fixing some behaviors that are probably bugs:

  1. On a new project
  • Load osm xyz
  • Instead of zooming to globe, scale is 50% zoomed out from globe
image
  1. On a new project
  • Set project crs to my local crs
  • Load osm xyz
  • Project crs is changed to 3875! (but interestingly is properly zoomed to extent this time!)
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants