Skip to content

Example conceals points on zoom #109

@jademackay

Description

@jademackay

The "Add points, polygons and text to a map" example (here) 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions