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))

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.OpenStreetMap(:Mapnik)
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)
    m
end

Providers list ​

More providers are available. See the following list:

julia
providers = TileProviders.list_providers()
Dict{Function, Vector{Symbol}} with 40 entries:
  TopPlusOpen           => [:Color, :Grey]
  OpenWeatherMap        => [:Clouds, :CloudsClassic, :Precipitation, :Precipita…
  Thunderforest         => [:OpenCycleMap, :Transport, :TransportDark, :SpinalM…
  CartoDB               => [:Positron, :PositronNoLabels, :PositronOnlyLabels, …
  MtbMap                => []
  OneMapSG              => [:Default, :Night, :Original, :Grey, :LandLot]
  SafeCast              => []
  NASAGIBS              => [:ModisTerraTrueColorCR, :ModisTerraBands367CR, :Vii…
  USGS                  => [:USTopo, :USImagery, :USImageryTopo]
  OpenAIP               => []
  MapTiler              => [:Streets, :Basic, :Bright, :Pastel, :Positron, :Hyb…
  HERE                  => [:normalDay, :normalDayCustom, :normalDayGrey, :norm…
  MapBox                => []
  SwissFederalGeoportal => [:NationalMapColor, :NationalMapGrey, :SWISSIMAGE]
  WaymarkedTrails       => [:hiking, :cycling, :mtb, :slopes, :riding, :skating]
  TomTom                => [:Basic, :Hybrid, :Labels]
  OpenSnowMap           => [:pistes]
  OpenSeaMap            => []
  BaseMapDE             => [:Color, :Grey]
  ⋮                     => ⋮

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)
    wait(m)
    hidedecorations!(ax)
    hidespines!(ax)
    fig
end

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