Tyler + GridLayout throws error
alex-s-gardner opened this issue · comments
f = Figure(resolution=(1912 * scale, 2284 * scale))
ga = f[1:2, 1] = GridLayout()
m = Tyler.Map(extent; provider, figure = f, axis = ga);
throws this error:
ERROR: type GridLayout has no field autolimitaspect
Stacktrace:
[1] setproperty!
@ ~/.julia/packages/GridLayoutBase/lYdxT/src/gridlayout.jl:55 [inlined]
[2] Tyler.Map(extent::Extent{(:X, :Y), Tuple{Tuple{Int64, Int64}, Tuple{Int64, Int64}}}, extent_crs::MapTiles.WGS84; resolution::Tuple{Int64, Int64}, figure::Figure, axis::GridLayout, provider::Provider, crs::MapTiles.WebMercator, max_parallel_downloads::Int64, cache_size_gb::Int64, depth::Int64, halo::Float64, scale::Float64)
@ Tyler ~/.julia/packages/Tyler/mD1F5/src/Tyler.jl:126
[3] top-level scope
@ ~/Documents/GitHub/AltimPlots.jl/src/plot_data.jl:61
You need to pass an axis, and not a gridlayout slot!
I think you may be able to pass the ga to figure though, at least if you do fig[1:2, 1]
🤦 ..... well that should have been obvious..
just to close out:
This works
f = Figure(resolution=(1912 * scale, 2284 * scale))
ax = Axis(f[1:2, 1])
m = Tyler.Map(extent; provider, figure = f, axis = ax);
while this does not work
f = Figure(resolution=(1912 * scale, 2284 * scale))
m = Tyler.Map(extent; provider, figure = f[1:2, 1]);
@alex-s-gardner I think that autolimitaspect
getproperty is actually your code too 😂
So @rafaqz that error was only kicked cuz I was trying to ignoratly pass a gridlayout as an axis 🤦.
m = Tyler.Map(extent; provider, figure = f[1:2, 1]);
returns a different error related to the "title" keyword
ERROR: MethodError: no method matching display(::GridPosition; title::String)
Closest candidates are:
display(::Any) got unsupported keyword argument "title"
@ Base multimedia.jl:336
display(::Union{Figure, Makie.FigureAxisPlot, Scene}; backend, update, screen_config...)
@ Makie ~/.julia/packages/Makie/Iqcri/src/display.jl:110
display(::GLMakie.Screen, ::Scene; connect) got unsupported keyword argument "title"
@ GLMakie ~/.julia/packages/GLMakie/XSSSf/src/display.jl:1
I know I just thought that doing that hits the line where you set ax.autolimitaspect = 1
but maybe thats not true either
It did indeed !