Point Graphic infoTemplate/Popup not on top of point

1400
7
05-01-2013 08:35 AM
AndrewDavis
Deactivated User
Hi ,

I have a point graphic which I add to the map from parameters.  I can click on the point and get the attribute information to return, but the info box is always up on the top left of the map and not tied to the point's geometry.

I have been looking for sometype of call for the info window's anchor point with no luck..

I thought the that information would take the graphic's geom and use that as the anchor point.

Should I have to set the graphic layers anchor..?  map.getInfoWindowAnchor(evt.screenPoint);..

Andy
0 Kudos
7 Replies
KellyHutchins
Esri Notable Contributor
Andrew,

Here's a link to a sample that may help. The sample adds graphics to the map and associates an info window with the graphics - which sounds like the same thing you are trying to do.

http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/map_topo_graphics.html
0 Kudos
AndrewDavis
Deactivated User
Andrew,

Here's a link to a sample that may help. The sample adds graphics to the map and associates an info window with the graphics - which sounds like the same thing you are trying to do.

http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/map_topo_graphics.html


Hi Kelly,

Thanks for the help..  I have been working through the samples again and can reproduce the results to a degree.

I am able to add  graphics to the map from a collection of geometry/attributes.  I can also click on the graphics and get the individual graphic attributes to show up in the popup.  However, I cannot get the popup to anchor to the graphic (little tail).

None of the examples I have seen show how to set that anchor. 

My map is in WGS84 and my graphics are unprojected (lat lon in Decimal Degrees).  I thought that the graphics geometry would have set the infoWindow anchor.

Any thoughts??
0 Kudos
KellyHutchins
Esri Notable Contributor
If you use setInfoWindow to associate the window with the graphic everything should be taken care of for you. Do you have a code snippet you can share that shows the problem?

Kelly
0 Kudos
AndrewDavis
Deactivated User
If you use setInfoWindow to associate the window with the graphic everything should be taken care of for you. Do you have a code snippet you can share that shows the problem?

Kelly


Kelly, thanks...  problem is that my script is on my intranet.  My work on my connected machine is working very well.  I will try to replicate the error and then post it..

Andy
0 Kudos
AndrewDavis
Deactivated User
Kelly, thanks... problem is that my script is on my intranet. My work on my connected machine is working very well. I will try to replicate the error and then post it..

Andy


I am unable to replicate the problem on my internet enabled machine.  I will try to find out what this is and post it .
0 Kudos
AndrewDavis
Deactivated User
I think I have figured out the issue, or at least have a thought.

My map on the internet is in web mercator, I am consuming ESRI Online Services and that one works..

My map on the local Intranet is geographic, and the popup shows up with the correct information but the anchor point for the popup is way off.

Is there a way to convert the popup's anchor point  (evt) show point to geographic? or should I try to convert the entire map to web mercator?

Andy
0 Kudos
AndrewDavis
Deactivated User
Figured it out.

It was a projection issue. My intranet map is Geographic, and my other map is Web Mercator. I set the following up and in my map.js script..


dojo.connect(map, 'onLoad', function(){
   dojo.connect(map.graphics, 'onClick', function(evt){
      map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
   });
});



That solved everything..
0 Kudos