This is probably a simple answer, but for some reason I just can't get a graphics layer to add when I click on a map. THe alert "map clicked" does come up, but the point graphic layer is not added to the map? private var myGraphicsLayer:GraphicsLayer = new GraphicsLayer();
private var configFeatureLayers:Array;
//this function called when the widget's configuration is loaded
private function basewidget_widgetConfigLoadedHandler(event:Event):void
{
if (map.loaded)
{
Alert.show("map loaded");
loadHandler(null);
}
else
{
map.addEventListener(MapEvent.LOAD, loadHandler);
}
function loadHandler(event:MapEvent):void
{
map.removeEventListener(MapEvent.LOAD, loadHandler);
map.addEventListener(MapMouseEvent.MAP_CLICK, clickHandler);
}
function clickHandler(event:MapMouseEvent):void
{
showPopup(event.mapPoint);
}
function showPopup(mapPoint:MapPoint):void
{
Alert.show("map clicked");
myGraphicsLayer.clear();
var graphic:Graphic = new Graphic(mapPoint, clickPtSym);
myGraphicsLayer.add(graphic);