From 95ee4007072ccf0dd600906eb494732caf26e674 Mon Sep 17 00:00:00 2001 From: Kelly Innes Date: Mon, 9 Sep 2019 14:36:30 -0400 Subject: [PATCH] Fix bug which prevented marker layer from loading Previous work to encode the querystring into the tile cachekey mixed up some function arguments. In turn this prevents the vector tile facilities layer from loading. Additionally: the function extracted to create the tileURL was unconditionally requesting the facility grid layer, which would cause the markers layer to load as a grid, too. This change fixes the bug so that the marker layer will render correctly. --- CHANGELOG.md | 1 + src/app/src/components/VectorTileFacilitiesLayer.jsx | 4 ++-- src/app/src/util/util.js | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1f5974d3..49624172f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Fix a bug which prevented the facility claims dashboard page header from loading [#778](https://github.com/open-apparel-registry/open-apparel-registry/pull/778) +- Fix a bug which prevented the vector tile marker layer from rendering [#782](https://github.com/open-apparel-registry/open-apparel-registry/pull/782) ## [2.10.0] - 2019-08-22 ### Added diff --git a/src/app/src/components/VectorTileFacilitiesLayer.jsx b/src/app/src/components/VectorTileFacilitiesLayer.jsx index 2ee47c2e0..e28507055 100644 --- a/src/app/src/components/VectorTileFacilitiesLayer.jsx +++ b/src/app/src/components/VectorTileFacilitiesLayer.jsx @@ -348,8 +348,8 @@ function mapStateToProps({ vectorTileLayer: { key }, }) { const querystring = createQueryStringFromSearchFilters(filters); - const tileCacheKey = createTileCacheKeyWithEncodedFilters(querystring, key); - const tileURL = createTileURLWithQueryString(filters, tileCacheKey); + const tileCacheKey = createTileCacheKeyWithEncodedFilters(filters, key); + const tileURL = createTileURLWithQueryString(querystring, tileCacheKey, false); return { tileURL, diff --git a/src/app/src/util/util.js b/src/app/src/util/util.js index f727d693c..4c98bc04c 100644 --- a/src/app/src/util/util.js +++ b/src/app/src/util/util.js @@ -277,8 +277,10 @@ export const getContributorFromQueryString = (qs) => { return parseInt(contributor, 10); }; -export const createTileURLWithQueryString = (qs, key) => - `/tile/facilitygrid/${key}/{z}/{x}/{y}.pbf`.concat(isEmpty(qs) ? '' : `?${qs}`); +export const createTileURLWithQueryString = (qs, key, grid = true) => + `/tile/${grid ? 'facilitygrid' : 'facilities'}/${key}/{z}/{x}/{y}.pbf`.concat( + isEmpty(qs) ? '' : `?${qs}`, + ); export const createTileCacheKeyWithEncodedFilters = (filters, key) => `${key}-${hash(filters).slice(0, 8)}`;