# Need Help with Tyler.jl

**URL:** <https://discourse.julialang.org/t/need-help-with-tyler-jl/122295>\
**Category:** General Usage\
**Created:** [November 5, 2024, 3:55pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295 "2024-11-05T15:55:44Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elvander](https://avatars.discourse-cdn.com/v4/letter/e/47e85d/32.png) [@Elvander](https://discourse.julialang.org/u/Elvander)\
**Post date:** [November 5, 2024, 3:55pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/1 "2024-11-05T15:55:44Z")

</div>

I wish to plot a simple map of some EU country and superpose dots and lines ; This is supposedly simple, but alas - it doesnt work for me .

```julia
# For plots
using Tyler
using GLMakie
using GeoMakie
using Tyler.TileProviders
using Tyler.MapTiles
using Tyler.Extents

#
long = [40.4483, 40.4079]
latt = [-3.88463, -3.90931]

# Start plotting 
GLMakie.activate!(inline=false)

# Création de la figure
fig = Figure(; size = (800, 600))
#display(fig, px_per_unit = 2)

# Ajout de l'arrière-plan de la carte avec Tyler
ax = Axis(fig[1, 1]) #, title = "Spain map")
prov = Esri(:WorldImagery)
extent = Rect2f(-9, 35, 13, 10) #

# Charger les tuiles de la carte
tm = Tyler.Map(extent; provider=prov, figure=fig, axis=ax);

pts = Point2f(MapTiles.project((long,latt), MapTiles.wgs84, MapTiles.web_mercator))
objscatter = scatter!(tm.axis, pts; color = :red, markersize = 5, marker = :circle)

```

Produces the error:

```julia
ERROR: MethodError: no method matching getindex(::typeof(Makie.Combined))
Stacktrace:
 [1] Tyler.Map(extent::GeometryBasics.HyperRectangle{2, Float32}, extent_crs::MapTiles.WGS84; resolution::Tuple{Int64, Int64}, figure::Figure, axis::Axis, provider::Provider, crs::MapTiles.WebMercator, max_parallel_downloads::Int64, cache_size_gb::Int64, depth::Int64, halo::Float64, scale::Float64, max_zoom::Int64)
   @ Tyler C:\Users\XXYXYXYX\.julia\packages\Tyler\u3wcB\src\Tyler.jl:141
 [2] top-level scope
   @test.jl:26

```

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [November 8, 2024, 1:40pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/3 "2024-11-08T13:40:41Z")

</div>

Looks like an old tyler version.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [November 8, 2024, 2:20pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/4 "2024-11-08T14:20:41Z")

</div>

Two things that in error. 1) `lon` and `lat` are swapped. 2) Minimum latitude is greater than max latitude.  
With GMT that gives Bing images by default

```julia
using GMT

I = mosaic([-3.90931, -3.88463], [40.4079, 40.4483])
viz(I)

```

