Select to view content in your preferred language

I am having issues with the infowindow not showing up on click, despite the graphics having an infotemplate. Not sure if I am doing it incorrectly.

1003
4
Jump to solution
09-17-2014 08:32 AM
DarinBierbaum
Deactivated User

This is how I instantiate my graphic.

var pt = new esri.geometry.Point(jsonobj.longitude, jsonobj.latitude, this.map.spatialReference);

                    var sms = new esri.symbol.SimpleMarkerSymbol();

                    var infoTemplate = new esri.InfoTemplate("<b>THIS IS INFO</b>");

                    var graphic = new esri.Graphic(pt, sms, infoTemplate);

                    this.map.graphics.add(graphic);

0 Kudos
1 Solution

Accepted Solutions
TimWitt2
MVP Alum

Darin,

maybe this example of a pop-up for a graphic can help you

Button Popup 1 - JSFiddle

Tim

View solution in original post

4 Replies
TimWitt2
MVP Alum

Darin,

maybe this example of a pop-up for a graphic can help you

Button Popup 1 - JSFiddle

Tim

DarinBierbaum
Deactivated User

Hi Tim,

Thanks for the quick reply. Looking through your code I see how the buttons have the infowindow.show. I was under the impression that if you give a graphic an infotemplate when you create it that the default behavior is to show the infowindow when you click the graphic. Is this not the case. In the meantime I will keep fiddling with this code and see if I can get something similar to work in my program.

0 Kudos
TimWitt2
MVP Alum

In my example you can also click on the graphic and the infowindow will show, you don't have to click the button.

DarinBierbaum
Deactivated User

Yes, this is where I am finding myself having trouble, because from my understanding the default behavior of a graphic with an infoTemplate is that on click it should display the infoWindow, but my graphics dont seem to do that . I will fiddle around with it some more and see if I can find out why.

Thanks again for your help!

0 Kudos