public MapPageCS() { var customMap = new CustomMap { MapType = MapType.Street, WidthRequest = App.ScreenWidth, HeightRequest = App.ScreenHeight }; var pin = new CustomPin { Pin = new Pin { Type = PinType.Place, Position = new Position (37.79752, -122.40183), Label = "Xamarin San Francisco Office", Address = "394 Pacific Ave, San Francisco CA" }, Id = "Xamarin", Url = "http://xamarin.com/about/" }; customMap.CustomPins = new List<CustomPin> { pin }; customMap.Pins.Add(pin.Pin); customMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(37.79752, -122.40183), Distance.FromMiles(1.0))); Content = customMap; }
public MapPageCS() { CustomMap customMap = new CustomMap { MapType = MapType.Street }; CustomPin pin = new CustomPin { Type = PinType.Place, Position = new Position(37.79752, -122.40183), Label = "Xamarin San Francisco Office", Address = "394 Pacific Ave, San Francisco CA", Name = "Xamarin", Url = "http://xamarin.com/about/" }; customMap.CustomPins = new List <CustomPin> { pin }; customMap.Pins.Add(pin); customMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(37.79752, -122.40183), Distance.FromMiles(1.0))); Content = customMap; }
public MapPage() { InitializeComponent(); customMap.RouteCoordinates.Add(new Position(37.797534, -122.401827)); customMap.RouteCoordinates.Add(new Position(37.797510, -122.402060)); customMap.RouteCoordinates.Add(new Position(37.790269, -122.400589)); customMap.RouteCoordinates.Add(new Position(37.790265, -122.400474)); customMap.RouteCoordinates.Add(new Position(37.790228, -122.400391)); customMap.RouteCoordinates.Add(new Position(37.790126, -122.400360)); customMap.RouteCoordinates.Add(new Position(37.789250, -122.401451)); customMap.RouteCoordinates.Add(new Position(37.788440, -122.400396)); customMap.RouteCoordinates.Add(new Position(37.787999, -122.399780)); customMap.RouteCoordinates.Add(new Position(37.786736, -122.398202)); customMap.RouteCoordinates.Add(new Position(37.786345, -122.397722)); customMap.RouteCoordinates.Add(new Position(37.785983, -122.397295)); customMap.RouteCoordinates.Add(new Position(37.785559, -122.396728)); customMap.RouteCoordinates.Add(new Position(37.780624, -122.390541)); customMap.RouteCoordinates.Add(new Position(37.777113, -122.394983)); customMap.RouteCoordinates.Add(new Position(37.776831, -122.394627)); // pin at start var pin = new CustomPin { Pin = new Pin { Type = PinType.Place, Position = new Position(37.797534, -122.401827), Label = "Xamarin San Francisco Office", Address = "394 Pacific Ave, San Francisco CA" }, Id = "1Xamarin", Url = "http://xamarin.com/about/" }; customMap.CustomPins = new List <CustomPin> { pin }; customMap.Pins.Add(pin.Pin); pin = new CustomPin { Pin = new Pin { Type = PinType.Place, Position = new Position(37.776831, -122.394627), Label = "Xamarin Start", }, Id = "2Xamarin", Url = "http://xamarin.com/about/" }; customMap.CustomPins.Add(pin); customMap.Pins.Add(pin.Pin); customMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(37.797534, -122.401827), Distance.FromMiles(1.0))); }
public async void GetData() { KonumTablo model = new KonumTablo(); string URL = ""; var request = new HttpRequestMessage(HttpMethod.Get, URL + "/getlast"); using (HttpClient client = new HttpClient()) { var response = await client.SendAsync(request); if (response.StatusCode == HttpStatusCode.BadRequest) { model = null; } else if (response.StatusCode == HttpStatusCode.OK) { var content = await response.Content.ReadAsStringAsync(); model = JsonConvert.DeserializeObject <KonumTablo>(content); } else { model = null; } } double latData = (Convert.ToDouble(model.LatData)) / 1000000; double longData = (Convert.ToDouble(model.LongData)) / 1000000; DateTime newDate = new DateTime(model.DateTime.Year, model.DateTime.Month, model.DateTime.Day, model.DateTime.Hour + 3, model.DateTime.Minute, model.DateTime.Second); var pin = new CustomPin { Type = PinType.Place, Position = new Position(latData, longData), Label = "Son Konum", Address = newDate.ToString(), Id = "Xamarin", Url = "http://xamarin.com/about/" }; customMap.Pins.Add(pin); customMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(latData, longData), Distance.FromMiles(1.0))); }
public MapPage () { InitializeComponent (); var pin = new CustomPin { Pin = new Pin { Type = PinType.Place, Position = new Position (37.79752, -122.40183), Label = "Xamarin San Francisco Office", Address = "394 Pacific Ave, San Francisco CA" }, Id = "Xamarin", Url = "http://xamarin.com/about/" }; customMap.CustomPins = new List<CustomPin> { pin }; customMap.Pins.Add (pin.Pin); customMap.MoveToRegion (MapSpan.FromCenterAndRadius (new Position (37.79752, -122.40183), Distance.FromMiles (1.0))); }
public MapPage() { InitializeComponent(); var pin = new CustomPin { Type = PinType.Place, Position = new Position(37.79752, -122.40183), Label = "Xamarin San Francisco Office", Address = "394 Pacific Ave, San Francisco CA", Id = "Xamarin", Url = "http://xamarin.com/about/" }; customMap.CustomPins = new List <CustomPin> { pin }; customMap.Pins.Add(pin); customMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(37.79752, -122.40183), Distance.FromMiles(1.0))); }
public MapPage() { InitializeComponent(); //customMap.IsShowingUser = true; //requestGPSAsync(); // ArrayList<tipoDato> = new; var datoOcupacion = obtenerDatosOcupacion(); var datosResultadoOcupacion = JArray.Parse(datosOcupacion); //findMe(); string estadoletra = ""; bool estadoBool; /////////////////////////////////////////////////// ////////////////////////// int counter = 0; Title = "Stores"; Icon = "flag_map_marker4.png"; var customMap = new CustomMap { MapType = MapType.Street, WidthRequest = App.ScreenWidth, HeightRequest = App.ScreenHeight }; customMap.CustomPins = new List <CustomPin>(); foreach (var v in datosResultadoOcupacion) { if ((int)datosResultadoOcupacion[counter]["estado"] == 1) { estadoBool = false; estadoletra = "Ocupado"; } else { estadoBool = true; estadoletra = "Desocupado"; } var pin = new CustomPin() { Pin = new Pin() { Type = PinType.Place, Position = new Position((double)datosResultadoOcupacion[counter]["coordenadas_lat"], (double)datosResultadoOcupacion[counter]["coordenadas_lon"]), Label = estadoletra, Address = "Calle " + datosResultadoOcupacion[counter]["calle"].ToString() + " con " + datosResultadoOcupacion[counter]["interseccion1"].ToString() }, Id = "id: " + counter, Url = "", Estado = estadoBool }; customMap.CustomPins.Add(pin); counter++; } foreach (var pin in customMap.CustomPins) { customMap.Pins.Add(pin.Pin); } // dont delete below code ,they will save you if timer doesnt work . customMap.MoveToRegion(MapSpan.FromCenterAndRadius(customMap.CustomPins [0].Pin.Position, Distance.FromMiles(0.20))); Content = customMap; }