ministryofjustice / laa-recommended-technologies

A repository for crowd-sourcing technology guidance within LAA Digital
MIT License
3 stars 1 forks source link

Do we have recommendations for embedding maps into web pages? #21

Open rowlando opened 3 years ago

rowlando commented 3 years ago

Up until now, in LAA Digital, I think we've used Google Maps across the board. About a year or two ago, Google Maps changed its licensing model, meaning we now have to pay.

Recently there has been chatter about alternatives, e.g. Open Street Maps or OS Maps.

If we have a need for embedding maps, what is today's recommendation?

said-moj commented 3 years ago

Might be worth mentioning of a similar maps conversation that took place for the govuk design system https://github.com/alphagov/govuk-design-system-backlog/issues/75

rowlando commented 3 years ago

Might be worth mentioning of a similar maps conversation that took place for the govuk design system alphagov/govuk-design-system-backlog#75

Thanks @said-moj. I see explicit mention of OS Maps API and OS Vector Tile API being free to public sector by the Product Manager of OS.

Further down, there's mention of a throttling limit. It would be useful to understand this stuff.

rowlando commented 3 years ago

@mayowaadeniyi do you have the details about how to get access to the OS Maps API?

mayowaadeniyi commented 3 years ago

To access OS Maps you follow this tutorial . Quoting from my conversation with Antony Bishop

For us it's free. The MoJ account my team owns is part of a Government scheme. If you need a key for the Maps API let me know. Soon as you need one let us know over at #ask-operations-engineering

My thoughts on OS Maps is they can match the functionality of Google Maps API (based upon reading the docs and writing some of the code myself), so in terms of user experience it should be very similar. Some of the features (at least in our case) will require writing additional code as the particular features we want do not come out of the box.

There are a couple hitches though which I am currently seeing if we can get around. One of them being the low quality maps. They do talk about alternatives on the docs, so I will see if this can be configured.

rowlando commented 3 years ago

Thanks @mayowaadeniyi.

@rwk-moj One consideration switching to OS Maps are the different styles available.

Choose the style that suites your use case best, whether you need the detail of OS MasterMap or our iconic Leisure maps. There are four styles available: Road, Outdoor, Light and Leisure. Each map style contains OS OpenData and Premium data layers.

Which style should we default to? And other concerns that spring to mind around usability are:

I'm not sure how much effort should go into this type of analysis if OS Maps is the preferred solution because of cost factor. And maybe someone has already done the hard work.

@AntonyBishop do you know if anyone else is using OS Maps in D&T?

AntonyBishop commented 3 years ago

Hi all,

I do know that Robin Harrison from Book a Secure Move has been trying OS Maps.

rowlando commented 3 years ago

@merlinc any thoughts on OS Maps? Do you think we should be recommending it to developers at adopt? Any initial concerns so far?

rwk-moj commented 3 years ago

@rowlando Defra has done a really awesome detailed document into using maps that factor in:

Also, there's a great write-up of accessible maps from Benjy Stanton.

For the CLA/FALA service, I would suggest using whichever style is closest to the google map default style for now - I can't see the alternatives on the API but maybe it's something @mayowaadeniyi can pop into a test page that I can have a look at.

It's not something that has been tested in detail with users on our service and therefore we'd probably not want to make too drastic a change to how it looks without some additional research.

MalcolmVonMoJ commented 3 years ago

On CLA & FALA, we styled our Google Maps to conform to the government palette and improve accessibility (add missing visual clues for tab focus, increase contrast etc - all CSS stuff). It is done now - and we can share if anyone out there uses Google Maps, but any change to the Google Map HTML could eliminate those changes.

OS Maps is free for public sector since January. There was also talk on one of the x-gov Slack channels about OS providing a government style skin for it too.

From what I currently know, I'd favour OS maps because:

merlinc commented 3 years ago

@rowlando On Book a Secure Move we're trialling providing maps for some of our users.

One of the PRs that adds some mapping functionality is here - https://github.com/ministryofjustice/hmpps-book-secure-move-frontend/pull/1373

One thing to remember is that map tile data, is just that - data. This data is rendered by a mapping toolkit. I'd expect that if in the future we were to move to Bing Maps or Google Maps, then we'd need to change the authorization, and possibly translate the coordinates - but the rest of the code should really remain the same. For example, over the course of development, the authorization method shifted from using an embedded key, to an tile image proxy, to finally using OAuth - none of that affected the data that I was trying to render. So in this respect, OS Maps is no different to any other provider.

All those questions on accessibility, performance, touch screens - they're questions for the mapping toolkit itself to deal with, not OS Maps. One of the reasons I chose OpenLayers was it had support for mobile devices, accessibility, and a large number of examples to use for required features. The accessibility points raised above, and in the various links, are definitely valid, and need consideration into whatever design the maps are incorporated into.

Integrating OS Maps was easy - @AntonyBishop very promptly supplied the keys that I needed at the time, and as I figured out what the next piece of functionality I needed to use. As mentioned above, it's also free for Public Sector bodies, which definitely helped with the initial decision to use them.

If any Government projects have a user need for maps, then I think we should be advising our developers to use the OS Maps.

Two other things to note:

Firstly, OS also provide a number of other APIs, one of which allows you to search for addresses, and filter by categories (e.g. Court, Retail Shop). With a little bit of work, this could allow cleanup of existing data to be able to be mapped.

Finally, all off this mapping technology is only as good as the data that goes into it. For example, our staging environment had locations without any addresses or postcodes. This meant we couldn't look up where they were, and thus couldn't place these locations on a map at all.

AntonyBishop commented 3 years ago

If you'd like a meet up with OS to discuss their APIs let me know. Happy to set something up. I know they are interested to find out more about how we are adopting their products and how they can help us.

mayowaadeniyi commented 3 years ago

I did a spike investigating the usability of OS Maps/OS Vector Tiles into our application and mapping libraries Mapbox and Open Layers.

Robin Harrison above has already used Open Layers in their team, so there is proof it already works.

I did a presentation on this to my team which I will link here if anybody would like to take a look at it. It contains my findings on

The presentation is geared towards my team, so I may need to revamp it a bit, so it is more applicable for everyone.

It would be great to create a sort of standard around this, so everyone can employ the same APIs/tools into their application and we can have consistency across all our teams (depending on everyone's needs of course).

rowlando commented 3 years ago

@mayowaadeniyi yes please to a presentation, maybe at a dev community meeting?