I would like to add a feature layer to my map. When I do that, I noticed from the json that the coordinates returned by the server has unnecessary decimal precision. My feature service has Web Mercator projection (in meters) and when I used it as a FeatureLayer, it return coordinate up to 11 decimals like this: [13259971.983800001,572641.27050000057]. This makes the json response output size almost doubled and I think I can load my map faster by removing the unnecessary decimals.
I'm aware that through Query class, we can set geometryPrecision parameter to define decimals of coordinates that we want, but the part that I'm really lost is I dont know how to set this through FeatureLayer when its loaded for the first time to the map? I mean when I define a feature layer and would like to add it to the map like this:
var featureLayer = new FeatureLayer("https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0");
I noticed that the map.addLayer() function will execute a query to server for the first time to load the FeatureLayer that I dont know how to include geometryPrecision parameter to that query.
Thank you very much in advance and any help would be very appreciated.
Hi Mohammad Agus Salim. Is this in the context of trying to reduce network traffic by lowering payload sizes? FeatureLayers (in 4.X) will already make reduced precision quanitized queries when used against services that supported them. We've also since added a new more compressed pbf query format that further reduces payload sizes.
Hi Matt, thank you very much for taking your time to respond. Yes, I was trying to reduce network traffic by lowering payload sizes. I unfortunately still using 3.29 for some reason. Is there any workaround that you think we can do?
Sorry Mohammad, I don't have too much experience with 3X, but I'll check with someone and see if there is any workaround. I suspect however that there probably won't be one unfortunately.
Mohammad Agus Salim I talked two a couple of product engineers and and unfortunately I don't think we have a great workaround for this. For 4.x. though we will think about how we might allow more control over querying to allow apps to make their own trade-offs in terms of visual quality & network performance.