Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tyler + GridLayout throws error #46

Closed
alex-s-gardner opened this issue May 12, 2023 · 7 comments
Closed

Tyler + GridLayout throws error #46

alex-s-gardner opened this issue May 12, 2023 · 7 comments

Comments

@alex-s-gardner
Copy link
Contributor

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
@SimonDanisch
Copy link
Member

You need to pass an axis, and not a gridlayout slot!

@SimonDanisch
Copy link
Member

I think you may be able to pass the ga to figure though, at least if you do fig[1:2, 1]

@alex-s-gardner
Copy link
Contributor Author

🤦 ..... 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]);

@rafaqz
Copy link
Collaborator

rafaqz commented May 12, 2023

@alex-s-gardner I think that autolimitaspect getproperty is actually your code too 😂

@alex-s-gardner
Copy link
Contributor Author

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

@rafaqz
Copy link
Collaborator

rafaqz commented May 12, 2023

I know I just thought that doing that hits the line where you set ax.autolimitaspect = 1 but maybe thats not true either

@alex-s-gardner
Copy link
Contributor Author

It did indeed !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants