Open fazil1979 opened 5 years ago
Probably the anchor is not correct. Looks like the anchor is off the mid.
I suspects this is related https://github.com/amay077/Xamarin.Forms.GoogleMaps/releases/tag/v3.0.6 . Please try Xamarin.Forms.GoogleMaps v3.0.6+, probably fixed it.
Hi @amay077, do you know if it's fixed? I'm using 3.20 and I'm thinking it's not working wet … Let me know if I can help
Hi @jbravobr ,
I think it is fixed.
This gif is latest sample app's behavior, looks like works fine.
Is there any difference in your code?
hi @amay077 ! Yes, still heappens with me. This is my code
foreach (var item in context.MapQueryResponse)
{
var pin = new Pin
{
Type = PinType.Place,
Label = string.Empty,
Address = string.Empty,
Position = new Position((double)item.Latitude, (double)item.Longitude),
Tag = item.Id,
Icon = BitmapDescriptorFactory.FromView(new BindingPinView(item.BestPrice, item.HasQualityDefault, Convert.ToDouble(item.DefaultPrice)))
};
map.Pins.Add(pin);
This is my code from the BindingPinView
`<StackLayout xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:converters="clr-namespace:quip.Converters" x:Class="quip.Controls.BindingPinView" WidthRequest="200" HeightRequest="200">
@amay077 let me share something with you. That behaviour was happening when I was using Styles to my map, when I pass to used the default map style it worked ok.
Maybe cause is WidthRequest=200
and HeightRequest=200
.
I setted backgroud color to StackLayout then you can see below image.
This means, Binding Pin is very large and anchor is center of Yellow Rectangle.
VERSIONS
PLATFORMS
ACTUAL BEHAVIOR
When I zoom in, the pin is perfectly positioned, but when I zoom out, the pin is not positioning right, the more I zoom out, the more it is getting away from that coordinates
ACTUAL SCREENSHOTS
EXPECTED BEHAVIOR
The pin should keep its coordenate if the user zooms out, otherwise it is not showing the location that it should represent
HOW TO REPRODUCE
var pin = new Pin() { Type = PinType.Place, Label = "Tokyo SKYTREE", Address = "Sumida-ku, Tokyo, Japan", Position = new Position(35.71d, 139.81d), Icon = BitmapDescriptorFactory.FromView(new BindingPinView(pinDisplay.Text)) }; map.Pins.Add(pin);