Select to view content in your preferred language

MapTips sample doesn't work

852
6
03-17-2011 06:12 AM
DanielSchatt
Regular Contributor
I want to use the functionality in the MapTips sample (under the Graphics category) for my own site but it's not working in the sample here -- when I first open the sample site and hover the mouse over a state or city, it works correctly.  But after that first one, it doesn't display at all or displays the wrong state name.  I don't want to spend a whole lot of time working this into my site until I know it will work properly....is anyone else experiencing this or know what the problem is? Thanks!

Dan
0 Kudos
6 Replies
JenniferNery
Esri Regular Contributor
In this sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#GraphicsMapTip, the map tip gets its content populated through binding to its graphic attributes. For example,"{Binding [STATE_NAME]}". This map service contain this field: http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5 and the query requests for all fields (OutFields = "*").

If you will be replacing the service with your own and use the same sample, you need to make sure that the map tip binding statements only contain fields that are returned by the query.

You can also check that the symbol you used for these features do not have   IsHitTestVisible="False". This will cause the graphic element to ignore mouse events which will cause the layer mouse event to be ignored as well.
0 Kudos
DanielSchatt
Regular Contributor
Thanks Jennifer - useful info but I probably wasn't clear.  I haven't done anything at all with this yet-I've only looked at the MapTips sample here (that you put in a link to in your reply), and that sample is not working properly. 

I assume it's supposed to pop up the info whenever you hover the mouse over a new feature (city or state).  But, after opening the live sample each time, it only works for the first feature I hover over and then it doesn't work properly any more for that session.  Before I actually use the code for this in my own work, I was just wondering if anyone else was experiencing this problem with the sample and if anyone knew what the problem was. Thanks again...

Dan
0 Kudos
JenniferNery
Esri Regular Contributor
What version of the API are you using?

I am not able to reproduce the issue you described with the Interactive SDK link. Hovering on another city/state updates the map tip with the correct information.
0 Kudos
DanielSchatt
Regular Contributor
Jennifer, I have Silverlight 4.0...I downloaded the latest "ArcGIS API for Microsoft/Silverlight" for my own development but in this case, I'm just viewing your live sample with my browser.  I'm a newbie at this but I assume my API isn't involved when I'm viewing someone else's site?

Well here's the thing...I had been trying the live sample in Internet Explorer 8 and there it wasn't working properly as described previously, but I just tried the same live sample in Firefox (3.6.13) and it works perfectly...so I guess there's something here that IE doesn't like?
0 Kudos
JenniferNery
Esri Regular Contributor
I am not sure. I have used Google Chrome, IE8 and IE9 but I have not seen this odd behavior on the SDK samples.
0 Kudos
DanielSchatt
Regular Contributor
Sorry, just figured out my issue  Somehow, the zoom setting on my browser got set to 125% at some point and that was displacing all the features on the map -- set it back to 100% and all's well now.  Jennifer, thanks for the info and the time, appreciate it!
0 Kudos