Saturday, July 1, 2023

Summer Maps

 It's about time for the yearly (Northern Hemisphere) Summer Maps blog post. 😎



Since the release of 44.0 in March, aside from some fixes (like adding support for authentication HTTP headers in OpenTripPlanner plugin, as now needed by the Finnish Digitransit service) there has also been some changes on the surface in Maps.

First, Jakub Steiner has contributed with a refresh of icons used for transportation modes, and the various mode of public transit.

Here we can see the icons for transportation modes (walking, biking, car, and public transit, using a „train icon“) using the new GNOME icon style

In this capture we can see the new icons for metro (underground, subway service)


Above there is some samples from Portland, showing trams and gondolas.


Another new feature is the „Explore nearby points-of-interest“ browser mode of the main search entry, allowing the select preset categories grouped by main and sub categories. Clicking on a subcategory then proceeds with a search given the selected type of place centered around the center of the current map view sorted by, and showing the distance to the place („as the crow flies distance“):

Clicking the down-arrow button, or using the new CTRL+SHIFT+F shortcut shows the main categories

After selecting a sub category

Showing points-of-interest results with distances

Results nearby (less than 100 m, or 300 feet when using Imperial measures) are shown with a „less than“ indication as these can be somewhat imprecise, especially for things with a “two-dimensional extent“ such as larger buildings, or areas

 

