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

State Map generation

2 Answers 62 Views
Map
This is a migrated thread and some comments may be shown as answers.
Aktzc
Top achievements
Rank 1
Aktzc asked on 13 Jul 2012, 07:34 PM
I can get the united states map in my application (C#). I am eager to find out whether there is any onclick event for telerik map control, so that when we click on a state, we get the state map in a pop up window????

2 Answers, 1 is accepted

Sort by
0
Lancelot
Top achievements
Rank 1
answered on 17 Jul 2012, 05:24 PM
Hi Aktzc,

Here is a list of the events RadMap exposes. There are a couple ways to approach this.

This help document will show you how to be able to use a left mouse click event. The following code is used to change the styling of a RadMap line using mouse input from the user.

private void line_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
     {
         MapLine line = sender as MapLine;
         if (line != null)
         {
             if (this.selectedLine != null)
             {
                 this.SetDefaultStyle(this.selectedLine);
             }
 
             if (this.selectedPolyline != null)
             {
                 this.SetDefaultStyle(this.selectedPolyline);
             }
 
             this.selectedLine = line;
             this.selectedPolyline = line.Tag as MapPolyline;
 
             this.SetSelectedStyle(this.selectedLine);
             this.SetSelectedStyle(this.selectedPolyline);
         }
     }

You can adapt this to open a new window and load the state the user picked.

Or another option is the "DrillDown" behavior. RadMap allows you to drill down into lower shapefiles, for instance a state map. The RadMap demo shows you this in action. The Telerik admin will probably point you to the demo, if you look up to the right corner you can toggle the view to "Code" and see how they did it. If it isn't clear by looking at it there, go to C:\Program Files (x86)\Telerik\RadControls for Silverlight Q2 2012\Demos on your machine and load the demo into Visual Studio to see it for youself.

Good Luck,
Lancelot
0
Andrey
Telerik team
answered on 18 Jul 2012, 07:44 AM
Hi Aktzc,

I would recommend you to take a look into the following example:

http://demos.telerik.com/silverlight/#Map/DrillDown

Regards,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Map
Asked by
Aktzc
Top achievements
Rank 1
Answers by
Lancelot
Top achievements
Rank 1
Andrey
Telerik team
Share this question
or