Skip to content

Commit

Permalink
Fix projecting of draw tool data
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jul 9, 2018
1 parent ab93f86 commit ba29eae
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions geoviews/plotting/bokeh/callbacks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy as np
import cartopy.crs as ccrs

from holoviews.plotting.bokeh.callbacks import (
RangeXYCallback, BoundsCallback, BoundsXCallback, BoundsYCallback,
Expand Down Expand Up @@ -84,10 +83,11 @@ def project_drawn(cb, msg):
stream.update(data=msg['data'])
element = stream.element
stream.update(data=old_data)
if element.crs == ccrs.GOOGLE_MERCATOR or not isinstance(element, _Element):
proj = cb.plot.projection
if element.crs == proj or not isinstance(element, _Element):
return None
crs = element.crs
element.crs = ccrs.GOOGLE_MERCATOR
element.crs = proj
return project(element, projection=crs)


Expand Down Expand Up @@ -217,8 +217,7 @@ def _process_msg(self, msg):
xd, yd = projected.kdims
data['xs'] = data.pop(xd.name)
data['ys'] = data.pop(yd.name)
msg['data'] = data
return msg
return {'data': data}


class GeoPointDrawCallback(PointDrawCallback):
Expand Down

0 comments on commit ba29eae

Please sign in to comment.