Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overloaded IconMaker method #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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