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


C# MapLayer类代码示例

本文整理汇总了C#中MapLayer的典型用法代码示例。如果您正苦于以下问题:C# MapLayer类的具体用法?C# MapLayer怎么用?C# MapLayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MapLayer类属于命名空间,在下文中一共展示了MapLayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: showlocations

        private void showlocations()
        {
            foreach (Place p in _vm.Places)
            {
                Grid MyGrid = new Grid();
                MyGrid.RowDefinitions.Add(new RowDefinition());
                MyGrid.RowDefinitions.Add(new RowDefinition());
                MyGrid.Background = new SolidColorBrush(Colors.Transparent);

                BitmapImage bmi = new BitmapImage(new Uri("/Assets/pushpinPhone.png", UriKind.Relative));
                Image img = new Image();
                img.Tag = (p);
                img.Source = bmi;
               
        
                MyGrid.Children.Add(img);


                //Creating a MapOverlay and adding the Grid to it.
                MapOverlay MyOverlay = new MapOverlay();
                MyOverlay.Content = MyGrid;

                MyOverlay.GeoCoordinate = new GeoCoordinate(p.Latitude, p.Longitude);


                MyOverlay.PositionOrigin = new Point(0, 0.5);

                //Creating a MapLayer and adding the MapOverlay to it
                MapLayer MyLayer = new MapLayer();
                MyLayer.Add(MyOverlay);
                mapWithMyLocation.Layers.Add(MyLayer);
            }
        }
开发者ID:landerarnoys,项目名称:Shredder,代码行数:33,代码来源:MainPage.xaml.cs

示例2: NewStore

        public NewStore()
        {
            
            InitializeComponent();
            
            markerLayer = new MapLayer();
            map2.Layers.Add(markerLayer);

            //geoQ = new GeocodeQuery();
            //geoQ.QueryCompleted += geoQ_QueryCompleted;
            //Debug.WriteLine("All construction done for GeoCoding");

            System.Windows.Input.Touch.FrameReported += Touch_FrameReported;

            map2.Tap += map2_Tap;

            resultList.SelectionChanged += resultList_SelectionChanged;

            watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.Default);
            watcher.MovementThreshold = 20; // 20 meters

            watcher.StatusChanged += new EventHandler<GeoPositionStatusChangedEventArgs>(OnStatusChanged);
            watcher.PositionChanged += new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(OnPositionChanged);
            newCenter();
            watcher.Start();
        }
开发者ID:JLBR,项目名称:School-Projects,代码行数:26,代码来源:NewStore.xaml.cs

示例3: MapView

        public MapView()
        {
            InitializeComponent();

            _layer = new MapLayer();
            _map.Children.Add(_layer);
        }
开发者ID:TediWang,项目名称:4thandmayor-ancient,代码行数:7,代码来源:MapView.xaml.cs

示例4: Generate

        //an initial create-map method
        public override void Generate(int seed, RDungeonFloor entry, List<FloorBorder> floorBorders, Dictionary<int, List<int>> borderLinks)
        {
            //TODO: make sure that this algorithm follows floorBorders and borderLinks constraints

            this.seed = seed;
            this.entry = entry;
            FloorBorders = floorBorders;
            BorderLinks = borderLinks;

            BorderPoints = new Loc2D[1];

            rand = new Random(seed);

            MapArray = new Tile[10, 10];

            MapLayer ground = new MapLayer(Width, Height);
            GroundLayers.Add(ground);
            for (int y = 0; y < Height; y++)
            {
                for (int x = 0; x < Width; x++)
                {
                    MapArray[x, y] = new Tile(PMDToolkit.Enums.TileType.Walkable, 0, 0, 0);
                    GroundLayers[0].Tiles[x, y] = new TileAnim(new Loc2D(), 0);
                }
            }

            BorderPoints[0] = new Loc2D(0, 0);
        }
开发者ID:blastboy,项目名称:PMD-Toolkit,代码行数:29,代码来源:StandardMap.cs

