This resolves #243, an issue where only a subset of results with locations where showing on the map search results page.
The issue was the check for primaryHandlerId: when a search result had no primaryHandlerId, the loop skipped rendering the map marker.
A primaryHandlerId is needed for rendering a thumbURL, but not every match will have a thumbnail (assets that are "metadata only" won't have a primaryHandlerId, but they will still have a location).
This PR allows imgSrc to be null, and instead skips any matches without locations.
An additional issue was uncovered once all map markers started loading: Maximum recursive updates exceeded.
This was caused by a conflict between the watchers on markers (vue api) and the event listener for styledata changes (mapbox api). I think the old watchers on markers were before we started clustering map markers on zoom. Map clustering requires rending markers a different way. So, I've removed the old watch on the markers. (I didn't see a noticeable change in performance, but it stopped the vue warnings.)
This resolves #243, an issue where only a subset of results with locations where showing on the map search results page.
The issue was the check for
primaryHandlerId
: when a search result had noprimaryHandlerId
, the loop skipped rendering the map marker.A
primaryHandlerId
is needed for rendering a thumbURL, but not every match will have a thumbnail (assets that are "metadata only" won't have aprimaryHandlerId
, but they will still have a location).This PR allows
imgSrc
to be null, and instead skips any matches without locations.An additional issue was uncovered once all map markers started loading:
Maximum recursive updates exceeded.
This was caused by a conflict between the
watch
ers onmarkers
(vue api) and the event listener forstyledata
changes (mapbox api). I think the oldwatch
ers onmarkers
were before we started clustering map markers on zoom. Map clustering requires rending markers a different way. So, I've removed the oldwatch
on the markers. (I didn't see a noticeable change in performance, but it stopped the vue warnings.)