Exemplo n.º 1
0
        private void OnLocateMeClick(ElementEvent e)
        {
            GeoLocationProvider geoLocationProvider = new GeoLocationProvider(_map);

            GeoLocationOptions options = new GeoLocationOptions();

            options.UpdateMapView = true;

            geoLocationProvider.GetCurrentPosition(options);
        }
Exemplo n.º 2
0
        public async Task I_can_get_my_location_from_ip()
        {
            // Arrange
            var locationProvider = new GeoLocationProvider();

            // Act
            var location = await locationProvider.GetLocationAsync();

            // Assert
            location.Latitude.Should().NotBe(default);
Exemplo n.º 3
0
 public GeoLocationSensorSample(GeoLocationProvider provider, double time, GeoPoint3 location, GeoDatum geoDatum, double?bearing, double?speed, double?accuracy)
 {
     _provider = provider;
     _time     = time;
     _location = location;
     _geoDatum = geoDatum;
     _bearing  = bearing;
     _speed    = speed;
     _accuracy = accuracy;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ForecastProvider"/> class.
        /// </summary>
        /// <param name="weatherProvider">
        /// The weather provider.
        /// </param>
        /// <param name="coord">
        /// Coordinates of the city to get weather for
        /// </param>
        /// <param name="cityName">
        /// City name
        /// </param>
        /// <param name="countryCode">
        /// Country code
        /// </param>
        /// <param name="format">
        /// Weather output format
        /// </param>
        public ForecastProvider(
            IWeatherProvider weatherProvider,
            Coordinate coord   = null,
            string cityName    = null,
            string countryCode = null,
            string format      = null)
        {
            this.format = format ?? "{0}";
            var geoProv = new GeoLocationProvider();

            coord = coord ?? new GeoLocationProvider().Coordinate;

            cityName    = cityName ?? geoProv.City;
            countryCode = countryCode ?? geoProv.CountryCode;
            weatherProvider.Coordinate  = coord;
            weatherProvider.CityName    = cityName;
            weatherProvider.CountryCode = countryCode;

            this.WeatherProvider = weatherProvider;
            this.Coordinate      = coord;
        }
Exemplo n.º 5
0
 public Geolocator(Func <Context> contextFactory)
 {
     _provider = new GeoLocationProvider(contextFactory);
 }
Exemplo n.º 6
0
 public GeoIPAdapter(GeoLocationProvider geoLocationProvider)
 {
     _geoLocationProvider = geoLocationProvider;
 }