Add draw_base_map_from_file()
This commit is contained in:
parent
10fe96a642
commit
5484fb3bb8
1 changed files with 5 additions and 0 deletions
|
@ -46,6 +46,11 @@ class EquirectMap():
|
||||||
|
|
||||||
svg.render_layer(cr, None, rect)
|
svg.render_layer(cr, None, rect)
|
||||||
|
|
||||||
|
def draw_base_map_from_file(self,
|
||||||
|
cr: cairo.Context,
|
||||||
|
path: str):
|
||||||
|
return self.draw_from_file(cr, path, 0, 0, self.width, self.height)
|
||||||
|
|
||||||
def screen_to_map(self, x: float, y: float) -> shapely.Point:
|
def screen_to_map(self, x: float, y: float) -> shapely.Point:
|
||||||
lon = (x / self.width) * self.map_width + self.bounds[3]
|
lon = (x / self.width) * self.map_width + self.bounds[3]
|
||||||
lat = self.height * self.map_height + self.bounds[2] + (y / self.height)
|
lat = self.height * self.map_height + self.bounds[2] + (y / self.height)
|
||||||
|
|
Loading…
Add table
Reference in a new issue