diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d20d89..8b5f00a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [1.8.4] - 2023-11-08 +### Updated +- Basemap api updated to use open street map [#138](https://github.com/IN-CORE/pyincore-viz/issues/138) + +### Fixed +- Ipyleaflet map centering problem when map is called [#140](https://github.com/IN-CORE/pyincore-viz/issues/140) + ## [1.8.3] - 2023-08-16 ### Changed - Pytest changed to use micromamba [#128](https://github.com/IN-CORE/pyincore-viz/issues/128) diff --git a/docs/source/conf.py b/docs/source/conf.py index 5472a75..43ad713 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -33,7 +33,7 @@ # The short X.Y version version = '1.8' # The full version, including alpha/beta/rc tags -release = '1.8.3' +release = '1.8.4' # -- General configuration --------------------------------------------------- diff --git a/pyincore_viz/geoutil.py b/pyincore_viz/geoutil.py index 90668c5..688375e 100644 --- a/pyincore_viz/geoutil.py +++ b/pyincore_viz/geoutil.py @@ -947,7 +947,7 @@ def get_ipyleaflet_map_with_center_location(cen_lon, cen_lat, zoom_level): obj: An ipyleaflet map. """ - map = ipylft.Map(center=(cen_lon, cen_lat), zoom=zoom_level, basemap=ipylft.basemaps.Stamen.Toner, + map = ipylft.Map(center=(cen_lon, cen_lat), zoom=zoom_level, basemap=ipylft.basemaps.OpenStreetMap.Mapnik, crs=projections.EPSG3857, scroll_wheel_zoom=True) return map @@ -963,13 +963,17 @@ def get_ipyleaflet_map(bbox=None): obj: An ipyleaflet map. """ - map = ipylft.Map(basemap=ipylft.basemaps.Stamen.Toner, zoom=10, + map = ipylft.Map(basemap=ipylft.basemaps.OpenStreetMap.Mapnik, zoom=10, crs=projections.EPSG3857, scroll_wheel_zoom=True) if bbox is not None: # the boundary information should be converted to ipyleaflet code boundary bounds = GeoUtil.convert_bound_to_ipylft_format(bbox) map.fit_bounds(bounds) + # get center for different jupyter versions + center = GeoUtil.calc_center_from_bbox(bbox) + # need to reverse x and y + map.center = [center[1], center[0]] map.add_control(ipylft.LayersControl(position='topright')) map.add_control(ipylft.FullScreenControl(position='topright')) diff --git a/pyincore_viz/globals.py b/pyincore_viz/globals.py index 821493b..aa8270c 100644 --- a/pyincore_viz/globals.py +++ b/pyincore_viz/globals.py @@ -8,7 +8,7 @@ import logging from logging import config as logging_config -PACKAGE_VERSION = "1.8.3" +PACKAGE_VERSION = "1.8.4" INCORE_GEOSERVER_WMS_URL = "https://incore.ncsa.illinois.edu/geoserver/incore/wms" INCORE_GEOSERVER_DEV_WMS_URL = "https://incore-dev.ncsa.illinois.edu/geoserver/incore/wms" diff --git a/pyincore_viz/tabledatasetlistmap.py b/pyincore_viz/tabledatasetlistmap.py index 31c6707..a8a03ff 100644 --- a/pyincore_viz/tabledatasetlistmap.py +++ b/pyincore_viz/tabledatasetlistmap.py @@ -18,7 +18,8 @@ class TableDatasetListMap: """Mapping class for visualizing list of Table Dataset""" def __init__(self): - self.map = ipylft.Map(center=(0, 0), zoom=12, basemap=ipylft.basemaps.Stamen.Toner, scroll_wheel_zoom=True) + self.map = ipylft.Map(center=(0, 0), zoom=12, basemap=ipylft.basemaps.OpenStreetMap.Mapnik, + scroll_wheel_zoom=True) def create_basemap_ipylft(self, geo_dataframe, title_list): """Creates map window with given inventory with multiple table dataset file using folder location. @@ -36,7 +37,7 @@ def create_basemap_ipylft(self, geo_dataframe, title_list): # create base ipyleaflet map self.map = ipylft.Map(center=(cen_x, cen_y), zoom=12, - basemap=ipylft.basemaps.Stamen.Toner, scroll_wheel_zoom=True) + basemap=ipylft.basemaps.OpenStreetMap.Mapnik, scroll_wheel_zoom=True) # add map widgets self.map = self.create_map_widgets(title_list, self.map, geo_dataframe) diff --git a/recipes/meta.yaml b/recipes/meta.yaml index 825c3b8..fffacb0 100644 --- a/recipes/meta.yaml +++ b/recipes/meta.yaml @@ -1,5 +1,5 @@ {% set name = "pyincore-viz" %} -{% set version = "1.8.3" %} +{% set version = "1.8.4" %} package: name: {{ name|lower }} diff --git a/setup.py b/setup.py index a87c6a0..df9988b 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from setuptools import setup, find_packages # version number of pyincore -version = '1.8.3' +version = '1.8.4' with open("README.rst", encoding="utf-8") as f: readme = f.read()