I am creating an application using JP 4.12 and I would like for the application to point to an URL within the attribute table of a feature layer when a user clicks on a point feature. I came across the following post and I tried the following code but it does not seem to work.
- //Code for the specific URL to open in a new window
- featureLayer.on('click',function(e){
- var specific = e.graphic.attributes['SpecificAttribute']
- window.open("http://YourUrl.com/"+specific);
- });
In the SpecificAttribute, I have placed the name of the field that contains the URLs.
- //Code for the specific URL to open in a new window
- featureLayer.on('click',function(e){
- var specific = e.graphic.attributes['Link']
- window.open(specific);
- });
Any help would be greatly appreciated!