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:
  AzureMaps             => [:MicrosoftImagery, :MicrosoftBaseDarkGrey, :Microso…
  USGS                  => [:USTopo, :USImagery, :USImageryTopo]
  CyclOSM               => []
  GeoportailFrance      => [:plan, :parcels, :orthos]
  HEREv3                => [:normalDay, :normalDayCustom, :normalDayGrey, :norm…
  OpenFireMap           => []
  OpenSeaMap            => []
  Stadia                => [:AlidadeSmooth, :AlidadeSmoothDark, :OSMBright, :Ou…
  FreeMapSK             => []
  MapTilesAPI           => [:OSMEnglish, :OSMFrancais, :OSMEspagnol]
  JusticeMap            => [:income, :americanIndian, :asian, :black, :hispanic…
  SwissFederalGeoportal => [:NationalMapColor, :NationalMapGrey, :SWISSIMAGE]
  Esri                  => [:WorldStreetMap, :DeLorme, :WorldTopoMap, :WorldIma…
  SafeCast              => []
  OpenTopoMap           => []
  OpenRailwayMap        => []
  Thunderforest         => [:OpenCycleMap, :Transport, :TransportDark, :SpinalM…
  Jawg                  => [:Streets, :Terrain, :Lagoon, :Sunny, :Dark, :Light,…
  nlmaps                => [:standaard, :pastel, :grijs, :water, :luchtfoto]
  ⋮                     => ⋮

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.