AnsweredAssumed Answered

context menus limitations?

Question asked by lkoumis on Nov 18, 2015
Latest reply on Nov 18, 2015 by rscheitlin

I noticed that inside the click function of a context menu I don't have access to the map object or call a new function outside the context menu.

Are these limitations for the context menus?

 

for the script below, I get these errors....

 

Cannot read property 'addLayer' of undefined

this.myfunction is not a function

 

---------

ctxMenuForGraphics = new Menu({});

  ctxMenuForGraphics.addChild(new MenuItem(

  {

  label: "something",

  onClick: function ()

  {  

   this.map.addLayer(xxx);

   this.myfunction();

  

 

  }

  }));

  ctxMenuForGraphics.startup();

--------

},

myfunction: function(){

----

},

-----------

Outcomes