Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions staticmap/staticmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ def extent_px(self):


class IconMarker:
def __init__(self, coord, file_path, offset_x, offset_y):
def __init__(self, coord, file_path_or_img , offset_x, offset_y):
"""
:param coord: a lon-lat pair, eg (175.0, 0.0)
:type coord: tuple
:param file_path: path to icon
:type file_path: str
:type file_path_or_img: str / Image
:param offset_x: x position of the tip of the icon. relative to left bottom, in pixel
:type offset_x: int
:param offset_y: y position of the tip of the icon. relative to left bottom, in pixel
:type offset_y: int
"""
self.coord = coord
self.img = Image.open(file_path, 'r')
self.img = Image.open(file_path_or_img, 'r') if type(file_path_or_img) == type("") else file_path_or_img
self.offset = (offset_x, offset_y)

@property
Expand Down