partial void routeButton_TouchUpInside(UIButton sender) { if (MapRoute != null) { MapView.RemoveMapObject(MapRoute); MapRoute = null; } // START: Daimler Fleetboard NMAGeoCoordinates start = new NMAGeoCoordinates(48.7244153, 9.1161991); // END: Biergarten NMAGeoCoordinates end = new NMAGeoCoordinates(48.701356, 9.1393803); // Create an NSMutableArray to add two stops NSObject[] stops = new NSObject[] { start, end }; NMARoutingMode routingMode = new NMARoutingMode(NMARoutingType.Fastest, NMATransportMode.Car, NMARoutingOption.Highway); // Initialize the NMACoreRouter if (Router == null) { Router = new NMACoreRouter(); } // Trigger the route calculation Router.CalculateRouteWithStops(stops, routingMode, OnCalculateRouteCompletion); }
public VehicleMapMarker(NMAGeoCoordinates coordinates, string vehicleName) : base(coordinates) { VehicleImageContext imageContext = GenerateMarkerImageWithText(vehicleName); Icon = NMAImage.ImageWithUIImage(imageContext.image); // place the blue dot of the marker image on the correct location on the map AnchorOffset = imageContext.anchorOffset; }
private void ConfigureMapView() { MapView.CopyrightLogoPosition = NMALayoutPosition.BottomLeft; NMAGeoCoordinates geoCoordCenter = new NMAGeoCoordinates(50.9605737, 7.7703383); MapView.SetGeoCenter(geoCoordCenter, NMAMapAnimation.None); MapView.ZoomLevel = 5; MapView.WeakGestureDelegate = this; NMAClusterLayer cl = new NMAClusterLayer(); cl.AddMarker(new VehicleMapMarker(new NMAGeoCoordinates(50.9605738, 7.7703383), "Testvehicle 1")); cl.AddMarker(new VehicleMapMarker(new NMAGeoCoordinates(49.8022486, 8.6021228), "Testvehicle 2")); cl.AddMarker(new VehicleMapMarker(new NMAGeoCoordinates(48.712405, 9.3061532), "Testvehicle 3")); MapView.AddClusterLayer(cl); }