Answered Map Children Image size very large?

  • Friday, July 27, 2012 6:59 PM
     
      Has Code

    I'm placing an image/symbol on a map with code like this:

    locationIcon = new Image();
    locationIcon.Source = new BitmapImage(new Uri("ms-appx:///Assets/PushpinCar.png"));
       map1.Children.Add(locationIcon);
    

    The png is 32x26 pixels but shows up on the map as huge -- about half the map size which is about 500x500.
    Why is that and how am I supposed to add a symbol to a map?

    thanks,

    Rick

All Replies

  • Friday, July 27, 2012 7:52 PM
     
     Answered
    Explicitly specify the size of the Image. During the layout pass we ask the control how large it wants to be and without a specific size it looks like Image does not auto size to fit.
  • Friday, July 27, 2012 10:20 PM
     
      Has Code

    This code seemed to work OK:

                locationIcon.MaxHeight = 26;
                locationIcon.MaxWidth = 32;
    

    Thanks,

    Rick