Monday, 26 October 2015

GeoJSON in Maps

For Maps 3.19.1 release we managed to land some support for showing  a GeoJSON layer. This means that you can get a GeoJSON file from somewhere then open it with Maps.


The different ways to load GeoJSON with Maps is currently...
... from the command line: gnome-maps file.geojson
... drag the file to a Maps window
... double click the file to open it with Maps

In order for double clicking the GeoJSON file to work we need to install the application/vnd.geo+json mime-type on the desktop. I have added the mime-type to the component shared-mime-info. So you will need a release from that module or build it yourself from Git.

GeoJSON files can be used to create a custom layer above the map. For instance displaying political areas like counties or voting area. An example would be all the municipalities of Norway.

You can also add different places, for instance GUADEC this year will be at Karlsruhe. The bid I saw included four different options for venue. We could map this using GeoJSON (I used to create a layer showing the different options on the map.

Heavy lifting by Mapbox

It turns out rendering large sets of GeoJSON is non-trivial. Fortunatly it is something that Mapbox already has solved with their JavaScript library called geojson-vt. Under the heading of "Rendering big geodata on the fly with GeoJSON-VT" the article describes how the library breaks down the GeoJSON set into vector tiles by filtering out features, optimizing detail and clipping.

We lift the code into Maps, we have to change the way the geojson-vt modules include each other in order to fit into the gjs way of doing things, but other than that, the code is unchanged. The code is then used to construct a libchamplain tile source and is then added as an overlay source to the map view.


Right now the code will only handle GeoJSON files that do not change the Coordinate Reference System (crs) to something other than the one we are used to (latitude and longitude ranging from -180/-90 to 180/80).

No styling information is taken into account (except the name property for Points). There is no standard GeoJSON styling style. But we could for instance support the one from Mapbox.


Styling and UX for this feature may change before we end up in 3.20. Please try it out and comment and file bugs. It will help us!

If you want to help out now there are some tasks to look at:

Wednesday, 30 September 2015

Do you want to contribute to Maps?

Right now we have quite a number of tasks in our Bugzilla that are suitable for someone that want to get started developing for Maps or GNOME in general.

I am going to list some of them here and maybe it will pique someones interest. However finding a first task to work on is not all that one need to do in order to start developing for GNOME. You also need to be able to build and run the latest developer version of the GNOME module you want to develop for. In order to get there I will defer to the excellent Newcomers guide.

On to the Maps entry tasks!

Remember last location and use it at start up

This task is about saving the latitude and longitude of the view you are currently viewing so that Maps can go there on start-up. Instead of starting with a view of the world every time.

So in order to solve this you will interact a bit with the GSettings framework and a bit with the ChamplainView that contains our map.

Use stars instead of hearts for favorite places

We currently use hearts for favorite places on our Map bubbles. The rest of GNOME use stars. We should use stars as well. So here you will interact a bit with CSS and with UI files.

Implement new mockups for map Bubbles

We want to fit more information in our map bubbles. New mockups have been provided in the bugzilla for this task. To solve this you need to, among other things, interact a bit with GtkBuilder ui-files.

Support roundabouts in GraphHopper route results

GraphHopper now supports roundbouts. But we do not show that in our route planner UI. For this task we need to use the information from GraphHopper in the Maps ui.

These were a few of our tasks, there are More! We want your help and need it to make Maps 3.20 the best release yet!


Saturday, 12 September 2015

Using offline (local) tiles with GNOME Maps

I managed to get a freeze exception to include a new feature in Maps for 3.18. It is now possible to use local, offline, tiles by using the --local command line option.
What you need are image map tiles, organized in a standard way in a directory. Then you can point Maps towards that directory and have local tiles usable offline.

For instance, I downloaded a bounding box of London. In the zoom-levels of 11, 12, 13, 14 and 15. The tiles are organized as Z/X/Y.png. Where Z is zoom-level, X and Y are the tile numbers. London at those zoom-levels will be 2750 tiles and about 60M.

I used a perl script found while googling. Please be advised to follow the tile servers usage policy before attempting bulk downloading of tiles.

$ tree london/
├── 11
│   ├── 1022
│   │   ├── 679.png
│   │   ├── 680.png
│   │   ├── 681.png
│   │   └── 682.png
│   ├── 1023
│   │   ├── 679.png
│   │   ├── 680.png
│   │   ├── 681.png
│   │   └── 682.png
│   └── 1024
│       ├── 679.png
│       ├── 680.png
│       ├── 681.png
│       └── 682.png
├── 12
│   ├── 2044
│   │   ├── 1359.png
│   │   ├── 1360.png

Using this I can do:
$ jhbuild run gnome-maps --local ~/london

So this is kind of an hidden feature. So that we can test using offline tiles before we find a way of getting downloading into Maps. One kind of major issue right now is where do we get the tiles? Bulk downloading tiles from OpenStreetMaps is not very nice. OSM is a non-profit org. run by volunteers on donations. We do not want to leach on bandwidth. So we need a way around this. Maybe host our own?

Please also consider that when and if you want to download tiles to try this Maps feature. See the tile usage policy about bulk downloading. And try to follow it!

Please enjoy!

Monday, 10 August 2015

GNOME Maps presence at GUADEC 2015

GUADEC is the GNOME Users And Developers European Conference. This year it was held in Gothenburg.

I presented a talk about Client side rendering of maps using MapCSS.
I will embed the slide for that talk to this post. There will also be videos later on, as all talks were recorded.

After the core days we had an opportunity to gather an informal Maps BoF 
were interested gathered to talk about our roadmap. We also managed to jot down some ideas for future GSoC / Outreacy proposals.

You can find the updated roadmap here.

We are late in the 3.18 cycle and we have not had the amount of developer bandwidth we would have liked. But I still want to get in some stuff before the freezes. I would love some help from you!

For  3.20 we are more ambitious. And we want to land some features.
Right now the plan is to go for:
  • Basic editing of OpenStreetMap data from Maps (bug)
  • Printing of routes (bug)
  • Opening and displaying geographic annotation and visualization, possibly through KML files
  • Integration with OwnCloud (bug)
  • Some sort of support for client side rendering
  • Further support for offline tiles
  • Someway to download tile
There are some nice projects and bugs to work on in Maps. If you want to get involved please check out our gnome-love bugs. And come visit us at #gnome-maps on

Wednesday, 22 July 2015

GUADEC at Folkets Hus Gothenburg

GUADEC is the GNOME Users And Developers European Conference. It is an annual conference taking place in Europe, whose prime topic is the development of the GNOME desktop environment.

This year GUADEC will take place at Gothenburg, Sweden on August 7 – 9 the core days at Folkets Hus. I am not sure that people are aware of what a Folkets Hus is, so I thought I'd take a moment to write something about them and their history.

At the end of the 19th century, the trade unions and the labour movement began to organise themselves in earnest. This meant they needed places to get together, to hold meetings and for education. This might seem innocent enough, but the opposition was great. Workers were not welcome to use existing premises. Landowners forbade open-air meetings, as fear for revolutionary ideas was great.

So the labour movement in southern Sweden decided to buy land, build houses and use them for their organisational needs without interference. The idea spread and all over the country Folkets Hus was constructed. And not only houses: Amusement Parks, Zoos, Open Air theaters, Cinemas and much more. The Folkets Hus movement was important for making the labour movement a part of peoples lives. Today the People's park and communiy centre movement is made up of about 600 meeting places in Sweden.

The People's park are a natural part of many cities and their connection to the early days of the labour movement are beginning to fade away in common memory.

People's park in Malmö

The Folkets Hus in Gothenburg, where GUADEC will be held, was constructed between 1948 and 1951. In 1956 a cinema and restaurant/dance hall was added.

Since then people have gathered there for dance, movies, study circles and for meetings and social events. Today Folkets Hus in Gothenburg acts as a venue for conferences  a part of Göteborg Film Festival a workplace for hundreds of people and a home to a large art collection.

I hope you will enjoy it here!

Tuesday, 5 May 2015

Client side rendering of our map using MapCSS!

We want to support an offline mode in GNOME Maps. A mode where you could download an area and have the map data available even if you do not have an Internet connection. The problem is that we are currently using pre-rendered bitmaps. We download them and we show them. This makes supporting an offline mode a bit tough since the amount of data we would have to save would be large.

We have talked off and on about how neat it would be if we could download some kind of vector data and render the map ourselves. But never really made any progress. Until now, kind of.

I have been working on a library that I call Vector-tile-glib. This library will parse and render the Mapbox Vector tile format, and style it using MapCSS. I have hacked a bit on evenings and other spare times when my son has been asleep. It has been fun. It is not done, nor stable. But it has reached a point where I want to tell more people about it and maybe even get some help. There is much left to do, and many many rough edges.

So what I have now is pretty much something that parses the vector tile and can output something to a Cairo context using MapCSS. Or in pictures:



In order to try it out I have also written a subclass of a Champlain renderer in Maps so we can try this library out in real time. The work is on a branch on the GNOME Maps git repository  called wip/jonasdn/vector-tiles, try it out!
Andreas Nilsson and Marcus Lundblad have been helping me out with an initial style. Join them!

For you to try this, build Maps from the wip branch, then choose the aerial view to get the client side rendered map. Like in the video below:

You can also try out live editing the MapCSS, like in this video:

There are also tools to use in the vector-tile-glib repo, for rendering to PNG, dumping tags from a vector tile and downloading tiles from Mapzen tile service. See the Github for more details on them.

I think this could be something cool to have. Partly for providing a path towards offline Maps and partly to have a map style of our GNOME. Help is appreciated! I am not a parser person or a render person, so I am sure I have made a bunch of really silly mistakes. Pointing them out would be helpful!

Tuesday, 22 April 2014

What's coming in Maps 3.14 and beyond

GNOME Maps is a simple maps application being developed in javascript, using the Gjs bindings. The map data for Maps comes from OpenStreetMap which is a collaborative project to create a free and editable map of the world.

Maps began as a preview in GNOME 3.10 and is still under active development.

How it looks today

Two map types are provided, one aerial and one street type.

We use the Geoclue D-Bus service to try to pinpoint your location with the most accuracy it can manage.

The search-entry will auto-complete. Not against the search server because that would violate the terms of agreement with Nominatim the search service we currently use. But Maps keep track of the recent-places you have visited and completes against them. And will also complete against bookmarked places and contacts later on.

This, among some other things, is what Maps can do today. There are plans and mockups brewing though. And I would like to go through some of them here.

Route search

There is work under way to provide route search to Maps. This will be done using GraphHopper an open source road routing enginge. Mattias Bengtsson started this project as GSoC project and the patches will soon be under heavy review. When this has landed Maps users will be able to find routes for car, bicycle and walking.

Bug for routing implementation here.

To illustrate how this could look in Maps I have here a video from quite some time a go that demos the functionality. The final result may look different and probably better as well.

We also have a GSoC student, Dario Di Nucci, looking into adding support for intermediate points, or via points, to GraphHopper so that we can use them in Maps!

Point of interests (POI)

Often when you are using a map application you want to actually find out something about the world around you. For instance where the nearest restaurant, ATM, bathroom or pub is located.

This is something that Maps also want to do. We have plans of showing you the POI's near you as icons overlayed the map. One idea is that this will kick in at appropriate zoom-levels and show you a small icon that represents, for instance a pub.
I have for you a small mockup video of the concept.


We have been accepted to this years GSoC and will have student looking in to this.
Rishi Raj Singh Jhelumi will be working on this functionality. Both the overlaying of POI icons and figuring out where (which service) to get the POI data from.

Contact data and check-ins

Another idea that we are thinking about is to integrate your contacts in Maps. So that the search auto-completes to the address of your contacts. And also possible having them appear in the same way that the POI's do in the section above.

Similar to this is the  integration of check-in information. So that you can see on the map where people you are connected to have checked-in using Facebook or FourSquare.

We will have a GSoC student working on this as well! Damián Nohales will be looking at integrating this to Maps and also have a look at enriching our map markers to have some actual useful information in a pretty way.

Map markers

Right now we use those little black markers as seen on the screenshot above to mark a place on the map. They do not provide much information about the place and there is really not much you can interact with.

Our plan is to replace them with GtkPopovers. Our designers have created some nice mockups for this and you can look at them here. And a sneak preview below, the mockups also contains ideas on how and when different markers should be used.


Talking to other GNOME applications

A bug has been filed to Maps asking to add links to GNOME Weather and Clocks, so that one could easily find out time and weather information about a place. A use-case might be.
I'll be travelling there, and I know the weather/time
are different, so I want to add check the weather to pack
ahead of me going there.
This is something that might be coming to Maps, but the designers have not yet provided any feedback on the idea.

Beyond, search, editing and custom maps?

As mentioned above the search service Nominatim does not allow us to auto-complete against the search results. This could be dealt with by hosting our own instance of Nominatim, or looking elsewhere for searching.

One thing that I think Maps stand out and bring extra value is for me the use of the collaborative mapping project OpenStreetMap (OSM). Going forward I would like to see a way to add and update the OSM database through Maps. There is a bug for this in bugzilla with this comment from Zeeshan Ali:
This would also make us the first OSM editor that works
out of the box w/o requiring java. :) All editors I've
tried so far are either mainly targetted for editing small
parts of the map (some of them even don't all you any editing
until you zoom enough) or they are very difficult to use.

Another thing I think would be cool for Maps is an easy way to create custom overlays for Maps. To Show interesting data with geo connection. Like the infant mortality rate per country, unemployment per Swedish municipality or maybe GNOME contributors density.

If you have any ideas of features that will not distract from the goal of being a simple map application foremost, please contact us and/or get involved!