From 0e49d14876960eb52bfd34cea5488e19f54df1d9 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Mon, 21 Sep 2020 12:57:54 +0200 Subject: [PATCH] Handle proj4.js API change in Hover formatter (#472) * Handle proj4.js API change in Hover formatter * Update travis --- .travis.yml | 7 ++++--- geoviews/plotting/bokeh/__init__.py | 6 +++++- geoviews/plotting/bokeh/plot.py | 6 +++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index e86bb94b..a85baf8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,12 @@ -language: generic -sudo: false +language: python + os: - linux +dist: xenial + env: global: - - PYENV_VERSION=3.7 - PYTHON_VERSION=3.7 - PKG_TEST_PYTHON="--test-python=py37" - CHANS_DEV="-c pyviz/label/dev -c bokeh" diff --git a/geoviews/plotting/bokeh/__init__.py b/geoviews/plotting/bokeh/__init__.py index 373fc9ba..658dd7f2 100644 --- a/geoviews/plotting/bokeh/__init__.py +++ b/geoviews/plotting/bokeh/__init__.py @@ -119,7 +119,11 @@ class GeoRasterPlot(GeoPlot, RasterPlot): var projections = Bokeh.require("core/util/projections"); var x = special_vars.x var y = special_vars.y - var coords = projections.wgs84_mercator.inverse([x, y]) + if (projections.wgs84_mercator.invert == null) { + var coords = projections.wgs84_mercator.inverse([x, y]) + } else { + var coords = projections.wgs84_mercator.invert(x, y) + } return "" + (coords[%d]).toFixed(4) """ diff --git a/geoviews/plotting/bokeh/plot.py b/geoviews/plotting/bokeh/plot.py index 19b81bc2..2b8a2796 100644 --- a/geoviews/plotting/bokeh/plot.py +++ b/geoviews/plotting/bokeh/plot.py @@ -52,7 +52,11 @@ class GeoPlot(ProjectionPlot, ElementPlot): var projections = Bokeh.require("core/util/projections"); var x = special_vars.data_x var y = special_vars.data_y - var coords = projections.wgs84_mercator.inverse([x, y]) + if (projections.wgs84_mercator.invert == null) { + var coords = projections.wgs84_mercator.inverse([x, y]) + } else { + var coords = projections.wgs84_mercator.invert(x, y) + } return "" + (coords[%d]).toFixed(4) """