Select to view content in your preferred language

InfoTemplate not working in only one layer.

990
7
06-29-2018 04:39 PM
EvelynHernandez
Regular Contributor

Hello,

Im wondering a reason why my infoTemplate in one layer is not working. I have a dynamic service with 5 layers and all the other ones are working perfectly when i click in the map, showing the information about them, but when i click the number (2) it doesnt show anything and it says "no info available"

Here is where i define the infoTemplate.

interrClienteSED.setInfoTemplates({
 0: {infoTemplate: getInfoTemplate2.getCriticalNisInfo()},
 1: {infoTemplate: getInfoTemplate2.getNISInfoConf()},
 2: {infoTemplate: getInfoTemplate2.getNISInfoPred()},
 3: {infoTemplate: myinfotemplate.getSubConf()},
 4: {infoTemplate: myinfotemplate.getSubPred()}
 });
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Here is where i have it: 2: {infoTemplate: getInfoTemplate2.getNISInfoPred()},

And this function gives me the infoTemplate that i use: 

getNISInfoPred(){
 let chqNisInfoTemp2= new InfoTemplate();
 chqNisInfoTemp2.setTitle("<b>NIS: ${ARCGIS.DBO.CLIENTES_XY_006.nis}</b>");
let chqNisInfoContent2 =
 "<div style=padding-top: 10px;><b>ID Orden:</b> ${ARCGIS.dbo.view_tiempo_order_po.id_orden}<br></div>";
 chqNisInfoTemp2.setContent(chqNisInfoContent2);
 return chqNisInfoTemp2;
 }‍‍‍‍‍‍‍‍

It doesnt show anything. Even if the fields are not correct, it suppose to show the template with ID Orden and NIS empty, but it just doesnt work at all.

Tags (2)
0 Kudos
7 Replies
RobertScheitlin__GISP
MVP Emeritus

Have you tried hard coding the strings returned for testing instead of using field values?

0 Kudos
EvelynHernandez
Regular Contributor

How i do that?

Enviado desde Correo<https://go.microsoft.com/fwlink/?LinkId=550986> para Windows 10

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Evelyn,

   Simply:

getNISInfoPred(){
  let chqNisInfoTemp2= new InfoTemplate();
  chqNisInfoTemp2.setTitle("test title");
  let chqNisInfoContent2 = "<div style=padding-top: 10px;><b>test content</b><br></div>";
  chqNisInfoTemp2.setContent(chqNisInfoContent2);
  return chqNisInfoTemp2;
}‍‍‍‍‍‍‍‍
0 Kudos
EvelynHernandez
Regular Contributor

Yes i did that and ...

I also put the code u gave me in the file, not adding a new reference.

let chqNisInfoTemp2= new InfoTemplate();
 chqNisInfoTemp2.setTitle("test title");
 let chqNisInfoContent2 = "<div style=padding-top: 10px;><b>test content</b><br></div>";
 chqNisInfoTemp2.setContent(chqNisInfoContent2);
var interrClienteSED = new ArcGISDynamicMapServiceLayer(layers.read_dyn_predichos_confirmados(),{id:"po_interrupciones"});
 interrClienteSED.setInfoTemplates({
 0: {infoTemplate: getInfoTemplate2.getCriticalNisInfo()},
 1: {infoTemplate: getInfoTemplate2.getNISInfoConf()},
 2: {infoTemplate: chqNisInfoTemp2},
 3: {infoTemplate: myinfotemplate.getSubConf()},
 4: {infoTemplate: myinfotemplate.getSubPred()}
 });
 interrClienteSED.setVisibleLayers=[0,1,2,3,4,5]‍‍‍‍‍‍‍‍‍‍‍‍‍

That layer(2) is the only one that has the problem, the other ones are working perfectly.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Strange. Well that eliminates it being an issue with a field name or field value. 

Again for testing purposes. Can you add that layer as a FeatureLayer and try and assign a infoTemplate?

0 Kudos
EvelynHernandez
Regular Contributor

I did it and it doesnt show the layer on the map (doesnt show any result)

var interFeature2 = new FeatureLayer("myServer/nterrupciones/PO_PC/MapServer/2");
interFeature2.show();

 mapp.addLayers([chqmapabase,  heatmapFeatureLayer, heatmapFeatureLayer1, gps_new, interFeature2]);

And i also tried to add it in the arcgis viewer for js and this what i got


As u can see there are 7 features but no one is shown...

When i do a query in the rest service i got them 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

The the problem resides in your map service. You need to republish after you run a geometry check GP on the data.

0 Kudos