aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-08-30 15:41:12 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-08-30 15:41:57 +0100
commitbc28ccfa79e384c7c58a266b98429ba390441758 (patch)
treebabc7bed8e1ab93c06d6acac6078b5481f33d332 /web
parented1d51af5496ac234a2365b9834308cfb88fd948 (diff)
Check resolutions exist before zooming asset layer
It is possible to get here on e.g. a /report/new page load where the asset is being shown but hasn't yet been added to the map.
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/assets.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/web/cobrands/fixmystreet/assets.js b/web/cobrands/fixmystreet/assets.js
index c653fe908..2cd93eb33 100644
--- a/web/cobrands/fixmystreet/assets.js
+++ b/web/cobrands/fixmystreet/assets.js
@@ -54,7 +54,7 @@ OpenLayers.Layer.VectorAsset = OpenLayers.Class(OpenLayers.Layer.Vector, {
// This function is called when the asset category is
// selected, and will zoom the map in to the first level that
// makes the asset layer visible if it's not already shown.
- if (!this.inRange) {
+ if (!this.inRange && this.resolutions) {
var firstVisibleResolution = this.resolutions[0];
var zoomLevel = fixmystreet.map.getZoomForResolution(firstVisibleResolution);
fixmystreet.map.zoomTo(zoomLevel);