public override void AddChild(UIElement element, Location location)
        {
            LocationRect locationRect;

            if (element is IClipable)
            {
                locationRect = ((IClipable)element).MBR;
            }
            else if (element is MapShapeBase)
            {
                locationRect = new LocationRect(((MapShapeBase)element).Locations);
            }
            else
            {
                locationRect = new LocationRect(new List <Location> {
                    location
                });
            }
            //TODO: need to keep track of visibility changed.
            mapLayerObjects.Add(new MapLayerObject {
                Element = element, Location = location, MBR = locationRect, Visible = element.Visibility == Visibility.Visible
            });
            refreshMapMovementWorker();
        }
 public static ICoordinate Convert(Location location)
 {
     return new Coordinate { Y = location.Latitude, X = location.Longitude };
 }
        void geocodeService_GeocodeCompleted(object sender, GeocodeCompletedEventArgs e)
        {
            // The result is a GeocodeResponse object
            GeocodeResponse geocodeResponse = e.Result;

            if (geocodeResponse.Results.Count  > 0)
            {
                resultLoaction = new Microsoft.Maps.MapControl.Location(geocodeResponse.Results[0].Locations[0].Latitude,
                    +geocodeResponse.Results[0].Locations[0].Longitude);

                Pushpin pin = new Pushpin() { Location = resultLoaction };
                mainMap.Children.Add(pin);
            }
        }
 public override void AddChild(UIElement element, Location location)
 {
     LocationRect locationRect;
     if (element is IClipable)
     {
         locationRect = ((IClipable)element).MBR;
     }
     else if (element is MapShapeBase)
     {
         locationRect = new LocationRect(((MapShapeBase)element).Locations);
     }
     else
     {
         locationRect = new LocationRect(new List<Location> { location });
     }
     //TODO: need to keep track of visibility changed.
     mapLayerObjects.Add(new MapLayerObject { Element = element, Location = location, MBR = locationRect, Visible = element.Visibility == Visibility.Visible });
     refreshMapMovementWorker();
 }
 public static ICoordinate Convert(Location location)
 {
     return(new Coordinate {
         Y = location.Latitude, X = location.Longitude
     });
 }