• CommentAuthortechquery
    • CommentTimeFeb 7th 2011
     
    Hi, Everyone.

    Can the GeoBase map show the point of interest (POI)?

    Thanks.
    •  
      CommentAuthorSeanS
    • CommentTimeFeb 7th 2011
     
    Yes. This can be demonstrated in the MapExplorer sample by choosing Points of Interest off the right-click menu. You can then look at the source code for MapExplorer to see how this is done with a PoiRenderer. Note that for performance reasons POIs do not display at all zoom levels, so if you don't see them, zoom in closer to street level for them to appear.

    There are other ways to display POIs, such as is shown in this tutorial:

    A Simple Mobile Navigation Application Using the NavigationManager Class - Part 2
    • CommentAuthortechquery
    • CommentTimeFeb 8th 2011
     
    Thanks for the helpful information Sean.

    I will try this and get back to you for the outcome.
    • CommentAuthortechquery
    • CommentTimeFeb 8th 2011
     
    Hello Sean.

    I tried using the PoiRenderer, however, the POI's that I set are not showing up even if I zoomed in to street view or much closer.

    The sample location I used is "Bryant Park, New York, NY, United States'. (40.754170164714452, -73.982575028096136)

    Here is the sample code snippet:
    PoiRenderer pr = new PoiRenderer();
    _renderList.Add(pr);

    PoiType[] poiTypes = {
    PoiType.PublicSportAirport,
    PoiType.Airport,
    PoiType.Restaurant,
    PoiType.Park,
    PoiType.ParkandRecreation,
    PoiType.AmusementPark
    };

    pr.SetFilter(poiTypes);

    // set the type of restaurants we want to show
    PoiRestaurantType[] foods = { PoiRestaurantType.PIZZA, PoiRestaurantType.FAST_FOOD };
    pr.SetRestaurantType(foods);



    Any thoughts?
    • CommentAuthorSharonD
    • CommentTimeFeb 10th 2011
     
    Have you set MapCtrl.Renderer to _renderList?
    Have you called MapCtrl.Invalidate() at the end?

    Regards,
    Sharon
    • CommentAuthortechquery
    • CommentTimeFeb 10th 2011
     
    Yes I did both methods.
    • CommentAuthorSharonD
    • CommentTimeFeb 10th 2011
     
    I have tested it in 3.6.0.0 and 3.6.0.2 and it works fine.

    The MapCtrl is centered at 40.754170164714452, -73.982575028096136 and its Zoom is set to 1.

    With the following code I can toggle correct POIs:
    namespace WindowsFormsApplication1
    {
    public partial class Form1 : Form
    {
    private RendererList renderList = new RendererList();
    private PoiRenderer pr;

    public Form1()
    {
    InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
    pr = new PoiRenderer();
    renderList.Add(pr);
    pr.Visible = false;
    mapMain.Renderer = renderList;
    }

    /*.............some methods.............*/

    private void toolStripMenuItem7_Click(object sender, EventArgs e)
    {
    // testing POI filter
    PoiType[] types = { PoiType.PublicSportAirport,
    PoiType.Airport,
    PoiType.Restaurant,
    PoiType.Park,
    PoiType.ParkandRecreation,
    PoiType.AmusementPark
    };
    pr.SetFilter(types);
    PoiRestaurantType[] foods = { PoiRestaurantType.PIZZA, PoiRestaurantType.FAST_FOOD };
    pr.SetRestaurantType(foods);

    pr.Visible = !pr.Visible;
    mapMain.Invalidate();
    }
    }
    }

    Sharon
    • CommentAuthortechquery
    • CommentTimeFeb 11th 2011
     
    Thanks Sharon. I lack the pr.Visible and it works now.

    Thank you so much for your help.