本文整理汇总了C#中MapLayer.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# MapLayer.Clear方法的具体用法?C# MapLayer.Clear怎么用?C# MapLayer.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapLayer
的用法示例。
在下文中一共展示了MapLayer.Clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawSearchMarkers
/*
* функция дляотрисовки маркеров поиска на карте.
* Если задан параметр index, то необходимо отобразить только один маркер с указанным индексом.
*/
private void DrawSearchMarkers(MapLayer mapLayer, int index = -1)
{
if (searchMapMarkers != null)
{
mapLayer.Clear();
if (index != -1)
{
DrawMapMarker(searchMapMarkers[index].Coordinate, searchMapMarkers[index].Kind, mapLayer, index);
RouteGuideMap.SetView(searchMapMarkers[index].Coordinate, RouteGuideMap.ZoomLevel, MapAnimationKind.Parabolic);
}
else
{
for (int i = 0; i < searchMapMarkers.Count; i++)
{
DrawMapMarker(searchMapMarkers[i].Coordinate, searchMapMarkers[i].Kind, mapLayer, i);
}
RouteGuideMap.SetView(searchMapMarkers[0].Coordinate, RouteGuideMap.ZoomLevel, MapAnimationKind.Parabolic);
}
}
}
示例2: CreaterouteOverlays
private void CreaterouteOverlays()
{
routedetails_layer = new MapLayer();
routedetails_layer.Clear();
MapOverlay overlay;
if (routeNavDetails.Count > 1)
{
var imgwidth = 0;
var imgheight = 0;
double x = 0;
double y = 0;
for (int i = 0; i < routeNavDetails.Count; i++)
{
var image1 = new Image();
if (i == 0)
{
image1.Source = new BitmapImage(new Uri("/Assets/start.png", UriKind.Relative));
imgwidth = 30;
imgheight = 30;
x = 0.0;
y = 0.9;
}
else if (i == routeNavDetails.Count - 1)
{
image1.Source = new BitmapImage(new Uri("/Assets/finish.png", UriKind.Relative));
imgwidth = 30;
imgheight = 30;
x = 1;
y = 0.9;
}
else
{
image1.Source = new BitmapImage(new Uri("/Assets/details.png", UriKind.Relative));
imgwidth = 20;
imgheight = 20;
x = 0.5;
y = 0.5;
}
image1.Width = imgwidth;
image1.Height = imgheight;
var poi = new RouteDetailsPois
{
instractions = routeNavDetails[i].instractions,
distance = routeNavDetails[i].distance / 1000.0,
coordinate =
new GeoCoordinate(routeNavDetails[i].coordinate.Latitude,
routeNavDetails[i].coordinate.Longitude)
};
image1.DataContext = poi;
image1.Tap += image1_Tap;
overlay = new MapOverlay
{
Content = image1,
GeoCoordinate =
new GeoCoordinate(routeNavDetails[i].coordinate.Latitude,
routeNavDetails[i].coordinate.Longitude),
PositionOrigin = new Point(x, y)
};
routedetails_layer.Add(overlay);
}
Mymap.Layers.Add(routedetails_layer);
}
}
示例3: DrawMyPositionMarker
/*
* функция отрисовки маркера текущей позиции пользователя на соответствующем слое карты +
* отрисовка окружности погрешности определения текущей позиции пользователя
*/
private void DrawMyPositionMarker(MapLayer mapLayer)
{
if (myMapMarker != null)
{
mapLayer.Clear();
DrawMyLocationAccuracyRadius(mapLayer);
DrawMapMarker(myMapMarker.Coordinate, myMapMarker.Kind, mapLayer);
}
}