I was just looking for a way to quickly determine whether a layer in a published ArcGIS Server MapService has z values. If you look at the html version of the page this is listed:
But if you view the same page in json via `?f=json`, that property seems to be missing. Is there a trick to get this information. I'd like to quickly be able to determine whether a layer loaded in my app has Z values, even though I am loading it in a 2D MapView.
[A 2D MapView will not load z values even if you request them. See here]
Solved! Go to Solution.
As @jcarlson has pointed out, and a helpful ESRI Canada representative suggested, there might actually be a `hasZ` property present in json even when the layer does not have z data. It might depend on your service configuration or ArcGIS Server version.
In my case, using ArcGIS Server 10.7.1 and 10.8, it turns out that the `hasZ` property was present if the layer does have z values (at least in the case of our configurations for our point layers). But not otherwise.
Once I confirmed that, the json response from an endpoint like (/arcgis/services/[servicename]/MapServer/[layer#]?f=json) worked fine. In javascript something like:
```
if(!json.hasZ) {
// handle no z values
}
```
Will handle both cases nicely.
I see the property:
As @jcarlson has pointed out, and a helpful ESRI Canada representative suggested, there might actually be a `hasZ` property present in json even when the layer does not have z data. It might depend on your service configuration or ArcGIS Server version.
In my case, using ArcGIS Server 10.7.1 and 10.8, it turns out that the `hasZ` property was present if the layer does have z values (at least in the case of our configurations for our point layers). But not otherwise.
Once I confirmed that, the json response from an endpoint like (/arcgis/services/[servicename]/MapServer/[layer#]?f=json) worked fine. In javascript something like:
```
if(!json.hasZ) {
// handle no z values
}
```
Will handle both cases nicely.