From 607f6f963e69c1d82ee411015a3dd905b54322ef Mon Sep 17 00:00:00 2001 From: Ryan Cosby Date: Thu, 1 Nov 2018 14:25:24 -0700 Subject: [PATCH] #97 default overview map to 0,0 when feature has no geometry --- js/app/main.js | 10 ++++++++-- js/app/survey.js | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/js/app/main.js b/js/app/main.js index d778741..51b06a8 100644 --- a/js/app/main.js +++ b/js/app/main.js @@ -531,8 +531,14 @@ define(['lib/i18n.min!nls/resources.js', 'prepareAppConfigInfo', 'handleUserSign if (prepareAppConfigInfo.appParams.includeOverviewMap) { // Jump the overview map to candidate.obj.geometry after transforming to lat/long; // we've asked the server to give us the geometry in lat/long (outSR=4326) for Leaflet - main.overviewMap.setView([candidate.obj.geometry.y, candidate.obj.geometry.x], - prepareAppConfigInfo.appParams.overviewMapZoom); + if (candidate.obj.hasOwnProperty('geometry')){ + main.overviewMap.setView([candidate.obj.geometry.y, candidate.obj.geometry.x], + prepareAppConfigInfo.appParams.overviewMapZoom); + } + else{ + main.overviewMap.setView([0, 0], + prepareAppConfigInfo.appParams.overviewMapZoom); + } } // Gallery diff --git a/js/app/survey.js b/js/app/survey.js index fd56f83..73981ff 100644 --- a/js/app/survey.js +++ b/js/app/survey.js @@ -313,7 +313,7 @@ define([], function () { }, /** - * Creates a survey form in the specified element. + * Checks to see that button, list, and dropdown questio styles have a domain set * @param {object} questionInfo Survey question, which contains question, field, style, domain, important */ _checkDomain: function(questionInfo){