Locating a Symbol on a Map by a number that it has been assigned

2226
1
06-11-2012 12:09 PM
Labels (1)
JessicaLott1
New Contributor
Hey Everyone,

I have an application that allows the user to add symbols to a map that represent water meters. I have the application locating by address, but I would like for the user to be able to
enter the meter number and be able to find the meter as well.

I am attaching my code as well as images to further explain what I am trying to do.

[ATTACH=CONFIG]15112[/ATTACH]


I let the user enter the meter number and information.

[ATTACH=CONFIG]15113[/ATTACH]

Then as you can see in that image, the user can see the information when they hover over the symbol.
The meter number is stored in a textblock which is Binded, if you look at my XAML you can see exactly what I am talking about.
I want to have another textbox that allows the user to enter the meter number and find it accordingly.

Thank-You for your help. Let me know if you have any questions. 🙂
0 Kudos
1 Reply
AnttiKajanus1
Occasional Contributor III
1. Store pure identifier in Attributes or parse Meter Number:xxxxx format when querying the Graphic.
2. When looking correct graphic from GraphicsLayer enumerate graphicsLayer.Graphics and look correct item like this in pseudocode


var foundItem = graphicsLayer.Graphics.FirstOrDefault(x => x.Attributes["identifierName"].ToString == variableThatWeAreLookingFor);

if (foundItem != null)
{
   Do stuff
}



Code assumes that graphics has "identifierName attribute but if you are not sure if that is included, then loop in foreach loop and check if the attribute contains that with ContainsKey("indentifierName").
0 Kudos