Skip to content

Commit 396043e

Browse files
authored
allow RGBA mapbox styles (#2553)
1 parent 98c1106 commit 396043e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/cartopy/io/img_tiles.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,8 @@ class MapboxStyleTiles(GoogleWTS):
505505
506506
"""
507507

508-
def __init__(self, access_token, username, map_id, cache=False):
508+
def __init__(self, access_token, username, map_id,
509+
desired_tile_form='RGB', cache=False):
509510
"""
510511
Set up a new instance to retrieve tiles from a Mapbox style.
511512
@@ -523,12 +524,15 @@ def __init__(self, access_token, username, map_id, cache=False):
523524
tiles will be retrieved through this process. Note that this style
524525
may be private and if your access token does not have permissions
525526
to view this style, then map tile retrieval will fail.
527+
desired_tile_form: optional
528+
The desired tile format. Use 'RGBA' if desired style includes
529+
transparency.
526530
527531
"""
528532
self.access_token = access_token
529533
self.username = username
530534
self.map_id = map_id
531-
super().__init__(cache=cache)
535+
super().__init__(cache=cache, desired_tile_form=desired_tile_form)
532536

533537
def _image_url(self, tile):
534538
x, y, z = tile

0 commit comments

Comments
 (0)