Fix screen_to_map() (I think)
This commit is contained in:
parent
3ca6078cd1
commit
efcf426b77
1 changed files with 2 additions and 2 deletions
|
@ -47,8 +47,8 @@ class EquirectMap():
|
||||||
svg.render_layer(cr, None, rect)
|
svg.render_layer(cr, None, rect)
|
||||||
|
|
||||||
def screen_to_map(self, x: float, y: float) -> shapely.Point:
|
def screen_to_map(self, x: float, y: float) -> shapely.Point:
|
||||||
lon = self.bounds[3] + (x / self.width) * self.width
|
lon = (x / self.width) * self.map_width + self.bounds[3]
|
||||||
lat = self.bounds[0] + (y / self.height) * self.height
|
lat = self.height * self.map_height + self.bounds[2] + (y / self.height)
|
||||||
|
|
||||||
return shapely.Point(lon, lat)
|
return shapely.Point(lon, lat)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue