Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If a point in PhotoSurvey feature service has no geometry the survey doesn't load correctly #97

Open
cosbyr opened this issue Oct 23, 2018 · 2 comments
Assignees

Comments

@cosbyr
Copy link
Contributor

cosbyr commented Oct 23, 2018

If the user has enabled the leaflet map the app crashes when a point has no geometry

We should probably just have the leaflet map default to 0,0 when it can't find a geometry on the point

@cosbyr
Copy link
Contributor Author

cosbyr commented Oct 23, 2018

May need to do something like this in main.js

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
     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);
     }
}

@cosbyr
Copy link
Contributor Author

cosbyr commented Nov 1, 2018

@ChrisBuscaglia
Tested above code and here's the results:

image

@cosbyr cosbyr self-assigned this Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant