Tuesday, December 11, 2018

Christmas Maps

It´s been ages since I last shared any Maps news, so it´s probably about time…
Some things have happened since the stable 3.30.0 release in September.

First off we have a new application icon, courtesy of Jakub Steiner using the icon style for the upcoming GNOME 3.32




Furthermore the application menu has moved into the new “hamburger menu ” in the title bar, in-line with changes being carried out across the board for GNOME applications, since the adoption of the desktop top bar menu for application-wide action was never really adopted in any significance by third-party applications.


Lately James Westman have made various valuable contributions, among others a better experience on first launch (should be no more gray areas “north of the north pole” in these situations), getting rid of some deprecation warnings when running with newer GJS versions, and also a bug fix with some parts from our C-based glue library for loading addresses from the contact book not being exposed as introspectable (and thus not being visible from JavaScript code) which strangely somehow was still working on older GJS. So I also made an additional bug-fix for the 3.30 series (3.30.3) with this fix.

Another feature James has been working on is replacing our old thumbnails that was being used in the menu for selecting the map style. This has been using static graphics captured from our previous map tile provider (MapQuest) which are not only not in-line with the currenly used tile style but may also be in a legal grey-zone. So one idea I floated was to dynamically use content from the current map view for the thumbnails.

James made some experimenting with this in WIP branch:

 
We have not decided quite yet from a design perspective if we should go with this approach, but I think it looks and feels pretty sleek. One slight downside is that it generates some additional tile accesses, but I think it´s acceptable.

So thank you very much James!

That´s that for now, and all have happy holidays!

Thursday, June 28, 2018

Summer with Maps

It´s been a while since I wrote a blog post last time… and even though we´ve had summer weather here (more or less) since quite some while, it seems appropriate with a little “start of summer” summer post. Since last time time I´ve amended a pretty long-standing issue we´ve had when running under a Wayland compositor (at least with the Mutter compositor, as used by gnome-shell) that makes the revealer widgets we´ve had for showing notifications not working in this case, as the map view is using the Clutter scene graph library and overlaying GTK+ widgets on that is not working under Wayland. Since Clutter is deprecated and this issue won´t be fixed and re-writing the map view library using some other backend (also making it working under the upcoming GTK+ 4) is a rather big undertaking, I´ve went ahead with a few workarounds to get rid of the overlayed widgets.

Notifications used for showing i.e. the need to zoom in to add OpenStreetMap POIs and for informing that location services is turned off (and this has been an issue at least on Fedora, where user location is by default disabled for privacy reasons) have been replaced with modal dialogs (not as elegant, but better than not showing up at all)




The notifications showing when routing fails for some reason have been replaced with showing messages in place of the result list.


Furthermore the total number of “via points” for routing has been limited to 10. This has been done partly because GraphHopper imposes a limit of 30, and also the UI doesn´t really cope well with too many locations anyway.

And with that Maps wishes you all a continued happy summer (or winter if you´re on the sothern hemisphere) 😎

Wednesday, March 28, 2018

Maps, Gitlab, and Meson

It's been a couple of weeks now since GNOME 3.28 was realeased. I´ve already written some about the new features in Maps for 3.28. But already now there´s some exiting news looking forward. The first is not related to code or features of Maps itself. But the project has been migrated to GNOME´s Gitlab instance (along with other projects now that mass-migration of the remaining projects from Cgit and Bugzilla is going on). I think this will simplify newcomer contributions and bug reporting quite a bit. Also the code review interface for the merge requests looks pretty nice.

The other big news is that Maps is now built using Meson. Even though the amount of compiled code (the private C library we use for interfacing with things like libxml2 and libfolks, which doesn´t natively support GIR bindings) is quite small, I still think build times are noticeably quicker now. I decided to remove support for building using Autotools right away, since we had some shell:ish magic going with installing our icons where shell sub process ran cut to parse file names into path destinations based on splitting on underscore characters. So I took the opportunity to clean this up and move the icons into suitable directory structures directly in the repo. I didn´t think it was worth the effort to “back-port” this the Autotools build system, so from now on master can now only be built with Meson (ofcourse on the stable “gnome_3_28” branch building is done the old way using Autotools).

Unfortunately we where out of tile access from Mapbox for little over a week recently, but a couple of weeks ago the GNOME Foundation board has voted to set aside a budget for tiles, so things should be good now.

