Working ESRI Winform Example

4 posts, 1 answers
  1. Dennis
    Dennis avatar
    2 posts
    Member since:
    Sep 2014

    Posted 11 Apr Link to this post

    Hello folks - I am attempting to make a project similar to the "theatre" demo that is part of the Winform Demos for Map / ESRI Shapefiles.  I have extracted all the code from the ExamplesCSVS2010 project file, and made a local copy of the theatre seating data.  It appears to be loading the ESRI files properly, I can inspect the map object and it appears to have all the objects in it, but I just do not SEE anything on my form.

     

    Is there a working standalone example anywhere?  Everything I have found on the forums is for outdated Silverlight, nothing for winform.  Seems like everything is there, but just missing this piece.  Any ideas?  Happy to post my current project, etc.for review, if that helps at all.

  2. Answer
    Hristo
    Admin
    Hristo avatar
    1031 posts

    Posted 12 Apr Link to this post

    Hello Dennis,

    Thank you for writing back.

    The source code of the example is located in the installation folder of the controls. Due to the specifics of the demo application, the viewport of the map is being panned slightly to the left and bottom. Please also make sure that you set the size of the map big enough to accommodate your shape file.

    I am sending you attached my sample project utilizing the demo application.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo
    Telerik by Progress
    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. Dennis
    Dennis avatar
    2 posts
    Member since:
    Sep 2014

    Posted 12 Apr in reply to Hristo Link to this post

    Hristo - thank you so much for the reply and the example project.  Much appreciated.  As I looked at the code, it looked exactly what i had extracted from the demo, except as you had referred to, i had not made the map control big enough to accomodate the data!  I went back to my code and resized it and everything worked perfectly.  Thanks again for this tip.  I thought perhaps it would clip it to the viewable port, but apparently not!

     

     

  4. Hristo
    Admin
    Hristo avatar
    1031 posts

    Posted 13 Apr Link to this post

    Hi Dennis,

    Thank you for writing back.

    I am glad that I managed to help. Indeed, the map will not scale to accommodate the imported shapefile. You can, however, control the zoom level. In the project I last sent, you can set the minimum and maximum zoom levels on the map provider: 
    private void SetupProvider()
    {
        EmptyMapProvider emptyProvider = new EmptyMapProvider();
        emptyProvider.MinZoomLevel = 10;
        emptyProvider.MaxZoomLevel = 20;
        emptyProvider.InitializationComplete += emptyProvider_InitializationComplete;
     
        this.radMap1.Providers.Add(emptyProvider);
    }
     
    private void emptyProvider_InitializationComplete(object sender, EventArgs e)
    {
        List<PointG> locations = new List<PointG>();
     
        foreach (MapVisualElement el in this.radMap1.Layers["Hall Layout"].Overlays)
        {
            locations.Add(el.Location);
        }
     
        this.radMap1.BringIntoView(RectangleG.GetBoundingRectangle(locations));
        this.radMap1.MapElement.EnableZooming = true;
        this.radMap1.MapElement.EnablePanning = true;
        this.radMap1.Zoom(14);
    }

    I hope this helps. Please let me know if you have other questions.

    Regards,
    Hristo
    Telerik by Progress
    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.
Back to Top