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

map

1 Answer 154 Views
Map
This is a migrated thread and some comments may be shown as answers.
Zuhair
Top achievements
Rank 1
Zuhair asked on 26 Jan 2013, 06:12 AM
Hi,
I'm new to WPF and telerik and tried to download the example demo Bing and openstreetmap providers
when i try to run it i get a lot of errors and this has been happening to me with all the demo examples.

can someone attach a working project for any map. so I can start from there

or what do i have to change to make the code run beside :

<UserControl x:Class="Telerik.Windows.Examples.Map.Shapefile.WorldContinents.Example"
to be :
<UserControl x:Class="my space name"

delete  xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=QuickStart.Common"

I keep getting error in this line only:

<UserControl.Resources>
        <example:ShapefileViewModel x:Key="DataContext" Region="world_continents" />
    </UserControl.Resources>


ShapefileViewModel ??!!!


thank you

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 29 Jan 2013, 12:46 PM
Hello Zuhair,

You can install our QSF demo application separately. You can download the installation file from your Telerik account under Manage Products - > Trial Downloads -> RadControls for WPF/Download -> Demos Automatic Installation. The QSF is installed locally in the folder like the following:
C:\Program Files (x86)\Telerik\RadControls for WPF Q3 2012\Demos

The QSF is quite complex application. You can't simple extract 1 sample project from it and get it run. There are many additional steps you have to do. For the "Bing and OpenStreetMap Providers" example you can do it as following:
1. Open the new WPF application project (for example GeoImageryProviders project) using the Visual studio.
2. Reference the three following DLLs:
 - Telerik.Windows.Controls.dll
 - Telerik.Windows.Controls.DataVisualization.dll
 - Telerik.Windows.Data.dll
3. Open the properties of the project and define WPF in the Conditional compilation symbols field in the Build section.
4. Open the MainWindow.xaml
5. Add the following namespace declaration:
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
6. Copy the XAML code of the  of the example but without using the QuickStart.ConfigurationPanel. You can use for example the Grid.ColumnDefinitions to add the configuration section (inner code of the QuickStart.ConfigurationPanel) in your application. The sample code is below.
<Window x:Class="GeoImageryProviders.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
         
        <telerik:RadMap Grid.Column="1" x:Name="RadMap1" ZoomLevel="7" />
 
        <StackPanel Grid.Column="0" Margin="3">
            <StackPanel>
                <TextBlock Text="Select Provider:" />
                <ListBox x:Name="ProviderBox"
                         SelectionChanged="ProviderBox_SelectionChanged"
                         Margin="0,2">
                    <ListBoxItem Content="BingMapProvider"/>
                    <ListBoxItem Content="OpenStreetMapProvider"/>
                </ListBox>
            </StackPanel>
            <StackPanel>
                <TextBlock Text="Select Location:" />
                <ListBox x:Name="LocationBox"                        
                         SelectionChanged="LocationBox_SelectionChanged"
                         Margin="0,2" >
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Description}"/>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
 
                    <telerik:Location Description="Sofia, Bulgaria"  Latitude="42.697872" Longitude="23.321583" />
                    <telerik:Location Description="Munich, Germany" Latitude="48.139126" Longitude="11.580186" />
                    <telerik:Location Description="Boston, Massachusetts" Latitude="42.358431" Longitude="-71.059773" />
                    <telerik:Location Description="Houston, Texas" Latitude="29.763284" Longitude="-95.363272" />
                </ListBox>
            </StackPanel>
        </StackPanel>
    </Grid>
</Window>

7. Open the MainWindow.xaml.cs.
8. Add the System.Windows.Threading and Telerik.Windows.Controls.Map namespaces to the usings section.
9. Remove the MainWindow method.
10. Copy the content of the Example class from the Example.xaml.cs to the MainWindow class.
11. Change the name of the 'Example' method to 'MainWindow'.
12. Add the VEKey constant string to the MainWindow class. This constant should contain your Bing Maps Key.
13. Navigate to the InitializeBingMapProvider method.
14. Change the using of the BingMapHelper.VEKey to using of the VEKey constant which is defined in the step #12.

Could you please provide us with step-by-step description of what you've tried to run the sample project and sent the project itself so we could check what is wrong and give you some additional instructions?

Greetings,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

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