Email Link - Shows multiple times with .actionlist

3823
1
02-06-2015 11:44 AM
KeithAnderson
New Contributor III

Friends of the mighty Javascript API-

I have been working with this example in my source:

History API to track selected feature | ArcGIS API for JavaScript

I have been trying many things to keep the Email link to not show up multiple times when it hits query(.actionlist.

I am loading a different single layer each Map Click of a Treeview control. Its always named  "theLayer".

I have tried many other Map events and also checking if the emailLink is already created...without any luck.

map.on("layer-add-result", function (result) {
    if (result.layer === theLayer) {
        console.log('THE layer');
        // Add a link into the InfoWindow Actions panel       
        //if (!dom.byId("emailLink")) {  
        //    domConstruct.create("span", {  
        //        id: "emailLink"  
        //    }, query(".actionList", this.map.infoWindow.domNode)[0]);  
        //}  
        var emailLink = domConstruct.create("a", {
            "class": "action",
                "innerHTML": "Email Map",
                "href": "javascript:void(0);"
        }, query(".actionList", map.infoWindow.domNode)[0]);
        //}, "emailLink", "only");

Any suggestions would be grateful

Thanks

Keith

Tags (1)
0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus

Keith,

   I have added a second layer programmatically to that sample and I am only getting one email link... Can you share more of your code?

0 Kudos