Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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();
                           shape: shape,
                           duration: 500,
                           color: { start: "yellow", end: [0,255,255] },
                           width: { start: 25, end: 15 }
                   }, 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. – ripsin Dec 2 '13 at 4:11

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)) {
share|improve this answer

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