示例5: AddMapIcon

        private void AddMapIcon(Map map, GeoCoordinate geoPosition)
        {
            // Create a small circle to mark the current location.
            Ellipse myCircle = new Ellipse();
            myCircle.Fill = new SolidColorBrush(Colors.Blue);
            myCircle.Height = 20;
            myCircle.Width = 20;
            myCircle.Opacity = 50;


            // Create a MapOverlay to contain the circle.
            MapOverlay myLocationOverlay = new MapOverlay();
            myLocationOverlay.Content = myCircle;
            myLocationOverlay.PositionOrigin = new Point(0.5, 0.5);
            myLocationOverlay.GeoCoordinate = geoPosition;


            // Create a MapLayer to contain the MapOverlay.
            MapLayer myLocationLayer = new MapLayer();
            myLocationLayer.Add(myLocationOverlay);

            // Add the MapLayer to the Map.
            maploc.Layers.Add(myLocationLayer);


        }
开发者ID:AegeanApp,项目名称:Aegean-App-V1,代码行数:26,代码来源:MapsPage.xaml.cs

示例6: StartCurrentPosition

        private void StartCurrentPosition()
        {
            _progressIndicator.IsIndeterminate = true;

            _customLayer = new MapLayer();
            MapControl.Layers.Add(_customLayer);
            MapControl.Center = new GeoCoordinate(48.8607, 2.3504);
            MapControl.ZoomLevel = 10;

            Random rand = new Random();
            
            foreach (var evt in model.ItemsByDate)
            {
                MapIcon posIcon = new MapIcon()
                {
                    Width = 40,
                    Height = 40,
                    AnchorPoint = MapIconAnchorPoint.Center,
                    Coordinate = new GeoCoordinate(evt.loc[0], evt.loc[1]),
                    Source = new Uri("/PanoramaApp1;component/Images/MapObjects.png", UriKind.RelativeOrAbsolute),
                    Content =  GetPushPinTemplate( evt.text + " - " + evt.nb_plus, evt)
                };
                _customLayer.Children.Add(posIcon);
            }

            _progressIndicator.IsIndeterminate = false;
        }
开发者ID:remiolivier,项目名称:bma-myhero,代码行数:27,代码来源:MapEventsListPage.xaml.cs

示例7: ShowMyLocationOnTheMap

        private async void ShowMyLocationOnTheMap()
        {
            // Get my current location.
            Geolocator myGeolocator = new Geolocator();
            Geoposition myGeoposition = await myGeolocator.GetGeopositionAsync();
            Geocoordinate myGeocoordinate = myGeoposition.Coordinate;
            GeoCoordinate myGeoCoordinate = CoordinateConverter.ConvertGeocoordinate(myGeocoordinate);

            // Create a small circle to mark the current location.
            Ellipse myCircle = new Ellipse();
            myCircle.Fill = new SolidColorBrush(Colors.Blue);
            myCircle.Height = 20;
            myCircle.Width = 20;
            myCircle.Opacity = 50;

            // Create a MapOverlay to contain the circle.
            MapOverlay myLocationOverlay = new MapOverlay();
            myLocationOverlay.Content = myCircle;
            myLocationOverlay.PositionOrigin = new Point(0.5, 0.5);
            myLocationOverlay.GeoCoordinate = myGeoCoordinate;

            // Create a MapLayer to contain the MapOverlay.
            MapLayer myLocationLayer = new MapLayer();
            myLocationLayer.Add(myLocationOverlay);

            // Add the MapLayer to the Map.
            Haritam.Layers.Add(myLocationLayer);
        }
开发者ID:ramazanguclu,项目名称:EnUcuzUrun,代码行数:28,代码来源:Harita.xaml.cs

示例8: GeoButton_Click

        private void GeoButton_Click(object sender, RoutedEventArgs e)
        {
            if (markerLayer != null)
            {
                map1.Layers.Remove(markerLayer);
                markerLayer = null;
            }

            markerLayer = new MapLayer();
            map1.Layers.Add(markerLayer);

            if (geoQ.IsBusy == true){
                geoQ.CancelAsync();
            }
            // Set the full address query

            GeoCoordinate setMe = new GeoCoordinate(map1.Center.Latitude, map1.Center.Longitude);
            setMe.HorizontalAccuracy = 1000000;

            geoQ.GeoCoordinate = setMe;
            geoQ.SearchTerm = geoBox.Text;
            geoQ.MaxResultCount = 200;

            geoQ.QueryAsync();
            Debug.WriteLine("GeocodeAsync started for: " + geoBox.Text);
        }
开发者ID:ZeynepCamurdan,项目名称:maps-samples,代码行数:26,代码来源:MainPage.xaml.cs

