Skip to content

Tyler.jl

A package for downloading map tiles on demand from different data source providers.

This package is currently in the initial phase of development. It needs support. Sponsorships are welcome!

Installation

In the Julia REPL type:

julia
] add Tyler

The ] character starts the Julia package manager. Hit backspace key to return to Julia prompt.

Or, explicitly use Pkg

julia
using Pkg
Pkg.add(["Tyler.jl"])

Demo: London

julia
using Tyler, GLMakie
m = Tyler.Map(Rect2f(-0.0921, 51.5, 0.04, 0.025))
wait(m)

INFO

A Rect2f definition takes as input the origin, first two entries, and the width and hight, last two numbers.

Tile provider

We can use a different tile provider as well as any style theme from Makie as follows:

julia
using GLMakie, Tyler
using Tyler.TileProviders

provider = TileProviders.OpenTopoMap()
london = Rect2f(-0.0921, 51.5, 0.04, 0.025)

with_theme(theme_dark()) do
    m = Tyler.Map(london; provider)
    hidedecorations!(m.axis)
    hidespines!(m.axis)
    wait(m)
end

Providers list

More providers are available. See the following list:

julia
providers = TileProviders.list_providers()
Dict{Function, Vector{Symbol}} with 40 entries:
  TomTom                => [:Basic, :Hybrid, :Labels]
  OneMapSG              => [:Default, :Night, :Original, :Grey, :LandLot]
  USGS                  => [:USTopo, :USImagery, :USImageryTopo]
  BaseMapDE             => [:Color, :Grey]
  NLS                   => [:osgb63k1885, :osgb1888, :osgb10k1888, :osgb1919, :…
  OpenRailwayMap        => []
  Thunderforest         => [:OpenCycleMap, :Transport, :TransportDark, :SpinalM…
  Jawg                  => [:Streets, :Terrain, :Lagoon, :Sunny, :Dark, :Light,…
  OpenSeaMap            => []
  nlmaps                => [:standaard, :pastel, :grijs, :water, :luchtfoto]
  WaymarkedTrails       => [:hiking, :cycling, :mtb, :slopes, :riding, :skating]
  OPNVKarte             => []
  OpenTopoMap           => []
  HikeBike              => [:HikeBike, :HillShading]
  OpenAIP               => []
  OpenSnowMap           => [:pistes]
  SwissFederalGeoportal => [:NationalMapColor, :NationalMapGrey, :SWISSIMAGE]
  CartoDB               => [:Positron, :PositronNoLabels, :PositronOnlyLabels, …
  MapBox                => []
  ⋮                     => ⋮

INFO

For some providers additional configuration steps are necessary, look at the TileProviders.jl documentation for more information.

Figure size & aspect ratio

Although, the figure size can be controlled by passing additional arguments to Map, it's better to define a Figure first and then continue with a normal Makie's figure creation workflow, namely

julia
using GLMakie, Tyler
using Tyler.TileProviders

provider = TileProviders.OpenTopoMap()
london = Rect2f(-0.0921, 51.5, 0.04, 0.025)

with_theme(theme_dark()) do
    fig = Figure(; size =(1200,600))
    ax = Axis(fig[1,1]) # aspect = DataAspect()
    m = Tyler.Map(london; provider, figure=fig, axis=ax)
    hidedecorations!(ax)
    hidespines!(ax)
    wait(m)
    fig
end

Next, we could add any other plot type on top of the ax axis defined above.