我目前正在寻找使用mapbox对所有注释进行排序.
我知道我应该使用以下过程:
//implementing this method and do the sort here
(NSComparator)annotationSortingComparatorForMapView:(RMMapView *)mapView
// remove current annotation and use the sorted array to redraw them
[mapView removeAnnotations:[mapView annotations]];
[mapView addAnnotations:annotationSorted];
Run Code Online (Sandbox Code Playgroud)
这里的问题是我迷失了我应该称之为这个过程的地方.
我实际上是mapView:layerForAnnotation:用来返回应该绘制的形状,但如果我没有错,那么它是一个回调,所以不是从代码中调用的.
谢谢你的帮助.
感谢jszumski,我想出了一个实现.对于那些在未来需要它的人来说,它是:
- (NSComparator)annotationSortingComparatorForMapView:(RMMapView *)RmapView
{
NSComparator sort =^(RMAnnotation *annotation1, RMAnnotation *annotation2)
{
// Sort user location annotations above all.
//
if ( annotation1.isUserLocationAnnotation && ! annotation2.isUserLocationAnnotation)
return NSOrderedDescending;
if ( ! annotation1.isUserLocationAnnotation && annotation2.isUserLocationAnnotation)
return NSOrderedAscending;
// Amongst user location annotations, sort properly.
//
if …Run Code Online (Sandbox Code Playgroud) 我想动态更新ffserver.conf以向其添加新的流源.
无论如何在ffserver中重新加载ffserver.conf而不停止运行的流?
我当前正在尝试获取 DataGrid 中选定行的内容。
问题是我实际上得到了一个 DataRowView 但我无法用它做任何事情......
我想访问 DataGrid 中所选行的所有字段。
这是可以帮助您的代码:
XAML:
<DataGrid SelectionUnit="FullRow" SelectedItem="{Binding SelectedZone, Mode=TwoWay}" AutoGenerateColumns="True" Margin="0,167,6,24" Name="existingCase" Width="780" >
<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}">
<EventSetter Event="MouseDoubleClick" Handler="resultDataGrid_MouseDoubleClick"/>
</Style>
</DataGrid.RowStyle>
</DataGrid>
Run Code Online (Sandbox Code Playgroud)
CS :
private void resultDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (sender != null)
{
SelectedZone = existingCase.SelectedItem;
// SelectedZone is declared as private object SelectedZone
MessageBox.Show(SelectedZone.GetType().ToString());
// Result to a System.Data.DataRowView
}
}
Run Code Online (Sandbox Code Playgroud)
感谢您的帮助