Cant Use or Run RadMap

2 posts, 0 answers
  1. Cesar
    Cesar avatar
    1 posts
    Member since:
    Apr 2008

    Posted 03 Feb 2011 Link to this post

    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 showme some errors, i will showyou the code and explain it:
    Im Using 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()
        Me.tooltipTemplate = TryCast(Me.Resources("TooltipTemplate"), DataTemplate)
    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
    AddHandler shape.MouseLeftButtonDown, New MouseButtonEventHandler(AddressOf shape_MouseLeftButtonDown)
    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 
    End If 




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

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

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

    Me.currentSelectedShape IsNot Nothing Then
    ' *** This line showme the error: Me.currentSelectedShape.ExtendedData is not a member of

    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

    roomShape IsNot Nothing Then
    ' **** here same error. roomShape.ExtendedData is not a member of 
    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

  2. Andrey
    Andrey avatar
    1681 posts

    Posted 08 Feb 2011 Link to this post

    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>>
Back to Top