Coder Social home page Coder Social logo

Comments (4)

wmbeers avatar wmbeers commented on September 15, 2024

See also #72, a fairly reliable way to trigger this problem.

from cmv-app.

wmbeers avatar wmbeers commented on September 15, 2024

Errors captured when investigating this with the user:

description: "Unable to get property 'spatialReference' of undefined or null reference",
message: "Unable to get property 'spatialReference' of undefined or null reference",
name: "TypeError",
number: -2146823281,
stack: "TypeError: Unable to get property 'spatialReference' of undefined or null reference
at simplify (https://js.arcgis.com/3.29/:2697:351)
at Anonymous function (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:19670)
at _buildAnalysisAreaBufferEdits (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:19549)
at saveAnalysisAreaBuffers (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:7266)
at Anonymous function (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:6203)
at l (https://js.arcgis.com/3.29/:108:242)
at k (https://js.arcgis.com/3.29/:108:174)
at resolve (https://js.arcgis.com/3.29/:110:267)
at Anonymous function (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:7192)"
}

TypeError: Cannot read property 'spatialReference' of undefined
at Object.simplify ((index):2697)
at AoiEditor.js:formatted:793
at Array.forEach ()
at Object._buildAnalysisAreaBufferEdits (AoiEditor.js:formatted:787)
at Object.saveAnalysisAreaBuffers (AoiEditor.js:formatted:287)
at AoiEditor.js:formatted:229
at l ((index):108)
at k ((index):108)
at e.resolve ((index):110)
at callback (AoiEditor.js:formatted:274) "TypeError: Cannot read property 'spatialReference' of undefined
at Object.simplify (https://js.arcgis.com/3.29/:2697:362)
at https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:19706
at Array.forEach ()
at Object._buildAnalysisAreaBufferEdits (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:19558)
at Object.saveAnalysisAreaBuffers (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:7278)
at https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:6205
at l (https://js.arcgis.com/3.29/:108:248)
at k (https://js.arcgis.com/3.29/:108:174)
at e.resolve (https://js.arcgis.com/3.29/:110:267)
at callback (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:7111)
----------------------------------------
rejected at a (https://js.arcgis.com/3.29/:109:154)
at l (https://js.arcgis.com/3.29/:108:407)
at k (https://js.arcgis.com/3.29/:108:174)
at e.resolve (https://js.arcgis.com/3.29/:110:267)
at callback (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:7111)
at https://www.fla-etat.org/est/dwr3/engine.js:1037:35
at Object.logHandlerEx (https://www.fla-etat.org/est/dwr3/engine.js:2553:9)
at Object.handleCallback (https://www.fla-etat.org/est/dwr3/engine.js:1033:29)
at eval (eval at dwr.engine._executeScript (https://www.fla-etat.org/est/dwr3/engine.js:720:6), :10:19)
at eval (eval at dwr.engine._executeScript (https://www.fla-etat.org/est/dwr3/engine.js:720:6), :11:3)
----------------------------------------
Error
at e.then.b.then (https://js.arcgis.com/3.29/:111:77)
at Object.saveAnalysisAreasAndShowAnalysisOptions (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:6187)
at HTMLSpanElement. (https://www.fla-etat.org/est/secure/map/js/knockout-latest.js:6:42326)
at HTMLSpanElement.dispatch (https://code.jquery.com/jquery-3.3.1.min.js:2:41772)
at HTMLSpanElement.y.handle (https://code.jquery.com/jquery-3.3.1.min.js:2:39791)"
m @ (index):115
(anonymous) @ (index):115
filter @ (index):72
l @ (index):115

relevant minified/expanded (but enough to narrow down in real source) code:
_buildAnalysisAreaBufferEdits: function() {
var a = this;
this._buildAnalysisAreasFromFeatures(),
this.loadingOverlay.show("Constructing analysis area buffers...");
var e = this.layers.analysisAreaBuffer.graphics
, t = this.analysisAreas()
, n = {
adds: [],
updates: [],
deletes: e.filter(function(e) {
return !this.getAnalysisAreaModel(e.attributes.FK_PROJECT_ALT)
}, this)
}
, s = new b
, o = [];
return t.forEach(function(i) {
var r = new b
, e = i.features().map(function(e) {
return (e.buffer || e.graphic).geometry
});
o.push(r),
esriConfig.defaults.geometryService.simplify(e).then(function(e) {

Stepping through t.forEach above, altNumber=1, features [{...geometry.paths[42]... seems ok
But it still wants to try to work through the empty analysis area, even after I delete the feature and reload, and remnant record in t_project_alt_aoi is a problem somehow
reload whole viewer

from cmv-app.

wmbeers avatar wmbeers commented on September 15, 2024

Perhaps related, I note a few new issues not reported by users:

  • You can click Next from feature editing screen in circumstances when you shouldn't:
    • While actively drawing a polygon or line
    • Before drawing any features or after deleting all features
  • You can give a point or line feature a 0 buffer, resulting in failure somewhere along the way after clicking Next on Analysis Areas screen. Note the "todo validate"... comment on line 314.

from cmv-app.

wmbeers avatar wmbeers commented on September 15, 2024

Further testing with Mike today, we observed behavior which seems to indicate that clicking Next too quickly after finishing the creation of a line (not extracting) gets it into the state where the "Unable to get property 'spatialReference' of undefined or null reference" exception occurs. First attempt to fix will be disabling the Next button while the user is interactively working on a feature (still in drawing mode, or a recent drag of a feature vertex), and re-enabling after on-the-fly saving is complete.

from cmv-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.