当前位置: 首页>>代码示例>>C#>>正文


C# MapLayer.Clear方法代码示例

本文整理汇总了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);
                }
            }
        }
开发者ID:KiraariK,项目名称:WaypointProject,代码行数:26,代码来源:MainPage.xaml.cs

示例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);
            }
        }
开发者ID:bendata61,项目名称:anyplace,代码行数:64,代码来源:MainPage.xaml.cs

示例3: DrawMyPositionMarker

        /*
         * функция отрисовки маркера текущей позиции пользователя на соответствующем слое карты + 
         * отрисовка окружности погрешности определения текущей позиции пользователя
         */
        private void DrawMyPositionMarker(MapLayer mapLayer)
        {
            if (myMapMarker != null)
            {
                mapLayer.Clear();

                DrawMyLocationAccuracyRadius(mapLayer);
                DrawMapMarker(myMapMarker.Coordinate, myMapMarker.Kind, mapLayer);
            }
        }
开发者ID:KiraariK,项目名称:WaypointProject,代码行数:14,代码来源:MainPage.xaml.cs


注:本文中的MapLayer.Clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。