And also since it´s boring writing blog posts without any screenshots, and in three weeks I´m going to San Fransico with work. I loaded transit data from MUNI in my OpenTripPlanner server instance and did some cable car “browsing”, notice the nice little icons (made by Andreas Nilsson):

Thursday, February 8, 2018

Entering the “home stretch” for GNOME 3.28

Earlier this week I´ve released GNOME Maps 3.27.90 (even though I just read an e-mail about the deadline for the release tarballs had been postponed for one week just after uploading the tarball).

This weekend I (like some 8000 others) participated in an exciting FOSDEM with lots of interesting talks and the week before that I gave presentation of GNOME Maps, and in particular the public transit functionality for TrafikLab (the sort of “developer community” driven by the Swedish organization Samtrafiken AB, who coordinates and aggregates data from all public transit operators, both commercial/private and regional/public ones.

One of the larger features landed in 3.27.90, which isnt´t visible on the surface is that Maps now uses some new language features introduced to JS in the ES6 standard, namely classes and ”arrow functions”.

So, when it comes to classes, as known from traditional OO languages such as Java or C++, earlier one would typically use prototypes to model object classes, but as of ES6 the language has support for a more traditional classes and with a method syntax. GJS also gained a new way to declare GObject classes.

So when earlier declaring an extending class would look something like this:

var MyListBoxRow = new Lang.Class({
    Name: 'MyListRow',
    Extends: Gtk.ListBoxRow,
    Template: 'resource:///<app-id>/ui/my-list-box-row.ui',

    ...
    myMethod: function(args) {

    }
});


this now becomes:

 
var MyListBoxRow = GObject.registerClass({
   Template: 'resource:///<app-id>/ui/my-list-box-row.ui'
} ,class MyListBoxRow extends Gtk.ListBoxRow {

  ...
  myMethod(args) {

  }
});

and in cases where we don´t need to inherit from GObject (such as when not declaring any signals, i.e. for utility data-bearing classes) we can skip the registering part and it becomes just a simple ES6 class:

var SomeClass = class {
   ...
   someMethod(args) {

   }
}

We still need the assign using “var” to export those outside the module in question, but when we gain ES7 support in GJS we should be able to utilize the “export” keyword here instead. Another simplication that should arrive with ES7 is that we´d be able to use a decorator pattern in place of GObject.registerClass so that it would become something like:

@GObject.registerClass 
class MyListRow extends Gtk.ListBoxRow

Techinically this could be done today using a transpiler step (using something like Babel) in the build system. These decorators will pretty much be higher-order functions. But I choose not to do this at this point, since we still use GNU Autotools as our build system and eventually we should switch to Meson.

The second change involves using the “arrow operator” to bind this to anonymous functions (in async callbacks). So instead of something like:

asyncFunctionCall(onObject, (function(arg) {
     doStuffWith(arg);
}).bind(this);

this becomes:

asyncFunctionCall(onObject, (arg) => doStuffWith(arg));

These changes results in a reduction of 284 lines of code, which isn´t too bad for a change that doesn´t actually involving removing or really rewriting any code.

Thanks go to Philip Chimento (and Endless) for bringing these improvements for GJS!

Some other changes since the last release is some visual fixes and tooltips for some of the buttons in routing sidebar contributed by Vibhanshu Vaibhav and a fix for a keyboard navigation bug (that I introduces when changing the behavior of the search entry to always activate when starting to type with no other entry active) contributed by Tomasz Miąsko. Thank you!

 

Thursday, December 21, 2017

Christmas Maps

So, we're approaching the end of the year and holidays, so I thought I should share some updates on some going-ons in Maps.

One issue we've had on our table is the way we do attribution. Currently in 3.26 and earlier we have shown the common OSM attribution and a provider logo on the map view. Now we also show attribution to OSM and the tile provider in the About dialog:


The tile provider name and link is included in the service file that is downloaded on start-up, so this can be changed later on without pushing new versions (if needed).

Another nice feature that we've had in mind for a while but didn't make it into 3.26 because we hadn't settled on the exact graphical layout is showing thumbnail images for places in the place info bubbles:


So, now we show a thumbnail picture for a location if it has a Wikipedia article linked to it in the OSM data, and if the Wikipedia API gives us a thumbnail corresponding to the article. This is yet another area where you as a user can add value by adding Wikipedia links, and also by uploading article title images to Wikipedia.

Another thing that has come up lately is an issue with how we overlay some things (like the zoom control buttons) using a GtkOverlay, which unfortunatly doesn't play well with the LibChamplain-based Clutter view used to display the map background when running under a Wayland compositor.
So, as a workaround, we have moved the zoom buttons to the headerbar (similar to the way it works in the EOG image viewer):

I think this is actually pretty nice, and I think I prefer this over the overlayed zoom buttons. So, I think we should probably keep this even if the GtkOverlay problem is solved (or we move away for using Clutter).

Lastly, I've been wanting to fill in some missing spots in our set of icons used for various modes of transit when doing the public transit routing, so I've been pestering Andreas about drawing some additional icons now and then for a while. As a piece of work-in-progress I can show you this nice rendition of a steam locomotive intending for representing tourist/heritage railways:



This example shows routes for the Mornington heritage railway outside of Melbourne in Australia, as the data I usually use for showcasing from the Swedish Samtrafiken organization currently unfortunately doesn't have this classification (I've bugged them about it…).

So, that's that for tonight. And happy hollidays everybody! 🎅🎆

Sunday, November 19, 2017

Maps Towards 3.28

So, it's been a while since my last blog post.

Some work has been done since the release of 3.26 in September. On the visual side we have adapted the routing sidebar to use a similar styling as is used in Files (Nautilus) and the GTK+ filechooser.










I also took the oportunity to improve the looks of the transit route labels when using a dark theme variant:

So that now the labels will get an outline in the lighter text color when the background is dark (the opposite compared to when using the regular light theme variant).

Another small improvement is that we now support the common --version command line option to… well, show the version number :-)
Also, the copyright date in the About dialog has been updated (since it hadn't been since 2013…).

Under the hood, and not immediately visible, I have cleaned out some cruft that generated a lot of run-time warnings about superfluous function arguments  (either the Javascript GIR bindings expected extra error “out parameters” before, or GJS just has gotten more verbose about these things).

I also started playing with some newer ES6 features, namely closures (so avoiding declaring an inline function using the “function” keyword and binding this to the scope, and rather do something like () => { do_suff_here; } when declaring signal callbacks and such. And the other thing being using ES6 classes (and the new GObject syntax in GJS.

And this not only makes the code nicer to read (IMO) it also cuts down on the LoC count a bit:

 
It's not only been hacking lately though, I had a nice video conference with representatives from Mapbox to discuss ways we could give back to them in return for their generousness towards us. I have some ideas about features we could implement in Maps that they were interested in. This is something I will most likely bring up again in a not too distant future.

Thursday, September 7, 2017

Approaching 3.26

So, we're on final stretch towards the GNOME 3.26 release next week, just released the last beta of Maps (3.25.92) earlier in the week. This cycle hasn't seen that any real ground-breaking user-visible changes. But various smaller bugfixes. Nevertheless there's been a few nice improvements on the surface (as seen in earlier blogposts).

A couple of handy keyboard shortcuts:


To switch between the regular map view and aerial view, ctrl+1 and ctrl+2 can be used (instead of having to use the layer menu in the title bar). And to ctrl+o to open a layer file (such as a GPX recorded GPS track).

We have also added some additional details shown in map bubbles, and those are also available for editing objects on OpenStreetMap


Now we have availabilty of toilets as well as relegious affinity (for things like places of worship) available. Also for the edit view, we now show and allow editing of editor notes (these are meant as hints for other contributors on OpenStreetMap).

One feature I talked about earlier, but that hasn't landed yet (and thus will have to wait until 3.28 next spring) is the showing of thumbnail images obtained from Wikipedia in the map bubbles, as we haven't settled the UI and tweaked suitable sizes and such yet.

Another issue I fixed is how we handle entering search text when starting typing, previously we would always focus the main search entry by default when starting the application. This had the downside of always showing the on-screen keyboard on start-up on tablets (when no keyboard is available). Now the search entry is instead automatically focused when typing (and no other text entry is active). This also means you can always start a search by start typing (unless a dialog such as the edit dialog is up, of course). This is also more in-line with how other GNOME apps does it.

Unfortunatly, we still haven't found a solution for hosting an instance of OpenTripPlanner for public transit routing, so when using that feature you'll still need to either run your own server, or point to a third-party one (by using the OTP_BASE_URL environment variable).