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.

I have a layer like,

realTimeLayer = new esri.layers.GraphicsLayer();

I have an infoTemplate like,

infoTemplate=new esri.InfoTemplate("/*Content goes here*/");

I am creating a graphic, adding it to the layer and plotting the point like,

 var graphic= new esri.Graphic(candidatePoint,candidateSymbol,attr,infoTemplate);
 realTimeLayer.add(graphic);
 map.addLayer(realTimeLayer);
 points.addPoint(candidatePoint);

In this case the info template works fine. But during some other event, I am adding the graphic like

var graphic= new esri.Graphic(candidatePoint,candidateSymbol,attr,infoTemplate);
map.graphics.add(graphic);
points.addPoint(candidatePoint);

But this time, I don't get the info template in IE9 even after clicking on the push pin. What could be the reason? And how should I correct this?

share|improve this question
    
Have you tested with other Browsers? –  Devdatta Tengshe Mar 15 '13 at 11:06
    
@DevdattaTengshe Yes. I did. Works fine with Ie7, Ie8 and Mozilla. –  Prasanna Mar 15 '13 at 11:55
add comment

1 Answer 1

up vote 0 down vote accepted

I corrected it by,

1) Removing the previous layer,
2) Creating a new GraphicsLayer()
3) And adding the graphic on top of the newly created layer. 

That is, I am not adding th graphic to the map.graphics object but to a new layer.

Code:

var graphic= new esri.Graphic(candidatePoint,candidateSymbol,attr,infoTemplate);
map.removeLayer(realTimeLayer);
realTimeLayer = new esri.layers.GraphicsLayer();
realTimeLayer.add(graphic);
share|improve this answer
add comment

Your Answer

 
discard

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

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