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

Radmap auto connection

2 Answers 54 Views
Map
This is a migrated thread and some comments may be shown as answers.
Civelle
Top achievements
Rank 2
Civelle asked on 18 Oct 2010, 12:41 PM
Hi.

We have implemented the radmap control in our application. Everything is fine except for we would like to prevent the control to automatically connect to Bing when loading the page. We built our code base on the example provided on your site and the XAML look like this:

         <telerik:RadMap x:Name="rmMap" Grid.Column="0" ZoomLevel="3" Center="62.832999, -95.9139999"  ZoomChanged="rmMap_ZoomChanged" CenterChanged="rmMap_CenterChanged" Visibility="Collapsed" Canvas.ZIndex="1">
             <telerikMap:InformationLayer Name="informationLayer">
                 <telerikMap:InformationLayer.ItemTemplate>
                     <DataTemplate>
                         <Border Background="#7FFFFFFF" BorderThickness="1" Padding="2,2,2,2">
                             <ToolTipService.ToolTip>
                                 <ToolTip Content="{Binding Path=Title}" />
                             </ToolTipService.ToolTip>
                             <telerikMap:MapLayer.HotSpot>
                                 <telerikMap:HotSpot X="0.5" Y="0.5" />
                             </telerikMap:MapLayer.HotSpot>
                             <Grid>
                                 <Grid.ColumnDefinitions>
                                     <ColumnDefinition Width="14" />
                                     <ColumnDefinition Width="Auto" />
                                 </Grid.ColumnDefinitions>
                                 <Path Fill="Red">
                                     <Path.Data>
                                         <GeometryGroup>
                                             <EllipseGeometry Center="7,7" RadiusX="3" RadiusY="3" />
                                             <EllipseGeometry Center="7,7" RadiusX="7" RadiusY="7" />
                                         </GeometryGroup>
                                     </Path.Data>
                                 </Path>
                             </Grid>
                         </Border>
                     </DataTemplate>
                 </telerikMap:InformationLayer.ItemTemplate>
                </telerikMap:InformationLayer>
             <telerikMap:InformationLayer Name="informationLayer2" />
            </telerik:RadMap>

So when we load the UserControl that contains RadMap, it automatically connects to BING Map Provider (this is my understanding) to provide the map as per the specifications above. Is there a way to still include the radmap in our UserControl and have it connect to BING only at the time of calling the 'SearchProvider.SearchAsync(request)' for the first time in our code?

The reason we want to do this is to limit the number of 'hits' to BING


Civelle.

2 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 20 Oct 2010, 03:57 PM
Hi Civelle,

If I understand your question correctly, you would like to have map region empty when your application starts (don’t show any map tiles). When user performs some operation (search something) map should start show tiles from Bing. Is it correct? If it is so, then you can use EmptyProvider when your application starts and then replace it with BingMapProvider when necessary. For example:

<telerik:RadMap x:Name="radMap" 
        Center="37.7847107699891, -122.421295514088"
        ZoomLevel="8">
    <telerik:RadMap.Provider>
        <telerik:EmptyProvider />
    </telerik:RadMap.Provider>
</telerik:RadMap>

private void DoSearch(object sender, RoutedEventArgs e)
{
    this.bingProvider = new BingMapProvider("You_Bing_Map_ID");
    this.radMap.Provider = bingProvider;            
  
    // Do other things
}


Sincerely yours,
Andrey Murzov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Civelle
Top achievements
Rank 2
answered on 20 Oct 2010, 04:17 PM
Hi Andrey.

Thanks for your suggestion: I think that this is exactly what we are looking for. I will try this as soon as I get a chance to get back working on the maps.


Civelle.
Tags
Map
Asked by
Civelle
Top achievements
Rank 2
Answers by
Andrey
Telerik team
Civelle
Top achievements
Rank 2
Share this question
or