private void AddGraphicFromLocatorCandidate(LocatorGeocodeResult candidate)
        {
            var graphic = new Graphic(new MapPoint(candidate.Location.X, candidate.Location.Y, MyMapView.SpatialReference));

            graphic.Attributes["Address"]   = candidate.Address;
            graphic.Attributes["Score"]     = candidate.Score;
            graphic.Attributes["MatchType"] = candidate.Attributes["Addr_type"];

            double x = 0.0, y = 0.0;

            double.TryParse(candidate.Attributes["X"], out x);
            double.TryParse(candidate.Attributes["Y"], out y);
            graphic.Attributes["LocationDisplay"] = string.Format("{0:0.000}, {1:0.000}", x, y);

            graphic.IsVisible = (candidate.Score >= MatchScoreSlider.Value);
            _addressOverlay.Graphics.Add(graphic);
        }
Exemplo n.º 2
0
 private void AddGraphicFromLocatorCandidate(LocatorGeocodeResult candidate)
 {
     if ((bool)LocationButton.IsChecked)
     {
         MenuFlyoutGotoButton.IsEnabled = true;
     }
     if (_stopsOverlay.Graphics.Count() > 0)
     {
         panelResults.Visibility = Visibility.Collapsed;
         _stopsOverlay.Graphics.Clear();
         _routesOverlay.Graphics.Clear();
         MyMapView.Overlays.Items.Clear();
         _directionsOverlay.GraphicsSource = null;
     }
     _stopsOverlay.Graphics.Add(CreateStopGraphic(MyMapView.LocationDisplay.CurrentLocation.Location, _stopsOverlay.Graphics.Count + 1));
     _stopsOverlay.Graphics.Add(CreateStopGraphic(new MapPoint(candidate.Location.X, candidate.Location.Y, MyMapView.SpatialReference), _stopsOverlay.Graphics.Count + 1));
 }
        private void AddGraphicFromLocatorCandidate(LocatorGeocodeResult candidate)
        {
            var graphic = new Graphic(new MapPoint(candidate.Location.X, candidate.Location.Y, MyMapView.SpatialReference));
            graphic.Attributes["Address"] = candidate.Address;
            graphic.Attributes["Score"] = candidate.Score;
            graphic.Attributes["MatchType"] = candidate.Attributes["Addr_type"];

            double x = 0.0, y = 0.0;
            double.TryParse(candidate.Attributes["X"], out x);
            double.TryParse(candidate.Attributes["Y"], out y);
            graphic.Attributes["LocationDisplay"] = string.Format("{0:0.000}, {1:0.000}", x, y);

            graphic.IsVisible = (candidate.Score >= MatchScoreSlider.Value);
			_addressOverlay.Graphics.Add(graphic);
        }