Created
April 7, 2017 11:19
-
-
Save anonymous/66e0e110a563c1fb87e4c0a70740ad62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.App; | |
using Android.Widget; | |
using Android.OS; | |
using Android.Support.V7.App; | |
using Android.Gms.Common.Apis; | |
using Android.Gms.Extensions; | |
using Android.Gms.Awareness; | |
using Android.Gms.Location; | |
using Android.Gms.Maps; | |
using Android.Gms.Location.Places.UI; | |
using Android.Locations; | |
[assembly: MetaData ("com.google.android.geo.API_KEY", Value="AIzaSyCe9FlFLkAo34iMnxnR23X3g_irRh7ir5E")] | |
namespace GpsAsyncTest | |
{ | |
[Activity(Label = "GpsAsyncTest", MainLauncher = true, Icon = "@mipmap/icon", Theme="@style/Theme.AppCompat")] | |
public class MainActivity : AppCompatActivity | |
{ | |
GoogleApiClient googleApi; | |
protected async override void OnCreate(Bundle savedInstanceState) | |
{ | |
base.OnCreate(savedInstanceState); | |
// Set our view from the "main" layout resource | |
SetContentView(Resource.Layout.Main); | |
//wider search radius for destination | |
double offset = 0.1; | |
var lat = 42.072596; | |
var lng = -82.624993; | |
var northEast = new Android.Gms.Maps.Model.LatLng(lat + offset, lng + offset); | |
var southWest = new Android.Gms.Maps.Model.LatLng(lat - offset, lng - offset); | |
var bounds = new Android.Gms.Maps.Model.LatLngBounds(southWest, northEast); | |
var builder = new PlacePicker.IntentBuilder(); | |
builder = builder.SetLatLngBounds(bounds); | |
var intent = builder.Build(this); | |
StartActivityForResult(intent, 10112); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment