2 posts, 0 answers
  1. Zuhair
    Zuhair avatar
    6 posts
    Member since:
    Jan 2013

    Posted 26 Jan 2013 Link to this post

    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:

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

    ShapefileViewModel ??!!!

    thank you
  2. Andrey
    Andrey avatar
    1681 posts

    Posted 29 Jan 2013 Link to this post

    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:
    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">
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            <telerik:RadMap Grid.Column="1" x:Name="RadMap1" ZoomLevel="7" />
            <StackPanel Grid.Column="0" Margin="3">
                    <TextBlock Text="Select Provider:" />
                    <ListBox x:Name="ProviderBox"
                        <ListBoxItem Content="BingMapProvider"/>
                        <ListBoxItem Content="OpenStreetMapProvider"/>
                    <TextBlock Text="Select Location:" />
                    <ListBox x:Name="LocationBox"                        
                             Margin="0,2" >
                                <TextBlock Text="{Binding Description}"/>
                        <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" />

    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?

    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft R3 2016 release webinar banner
Back to Top