Hi all,
I had a go with the new snapping tool rolled out with version 4.19, but found although the self snapping works well, the performance is really bad when I try to snap to other feature layers.
I've tried a feature layer (something like this: https://stg-gis.mapshare.vic.gov.au/arcgis/rest/services/mapshare/PropertyAndParcel/MapServer/5), and a geojson layer (simple 4 points rectangle), but none of them works well.
The browser I used is Chrome. Once I move my cursor close to the snapping point, the screen will freeze for at least 20 seconds. I even got unresponsive page warning from Chrome.
Any ideas in terms of why this could happen?
Thanks,
Johnny
Solved! Go to Solution.
Hello Keith and Johnny,
I would like to inform you that this issue has been resolved at 4.20.
Thanks,
Jose
Hello,
Glad to hear that you having been testing out the new 2D snapping in version 4.19. I tested the layer you provided, and I see it has over 3 million polygons. I am seeing some of the issues you described, however, once I wait for the errors to show up in the console, the feature snapping works fine. If I try beforehand, feature snapping does not work as you mentioned.
Thank you for bringing this up, we will be looking into this, and I will provide you with an update.
Would you be able to provide us with the geojson layer of the 4 polygons as well? Do these polygons have large numbers of vertices?
Thanks,
Jose
Hi Jose,
Thanks for the update. Here's the polygon I used:
Hi Jonny,
Thanks for providing the geojson geometry! We will be looking into this as well. To give you an update, I created an issue internally with our team, and we are looking into this.
We did test snapping with @arcgis/core in React prior to the release, so I'm curious to see why this geometry may impact the feature snapping. We will be looking into this as well.
Thank you for bringing up this issue to us!
Thanks,
Jose
Jonny,
I just tested the GeoJSON polygon you provided, and it seems to work with feature snapping pretty well. I tested both with a JavaScript application, and with a React application using @arcgis/core. Both are using version 4.19. The following is the JavaScript application used for testing (same code was used for React test). All you have to do is pass in your GeoJSON url for the GeoJSONLayer.
https://codepen.io/banuelosj/pen/abpeMXO
If you could provide a simplified app that reproduces the issue with the GeoJSON polygon geometry, I would be happy to look at it.
Thanks,
Jose
Hi Jose,
Thank you very much for the demo. It did take a bit of time to investigate, but I ended up finding where the problem is.
In our code, when we define the view, we set up the initial extent with a Web Mercator projection. Like this:
And whenever this is used. The snapping tool will go around the globe to snap a point that's very close to it.
I've modified your version a bit and got a demo here: https://codepen.io/jianingliu/pen/QWpWMzP
Drag the map a bit, and it will generate some random polygon for you to snap.
You'll see what I mean after trying to snap there.
Thanks,
Johnny
Hello Jonny,
I see it now. I added the extent onto the test app I provided, and can reproduce the same issue. The drawing visuals display from the opposite side of the map. I created an issue internally for this as well, and we will be looking into this as well!
I wanted to also provide an update on the feature snapping source timeouts with the 4 million polygons. We have a layer that we test at 125 million polygons, and we were not able to reproduce the issue. We are seeing a timeout on the initial request to fetch the layer extent of the feature layer from here:
https://stg-gis.mapshare.vic.gov.au/arcgis/rest/services/mapshare/PropertyAndParcel/MapServer/5
The layer extent is queried when you initially configure the featureSource property of the SnappingOptions. We are doing some further testing to try to narrow down the issue. I just wanted to provide an update and inform you that we have tested snapping successfully with over 125 million features.
I will reach out to you directly to provide updates, and if we have additional questions as we continue to look into this. Thanks for reaching out with these issues you ran into while utilizing the new snapping functionality, and looking forward to getting to the root cause of this issue.
Thanks,
Jose
Hello Jose,
Have you learned anymore about this issue? We are also seeing a significant delay when snapping is initialized. As you indicated, the issue appears to be caused by a slow response from the request for the snapping layer's extent.
Do you know if there will be a fix for this with 4.19, or if it will be fixed in 4.20?
Thank you for any additional information you can provide.
Best,
Keith
Hello Keith and Johnny,
I would like to inform you that this issue has been resolved at 4.20.
Thanks,
Jose
Hello Jose,
We are now using 4.20, but still seeing an approx. 20 second delay for snapping to be initialized - the snapping layer is relatively large parcel layer for the island of Oahu.
Once initialized , performance is very good.
Thanks,
Keith