示例9: ItemContainerGenerator_ItemsChanged

        private void ItemContainerGenerator_ItemsChanged(object sender, ItemsChangedEventArgs e)
        {
            if (e.Action == 1)
            {
                Position item = lstPositions.Items.Last() as Position;
                layers = new MapLayer();
                image = new BitmapImage();
                image.UriSource = (new Uri(SelectedFriend.Picture, UriKind.Absolute));

                grid = new Grid();
                grid.DataContext = item;
                grid.RightTapped += grid_RightTapped;
                textBlock = new TextBlock();
                textBlock.Text = item.Counter.ToString();
                textBlock.VerticalAlignment = VerticalAlignment.Bottom;
                textBlock.HorizontalAlignment = HorizontalAlignment.Center;
                brush = new ImageBrush();
                brush.ImageSource = image;
                ellipse = new Ellipse();
                ellipse.Height = 100;
                ellipse.Width = 100;
                ellipse.Fill = brush;
                grid.Children.Add(ellipse);
                grid.Children.Add(textBlock);
                layers.Children.Add(grid);
                MapLayer.SetPosition(grid, new Location(item.Latitude, item.Longitude));
                myMap.Children.Add(layers);
            }
        }
开发者ID:JorgeCupi,项目名称:SmartGuard,代码行数:29,代码来源:FriendInfoView.xaml.cs

示例10: ShowMyLocationOnTheMap

        private async void ShowMyLocationOnTheMap()
        {
            // Get my current location.
            Geolocator myGeolocator = new Geolocator();
            Geoposition myGeoposition = await myGeolocator.GetGeopositionAsync();
            Geocoordinate myGeocoordinate = myGeoposition.Coordinate;
            GeoCoordinate myGeoCoordinate = CoordinateConverter.ConvertGeocoordinate(myGeocoordinate);

            // Make my current location the center of the Map.
            this.mapWithMyLocation.Center = myGeoCoordinate;
            this.mapWithMyLocation.ZoomLevel = 13;

            // Create a small circle to mark the current location.
            Ellipse myCircle = new Ellipse();
            myCircle.Fill = new SolidColorBrush(Colors.Red);
            myCircle.Height = 20;
            myCircle.Width = 20;
            myCircle.Opacity = 50;

            // Create a MapOverlay to contain the circle.
            MapOverlay myLocationOverlay = new MapOverlay();
            myLocationOverlay.Content = myCircle;
            myLocationOverlay.PositionOrigin = new Point(0.5, 0.5);
            myLocationOverlay.GeoCoordinate = myGeoCoordinate;

            // Create a MapLayer to contain the MapOverlay.
            MapLayer myLocationLayer = new MapLayer();
            myLocationLayer.Add(myLocationOverlay);

            // Add the MapLayer to the Map.
            mapWithMyLocation.Layers.Add(myLocationLayer);

            txTop.Text = ("My Location - Lat " + myGeoCoordinate.Latitude.ToString("0.0000") + "   Lon " + myGeoCoordinate.Longitude.ToString("0.0000"));
        }
开发者ID:alexpt2000,项目名称:CompassV1,代码行数:34,代码来源:Map.xaml.cs

示例11: lockLayer

	void lockLayer(MapLayer mapLayer){
		GameObject child;
		for (int i = 0; i < mapLayer.gameObject.transform.childCount; i++){
			child = mapLayer.gameObject.transform.GetChild(i).gameObject;
			child.hideFlags = HideFlags.HideInHierarchy;
		}
	}
开发者ID:Brasilia,项目名称:PieceOfTreasure-OneGame10.15,代码行数:7,代码来源:GameMapController.cs

示例12: Seanslar_getCompleted

        void Seanslar_getCompleted(seanslar sender)
        {
            loader.IsIndeterminate = false;

            PanoramaRoot.Title = sender.SalonBilgisi.name;
            pItem1.DataContext = sender.SalonBilgisi;
            listFilmler.ItemsSource = sender.SalonBilgisi.movies;

            if (sender.SalonBilgisi.latitude.ToString() != "false")
            {
                SalonCoordinate = new GeoCoordinate(double.Parse(sender.SalonBilgisi.latitude), double.Parse(sender.SalonBilgisi.longitude));
                myMap.SetView(SalonCoordinate, 17);

                pinpoint_salon newPin = new pinpoint_salon();
                MapOverlay newOverlay = new MapOverlay();
                newOverlay.Content = newPin;
                newOverlay.GeoCoordinate = SalonCoordinate;
                newOverlay.PositionOrigin = new Point(0, 0);
                MapLayer MyLayer = new MapLayer();
                MyLayer.Add(newOverlay);
                myMap.Layers.Add(MyLayer);
            }
            else
            {
                myMap.Visibility = Visibility.Collapsed;
                recMap.Visibility = System.Windows.Visibility.Collapsed;
            }

        }
