Find a specific Marker

3 posts, 0 answers
  1. Victor
    Victor avatar
    23 posts
    Member since:
    Aug 2016

    Posted 01 Jun Link to this post

    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. Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 02 Jun Link to this post

    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.
  3. Victor
    Victor avatar
    23 posts
    Member since:
    Aug 2016

    Posted 06 Jun Link to this post

    That did the trick. Thanks
Back to Top