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.
Have you tried hard coding the strings returned for testing instead of using field values?
How i do that?
Enviado desde Correo<https://go.microsoft.com/fwlink/?LinkId=550986> para Windows 10
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;
}
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.
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?
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
The the problem resides in your map service. You need to republish after you run a geometry check GP on the data.