-
Notifications
You must be signed in to change notification settings - Fork 350
Comparison with Xamarin.Forms.Maps
Explain about comparison with Xamarin.Form.Maps. Unless otherwise noted, these are supported for Android and iOS onkly.
Can drawing Polyline, Polygon and Circle by common API.
For example, you can add a polyline as follows.
// map as Xamarin.Forms.GoogleMaps.Map
var polyline = new Polyline();
polyline.Positions.Add(new Position(40.77d, -73.93d));
polyline.Positions.Add(new Position(40.81d, -73.91d));
polyline.Positions.Add(new Position(40.83d, -73.87d));
polyline.StrokeColor = Color.Blue;
polyline.StrokeWidth = 5f;
polyline.Tag = "POLYLINE"; // Can set any object
polyline.IsClickable = true;
polyline.Clicked += (s, e) =>
{
// handle click polyline
};
map.Polylines.Add(polyline);
You can delete a polyline as follows.
map.Polylines.Remove(polyline);
In polyline or polygon, if you set IsClickable
to true
then you can subscribe Clicked
events.
Circle have not IsClickable
property and Clicked
events. Because Android native Google Maps API does not support circle clicking.
For more information, refer to ShapesPage.xaml.cs
in SampleApp - XFGoogleMapSample.
- In v1.1.0,
Pin
,Polyline
,Polygon
andCircle
's each properties does not support binding.
You can set pin to Map.SelectedPin
, then show info-window and pin marks "selected".
Set null
to Map.SelectedPin
, then close info-window and pin marks "unselected".
For more information, refer to PinsPage.xaml.cs
in SampleApp - XFGoogleMapSample.
Set animate
parameter to true
, then animation when map panning. set to false
, then panning directly. This is optional parameter, default is true
.
- None(from v1.1.0)