Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Using ESRI JSAPI 3.7 I'm flashing a graphic that works fine when the graphic is located within the bounds of the map extent (is visible). However, when you move the map so the graphic is located out of the map extent and try to flash, it throws the following error: "0x800a139e - JavaScript runtime error: lang.hitch: scope["setStroke"] is null (scope="[object Window]")". Here's the function I'm using. Can someone suggest maybe a way to flash only if the graphic is located onscreen? Thanks in advance!

function animateGraphic(graphicFlash) {                       
                   setTimeout(lang.partial(function (animateMe) {
                       var shape = animateMe.getDojoShape();
                       fx.animateStroke({
                           shape: shape,
                           duration: 500,
                           color: { start: "yellow", end: [0,255,255] },
                           width: { start: 25, end: 15 }
                       }).play();
                   }, graphicFlash), 100);
               }
share|improve this question

closed as unclear what you're asking by BradHards, Fezter, Curlew, PolyGeo, Paul Nov 24 '13 at 4:59

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

    
You might want to explain your architecture in a bit more detail. You're obviously close to the problem, and the tags hint at it, but they're a strange mix, so making this explicit might help. –  BradHards Nov 23 '13 at 6:29
    
Looks like I was a little erroneous and have updated my question. Thanks. –  Scott Dec 2 '13 at 4:11
add comment

1 Answer 1

You could try checking if the graphicFlash is within the map extent in the beginning of your function. Here I reference the map directly, there are cleaner ways to do this, but as an example:

if(!map.extent.contains(flashGraphic)) {
    return;
}
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.