This is a migrated thread and some comments may be shown as answers.

Find a specific Marker

2 Answers 120 Views
Map
This is a migrated thread and some comments may be shown as answers.
Victor
Top achievements
Rank 2
Victor asked on 01 Jun 2017, 07:57 PM

Hi There,

I have created a marker called Car. This marker has a property called m_sLicensePlate.

How can i find that specific marker based on this property. The markers are in a specific layer.

My idea is something like :

 

Car findMarker(string p_sLicensePlate)

{

MapLayer carLayer = new MapLayer("Cars");

 

foreach (Car Item in carLayer.....)

{

    if (Item.m_sLicensePlate == p_sLicensePlate) return Item;

}

return null;

}

2 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 02 Jun 2017, 08:26 AM
Hello Victor,

If you create a new more layer inside the method it will be always empty. You need to get it from the map control:
private void radButton1_Click(object sender, EventArgs e)
{
    MapLayer carLayer = radMap1.Layers[0];
 
    foreach (CarMarker Item in carLayer)
    {
        Console.WriteLine(Item.ID);
    }
}

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Victor
Top achievements
Rank 2
answered on 06 Jun 2017, 04:33 PM
That did the trick. Thanks
Tags
Map
Asked by
Victor
Top achievements
Rank 2
Answers by
Dimitar
Telerik team
Victor
Top achievements
Rank 2
Share this question
or