Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
flopp committed Apr 9, 2024
1 parent 39a5750 commit e3db922
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion examples/custom_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def render_pillow(self, renderer: staticmaps.PillowRenderer) -> None:
x, y = renderer.transformer().ll2pixel(self.latlng())
x = x + renderer.offset_x()

tw, th = renderer.draw().textsize(self._text)
left, top, right, bottom = renderer.draw().textbbox((0, 0), self._text)
th = bottom - top
tw = right - left
w = max(self._arrow, tw + 2 * self._margin)
h = th + 2 * self._margin

Expand Down
2 changes: 1 addition & 1 deletion examples/frankfurt_newyork.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import staticmaps

context = staticmaps.Context()
context.set_tile_provider(staticmaps.tile_provider_StamenToner)
context.set_tile_provider(staticmaps.tile_provider_ArcGISWorldImagery)

frankfurt = staticmaps.create_latlng(50.110644, 8.682092)
newyork = staticmaps.create_latlng(40.712728, -74.006015)
Expand Down
2 changes: 1 addition & 1 deletion examples/geodesic_circles.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import staticmaps

context = staticmaps.Context()
context.set_tile_provider(staticmaps.tile_provider_StamenToner)
context.set_tile_provider(staticmaps.tile_provider_OSM)

center1 = staticmaps.create_latlng(66, 0)
center2 = staticmaps.create_latlng(0, 0)
Expand Down

0 comments on commit e3db922

Please sign in to comment.