Test case 1 - set the source of the info template to the URL of the image. example value from this field (image_url) https://images.skyvdn.com/thumbs/RichmondCS064EB1790.flv.png
"<tr><td id='tblMainline1'>image_url</td><td id='tblSubline2'><img src='${image_url}'/></td>"+
If I do this and click on the same feature it does not reload the image from the image source. I have to refresh my browser in order to see the new image. These are traffic cameras so there is a static image that gets added to the Rest End point every few minutes.
Test case 2 - call a function from the link to push a url to the div tag to refresh the image. RIGHT now I a, simply trying to get an alert fired in the function from the onvclick event. This is NOT working
I tired these 3 examples
I do not get the alerts....doing something wrong?
function inHrefFunction(test){
alert("Here");
alert(test);
}
function onclickFunction(url) {
alert(url);
}
function myFunction(name, work) {
alert(name + " " + work);
}
var infoHighwayCameras = new InfoTemplate();
infoHighwayCameras.setTitle("Highway Cameras");
infoHighwayCameras.setContent("<table>" +
"<tr><td id='tblTitle'>Highway Cameras</td><td id='tblTitle2'></td></tr>" +
"<tr><td id='tblTitleLine'></td><td id='tblTitleLine2'></td></tr>" +
"<tr><td></td><td></td></tr>" +
"<tr><td id='tblMainline1'>image_url</td><td id='tblSubline2'><i>TEST1 <a href='#' onclick='onclickFunction('${image_url}')'>Click Me!</a>." +
"<tr><td id='tblMainline1'>image_url</td><td id='tblSubline2'><i>TEST2 <a href='javascript:inHrefFunction('${image_url}')'>Click Me!</a>." +
"<tr><td id='tblMainline1'>image_url</td><td id='tblSubline2'><i>TEST2 <button onclick='myFunction('Harry Potter','Wizard')'>Try it</button>" +
"<tr><td id='tblMainline1'>image_url</td><td id='tblSubline2'><img src='${image_url}'/></td>"+
"</table><hr>");
var HighwayCameras = new FeatureLayer("https://services.arcgis.com/DO4gTjwJVIJ7O9Ca/arcgis/rest/services/Camera_Location_VDOT/FeatureServer...", {
mode: FeatureLayer.MODE_ONDEMAND,
visible: false,
opacity: .5,
outFields:["*"],
infoTemplate: infoHighwayCameras
});
legendLayers3.push({ layer: HighwayCameras, title: 'Highway Cameras' });