开发者ID:yajinn,项目名称:sinemaciWP,代码行数:29,代码来源:SalonPage.xaml.cs

示例13: OnNavigatedTo

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            string quakeQueryString = string.Empty;

            if (NavigationContext.QueryString.TryGetValue("quake", out quakeQueryString))
            {
                quake = Earthquake.DeserializeFromQueryString(quakeQueryString);
            }
            else return;

            ContentPanel.DataContext = quake;

            QuakeMap.Center = quake.Location;
            Pushpin pin = new Pushpin
            {
                GeoCoordinate = quake.Location,
                Content = quake.FormattedMagnitude
            };
            if (quake.Magnitude >= appSettings.MinimumWarningMagnitudeSetting)
                pin.Background = Application.Current.Resources["PhoneAccentBrush"] as SolidColorBrush;

            MapOverlay overlay = new MapOverlay();
            overlay.Content = pin;
            overlay.GeoCoordinate = quake.Location;
            overlay.PositionOrigin = new Point(0, 1);

            MapLayer layer = new MapLayer();
            layer.Add(overlay);
            QuakeMap.Layers.Add(layer);

            base.OnNavigatedTo(e);
        }
开发者ID:adamsp,项目名称:wsnz-windowsphone,代码行数:32,代码来源:QuakeDisplayPage.xaml.cs

示例14: AddPoint

        private void AddPoint(Map controlMap, GeoCoordinate geo)
        {
            // With the new Map control:
            //  Map -> MapLayer -> MapOverlay -> UIElements
            //  - Add a MapLayer to the Map
            //  - Add an MapOverlay to that layer
            //  - We can add a single UIElement to that MapOverlay.Content
            MapLayer ml = new MapLayer();
            MapOverlay mo = new MapOverlay();

            // Add an Ellipse UI
            Ellipse r = new Ellipse();
            r.Fill = new SolidColorBrush(Color.FromArgb(255, 240, 5, 5));
            // the item is placed on the map at the top left corner so
            // in order to center it, we change the margin to a negative
            // margin equal to half the width and height
            r.Width = r.Height = 12;
            r.Margin = new Thickness(-6, -6, 0, 0);

            // Add the Ellipse to the Content 
            mo.Content = r;
            // Set the GeoCoordinate of that content
            mo.GeoCoordinate = geo;
            // Add the MapOverlay to the MapLayer
            ml.Add(mo);
            // Add the MapLayer to the Map
            controlMap.Layers.Add(ml);
        }
开发者ID:natsirt20,项目名称:School,代码行数:28,代码来源:Geolocation.xaml.cs

示例15: SelectDestination

        public SelectDestination()
        {
            InitializeComponent();
            street.Visibility = Visibility.Visible;
            (ApplicationBar.Buttons[1] as ApplicationBarIconButton).IsEnabled = true;
              
            GeoCoordinate geo = new GeoCoordinate();
            geo = MainPage.bookingData.current_location;
            googlemap.Center = geo;
            googlemap.ZoomLevel = 16;

            zzoom.IsEnabled = true;
            positionLoaded = true;

            Microsoft.Phone.Controls.Maps.Pushpin new_pushpin = new Microsoft.Phone.Controls.Maps.Pushpin();
            new_pushpin.Location = geo;

            pushPinCurrentLocation = new MapLayer();

            new_pushpin.Content = "Current Location:\n ";
            new_pushpin.Content += MainPage.bookingData.current_location_address;
            new_pushpin.Visibility = Visibility.Visible;

            googlemap.Children.Add(pushPinCurrentLocation);
            pushPinCurrentLocation.AddChild(new_pushpin, geo, PositionOrigin.BottomLeft);

            
                if (MainPage.bookingData.isDesSet == true)
                {
                    AddressMapping();
                }

 
            
        }
开发者ID:RazaChohan,项目名称:Cab9,代码行数:35,代码来源:SelectDestination.xaml.cs


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