Select to view content in your preferred language

JSAPI Editor Dijit merge operation moves polygon

3054
4
Jump to solution
09-17-2014 02:59 PM
KenDoman
Frequent Contributor

We have a custom JavaScript API based application that loads an ArcGIS Online Webmap from our organization and lets the user edit the shapes of polygons in a specific layer. Initially, the polygons all cover a specific area, and there are no gaps in between them. The application loads the Editor Dijit, and configurations plus event handlers limit the Editor Dijit to the following:

  • Edit Feature Attributes
  • Draw new polygons
  • Autocomplete polygons
  • Cut features
  • Merge features.
  • Undo and Redo

Problem: When the user cuts a polygon, the two pieces look okay. But when the two features are selected and merged, the new polygon is displaced by two to three pixels in some random direction. The merged shape is maintained, but it looks like it slid over a little bit. This creates gaps and overlaps in the polygons where there weren't any before. When we look at the data in ArcMap, we see the same gaps and overlaps in the edited polygon. While the displacement appears to be a couple pixels off, that translates to about 10 foot gaps in our data.

 

For right now, we don't have a topology on these features, since the extra checks and balances they add reduce the performance of other operations.

 

Any suggestions? I'll be happy to post bits of my code when I have time.

0 Kudos
1 Solution

Accepted Solutions
KenDoman
Frequent Contributor

Oops, forgot to note the answer after further investigation.

The changes to the feature class shape after merging were due to projection differences. The web map, which used ESRI base map layers, was in Web Mercator, while the edited data was in a State Plane projection. Once base maps were switched out so both the map and the edited layer were in the same State Plane projection, gaps showed much less frequently (apart from accidentally dragging parcels a pixel or two over while selecting them).

Word to the wise: Mind your projections, especially while editing.

View solution in original post

0 Kudos
4 Replies
JonathanUihlein
Esri Regular Contributor

Hi Ken, thanks for posting!

I have some questions:

  • What browser were you using?
  • If it was IE, what version specifically?
  • If it was IE, does this issue also occur in Chrome, Firefox when using the same exact use-case?
  • Are you using a template application or is this a completely new in-house application?

Any code snippets are also much appreciated.

0 Kudos
KenDoman
Frequent Contributor

Thanks Jonathan,

To answer your questions:

  • First noticed it in Chrome, and it was repeatable in FireFox and IE 11.
  • We are using a new in-house application.

I'll post some snippets in the morning, once I have access to my machine.

As a side note, we confirmed that the spatial reference of the data matched the spatial reference of the basemap behind it (Ohio State Plane). We thought we fixed the issue before when the map used the Web Mercator basemaps provided by ArcGIS Online. Now the issue has creeped up again.

0 Kudos
JonathanUihlein
Esri Regular Contributor

Thanks Ken!

As strange as this may sound, I'm glad this is not an IE exclusive issue  

Do you have any additional details about how this issue was fixed previously and what was the root cause?

Are you using mouse events or drag events for map interaction?

Code always welcome!

0 Kudos
KenDoman
Frequent Contributor

Oops, forgot to note the answer after further investigation.

The changes to the feature class shape after merging were due to projection differences. The web map, which used ESRI base map layers, was in Web Mercator, while the edited data was in a State Plane projection. Once base maps were switched out so both the map and the edited layer were in the same State Plane projection, gaps showed much less frequently (apart from accidentally dragging parcels a pixel or two over while selecting them).

Word to the wise: Mind your projections, especially while editing.

0 Kudos