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

Working ESRI Winform Example

3 Answers 167 Views
Map
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 11 Apr 2017, 05:46 PM

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.

3 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 12 Apr 2017, 08:30 AM
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.
0
Dennis
Top achievements
Rank 1
answered on 12 Apr 2017, 04:54 PM

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!

 

 

0
Hristo
Telerik team
answered on 13 Apr 2017, 06:04 AM
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.
Tags
Map
Asked by
Dennis
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Dennis
Top achievements
Rank 1
Share this question
or