Skip to content

Commit 4307d29

Browse files
authored
add reset_limits kwarg, disambiguate some function calls (#294)
* add a reset_limits kwarg to GeoAxis, to control insertion behaviour * minor fixes for crs * Bump patch version
1 parent eeacf36 commit 4307d29

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GeoMakie"
22
uuid = "db073c08-6b98-4ee5-b6a4-5efafb3259c6"
33
authors = ["Makie.jl Contributors"]
4-
version = "0.7.8"
4+
version = "0.7.9"
55

66
[deps]
77
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"

src/geoaxis.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,15 +823,24 @@ end
823823

824824
# This is where we override the stuff to make it our stuff.
825825
function Makie.plot!(axis::GeoAxis, plot::Makie.AbstractPlot)
826+
# deal with setting the transform_func correctly
826827
source = pop!(plot.kw, :source, axis.source)
827828
transformfunc = lift(create_transform, axis.dest, source)
828-
trans = Transformation(transformfunc; get(plot.kw, :transformation, Attributes())...)
829+
830+
trans = Makie.Transformation(transformfunc; get(plot.kw, :transformation, Attributes())...)
829831
plot.kw[:transformation] = trans
832+
833+
# remove the reset_limits kwarg if there is one, this determines whether to automatically reset limits
834+
# on plot insertion
835+
reset_limits = to_value(pop!(plot.kw, :reset_limits, true))
836+
837+
# actually plot
830838
Makie.plot!(axis.scene, plot)
839+
831840
# some area-like plots basically always look better if they cover the whole plot area.
832841
# adjust the limit margins in those cases automatically.
833-
Makie.needs_tight_limits(plot) && Makie.tightlimits!(axis)
834-
if Makie.is_open_or_any_parent(axis.scene)
842+
Makie.needs_tight_limits(plot) && reset_limits && Makie.tightlimits!(axis)
843+
if Makie.is_open_or_any_parent(axis.scene) && reset_limits
835844
Makie.reset_limits!(axis)
836845
end
837846
return plot

src/projection.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,5 +153,5 @@ Return a PROJ-compatible string from a GeoFormatTypes CRS object.
153153
"""
154154
function gft2str end
155155
gft2str(crs::GeoFormatTypes.EPSG{1}) = String("EPSG:$(GeoFormatTypes.val(crs))")
156-
gft2str(crs::GeoFormatTypes.CoordinateReferenceSystemFormat) = string(GeoFormatTypes.val(crs))
157-
gft2str(crs::GeoFormatTypes.WellKnownText{GeoFormatTypes.CRS}) = string(GeoFormatTypes.val(crs))
156+
gft2str(crs::GeoFormatTypes.CoordinateReferenceSystemFormat) = Base.convert(String, crs)
157+
gft2str(crs::GeoFormatTypes.WellKnownText{GeoFormatTypes.CRS}) = Base.convert(String, crs)

0 commit comments

Comments
 (0)