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(xyz);
this.myfunction();
}
}));
ctxMenuForGraphics.startup();
--------
},
myfunction: function(){
----
},
-----------