AnsweredAssumed Answered

Adding null geometry to a map

Question asked by processing... on Oct 26, 2015
Latest reply on Oct 29, 2015 by processing...

I noticed that when bad data is used to create a Point graphic in a graphicLayer, a point is (seemingly) randomly placed on the map.

 

Specifically, the bad data is that graphic.geometry.x (and .y) is undefined.

 

The default map extent is about 4 when I add the point (in fact, I had a layer, then 5 points to the layer where all x and y are undefined). All points display in the middle of the USA. When I mouse scroll to zoom in/out, the points all move to the top-left visible coordinate of the map. From there, I can pan the map around, and the points stay still. The points reset to wherever the top-left visible x/y coordinate is on the map.

 

Any thoughts on what is happening? Why isn't there some kind of validation to not show anything? Bad data shouldn't result in unexpected visual data, no?

 

And yes, I'm adding validation on my end. I found a code path where I'm setting the geometry to the value of a jQuery .val() DOM element. Once I correct it, this isn't an issue. I'm just trying to understand it better.

 

This is for 3.14.

 

Thank you,
D

Outcomes