This feature was something I had in mind for a while, and there has been an old issue about this floating around since the Bugzilla days (before the migration to GitLab, it was issue #3 after the migration…).

I remember envisioning the outlines of this during a walk one afternoon/evening early in winter of 2021 during the mandated „working from home“ days when we had step contest at work. But I had put the idea off before in anticipation of the GTK 4 port as I din't want introduce too much new UI needing porting before that). But now that that has been finished it was time…

 Behind the scenes this is using the Overpass API to search the OpenStreetMap database based on tags and centered around a specific coordinate.

And by the way, the set of categories is defined in JSON-like object structure in the src/potCategories.js module, so this can be altered relatively easy (and add Overpass query parameter „fragments“.


The next thing, the routing sidebar has had some issues when using a small form-factor device (e.g. phones), now there is WIP in an MR to migrate the sidebar to use an OverlaySplitView from libadwaita.


This allows swiping in from the edge to bring up the routing sidebar and „swipe away“ the sidebar to close it on touch screens.

It also „collapses“ the view so the sidebar is overlayed on the map view rather than „pushing it aside“ on narrower screens:


This is still not finally merged to main, but hopefully this should make it in for 45.0.


Another thing is that since migration to libshumate it is possible to rotate the map view using touch gestures. And as we didn't have a way to reset the rotation (beside restarting the application) to mitigate that I have added a compass button showing when the view rotated away from normal „north is up”.

 

Also the zoom buttons have been moved back to be overlay buttons as they where back in the day. They where changed to headerbar button back in 2017 as a work-around for GTK widgets not being able to be overlayed on top of Clutter surfaces on Wayland. But this is no longer an issue as we don't use Clutter nowadays.

This overlay button design might be subject for a redesign later on. Possible moving them down to the bottom end (right in LTR) corner, similar to the zoom controls of the new Loupe image viewer app. The license banner would then be displayed on startup as toast maybe, or as popover when clicking an info button. Or something like that.

And last, but not least we had a contribution from Szymon Kłos who implemented support loading tracks recorded by Garmin sport watches as shape layers. Thanks Szymon!

I will also attend GUADEC in Riga later in July, so those who go there, maybe see you there!

And I think that's about it for this time!

Friday, March 10, 2023

Maps and GNOME 44

 So it's that time that occurs twice a year when we're approaching a new GNOME release, this time 44.



In Maps there's been some polish touching up some of the rough edges in 43.x (from the GTK 4 port).

For example keyboard navigation of the search results is back.


Also, the focus handling of the entry is fixed so that the quirky flickering (re-popping up the the results popover when typing a space into the search entry) is now gone.

Also thanks to Christopher Davis for fixing up the styling of the results!

We also had contributions from an anonymous user improving the style of some labels, among others the tooltips of the headerbar buttons.


Adrien Plazas has worked on making the „Export as Image“ dialog fit on phones.


Unfortunately an issue has come to our attention with the way the „go to“ animations works, resulting some times when covering large distances (for example when selecting a search result far away) that results in throttling from the tile server (HTTP 429, „too many requests”). This results in empty tiles showing up at the destination (and one needs to sometimes wait a while before Maps gets the view refreshed with new tiles (after restarting to force re-trying).

 As this results in a really bad user experience as a work-around we have disabled the animations for now (the animations when zooming is still in place, and of course panning the map view still works as usual).

I also cherry-picked this for the 43 branch, and will probably also cut a 43.4 with this change (versions prior to 43.0 is not affected, as the animations in libchamplain uses another algorithm, first zooming out „high“ (a low zoom level) before moving, resulting in less intermediate tiles compared to the “fly to“-like animations now used in libshumate.

 We will try to come up with a better solution in libshumate soon. Either reverting to an approach like that in libchamplain, or try to implement our own rate limiting of some sort during animations to avoid firing off too many requests.

 Meanwhile at the libshumate side James Westman has been busy working on the vector tile support implementing label support among other things.

He is also working on a vector tile style using the GNOME color palette in light and dark variants.


This can be trying out on https://maps.jwestman.net/

 There will also be some other things coming for the next development cycle for GNOME 45, but let's save that for next time!

Thursday, December 29, 2022

Maps wrap-up 2022

 As I was quite busy during the days before Christmas this year I didn't get time to write the traditional holidays Maps blog post.

So I thought I should at least write a quick wrap-up of the happenings during 2022 before the end-of-year.

As always, we started out in spring with a new major release along the spring GNOME release (42.0).

In 42.0 (or rather during the development cycle leading up to it) Maps gained support for using the development profile, so that you can install nightly snapshot releases from the GNOME nightly Flatpak repo (or using locally-built bundles) in parallell with a stable release (using the Flathub release or from a „traditional“ distro package).


Like for other apps, the icon for the development release is distinguished by the „bio hazard stripe“.

Also in the 42.0 release, support for the maps: URI scheme was added. Using this a link can constructed that when opened will initiate a search using the encoded search term in Maps. This is now used by Contacts when a contact in the address book has an address set. There is also a DBus API for performing searches.

Later during spring, after the 42 release some additional spring cleaning was made.

Support for social media check-in was removed (and along with it the dependency on gnome-online-accounts). The one remaining implementation for Foursquare had not been working that reliably (and hasn't been widely used), and also the other implementation (for Facebook) had been removed one release before, and had been broken for a few years due to upstream API changes.

This was also done to get remove some mostly unused UI to get less code to port to GTK 4.

Another change was changing the process for performing OAuth setup for editing POIs in OpenStreetMap. Previously we had handled username and password locally and programmatically posted the OAuth authorization forms using a ported variant of the same code used by JOSM.

As this method is not really best-practice for doing OAuth sign-up, and this had already at one point been broken and needed fix due to changes on the server-side this was then rewritten to hand off the authorizing to use an external web browser.


   This has taken inspiration from how Cawbird implements signing in to Twitter.

Then in late June it became appearent that  due to other dependencies migrating to libsoup 3 (for HTTP request support) maintaining Maps using GTK 3, libchamplain (depending on libsoup 2.x) for GNOME 43 was looking impossible.

So, it seemed a last-minute port to use GTK 4 and our new libshumate map rendering library (based on the GTK 4 scene graph) should be attempted, even though the schedule was getting a bit tight…

But after some additional bumps (such as porting the OSM loging to use OAuth 2 due to needing to port to a new version of librest) and some frantic summer coding nights, just in time for GNOME 43 it was in working (good enough) condition.


Christopher Davis helped port the about window to use the new libadwaita version of the dialog. He also did some additional clean-ups after the GTK 4 port.

This release also involved settling on the API/ABI for libshumate and declare it as 1.0.0.

Following the release, I have also done some post-port mending to fix some brokenness left after the port.

Among the fixes, the „place bubbles“ has been fixed to get rid of the extraneous margin that unintentionally got there after the port (due to GtkPopover widgets behaving differently, they where special-cased in GTK 3 when it comes to applying the CSS spacing rules).

So after this fix the place image (when there is one) is now again „flush on“ with edge.

 This is available in the latest Maps release (43.2).

 James Westman has also been working on fixing some performance issues and memory leaks in libshumate (that has been backported to the 1.0 branch, currently the stable version released is 1.0.3).

James has also been continuing improving the vector tile support in libshumate.

I also took the time to implement one additional feature for the new major release (44.0).

Now Maps supports fetching the thumbnail and Wikipedia article extract when a place has a tag referring to an entry in Wikidata.

It is also now possible to edit those when editing a POI (and the Wikidata tag can be  „fetched“ semi-automatically when a Wikipedia article tag is filled in by pressing a reload button.


That's it for now. I said it was going to be a quick wrap-up, but I guess it got some length to it after all!

So, see ya in 2023 and happy new year!