public void OnShow() { RemoveMapView(); _map = new AppleMapsView(CreateMapOptions()); _map.Show(AppleMapsDemoUtils.RectTransformToScreenSpace(rect)); Debug.Log(_map.MapType); // Point annotations AddPointAnnotation(); AppleMapsDemoUtils.AddRandomPointAnnotations(_map); // Circles AddCircle(); AppleMapsDemoUtils.AddRandomPointCircles(_map); // Polylines & Polygons AddPolyline(); AddPolygon(); // Image overlay AddImageOverlay(); SetMapListeners(); }
public void RemoveMapView() { if (_map != null) { _map.Remove(); _map = null; } }
public static void AddRandomPointCircles(AppleMapsView map) { for (int i = 0; i < 5; i++) { var location = new LocationCoordinate2D(i * -10, i * 10); var circle = new Circle(location, 1000 * (i + 1)); map.AddOverlay(circle); } }
public static void AddRandomPointAnnotations(AppleMapsView map) { for (int i = 0; i <= 5; i++) { var location = new LocationCoordinate2D(i * 10, i * 10); var pointAnnotation = new PointAnnotation(location, "Title" + i, "Subtitle" + i) { PinTintColor = AppleMapsUtils.RandomColor() }; map.AddAnnotation(pointAnnotation); } }
public static void UpdateMapOptions(AppleMapsView map) { map.MapType = MapViewType.Satellite; map.CoordinateRegion = BerlinRegion; map.IsScrollEnabled = true; map.IsRotateEnabled = true; map.IsZoomEnabled = true; map.IsPitchEnabled = true; map.ShowsBuildings = true; map.ShowsCompass = true; map.ShowsPointsOfInterest = true; map.ShowsScale = true; map.ShowsTraffic = true; }