laptop and a wrench

Erro

Vector tile services fail to display in ArcGIS API for JavaScript 4.18 and above and return the error message, "Cannot read property 'getAttributeLocations' of undefined."

Última Publicação: October 29, 2021 ArcGIS API for JavaScript
Número de ID do Erro BUG-000143069
EnviadoSeptember 21, 2021
Última ModificaçãoJune 5, 2024
Aplica-se àArcGIS API for JavaScript
Versão encontrada4.20
Sistema OperacionalN/A
Versão do Sistema OperacionalN/A
StatusWill Not Be Addressed

Informações Adicionais

By definition, the JS AP identifies style-layers by their names, and the assumption is that names are unique across the style (they are case insensitive). In this particular case, there are two layers named background: { "id": "background", "type": "background", "paint": { "background-color": "#FEFFFF" } }, { "id": "Background", "type": "fill", "source": "esri", "source-layer": "Background", "layout": {}, "paint": { "fill-color": "#A9DDEF" } }, The MapBox style spec indicate that layer Id (name) must be unique: https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/. The renderer is accessing the layer by it's name (using lowercase form) and therefore in this case we end up with the wrong layer type. At 4.18, we added new methods to interact with style-layers and made some code cleaning as part of it. https://developers.arcgis.com/javascript/latest/4.18/#vectortilelayer We can add a protection to bail out in case. BUT we end up with the wrong layer type and we would still end up not rendering all layers. This is what is happening for MapBox I am sure. So we will not add a protection to bail out in those cases. The best solution here is for the user to update their layer Ids. This test app shows the user's vector tile layer working at JS API version 4.21. https://codepen.io/U_B_U/pen/XWgBEVX?editors=1000

Etapas para Reproduzir

ID do Erro: BUG-000143069

Software:

  • ArcGIS API for JavaScript

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download