As the documentation online:
this.informationLayer.Reader = new MapShapeReader();
this.informationLayer.Reader.Source = new Uri("/Silverlight.Help.RadMapSamples;component/Data/bulgaria.kml",UriKind.RelativeOrAbsolute )
But, there is no the "Source" property in "Reader.Source" ... How to do it???
5 Answers, 1 is accepted
Currently the InformationLayer.Reader property can use the instance of the MapShapeReader or of the SqlGeospatialDataReader. They have different Source properties. The type of InformationLayer.Reader property is a base class they inherit. But the base class does not contain this property.
So, you should convert the value of Reader property to MapShapeReader type before using the Source property. Also you can use a variable of MapShapeReader type in your code like below:
MapShapeReader reader =
new
MapShapeReader();
this
.informationLayer.Reader = reader;
reader.Source =
new
Uri(
"/Silverlight.Help.RadMapSamples;component/Data/bulgaria.kml"
, UriKind.RelativeOrAbsolute);
P.S. You have opened several posts in different threads with the same question. Please avoid duplicate threads and choose one of them only if you'd like to continue conversation on the same topic. This will make it easier for both sides to follow it.
Kind regards,
Andrey Murzov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
As you said, however, this.informationLayer.Reader = reader; They said that the name "reader" doesn't exsit in current context.
Also,I got another question want to be answered.
I created a radMap1 already, but I want to create the "level" also, which means that after button_touchdown,I want to show another background or another radMap of floor plan.
which one is better for me to do it, another radMap2 or image background?
if I use the image background, how to get the correct image Uri? and I mainly want to add shapefile for it to touch, is it necessary to add the image for background?
Now my coding is like this:
private void level1_touchdown(object sender, TouchEventArgs e)
{
radMap1.Visibility = Visibility.Collapsed;
ImageBrush b = new ImageBrush();
b.ImageSource = new BitmapImage(new Uri(@"D:\component\images\directory_level2.png"));
b.Stretch = Stretch.Uniform;
this.Background = b; ;
//this.Background.SetValue(ImageBrush.ImageSourceProperty, new BitmapImage() { UriSource = new Uri(@"D:\component\images\directory_level2.png") });
}
but the error is can't get the path of image.
Really confused about that, hope can be solved.
Please, be careful when you copy-paste code. You have to declare and assign 'reader' variable before using it. Just take a look into the first line in my code snippet:
MapShapeReader reader =
new
MapShapeReader();
It is up to you to show another RadMap control or simple image. It absolutely depends on your application requirements. But if you need to show floor plan using ESRI shape file (or KML file, or WKT/WKB) then you definitely should use RadMap. By the way, you can use same RadMap control to show different 'levels' of your map. Simple clear all items in the InformationLayer and add another ones.
Please be advised that Telerik is a third-party vendor which supplies components based on a platform provided by Microsoft. That is why our documentation does not provide the basics of how to work with Silverlight and XAML. Your question about image URI seems to be general programming question, which is not related to any of RadControls for Silverlight and we consider it out of the scope of our support services. I will kindly recommend you to start from having a look at MSDN:
http://msdn.microsoft.com/en-us/library/system.uri(v=vs.95).aspx
http://msdn.microsoft.com/ru-ru/library/cc296240(v=vs.95).aspx
http://msdn.microsoft.com/ru-ru/library/system.windows.controls.image.source(v=vs.95).aspx
http://msdn.microsoft.com/en-us/library/cc189008(v=vs.95).aspx
Regards,
Andrey Murzov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
thanks a lot.
I am thinking that if possible for me to add some shape control on the background image? However, what make me confused is that how can I put the shape control on the correct position on the image for people to touch down.
Or antoher way I can do is accroding to the sample in telerik"stadium map" to add the shape file...I already install the ArcGIS, but really not familar with this software...is there any shapefile can download for my project? Since my project can use any other floor plan image no matter shoppingmall or anywhere...I just want to show the touch function with detail information about the facility like washroom..
At last, Could you post the stadium map whole source code for us to learn?
I am very appreciate to see your answer.
Could you, please clarify what do you mean under "shape control"? We have not any map shape management control which can be used outside the RadMap control.
For avoid misunderstanding about the RadMap I should note that we provide the control only. Telerik does not provide any map images, shape-files, kml-files and databases except of files which are provided just for our examples only. All shape files are used in our demo application (including "Hotel floorplan" and "Stadium map") are available in the installation package. You can find these examples and theirs shape-files using the path like the following:
C:\Program Files (x86)\Telerik\RadControls for Silverlight Q2 2013\Demos\Examples\Map\Stadium
C:\Program Files (x86)\Telerik\RadControls for Silverlight Q2 2013\Demos\Examples.Web\DataSources\Geospatial\Stadium\
C:\Program Files (x86)\Telerik\RadControls for Silverlight Q2 2013\Demos\Examples\Map\Hotel
Regards,
Andrey Murzov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>