Displaying Maps On Your Website

If you are looking for a way to display maps on your website there are a lot of options available to you. Most people will just think of Google Maps but there are a lot of alternatives and some are cheaper too.

How they compare

Pricing

Prices and pricing models vary a lot. Many APIs offer some free "requests" per month or year but be careful about how they define a "request". There are two main ways to define a request:

  1. A full map load. This means a complete set of tiles required to view one map is considered to be one request. If this model is used you may not be charged extra if the user pans around the map. Free tier allowances may appear less generous and per request fees may appear higher for APIs that use this model.
  2. Per tile request. This literally means every tile a user requests will be counted as a request. It can be difficult to understand how many of these requests a typical user will consume. As a rule of thumb, many of the APIs that use this model say one map load is four tiles. Be aware that you will normally be charged extra if a user pans around and zooms. You may want to limit the area and/or the zoom levels to control costs. This model more accurately models the costs incurred by the provider so the per request fees are likely to be lower and the free tiers may be more generous.

Permitted use

The big tech companies generally don't differentiate between commercial and non-commercial usage. Instead, they normally offer some kind of free tier and automatically start charging when this has been used. Free tiers on some of the alternatives restrict commercial usage.

What is commercial usage?

Disclaimer: I am not a legal expert. The comments in this section are my opinion and my unqualified interpretation. Please seek legal advice if you are unsure of the definition of commercial usage.

If your tile provider restricts commercial usage refer to their terms and conditions. Many sites with such restrictions are quite vague this. If it is not otherwise stated I would err on the side of caution and assume they are using the broadest possible definition of commercial usage. That means any hint of commercial advantage is considered to be commercial usage. Including but not limited to:

  1. Indirect commercial advantages such as a non-profitable site that help direct users to a business.
  2. Any site that displays ads even if the site is a hobby site where the ads are displayed to help limit or control costs.
  3. Any site that sells a product or promotes another site that does.

Vendor lock-in

The big tech companies all provide their own API to access their tiles. However, with some of these products, it is possible to use alternatives. For example, Google maps can be used with OpenLayers. An example can be found here.

With the notable exception of MapBox, most of the alternatives don't provide a Javascript API to access the tiles. Instead, they rely on third-party open-source tools. This means it should be easier to switch in the future. Although MapBox provides its own Javascript API. It is a commonly used open-source API that is used by other tile providers. It is also possible to use Open Layers with MapBox data.

Data quality

The alternatives generally use data from OpenStreetMap and other open data projects like Natural Earth. Services provided by the big tech companies use proprietary data sources but may use data from these sources as well.

The quality of OpenStreetMap data is generally high but varies from region to region because it is a community-driven project like Wikipedia. It is worth comparing the quality of the data for the region you need before deciding on a provider.

Some of the options

Big Tech Companies


Alternatives

Artistic maps


Road Maps


Doing things yourself

OpenMapTiles offers an option to buy tiles and serve them yourself. There is also a free option for non-commercial use. The hardware requirements for serving vector tiles are far less demanding than raster tiles. Vector tiles can be served from a low-cost digital ocean droplet or AWS EC2 instance. With vector tiles, it may also be practical to serve tiles from a static storage service such as AWS S3.

If you are looking for a free option. You can also generate tiles yourself using a toolchain provided by OpenMapTiles.org. They may also free tiles available for your area from other tile providers. If you are serving maps for Great Britain only you can use the Ordnance Survey Open Zoom Stack.

Comments

Popular Posts