Hello,
In our app we are using filtering through a RadGridView bound to a QueryableCollectionView that wraps an ObservableCollection. Now I'm trying to use that filtered QueryableCollectionView as the ItemSource for a VisualizationLayer in a RadMap so that the filter on the grid also applies to items shown on the map, but the bind fails with the following error: "System.ArgumentException: 'Telerik.Windows.Data.QueryableCollectionView' is not a valid value for property 'Source'."
I've attached a quick project replicating the issue with the relevant code in MainWindow.xaml:
<!-- Doesn't work -->
<telerik:VisualizationLayer ItemsSource="{Binding ItemViewModelsView }" ItemSelectionMode="None">
<telerik:VisualizationLayer.ItemTemplate>
<DataTemplate DataType="{x:Type local:ItemViewModel}">
<Ellipse Fill="Blue" Width="12" Height="12" telerik:MapLayer.Location="{Binding Location}"/>
</DataTemplate>
</telerik:VisualizationLayer.ItemTemplate>
</telerik:VisualizationLayer>
<!-- Also doesn't work pulling directly from the GridView -->
<telerik:VisualizationLayer ItemsSource="{Binding Items, ElementName=GridView }" ItemSelectionMode="None">
<telerik:VisualizationLayer.ItemTemplate>
<DataTemplate DataType="{x:Type local:ItemViewModel}">
<Ellipse Fill="Blue" Width="12" Height="12" telerik:MapLayer.Location="{Binding Location}"/>
</DataTemplate>
</telerik:VisualizationLayer.ItemTemplate>
</telerik:VisualizationLayer>
<!-- Works but isn't filtered -->
<telerik:VisualizationLayer ItemsSource="{Binding ItemViewModels }" ItemSelectionMode="None">
<telerik:VisualizationLayer.ItemTemplate>
<DataTemplate DataType="{x:Type local:ItemViewModel}">
<Ellipse Fill="Blue" Width="12" Height="12" telerik:MapLayer.Location="{Binding Location}"/>
</DataTemplate>
</telerik:VisualizationLayer.ItemTemplate>
</telerik:VisualizationLayer>
and the ViewModel:
public partial class MainWindowViewModel : ObservableObject
{
[ObservableProperty] private ObservableCollection<ItemViewModel> _itemViewModels;
public QueryableCollectionView ItemViewModelsView { get; private set; }
//...
}
It appears to me that the issue is because QueryableCollectionView is both an IEnumerable and a ICollectionView so when it tries to assign it to the MapItemsSource the CollectionViewSource.IsSourceValid() that's called during that assignment is returning false because it is an ICollectionView.
Is there a known workaround for this or suggested alternative to get the expected functionality?
Thanks!
Hi,
I am working on a tool for an application based on one of the examples. I have noticed that when I create the pushpin using a Path then it is only selected if I hit exactly on the lines of the image being drawn.
This could be a general XAML question, but not really sure how this works. I would like to have the pin selected when I hit the area defined by the image.
My datatemplate:
<DataTemplate x:Key="PositionPushPinTemplate">hello
i have customprovider base on UriImageProvider.
When I lose my network connectionand I try to move the map quickly or zoom in or out, the program breaks and my visual studio go to getemptyimage located in class imagemapsource.
What I'm doing wrong or how to protect myself from it?
Is there a reason the ArcGIS provider does not require a key? Following the documentation shows the map without any issues.
https://docs.telerik.com/devtools/wpf/controls/radmap/features/providers/arcgis
Also, is there a way to use other styles or basemaps other than what the control provides? In particular, the imagery hybrid, which is aerial imagery with the roads/labels.
Is it possible to change the max zoom? ArcGisWorldMapSourceBase.cs uses a max zoom of only 19. I have the same issue with the Bing and Azure providers. I'd like to use the higher zoom levels available and not have the map control scale the images, which will then be blurry.
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:
Here is the code portion
<telerik:VisualizationLayer x:Name="visualizationLayer" ItemsSource="{Binding ObJItems}">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.
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
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.
I have a MapPinPoint, and I want to insert it inside an Ellipse dynamically
How can this be done?
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?
How to compare two MapPinPoint
MapPinPoint mapPinPoint1 = new MapPinPoint();
MapPinPoint mapPinPoint2 = new MapPinPoint();
How can you check if they are equal?