AnsweredAssumed Answered

Click a point feature that opens a URL in a browser

Question asked by marques.munson on Jul 16, 2019
Latest reply on Jul 19, 2019 by Liz.Eidsness_aafc

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.

 

  1. //Code for the specific URL to open in a new window  
  2.   featureLayer.on('click',function(e){   
  3.     var specific = e.graphic.attributes['SpecificAttribute']   
  4.     window.open("http://YourUrl.com/"+specific);  
  5.   });  

In the SpecificAttribute, I have placed the name of the field that contains the URLs. 

 

  1. //Code for the specific URL to open in a new window  
  2.   featureLayer.on('click',function(e){   
  3.     var specific = e.graphic.attributes['Link']   
  4.     window.open(specific);  
  5.   });  

 

Any help would be greatly appreciated!

Outcomes