A low res image of the above.

 ![valencia-fs8](https://global.discourse-cdn.com/julialang/original/3X/5/8/58d8d5a3d74aa0ada6bcdcd53515410dec9da24e.jpeg)

---

<div class="post-metadata">

**Author:** ![Elvander](https://avatars.discourse-cdn.com/v4/letter/e/47e85d/32.png) [@Elvander](https://discourse.julialang.org/u/Elvander)\
**Post date:** [November 8, 2024, 2:54pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/5 "2024-11-08T14:54:58Z")

</div>

I have Tyler version v0.1.5 - the 0.2.0 version seems to have some conflict:

```julia
Pkg.add(PackageSpec(name="Tyler", version="0.2.0"))
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package PointClouds [3cc211ed]:
 PointClouds [3cc211ed] log:
 ├─possible versions are: 0.3.0-0.4.0 or uninstalled
 ├─restricted by julia compatibility requirements to versions: uninstalled
 └─restricted by compatibility requirements with Tyler [e170d443] to versions: 0.3.0-0.3.1 — no versions left
   └─Tyler [e170d443] log:
     ├─possible versions are: 0.1.0-0.2.0 or uninstalled
     └─restricted to versions 0.2.0 by an explicit requirement, leaving only versions: 0.2.0

```

---

<div class="post-metadata">

**Author:** ![Elvander](https://avatars.discourse-cdn.com/v4/letter/e/47e85d/32.png) [@Elvander](https://discourse.julialang.org/u/Elvander)\
**Post date:** [November 8, 2024, 2:56pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/6 "2024-11-08T14:56:55Z")

</div>

Swapping them resulted in the same error ;

I used GMT before, but for some reason that stopped plotting anything without changing either my code or data ; This is why I turned to GLMakie / Tyler

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [November 8, 2024, 3:02pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/7 "2024-11-08T15:02:06Z")

</div>

One normally open issues in the package site to try to fix whatever error is causing that behavior.

---

<div class="post-metadata">

**Author:** ![lazarusA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lazarusa/32/6571_2.png) [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Post date:** [November 8, 2024, 3:26pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/8 "2024-11-08T15:26:43Z")

</div>

the issue is the MapTiles.project function, that only works for pairs of points, not arrays. But even doing that, the marker is being hidden, this doesn’t fail now, but we don’t see the marker, something broke this recently @sdanisch ?

```julia
using GLMakie
GLMakie.activate!()

# using GeoMakie
using Tyler
using Tyler.TileProviders
using Tyler.MapTiles
using Tyler.Extents

#
latt = [40.4483, 40.4079]
long = [-3.90931, -3.88463]

function to_web_mercator(lo,lat)
    return Point2f(MapTiles.project((lo,lat), MapTiles.wgs84, MapTiles.web_mercator))
end

pts = to_web_mercator.(long,latt)

fig = Figure(; size = (800, 600))
#display(fig, px_per_unit = 2)

# Ajout de l'arrière-plan de la carte avec Tyler
ax = Axis(fig[1, 1]) #, title = "Spain map")
prov = Esri(:WorldImagery)
extent = Rect2f(-9, 35, 13, 10) #
# lon, lat, delta, delta
# Charger les tuiles de la carte
tm = Tyler.Map(extent; provider=prov, figure=fig, axis=ax);

objscatter = scatter!(ax, pts; color = :red,
    marker = '⭐', markersize = 50)
translate!(objscatter, 0, 0, 2)
# limits!(ax, Rect2f(data_limits(objscatter)))
fig

```

edit: lon and lat were reversed ☹ , now all is fine 😃

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [November 8, 2024, 3:39pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/9 "2024-11-08T15:39:30Z")

</div>

I think the marker thing might be this issue I recently encountered:

> <https://github.com/MakieOrg/Tyler.jl/issues/109>
>
> The "Add points, polygons and text to a map" example (\[here\](https://makieorg.gi…thub.io/Tyler.jl/v0.1.4/points\_poly\_text)) duplicated below conceals the star point when I zoom about 10 mouse clicks. It seems to be that the point is printed over when the tiles update.
> 
> \`\`\`
> using Tyler, GLMakie
> using Tyler.TileProviders
> using Tyler.MapTiles
> using Tyler.Extents
> 
> provider = TileProviders.Esri(:WorldImagery)
> 
> \# point location to add to map
> lat = 34.2013;
> lon = -118.1714;
> pts = Point2f(MapTiles.project((lon,lat), MapTiles.wgs84, MapTiles.web\_mercator))
> delta = 1
> extent = Extent(X = (lon - delta/2, lon + delta/2), Y = (lat-delta/2, lat+delta/2));
> 
> m = Tyler.Map(extent; provider, figure=Figure(; size=(1000, 600)))
> \# wait for tiles to fully load
> wait(m)
> 
> objscatter = scatter!(m.axis, pts; color = :red,
> marker = '⭐', markersize = 50)
> \# hide ticks, grid and lables
> hidedecorations!(m.axis)
> \# hide frames
> hidespines!(m.axis)
> \# Plot a plygon on the map
> p1 = (lon-delta/8, lat-delta/8)
> p2 = (lon-delta/8, lat+delta/8)
> p3 = (lon+delta/8, lat+delta/8)
> p4 = (lon+delta/8, lat-delta/8)
> 
> polyg = MapTiles.project.(\[p1, p2, p3, p4\], Ref(MapTiles.wgs84), Ref(MapTiles.web\_mercator))
> polyg = Point2f.(polyg)
> poly!(polyg; color = :transparent, strokecolor = :black, strokewidth = 5)
> 
> \# Add text
> pts2 = Point2f(MapTiles.project((lon,lat-delta/6), MapTiles.wgs84, MapTiles.web\_mercator))
> text!(pts2, text = "Basic Example"; fontsize = 30,
> color = :darkblue, align = (:center, :center)
> )
> m
> 
> \#10 mouse clicks and star disappears
> \`\`\`

---

<div class="post-metadata">

**Author:** ![lazarusA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lazarusa/32/6571_2.png) [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Post date:** [November 8, 2024, 3:41pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/10 "2024-11-08T15:41:07Z")

</div>

yes, it works for the example in the docs, but weirdly enough not for this case… so, it seems like something buggy is actually happening here.

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [November 8, 2024, 3:42pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/11 "2024-11-08T15:42:57Z")

</div>

It did look to my, like the markers are outside the region (extent)?

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [November 8, 2024, 3:47pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/12 "2024-11-08T15:47:08Z")

</div>

try: `limits!(ax, Rect2f(data_limits(objscatter)))` and it will take you outside the map… Which makes sense since the values are outside the extend from the beginning!

---

<div class="post-metadata">

**Author:** ![lazarusA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lazarusa/32/6571_2.png) [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Post date:** [November 8, 2024, 3:56pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/13 "2024-11-08T15:56:40Z")

</div>

thanks! I updated my answer, now it works fine 😃

---

<div class="post-metadata">

**Author:** ![Elvander](https://avatars.discourse-cdn.com/v4/letter/e/47e85d/32.png) [@Elvander](https://discourse.julialang.org/u/Elvander)\
**Post date:** [November 8, 2024, 4:09pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/14 "2024-11-08T16:09:35Z")

</div>

I took exactly the code above, and it does not work:

```julia
# For plots
using GLMakie
GLMakie.activate!()

using Tyler
using Tyler.TileProviders
using Tyler.MapTiles
using Tyler.Extents

#
long = [40.4483, 40.4079]
latt = [-3.88463, -3.90931]

function to_web_mercator(lat,lo)
    return Point2f(MapTiles.project((lat,lo), MapTiles.wgs84, MapTiles.web_mercator))
end
pts = to_web_mercator.(latt,long)

# Création de la figure
fig = Figure(; size = (800, 600))

# Ajout de l'arrière-plan de la carte avec Tyler
ax = Axis(fig[1, 1]) #, title = "Spain map")
prov = Esri(:WorldImagery)
extent = Rect2f(-9, 35, 13, 10) #

# Charger les tuiles de la carte
tm = Tyler.Map(extent; provider=prov, figure=fig, axis=ax);

objscatter = scatter!(ax, pts; color = :red, marker = '⭐', markersize = 50)
translate!(objscatter, 0, 0, 2)
limits!(ax, Rect2f(data_limits(objscatter)))

fig

```

This still gives:

```julia
ERROR: MethodError: no method matching getindex(::typeof(Makie.Combined))
Stacktrace:
 [1] Tyler.Map(extent::GeometryBasics.HyperRectangle{2, Float32}, extent_crs::MapTiles.WGS84; resolution::Tuple{Int64, Int64}, figure::Figure, axis::Axis, provider::Provider, crs::MapTiles.WebMercator, max_parallel_downloads::Int64, cache_size_gb::Int64, depth::Int64, halo::Float64, scale::Float64, max_zoom::Int64)
   @ Tyler C:\Users\d34552\.julia\packages\Tyler\u3wcB\src\Tyler.jl:141
 [2] top-level scope

```

---

<div class="post-metadata">

**Author:** ![lazarusA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lazarusa/32/6571_2.png) [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Post date:** [November 8, 2024, 4:18pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/15 "2024-11-08T16:18:48Z")

</div>

please, verify that you have the latest versions:

```julia
(docs) pkg> st GLMakie Tyler
Status `~/Documents/Tyler.jl/docs/Project.toml`
  [e9467ef8] GLMakie v0.10.16
  [e170d443] Tyler v0.2.0 `..`

```

---

<div class="post-metadata">

**Author:** ![Elvander](https://avatars.discourse-cdn.com/v4/letter/e/47e85d/32.png) [@Elvander](https://discourse.julialang.org/u/Elvander)\
**Post date:** [November 8, 2024, 4:26pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/16 "2024-11-08T16:26:10Z")

</div>

I dont ; Pkg.update(“Tyler”) keeps met at 0.1.5 ; what must be done to move it to 0.2.0 ?

```julia
Pkg.add(Pkg.PackageSpec(name="Tyler", version="0.2.0"))
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package PointClouds [3cc211ed]:
 PointClouds [3cc211ed] log:
 ├─possible versions are: 0.3.0-0.4.0 or uninstalled
 ├─restricted by julia compatibility requirements to versions: uninstalled
 └─restricted by compatibility requirements with Tyler [e170d443] to versions: 0.3.0-0.3.1 — no versions left
   └─Tyler [e170d443] log:
     ├─possible versions are: 0.1.0-0.2.0 or uninstalled
     └─restricted to versions 0.2.0 by an explicit requirement, leaving only versions: 0.2.0

```

But

```julia
Pkg.add("PointClouds")
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package PointClouds [3cc211ed]:
 PointClouds [3cc211ed] log:
 ├─possible versions are: 0.3.0-0.4.0 or uninstalled
 ├─restricted to versions * by an explicit requirement, leaving only versions: 0.3.0-0.4.0
 └─restricted by julia compatibility requirements to versions: uninstalled — no versions left

```

I can not remove this PointClouds package either nor update ;

---

<div class="post-metadata">

**Author:** ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)\
**Post date:** [November 8, 2024, 5:27pm UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/17 "2024-11-08T17:27:59Z")

</div>

> [@Elvander](#):
>
> `restricted by julia compatibility requirements`

What version of julia are you running? [History for Project.toml - efpl-columbia/PointClouds.jl · GitHub](https://github.com/efpl-columbia/PointClouds.jl/commits/main/Project.toml) indicates that PointClouds 0.3 and later requires version julia 1.10.

---

<div class="post-metadata">

**Author:** ![Elvander](https://avatars.discourse-cdn.com/v4/letter/e/47e85d/32.png) [@Elvander](https://discourse.julialang.org/u/Elvander)\
**Post date:** [November 14, 2024, 9:59am UTC](https://discourse.julialang.org/t/need-help-with-tyler-jl/122295/18 "2024-11-14T09:59:07Z")

</div>

Thanks - after going to v1.11 allowing for an update of all the packages and multiple reboots it now plots the test !
