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

Cant Use or Run RadMap

1 Answer 67 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Cesar
Top achievements
Rank 1
Cesar asked on 03 Feb 2011, 07:18 PM
HI, im using Visual Web Developer 2010 express spanish version with the latest hotfix:

OS: Windows Vista
Browser: Internet Explorer 8.0.6001.18999
Telerik version: 2010.1.412.1040

Microsoft Visual Studio 2010
Versión 10.0.30319.1 RTMRel
Microsoft .NET Framework
Versión 4.0.30319 RTMRel

Versión instalada: WD Express

Microsoft Visual Web Developer 2010   01015-532-2002307-70201
Microsoft Visual Web Developer 2010

Hotfix for Microsoft Visual Web Developer 2010 Express - ESN (KB982218)   KB982218
------

Im trying to run the example radmap control and my vs.net showme some errors, i will showyou the code and explain it:
Im Using vb.net 2010.

File: MainPage.xaml.vb (only first lines)

Imports System.Collections.Generic
Imports System.Windows 
Imports System.Windows.Controls
Imports System.Windows.Input 
Imports System.Windows.Media
Imports Telerik.Windows.Controls.Map
Imports Telerik.Windows.Controls
Imports Telerik.Windows.Controls.Map.MapShape

Namespace Telerik.Windows.Examples.Map.Hotel

Partial Public Class Example

Inherits UserControl 

 

 

Private uriArray As Uri() = {New Uri("/Map;component/Hotel/ShapeFiles/Hotel_base.shp", UriKind.RelativeOrAbsolute), New Uri("/Map;component/Hotel/ShapeFiles/Hotel_Rooms.shp", UriKind.RelativeOrAbsolute), New Uri("/Map;component/Hotel/ShapeFiles/Hotel_Corridors.shp", UriKind.RelativeOrAbsolute), New Uri("/Map;component/Hotel/ShapeFiles/Hotel_ServiceRooms.shp", UriKind.RelativeOrAbsolute), New Uri("/Map;component/Hotel/ShapeFiles/Hotel_LiftsAndLadders.shp", UriKind.RelativeOrAbsolute)}

 

 

Private uriArrayIterator As Integer = 0
Private rooms As New List(Of MapShape)() 
Private selectedConditions As New List(Of String)()
Private selectedRoomTypes As New List(Of String)()
Private tooltipTemplate As DataTemplate
Private currentSelectedShape As MapShape
Private locationList As New Dictionary(Of LocationRect, ExtendedData)() ' here the first ERROR: ExtendedData is not defined.

Public Sub New()
    InitializeComponent()
    Me.tooltipTemplate = TryCast(Me.Resources("TooltipTemplate"), DataTemplate)
    Me.selectedConditions.Add("Free")
    Me.selectedConditions.Add("Reserved")
    Me.selectedConditions.Add("Occupied")
End Sub

Private Sub MapShapeReader_PreviewReadCompleted(ByVal sender As Object, ByVal eventArgs As Telerik.Windows.Controls.Map.PreviewReadShapesCompletedEventArgs)
' **** error **** here equal: PreviewReadShapesCompletedEventArgs is not defined.
' and MapShapeReader is not defined too.

Dim shapeReader As MapShapeReader = TryCast(sender, MapShapeReader)
If shapeReader.Source Is uriArray(0) Then 
    
Dim baseShape As MapShape = TryCast(eventArgs.Items(0), MapShape
    
If baseShape IsNot Nothing Then 
        
baseShape.Fill = TryCast(Me.Resources("hotelBase"), Brush
    
End If
End If

If shapeReader.Source Is uriArray(1) Then 
    
For Each element As FrameworkElement In eventArgs.Items 
        
Dim shape As MapShape = TryCast(element, MapShape
        
Me.rooms.Add(shape) 
        
AddHandler shape.MouseLeftButtonDown, New MouseButtonEventHandler(AddressOf shape_MouseLeftButtonDown)
        
Me.ColorRoom(shape)
    
Next
End If

If shapeReader.Source Is uriArray(2) Then 
    
For Each element As FrameworkElement In eventArgs.Items 
        
Dim corridorShape As MapShape = TryCast(element, MapShape
        
If corridorShape IsNot Nothing Then 
            
corridorShape.Fill = TryCast(Me.Resources("corridorFill"), Brush
        
End If 
    
Next
End If 

 

 

 

If shapeReader.Source Is uriArray(3) Then 
    For Each element As FrameworkElement In eventArgs.Items 
        
Dim shape As MapShape = TryCast(element, MapShape
        
Me.ColorServiceRooms(shape) 
    
Next 
End If

If shapeReader.Source Is uriArray(4) Then
    
For Each element As FrameworkElement In eventArgs.Items
        
Dim shape As MapShape = TryCast(element, MapShape)
        
Me.ColorLiftsAndLadders(shape)
    
Next
End If
End Sub

' ************************************************************************************
' ******** Other ERROR ****************
Private Sub UpdateRoomShapeSelection(ByVal roomShape As MapShape)

If
Me.currentSelectedShape IsNot Nothing Then
' *** This line showme the error: Me.currentSelectedShape.ExtendedData is not a member of telerik.windows.controls.map.mapshape

Dim originalState As String = Me.currentSelectedShape.ExtendedData.GetValue("RoomState").ToString()Me.currentSelectedShape.Fill = TryCast(Me.Resources(String.Format("{0}", originalState)), Brush)
Me.currentSelectedShape.Stroke = TryCast(Me.Resources(String.Format("{0}Stroke", originalState)), Brush)
Me.currentSelectedShape.StrokeThickness = 1
End If

If
roomShape IsNot Nothing Then
' **** here same error. roomShape.ExtendedData is not a member of telerik.windows.controls.map.mapshape 
    
Dim roomState As String = roomShape.ExtendedData.GetValue("RoomState").ToString()
    roomShape.Fill =
TryCast(Me.Resources(String.Format("{0}HighlightFill", roomState)), Brush)
    roomShape.Stroke =
TryCast(Me.Resources(String.Format("{0}HighlightStroke", roomState)), Brush)
    roomShape.StrokeThickness = 2
    Me.currentSelectedShape = roomShape
End If

End Sub

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 08 Feb 2011, 09:07 AM
Hi Cesar,

You use version of RadControls for Silverlight 2010.1.412.1040. Unfortunately the map control of this version does not contain features required for this example. This functionality is available since 2010.3 version only. I would recommend that you download the latest internal build.

Best wishes,
Andrey Murzov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
General Discussions
Asked by
Cesar
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or