Select to view content in your preferred language

Can a maptip call a relationship query?

629
2
04-10-2013 07:40 AM
AngelGonzalez
Frequent Contributor
How would you go about having a maptip call a relationshipquery on the fly?

Basically I have a feature layer which uses maptips. When a user hover over a feature I want to do a relationship query and add the
value of a field(s) returned from the relationshipquery to the maptip. I cannot find any good samples. Can anyone post/point me a good sample?

Thanks
0 Kudos
2 Replies
PhilipKnight1
Regular Contributor
I don't know for sure, but I don't think that the maptips are really generated on the fly. Keep in mind that (USUALLY) you bind the data in the xaml. So I assume (always dangerous to do so) that the actual generation is done under the hood, and it's not possible to tie a query to the maptip.

I think your best would be to dynamically create a maptip for each graphic. Unfortunately this means having to loop through each and every graphic that will have a maptip and assign the maptip value to the result of the specified query. This also means that you have to run the query for each graphic.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
How would you go about having a maptip call a relationshipquery on the fly?

Basically I have a feature layer which uses maptips. When a user hover over a feature I want to do a relationship query and add the
value of a field(s) returned from the relationshipquery to the maptip. I cannot find any good samples. Can anyone post/point me a good sample?

Thanks

I don't know any sample but you could develop your own maptip control and from the attributes of the graphic (the attributes dictionary is set as the datacontext of the maptip), you could retrieve the related object and bind it to your custom maptip.
0 Kudos