Closed dansiegel closed 5 years ago
Do you know Xamarin.Forms.GoogleMaps.Bindings ?
This is already implemented part of your request.
I am familiar with it... it should really be baked in though. Happy to send you a PR on this
I supported ItemsSource and ItemTemplate in Xamarin.Forms.GoogleMaps v3.1.0+ .
Thanks @dansiegel ! 👍
Is there any documentation as far as using the DataTemplate part of the binding goes?
<maps:Map x:Name="mapView" ItemsSource="{Binding Pins}" AbsoluteLayout.LayoutBounds="0, 0, 1, 0.7" AbsoluteLayout.LayoutFlags="All">
<maps:Map.ItemTemplate>
<DataTemplate>
<maps:Pin Label="teste" Address="address">
<maps:Pin.Position>
<maps:Position >
</maps:Position>
</maps:Pin.Position>
</maps:Pin>
</DataTemplate>
</maps:Map.ItemTemplate>
</maps:Map>
This is what I currently got, yet can't seem to figure out how to get Latitude and Longitude into it.
SUMMARY
Working with the Map control should allow easy binding to a data set with a DataTemplate. This should work similar to a ListView in which you can bind to a generic set of data with a DataTemplate that produces a Pin to add to the controls Pin collection.
DETAILS
Two bindable properties should be added:
In addition, an event and Command should be added in the spirit of when a Pin is Selected.
When a Pin is selected the ItemSelected event should invoked and the Command executed with the BindingContext of each passed to them.
PLATFORMS