I am trying to generate offline areas through ArcGIS Python API, getting an below error
TypeError: 'VectorTileLayer' object is not subscriptable
If your "VectorTileLayer" object has no attribute "layerType", that means that your cached_layer is a VectorTileLayer.
Try the below and see what objects are being returned for cached_layers
for cached_layer in cached_layers: print(type(cached_layer))
Still, i am getting an error after changing to your suggested code.
Hi @vijaybadugu,
Looks like a VectorTileLayer is not subscriptable meaning you cannot use square bracket notation to access the "layerType".
You could try cached_layer.layerType.
Update to...
for cached_layer in cached_layers: if cached_layer.layerType == "VectorTileLayer": if cached_layer.url: layer0_obj = arcgis_layers.VectorTileLayer( cached_layer.url, self._gis )
Please let us know if that helps.
All the best,
Glen
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.