示例#1
0
        private void Map1_MapSingleClick(object sender, MapClickEventArgs e)
        {
            Window window = new Window
            {
                Title                 = "Mark A Place",
                Content               = new PopupPromptUserControl(),
                SizeToContent         = SizeToContent.Height,
                Owner                 = Application.Current.MainWindow,
                WindowStartupLocation = WindowStartupLocation.CenterOwner,
                Width                 = 280
            };

            PopupPromptViewModel promptVM;

            window.DataContext = promptVM = new PopupPromptViewModel();
            promptVM.Confirm   = () => window.DialogResult = true;
            if (window.ShowDialog().Value)
            {
                PopupContentView popupContent = new PopupContentView();
                popupContent.DataContext = promptVM;

                Popup popup = new Popup();
                popup.Content  = popupContent;
                popup.Width    = 260;
                popup.Height   = 200;
                popup.Location = e.WorldCoordinate;
                Map1.Placements.Add(popup);
            }
        }
示例#2
0
        private void mMap_MapClick(object sender, MapClickEventArgs e)
        {
            LatLng        latLng  = e.Point;
            MarkerOptions options = new MarkerOptions()
                                    .SetPosition(latLng)
                                    .InvokeIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.dot));

            mMap.AddMarker(options);
            arrayPointX[polygonCount].Add(latLng.Latitude);
            arrayPointY[polygonCount].Add(latLng.Longitude);
        }
        private void Map1_MapSingleClick(object sender, MapClickEventArgs e)
        {
            Feature identifiedFeature = IdentifyHelper.Identify(dataLayer, e.WorldCoordinate, Map1.CurrentScale, Map1.MapUnit).FirstOrDefault();

            if (identifiedFeature != null)
            {
                double areaInSquareKilometer = ((GeoAreaBase)identifiedFeature.Geometry).GetArea(GeoUnit.Meter, AreaUnit.SquareKilometers);
                identifiedFeature.FieldValues.Add("Area", $"{areaInSquareKilometer:N2} sq. km");

                MemoryLayer highlightLayer = Map1.FindLayer <MemoryLayer>("HighlightLayer");
                highlightLayer.Features.Clear();
                highlightLayer.Features.Add(identifiedFeature);

                Map1.Refresh("HighlightOverlay");
            }
        }
示例#4
0
        private void Map1_MapSingleClick(object sender, MapClickEventArgs e)
        {
            Feature identifiedFeature = IdentifyHelper.Identify(dataLayer, e.WorldCoordinate, Map1.CurrentScale, Map1.MapUnit).FirstOrDefault();

            if (identifiedFeature != null)
            {
                double distanceInMeter = ((GeoLinearBase)identifiedFeature.Geometry).GetLength();
                identifiedFeature.FieldValues.Add("Distance", $"{distanceInMeter:N2} m");

                MemoryLayer highlightLayer = Map1.FindLayer <MemoryLayer>("HighlightLayer");

                highlightLayer.Features.Clear();
                highlightLayer.Features.Add(identifiedFeature);

                Map1.Refresh("HighlightOverlay");
            }
        }
示例#5
0
        private void Map1_MapSingleClick(object sender, MapClickEventArgs e)
        {
            Feature identifiedFeature = IdentifyHelper.Identify(dataLayer, e.WorldCoordinate, Map1.CurrentScale, Map1.MapUnit).FirstOrDefault();

            if (identifiedFeature != null)
            {
                MemoryLayer highlightLayer = Map1.FindLayer <MemoryLayer>("HighlightLayer");

                highlightLayer.Features.Clear();
                highlightLayer.Features.Add(identifiedFeature);

                WktTextBox.Text = identifiedFeature.ToWkt();
                WkbTextBox.Text = Convert.ToBase64String(identifiedFeature.ToWkb());

                Map1.Refresh("HighlightOverlay");
            }
        }
        private void Map1_MapClick(object sender, MapClickEventArgs e)
        {
            // We added a ShapefileLayer in the Loaded event,
            // it's default name is the name of the shapefile.
            // so here, we could find the layer back by the shapefile name without extension.
            FeatureLayer featureLayer      = Map1.FindLayer <FeatureLayer>("countries-900913");
            Feature      identifiedFeature = IdentifyHelper.Identify(featureLayer, e.WorldCoordinate, Map1.CurrentScale, Map1.MapUnit).FirstOrDefault();

            Map1.Placements.Clear();
            if (identifiedFeature != null)
            {
                Popup popup = new Popup();
                popup.Location = e.WorldCoordinate;
                popup.Content  = new Label {
                    Content = identifiedFeature.FieldValues["LONG_NAME"]
                };
                Map1.Placements.Add(popup);
            }
        }
示例#7
0
        private void Map1_MapSingleClick(object sender, MapClickEventArgs e)
        {
            Feature identifiedFeature = IdentifyHelper.Identify(dataLayer, e.WorldCoordinate, Map1.CurrentScale, Map1.MapUnit).FirstOrDefault();

            if (identifiedFeature != null)
            {
                MemoryLayer highlightLayer = Map1.FindLayer <MemoryLayer>("HighlightLayer");

                highlightLayer.Features.Clear();
                highlightLayer.Features.Add(identifiedFeature);

                GeoBound identifiedBound = identifiedFeature.GetBound();
                highlightLayer.Features.Add(new Feature(new GeoLine(identifiedBound.GetVertices())));

                GeoPoint identifiedCenter = identifiedBound.GetCentroid();
                highlightLayer.Features.Add(new Feature(identifiedCenter));

                Map1.Refresh("HighlightOverlay");
            }
        }
示例#8
0
 private void njbGoogleMap1_MapRightClick(object sender, MapClickEventArgs e)
 {
     LastRightClickPosition = e.LatLng;
     contextMenuStrip1.Show(Cursor.Position.X, Cursor.Position.Y);
 }
示例#9
0
 private void njbGoogleMap1_MapClick(object sender, MapClickEventArgs e)
 {
 }
示例#10
0
 private async void MapClickHandler(object sender, MapClickEventArgs args)
 {
     await ViewModel.SetPosition(args.Point.Longitude, args.Point.Latitude);
 }