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

shapefile uri/location

4 Answers 11 Views
Map
This is a migrated thread and some comments may be shown as answers.
Wyatt
Top achievements
Rank 1
Wyatt asked on 05 Aug 2014, 12:44 PM
when trying to add a shapefile layer I keep getting not found errors.  what should the uri look like and where do the shapefiles go?

do the go in the web harness part of the project or the xaml part? and the URI what should that be?


    <telerik:MapShapeReader DataSource="PhysicalLocations;/ClientBin/cb_2013_us_state_500k.dbf"
                                            Source="PhysicalLocations;/ClientBin/cb_2013_us_state_500k.shp"
                                            PreviewReadCompleted="MapShapeReader_PreviewReadCompleted">
                        
                    </telerik:MapShapeReader>

4 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 05 Aug 2014, 01:50 PM
Hi Wyatt,

You can include the shape-file (.shp and .dbf) to the Silverlight project as Resources. In this case you should set the Uri format like to the following:
/Assembly Name;component/Path/File Name.

Or can include the shape-file to the web project as Content. In a case, when the shape-file is placed on the web site then you can use the the following Uri format:
Path/File Name.

Regards,
Andrey Murzov
Telerik

 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Pavel R. Pavlov
Telerik team
answered on 06 Aug 2014, 04:59 AM
Hi Wyatt,

You can include the shape-file (.shp and .dbf) to the Silverlight project as Resources. In this case you should set the Uri format like to the following:
/Assembly Name;component/Path/File Name.

Or can include the shape-file to the web project as Content. In a case, when the shape-file is placed on the web site then you can use the the following Uri format:
Path/File Name.

Regards,
Andrey Murzov 
Telerik

 
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Wyatt
Top achievements
Rank 1
answered on 07 Aug 2014, 03:49 PM
is there some additional setting?  I have the files in a folder in the web project under ClientBin/cb_2013_us_state_500k.dbf and ClientBin/cb_2013_us_state_500k.shp and have tried the following iterations. all come back as not found? I was able to do it successfully in a wpf project, just not a sliverlight website.

I also have Copy to output directory set to copy always

DataSource="../ClientBin/cb_2013_us_state_500k.dbf"
                                            Source="../ClientBin/cb_2013_us_state_500k.shp"

DataSource="~/ClientBin/cb_2013_us_state_500k.dbf"
                                            Source="~/ClientBin/cb_2013_us_state_500k.shp"

DataSource="/ClientBin/cb_2013_us_state_500k.dbf"
                                            Source="/ClientBin/cb_2013_us_state_500k.shp"

DataSource="ClientBin/cb_2013_us_state_500k.dbf"
                                            Source="ClientBin/cb_2013_us_state_500k.shp"
0
Andrey
Telerik team
answered on 08 Aug 2014, 12:57 PM
Hello Wyatt,

When you use IIS Express for your web project then most often this problem occurs in a case when the MIME types for shape and dbf files are not defined on the web server.

You should define MIME types for using shape files:
Extensions: .shp and .dbf
MIME type: application/octet-stream

You can set it for example using the following commands of appcmd in the folder of the IIS Express (usually its location is C:\Program Files (x86)\IIS Express):
appcmd set config /section:staticContent /+[fileExtension='.shp',mimeType='application/octet-stream']
appcmd set config /section:staticContent /+[fileExtension='.dbf',mimeType='application/octet-stream']

Regards,
Andrey Murzov
Telerik

 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Map
Asked by
Wyatt
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Pavel R. Pavlov
Telerik team
Wyatt
Top achievements
Rank 1
Share this question
or