Telerik Forums
UI for WPF Forum
0 answers
4 views

Hello ,

I'm currently working on a visualization layer to display a trace line of a Location Collection. To achieve this, I have set the ItemsSource of the layer to an Observable Collection. Additionally, I am using PolylineData to visualize the Location Collection. However, during implementation, I encountered the following errors:

  • The specified value cannot be assigned. The following type was expected: "DependencyObject".
  • Property 'VisualTree' does not support values of type 'PolylineData'.

Here is the code portion 

                                <telerik:VisualizationLayer x:Name="visualizationLayer" ItemsSource="{Binding ObJItems}">
                                    <telerik:VisualizationLayer.ItemTemplate>
                                        <DataTemplate>
                                            <telerik:PolylineData Points="{Binding TrackPoints}">
                                        <telerik:PolylineData.ShapeFill>
                                            <telerik:MapShapeFill Stroke="Blue" 
                                      StrokeThickness="2" />
                                        </telerik:PolylineData.ShapeFill>
                                    </telerik:PolylineData>
                                        </DataTemplate>
                                    </telerik:VisualizationLayer.ItemTemplate>
                                </telerik:VisualizationLayer>


BNM2024
Top achievements
Rank 1
Iron
 asked on 11 Mar 2024
2 answers
9 views

Hello, 

I'm currently working on a visualization layer to display a trace line of a Location Collection. To achieve this, I have set the ItemsSource of the layer to an Observable Collection. Additionally, I am using PolylineData to visualize the Location Collection. However, during implementation, I encountered some errors.

  • The specified value cannot be assigned. The following type was expected: "DependencyObject".
  • Property 'VisualTree' does not support values of type 'PolylineData'.

Here is the portion of the code

<telerik:VisualizationLayer x:Name="visualizationLayer" ItemsSource="{Binding ObjItems}">
                                    <telerik:VisualizationLayer.ItemTemplate>
                                        <DataTemplate>
                                            <telerik:PolylineData Points="{Binding TrackPoints}">
                                        <telerik:PolylineData.ShapeFill>
                                            <telerik:MapShapeFill Stroke="Blue" 
                                      StrokeThickness="2" />
                                        </telerik:PolylineData.ShapeFill>
                                    </telerik:PolylineData>
                                        </DataTemplate>
                                    </telerik:VisualizationLayer.ItemTemplate>
                                </telerik:VisualizationLayer

BNM2024
Top achievements
Rank 1
Iron
 answered on 11 Mar 2024
1 answer
41 views

Hello. I faced the problem when i am trying to get Route from BinRestMapProvider, using method CalculateRouteAsync, it returns status code 400 and message like this: "This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","errorDetails":["One or more parameters are not valid.","waypoint: One or more locations specified in the waypoint parameter are invalid or require more information. : 42,6957539183824;23,3327663758679"],"resourceSets":[],"statusCode":400,"statusDescription":"Bad Request" "

I just followed the example at:
https://docs.telerik.com/devtools/wpf/controls/radmap/features/providers/bing-rest-map-provider/routing

I guess problem is in example 4 of this doc: "request.Waypoints.Add(point.ToString());"

I hope someone can help me with it.

Dmytro
Top achievements
Rank 1
Iron
 answered on 09 Jun 2023
2 answers
57 views

I have a MapPinPoint, and I want to insert it inside an Ellipse dynamically

How can this be done?

Ohad
Top achievements
Rank 3
Bronze
Iron
Iron
 answered on 08 Jan 2023
2 answers
50 views

var frameworkElements = KmlReader.Read(memoryStream);

I have a list of the elements (which in the initial stage are not displayed on the map) and I want to have a BusyIndicator until loading.

That is, until I performed the KmlReader.Read(memoryStream), the list in the picture will be a square without data, so I want a BusyIndicator

But the KmlReader works on the UI thread, so this cannot be done.

Is there a way to overcome this?

Is there a way to make this line in the background thread?

 

Ohad
Top achievements
Rank 3
Bronze
Iron
Iron
 updated answer on 26 Dec 2022
0 answers
43 views

How to compare two MapPinPoint

MapPinPoint mapPinPoint1 = new MapPinPoint();
MapPinPoint mapPinPoint2 = new MapPinPoint();

How can you check if they are equal?

Ohad
Top achievements
Rank 3
Bronze
Iron
Iron
 asked on 22 Dec 2022
0 answers
40 views
Is it possible to create the MapShapeReader by passing the XmlDocument object or do I have to save it locally and pass the path?
Ohad
Top achievements
Rank 3
Bronze
Iron
Iron
 asked on 17 Nov 2022
0 answers
30 views

When I create a MapPolygon and then I call SetView with the GeoBounds I get the correct zoom and center.

var polygon = new MapPolygon
{
    Points = points,
    ToolTip = toolTip,
    ShapeFill = new MapShapeFill
    {
        Stroke = new SolidColorBrush(Colors.Blue),
        StrokeThickness = 2,
        Fill = new SolidColorBrush(Color.FromArgb(0x5A, 0x80, 0x80, 0x80))
    }
};
RadMap.SetView(polygon.GeoBounds);

But when I create a MapEllipse and call SetView I get ZoomLevel = 1 and I don't understand why

var ellipse = new MapEllipse
{
    Width = (double)radius * 2,
    Height = (double)radius * 2,
    Stroke = new SolidColorBrush(Colors.Blue),
    StrokeThickness = 2,
    Fill = new SolidColorBrush(Color.FromArgb(0x5A, 0x80, 0x80, 0x80)),
    Location = points.ElementAt(0),
};
MapLayer.SetHotSpot(ellipse, new HotSpot { X = 0.5, Y = 0.5 });
RadMap.SetView(ellipse.GeoBounds);

Would appreciate help

Ohad
Top achievements
Rank 3
Bronze
Iron
Iron
 updated question on 15 Nov 2022
0 answers
36 views

I'm working with OSM and getting a BoundingBox to a certain location.

How can I take the value of the BoundingBox and put it in the Map.

Because BoundingBox is min latitude, max latitude, min longitude, max longitude

And Map.GeoBounds requires North, South, East, and West.

And given that I was able to put the Map.GeoBounds,

How can I make it possible to slide the map to the sides and not lock it as I am currently noticing happening.

For Example:

London BoundingBox I got from Nominatim (OSM): 

{51.2867601, 51.6918741, -0.5103751, 0.3340155}

 

And the main goal of course is to set the zoom according to the search location,

In my understanding, it should be done with the GeoBounds property.

Would appreciate help

Ohad
Top achievements
Rank 3
Bronze
Iron
Iron
 updated question on 02 Nov 2022
1 answer
40 views

I would like to create a MapEllipse from Code Behind using values that I have stored.

But the property Center only has a get method.

How can I determine the Center of the MapEllipse from Code Behind?

 

 

var mapEllipse = new MapEllipse();
mapEllipse.Width = mapEllipse.Height = 50;
mapEllipse.Fill = Brushes.Yellow;
mapEllipse.Opacity = 0.2;
mapEllipse.Stroke = Brushes.Red;
mapEllipse.StrokeThickness = 2;
//mapEllipse.Center = ?

 

Thanks

 

Dilyan Traykov
Telerik team
 answered on 27 Oct 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?