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

Problem publish shape files

1 Answer 99 Views
Map
This is a migrated thread and some comments may be shown as answers.
Sasa Grebenar
Top achievements
Rank 1
Sasa Grebenar asked on 03 Feb 2011, 03:01 PM
Hi
I have problem when I made publish of my project which show esri shape files. When I start project in VS2010 everything work ok and I see shape file ok but when I publish it application work ok but I don't see shape file. I publish project to 
http://****.dyndns.org:8081/gr1/ .

I found that 'MapShapeReader_PreviewReadCompleted' which I defined for MapShapeReader never fire on published version
            
            PreviewReadCompleted
="MapShapeReader_PreviewReadCompleted"
            ReadCompleted
="MapShapeReader_ReadCompleted"

<my:EmptyProvider MinZoomLevel="3" MaxZoomLevel="20" />

I use RadControls version 2010.3.1110.1040

Would you be so kind to help me. I need to show my project next week and this is very urgent to me..


Best regards

SASA

Error

Webpage error details
  
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; AskTB5.6)
Timestamp: Fri, 4 Feb 2011 15:39:58 UTC
  
  
Message: Unhandled Error in Silverlight Application Object reference not set to an instance of an object.   at eGroblje.MainPage.MapShapeReader_PreviewReadCompleted(Object sender, PreviewReadShapesCompletedEventArgs eventArgs)
   at Telerik.Windows.Controls.Map.PreviewReadShapesCompletedEventHandler.Invoke(Object sender, PreviewReadShapesCompletedEventArgs eventArgs)
   at Telerik.Windows.Controls.Map.MapShapeReader.OnPreviewReadCompleted(PreviewReadShapesCompletedEventArgs previewReadCompletedArgs)
   at Telerik.Windows.Controls.Map.MapShapeReader.CompleteReading(ShapeReaderStatus status, Exception error)
   at Telerik.Windows.Controls.Map.MapShapeReader.CheckComplete(Exception serviceError, Object userState, Stream stream, Boolean data)
   at Telerik.Windows.Controls.Map.MapShapeReader.ReadShapesCompleted(Object sender, OpenReadCompletedEventArgs e)
   at System.Net.WebClient.OnOpenReadCompleted(OpenReadCompletedEventArgs e)
   at System.Net.WebClient.OpenReadOperationCompleted(Object arg)
Line: 1
Char: 1
Code: 0
URI: http://***.dyndns.org:8081/gr1/Silverlight.js

  MainPage.xaml

<UserControl x:Class="eProjekt.MainPage" 
.... 
    <my:RadMap.Provider>
             <my:EmptyProvider MinZoomLevel="3" MaxZoomLevel="20" />
    </my:RadMap.Provider>
    <my:InformationLayer.Reader
        <my:MapShapeReader ClearLayer="False" 
            PreviewReadCompleted="MapShapeReader_PreviewReadCompleted"
            ReadCompleted="MapShapeReader_ReadCompleted"
            Source="/eProjekt.MainPage;component/ShapeFiles/shape1.shp"
        </my:MapShapeReader
    </my:InformationLayer.Reader
... 
</UserControl>

   

 MainPage.xaml.vb

Partial Public Class MainPage 
  
    Inherits UserControl 
   
    Private uriArray As Uri() = {New Uri("../ShapeFiles/shape1.shp", UriKind.RelativeOrAbsolute),
    New Uri("../ShapeFiles/shape2.shp", UriKind.RelativeOrAbsolute),
    New Uri("../ShapeFiles/shape3.shp", UriKind.RelativeOrAbsolute)} 
   
Private Sub MapShapeReader_PreviewReadCompleted(ByVal sender As Object, ByVal eventArgs As Telerik.Windows.Controls.Map.PreviewReadShapesCompletedEventArgs) 
   
  
        MessageBox.Show("MapShapeReader_PreviewReadCompleted")
        Dim shapeReader As MapShapeReader = TryCast(sender, MapShapeReader)
        If shapeReader.Source Is uriArray(0) Then
            ....
            ....
        End If
          
End Sub
  
End Class

 

 

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 08 Feb 2011, 08:44 AM
Hello Sasa Grebenar,

It is very complicated and it is hard to reproduce the problem using just a code snippet you sent.
Most often this problem occurs in published projects when MIME types for shape and dbf files are not defined on the web server. Please check that MIME types for using shape files are defined:
Extensions: .shp and .dbf
MIME type: application/octet-stream

The version you use does not fire the PreviewReadCompleted event when an error occurs during loading of shape files. You can use the ReadCompleted event to check the eventArgs.Error property that returns the exception when it occurs.

Greetings,
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
Map
Asked by
Sasa Grebenar
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or