I have a problem I could use some help with. In our application we have multiple FeatureLayers and on some of these layers a user can draw new objects.
When a user draws a new object, lets call it a tent (any type of Geometry), I need to check if the position is valid. The object is valid when it does not consume the same position as a building. The buildings are stored on a separate featureLayer that is stored on a MapServer (and loaded in the browser). The drawing, the tent, is only stored locally (for now).
So to get to the point.. what is think I need is a service that finds the distance between all objects on a layer(the buildings) and the object that is drawn at-the-moment..
I did have a look at the SummarizeNearby services but at this moment we don’t have the license for it. Then I had a look at the GeometryService and I would like to know if this is the correct way to do it..
I think it is possible to use the difference or intersect method of the GeometryService to find the difference between all the graphic/geometries on the buildings-layer and the drawn-object. If the difference is the same size as the graphics in the buildings-layer, then there is no conflict. But if the result is different then the buildings-layer, then the buildings-layer did contain the object that is just drawn, and there-for the drawn object is not valid.
Please let me now if this is the way to go, or if there are other ways to calculate/find objects that intersect/overlap.