【发布时间】:2018-05-07 13:28:38
【问题描述】:
我正在尝试使用 Xamarin 为 Android 构建 ActivityTracker 应用程序。我已经可以访问 Google Maps Api 并且可以获得当前设备位置。下一步是将我进入折线的位置连接起来,但折线在地图上不可见。
这是我试过的代码
private Polyline polyline;
public void OnMapReady(GoogleMap map)
{
_map = map;
_map.MyLocationEnabled = true;
_map.TrafficEnabled = true;
_map.SetIndoorEnabled(true);
PolylineOptions poly = new PolylineOptions()
.InvokeColor(Color.Red)
.InvokeWidth(5)
.Visible(true)
.InvokeZIndex(30);
poly.Add(new LatLng(95, 50));
poly.Add(new LatLng(90, 55));
poly.Add(new LatLng(100, 50));
polyline = _map.AddPolyline(poly);
_map.MyLocationChange += MyLocationChanged;
}
【问题讨论】:
标签: android google-maps xamarin