I have a test for my app on Android and UWP where I am loading different size images into SkiaSharp, and put them on the map as pins. Starting on the right, there is a 20x20 icon, then moving to the left, a 40x40 icon, then 60x60 etc. until 300x300 (15 icons total).
It works on Android, but not on UWP. It looks like this:
Right when I start dragging, the icons all move to the bottom:
When I zoom out, all 15 icons are there, but they are all the same size (the far right should be 20x20, far left should be 300x300):
This is particularly confusing having had used the Bing Maps API before and not having an issue with pins not rendering, under reasonable load. Also of note, you can tell the image on the right has a lower resolution, but is rendered at the same size on the map for some reason, so that rules out accidentally sending the same image to each pin.
EXPECTED BEHAVIOR
It works on Android as expected:
HOW TO REPRODUCE
There are some dependency injected services for loading the actual image. The actual code to place the pins is below:
for (int i = 0; i < 15; i++)
{
var length = 20 * (i + 1);
SkiaSharp.SKBitmap skb = await BitmapProvider.LoadBitmapAsync("BusBaseIcon", length, length);
var surface = SkiaSharp.SKSurface.Create(new SkiaSharp.SKImageInfo(length, length));
var skc = surface.Canvas;
skc.DrawBitmap(skb, new SkiaSharp.SKRect(0, 0, length, length));
var data = surface.Snapshot().Encode(SkiaSharp.SKEncodedImageFormat.Png, 80);
MemoryStream ms = new MemoryStream();
data.SaveTo(ms);
ms.Position = 0;
var pin = new Pin();
//var button = new Button() { WidthRequest = 80, HeightRequest = 30, Text = "Test" };
pin.Icon = BitmapDescriptorFactory.FromStream(ms);
pin.Label = "Button";
var center = ViewModel.Center.ToXFGMPosition();
pin.Position = new Position(center.Latitude, center.Longitude - .005 * i);
MainMapControl.Pins.Add(pin);
}
VERSIONS
PLATFORMS
ACTUAL BEHAVIOR
I have a test for my app on Android and UWP where I am loading different size images into SkiaSharp, and put them on the map as pins. Starting on the right, there is a 20x20 icon, then moving to the left, a 40x40 icon, then 60x60 etc. until 300x300 (15 icons total).
It works on Android, but not on UWP. It looks like this:
Right when I start dragging, the icons all move to the bottom:
When I zoom out, all 15 icons are there, but they are all the same size (the far right should be 20x20, far left should be 300x300):
This is particularly confusing having had used the Bing Maps API before and not having an issue with pins not rendering, under reasonable load. Also of note, you can tell the image on the right has a lower resolution, but is rendered at the same size on the map for some reason, so that rules out accidentally sending the same image to each pin.
EXPECTED BEHAVIOR
It works on Android as expected:
HOW TO REPRODUCE
There are some dependency injected services for loading the actual image. The actual code to place the pins is below: