laptop and a wrench

Erro

A pop-up throws an invalid content type error when clicking the GraphicsLayer that does not have a PopupTemplate class defined.

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

Informações Adicionais

Tested against 4.1 and can not reproduce.

Solução Provisória

Option A Define the graphics within the graphics collection of the view as shown in the sample at https://developers.arcgis.com/javascript/latest/sample-code/get-started-graphics/index.html The blank pop-up or the error is no longer displayed. Option B Wire into the view's click event. Perform a hit-test and check if the intersecting layer belongs to the layer that the user did not define a PopupTemplate against. If needed, hide the html for the pop-up from the user interface. An example of the code for this approach is shown below. Note that the pop-up does not appear, but the error still occurs. view.on("click", function(evt){ // Search for graphics at the clicked location view.hitTest(evt.screenPoint).then(function(response){ if(response.results[0].graphic){ console.log("Top graphic found! Here it is: ", response.results[0].graphic); document.getElementsByClassName("esri-popup")[0].style.display = response.results[0].graphic.layer.id == "layer-2" ? "none" : "block"; } }); });

Etapas para Reproduzir

ID do Erro: BUG-000097999

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