Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

My webapp allows the user to zoom to a map extent, then create a new window with a new map drawn to the zoomed extent of the parent window map. The parent map contains graphics, which should also be passed and added to the child window map. My problem is that the graphics do not draw in the child window until I refresh the page. Once I manually refresh, all the graphics are there in the right place. I have tried various ways of forcing a refresh of the map or layer using javascript but nothing has worked. I have a feeling this is a runtime rendering issue? IF anyone has ideas I would appreciate it, thanks. Code below (note, this code is for the child window, 'window.opener' refers to the parent window):

    function drawCrosswalks()   
{
    updateLayerVisibility();
    var locCrosswalkArray = [];
    for (var i=0, l=window.opener.globalCrosswalkArray.length; i<l; i++)
    {
        locCrosswalkArray[i] = window.opener.globalCrosswalkArray[i];;
                    // globalCrosswalkArray is a graphics array from the parent page)
    }

    if (locCrosswalkArray.length > 0) 
    {            
        for (var i = 0, il = window.opener.globalCrosswalkArray.length; i < il; i++) 
        {
            var symbol;
            var  crossWalkG =  window.opener.globalCrosswalkArray[i].feature;
            symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, 
            new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
                new dojo.Color([50, 205, 50]), 3), new dojo.Color([0, 0, 255, 0])); 
            crossWalkG.setSymbol(symbol);              
            printMap.graphics.add(crossWalkG);
        }

    } // end if

    printMap.resize();       
    printMap.setExtent(printMap.extent) ;
    schoolSafetyLayer.refresh(); // none of this worked

 } // end func
share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.