Пример #1
0
        async void drawMark(string type, GeoPoint point)
        {
            MapFragment mapFrag = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.map);

            Android.Gms.Maps.GoogleMap map = mapFrag.Map;
            Marker        marker;
            MarkerOptions markerOptions;

            switch (type)
            {
            case "origin":
                markerOptions = new MarkerOptions();
                markerOptions.SetPosition(new LatLng(point.latitude, point.longitude));
                markerOptions.SetTitle("Origin");
                marker = map.AddMarker(markerOptions);
                marker.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.car));
                break;

            case "finalDestionation":
                markerOptions = new MarkerOptions();
                markerOptions.SetPosition(new LatLng(point.latitude, point.longitude));
                markerOptions.SetTitle("Final Destination");
                marker = map.AddMarker(markerOptions);
                marker.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.CheckeredFlag));
                break;

            case "pitStop":
                markerOptions = new MarkerOptions();
                markerOptions.SetPosition(new LatLng(point.latitude, point.longitude));
                markerOptions.SetTitle("Final Destination");
                marker = map.AddMarker(markerOptions);
                break;
            }
        }
		protected override void OnResume ()
		{
			base.OnResume ();

			// Get a handle on the map element
			_mapFragment = FragmentManager.FindFragmentById(Resource.Id.map) as MapFragment;
			_map = _mapFragment.Map;

			// Set the map type 
			_map.MapType = GoogleMap.MapTypeNormal;

			// show user location
			_map.MyLocationEnabled = true;

			// setup a location manager
			_locationManager = GetSystemService(Context.LocationService) as LocationManager;

			// Add points on the map
			MarkerOptions marker1 = new MarkerOptions()
				.SetPosition(Location_Xamarin)
				.SetTitle("Xamarin")
				.InvokeIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueBlue));
			_map.AddMarker(marker1);

			MarkerOptions marker2 = new MarkerOptions()
			    .SetPosition(Location_Atlanta)
			    .SetTitle("Atlanta, GA")
			    .InvokeIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueRed));
			_map.AddMarker(marker2);

			// Add custom marker images on the map
			AddMonkeyMarkersToMap();

			// Add custom arrow callout on map
			AddInitialNewYorkBarToMap();

			// Add custom overlay image on the map
			PositionChicagoGroundOverlay(Location_Chicago);

			// use a generic location provider instead
			Criteria locationCriteria = new Criteria();
			locationCriteria.Accuracy = Accuracy.Coarse;
			locationCriteria.PowerRequirement = Power.Medium;

			var locationProvider = _locationManager.GetBestProvider(locationCriteria, true);
			if (locationProvider != null)
			{
				_locationManager.RequestLocationUpdates(locationProvider, 2000, 1, this);
			} else
			{
				Log.Info("error", "Best provider is not available. Does the device have location services enabled?");
			}

			// TODO: Step 4a - attach map handler for marker touch
//            _map.MarkerClick += MapOnMarkerClick;

			// TODO: Step 4c - attach map handler for info window touch
//			_map.InfoWindowClick += HandleInfoWindowClick;
		}
Пример #3
0
        public void OnMapReady(GoogleMap googleMap)
        {
            mMap = googleMap;
              LatLng latlng = new LatLng(loc.Latitude, loc.Longitude); //Wijnhaven
              CameraUpdate camera = CameraUpdateFactory.NewLatLngZoom(latlng, 15);
              mMap.MoveCamera(camera);
              MarkerOptions start = new MarkerOptions()
               .SetPosition(latlng)
               .SetTitle("Uw huidige locatie")
               .SetSnippet("U bevind zich hier")
               .SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueBlue));

              mMap.AddMarker(start);
              MarkerFactory mFactory = new MarkerFactory(preLoad.csvFT.getMarkers());
              float lowest = 99999;
              for (Iterator iter = mFactory.getIterator(); iter.hasNext();)
              {
            FietsTrommel ft = iter.next();
            if (ft.xcoord.Length > 0 && ft.ycoord.Length > 0)
            {
              double lat = Convert.ToDouble(ft.xcoord.Replace('.', ','));
              double lon = Convert.ToDouble(ft.ycoord.Replace('.', ','));
              Location fietsT = new Location("");
              fietsT.Latitude = lat;
              fietsT.Longitude = lon;

              if (fietsT.DistanceTo(loc) < 500)
              {
            LatLng coords = new LatLng(lat, lon);
            MarkerOptions newMarker = new MarkerOptions()
             .SetPosition(coords)
             .SetTitle(ft.Straat)
             .SetSnippet("Sinds: " + ft.Mutdatum)
             .Draggable(true);

            mMap.AddMarker(newMarker);
              }
              if (fietsT.DistanceTo(loc) < lowest)
              {
            lowest = fietsT.DistanceTo(loc);
            closest = ft;
              }
            }
              }
              Location closestF = new Location("");
              double closLat = Convert.ToDouble(closest.xcoord.Replace('.', ','));
              double closLon = Convert.ToDouble(closest.ycoord.Replace('.', ','));
              closestF.Latitude = closLat;
              closestF.Longitude = closLon;
        }
Пример #4
0
        private void AddMarker(Marker marker)
        {
            if (marker is Polyline)
            {
                AddPolyline(marker as Polyline);
                return;
            }

            MarkerOptions options = new MarkerOptions();

            if (marker.ZIndex.HasValue)
            {
                options.InvokeZIndex(marker.ZIndex.Value);
            }
            options.SetPosition(new LatLng(marker.Center.Latitude, marker.Center.Longitude));

            if (!string.IsNullOrEmpty(marker.Icon))
            {
                if (imageResolver != null)
                {
                    System.IO.Stream stream = imageResolver.Resolve(marker.Layer, marker.Icon);
                    if (stream == null)
                    {
                        stream = imageResolver.Resolve(marker);
                    }
                    if (stream != null)
                    {
                        options.SetIcon(BitmapDescriptorFactory.FromBitmap(BitmapFactory.DecodeStream(stream)));
                    }
                }
                else
                {
                    options.SetIcon(BitmapDescriptorFactory.FromResource(ResourceManager.GetDrawableByName(marker.Icon)));
                }
                if (marker.Label != null)
                {
                    CreateLabel(marker);
                }
            }

            options.SetTitle(marker.Title);
            options.SetSnippet(marker.Content);
            options.Draggable(marker.Draggable);

            markers.Add(marker, googleMap.AddMarker(options));

            marker.PropertyChanged += Marker_PropertyChanged;
        }
		void FindMap ()
		{
			_map = (SupportFragmentManager.FindFragmentById (Resource.Id.map) as SupportMapFragment).Map;
			if (_map != null) {
				_map.MyLocationEnabled = true;

				_map.UiSettings.TiltGesturesEnabled = false;
				_map.UiSettings.RotateGesturesEnabled = false;

				_map.MapClick += OnMapClick;
				_map.MapLongClick += OnMapLongClick;
				_map.MyLocationChange += HandleMyLocationChange;
				_map.MarkerClick += OnMarkerClick;

				_map.SetInfoWindowAdapter (new InfoWindowAdapter ());

				// here because map should be already initialized
				// http://developer.android.com/reference/com/google/android/gms/maps/model/BitmapDescriptorFactory.html
				_alarm_marker_normal = BitmapDescriptorFactory.FromResource (Resource.Drawable.marker_violet);
				_alarm_marker_normal_selected = BitmapDescriptorFactory.FromResource (Resource.Drawable.marker_violet_selected);
				_alarm_marker_disabled_selected = BitmapDescriptorFactory.FromResource (Resource.Drawable.marker_grey_selected);				
				_alarm_marker_disabled = BitmapDescriptorFactory.FromResource (Resource.Drawable.marker_grey);
                
				RefreshData ();

				_map.SetOnMapLoadedCallback (this);

				if (Mode == Mode.Add) {
					if (AlarmToAddMarker != null) {
						AlarmToAddMarker = _map.AddMarker (new MarkerOptions ().SetPosition (AlarmToAddMarker.Position).InvokeIcon (_alarm_marker_normal));
					}
				}
			}
		}
Пример #6
0
        public MapRoute(GoogleMap map, List<Station> stations)
        {
            _map = map;
            _mapRoutes = new List<Polyline>();
            _mapStations = new List<Marker>();

            // Choose color;
            Color color = Color.DodgerBlue;

            // Create polyline.
            var polyline = new PolylineOptions();
            polyline.InvokeWidth(4f);
            polyline.InvokeColor(color);

            for (var i = 0; i < stations.Count; i++)
            {
                // Add points to polyline.
                var station = stations[i];
                if (station != null && station.latitude != 0f && station.longitude != 0f)
                {
                    var latlng = new Android.Gms.Maps.Model.LatLng(station.latitude, station.longitude);
                    polyline.Add(latlng);
                    // Create marker.
                    var marker = new MarkerOptions();
                    marker.SetPosition(latlng);
                    marker.SetTitle((i + 1) + ". " + station.postName);
                    marker.Draggable(false);
                    marker.SetSnippet("ul. " + station.street);
                    _mapStations.Add(_map.AddMarker(marker));
                }
            }

            // Add polyline to map.
            _mapRoutes.Add(_map.AddPolyline(polyline));
        }
Пример #7
0
		void CargamosMarcadores ()
		{
			if (mMap == null) 
			{
				mMap = _mapFragment.Map;
				if (mMap != null)
				{
					//Relizamos un ciclo para cargar todas las ciudades en nuestro mapa y le asignamos un puntero de color azul
					foreach (Ciudad_Marca ciudad in MisCiudades) 
					{
						ciudad.Marcador=mMap.AddMarker(new MarkerOptions()
						                               .SetPosition(ciudad.Ubicacion)
						                               .SetTitle(ciudad.Nombre)
						                               .SetSnippet(ciudad.Descripcion)
						                               .InvokeIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueAzure)));
					}

					//Le indicamos que deve de cargar un ventana de información personalizada 
					mMap.SetInfoWindowAdapter (new CustomInfoWindowAdapter (this,MisCiudades));

					//Ubicamos la cámara en un posición que se puedan ver las marcas 
					mMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng ( 21.12806,-101.689163), 6));

				}

			}
		}
 public void OnMapReady (GoogleMap googleMap)
 {
     googleMap.MarkerDragEnd += (sender, e) => {
         mStreetViewPanorama.SetPosition (e.Marker.Position, 150);
     };
                         
     // Creates a draggable marker. Long press to drag.
     mMarker = googleMap.AddMarker (new MarkerOptions()
         .SetPosition (markerPosition)
         .SetIcon (BitmapDescriptorFactory.FromResource (Resource.Drawable.pegman))
         .Draggable(true));
 }
Пример #9
0
		public void OnMapReady (GoogleMap googleMap)
		{
			gMap = googleMap;
			SetUpMapAllEvents ();
			gMap.MapLongClick += (object sender, GoogleMap.MapLongClickEventArgs e) => {

				MarkerOptions marker = new MarkerOptions();
				marker.SetPosition(new LatLng(e.Point.Latitude, e.Point.Longitude));
				marker.SetTitle("Kasis");
				marker.SetIcon(BitmapDescriptorFactory.DefaultMarker (BitmapDescriptorFactory.HueCyan));
                
				gMap.AddMarker(marker);
			};
		}
Пример #10
0
        protected override void OnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs<Xamarin.Forms.View> e)
        {
            base.OnElementChanged(e);

            extendedMap = (ExtendedMap)Element;
            mapView = Control as MapView;
            map = mapView.Map;

            map.MarkerClick+= HandleMarkerClick;

            // Pin tıklanınca sağalta açılan menüyü engellemek için
            map.UiSettings.MapToolbarEnabled = true;
            map.UiSettings.MyLocationButtonEnabled = true;

            if (extendedMap.isOverlayNeeded) {
                LatLng southwest = new LatLng (extendedMap.sw.Latitude, extendedMap.sw.Longitude);
                LatLng northeast = new LatLng (extendedMap.ne.Latitude, extendedMap.ne.Longitude);

                LatLngBounds bounds = new LatLngBounds (southwest, northeast);

                string url = extendedMap.overlayURL;//"http://www.mgm.gov.tr/mobile/mblhrt/data/radar/MAX--_6100_P00.png";

                Bitmap objBitmap = GetImageBitmapFromUrl (url);

                BitmapDescriptor objBitmapDescriptor = BitmapDescriptorFactory.FromBitmap (objBitmap);
                GroundOverlayOptions objGroundOverlayOptions = new GroundOverlayOptions ().PositionFromBounds (bounds)/*.Position (objMapPosition, 100000)*/.InvokeImage (objBitmapDescriptor);

                map.AddGroundOverlay (objGroundOverlayOptions);

                //For freeing memory
                objBitmap.Recycle ();
            }

            for (int i = 0; i < extendedMap.pinDatas.Count; i++) {
                var markerWithIcon = new MarkerOptions ();
                markerWithIcon.SetPosition (new LatLng (extendedMap.pinDatas[i].lat, extendedMap.pinDatas[i].lng));
                markerWithIcon.SetTitle (i.ToString());
                /*markerWithIcon.SetTitle ("aa");
                markerWithIcon.SetSnippet ("bb");*/
                int resID = Resources.GetIdentifier (extendedMap.pinDatas [i].icon, "drawable" , "com.app1001.bluemart");
                //System.Diagnostics.Debug.WriteLine (resID);
                markerWithIcon.SetIcon(BitmapDescriptorFactory.FromResource(resID));
                map.AddMarker (markerWithIcon);
            }

            //Add Pins

            //map.SetInfoWindowAdapter(this);
            map.UiSettings.RotateGesturesEnabled = false;
        }
Пример #11
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            SetContentView (Resource.Layout.dashboard_listview_detail);
            progress = new ProgressDialog (this);
            lat = 37.09035962;
            lan = -95.71368456;
            flag = FindViewById<ImageView> (Resource.Id.ivNew1);
            flag.Click += Flag_Click;
            ivListEmpty = FindViewById<LinearLayout> (Resource.Id.ivEmptylist);
            lvlist = FindViewById<ListView> (Resource.Id.lvListDetail);
            llMap = FindViewById<RelativeLayout> (Resource.Id.llmap);
            tvnumber = FindViewById<TextView> (Resource.Id.tvNumber);
            tvdesc = FindViewById<TextView> (Resource.Id.tvdesc);
            tvtime = FindViewById<TextView> (Resource.Id.tvTime);
            tvreply = FindViewById<TextView> (Resource.Id.tvReply);
            ListSipp = new List<SippReplyModel> ();

            Typeface tf = Typeface.CreateFromAsset (Application.Context.Assets, "fonts/OpenSans-Light.ttf");
            Typeface tf1 = Typeface.CreateFromAsset (Application.Context.Assets, "fonts/OpenSans-Semibold.ttf");
            Typeface tf2 = Typeface.CreateFromAsset (Application.Context.Assets, "fonts/OpenSans-Bold.ttf");

            adapter = new CustomListViewDetail (this, ListSipp);
            lvlist.Adapter = adapter;
            if (adapter.IsEmpty) {
                ivListEmpty.Visibility = ViewStates.Visible;
            } else {
                ivListEmpty.Visibility = ViewStates.Gone;
            }

            mapFrag = (MapFragment)FragmentManager.FindFragmentById (Resource.Id.map);
            map = mapFrag.Map;
            map.UiSettings.CompassEnabled = true;
            map.UiSettings.ZoomControlsEnabled = false;
            map.MyLocationEnabled = false;

            LatLng lastLatLng = new LatLng (lat, lan);
            map.MoveCamera (CameraUpdateFactory.NewLatLngZoom (lastLatLng, 15));
            MarkerOptions marker = new MarkerOptions ();
            marker.SetPosition (new LatLng (lat, lan));
            map.AddMarker (marker);
            llMap.Background.SetAlpha (200);
            llMap.Click += LlMap_Click;
            tvnumber.SetTypeface (tf, TypefaceStyle.Normal);
            tvnumber.SetTypeface (tf2, TypefaceStyle.Normal);
            tvtime.SetTypeface (tf1, TypefaceStyle.Normal);
            tvreply.SetTypeface (tf1, TypefaceStyle.Normal);
        }
		public override void OnResume ()
		{
			base.OnResume ();

			_map = _myMapFrag.Map;//see GetMapAsync for a non-blocking solution

			_map.MapType = GoogleMap.MapTypeSatellite;

			MarkerOptions markerOp = new MarkerOptions()
				.SetPosition(LatLong_Van)
				.SetTitle("Vancouver")
				.SetSnippet("BC, Canada")
				.InvokeIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueGreen));
			_map.AddMarker(markerOp);
		}
Пример #13
0
        public void OnMapReady(GoogleMap googleMap)
        {
            map = googleMap;
            map.MyLocationEnabled = true;
            map.MapType = GoogleMap.MapTypeNormal;
            map.UiSettings.ZoomControlsEnabled = true;

            //map.UiSettings.CompassEnabled = true;
            map.UiSettings.SetAllGesturesEnabled(true);
            //map.UiSettings.RotateGesturesEnabled = true;
            map.AddMarker(new MarkerOptions().SetPosition(Location_NewYork));
            map.SetOnMarkerClickListener (this);

            /*LocationManager locManager = GetSystemService (Context.LocationService) as LocationManager;
            if (locManager.IsProviderEnabled (LocationManager.GpsProvider)) {
                locManager.RequestLocationUpdates (1000, 10, criteria, this, null);
            }

            else
            {
                AlertDialog.Builder builder = new AlertDialog.Builder(this);
                builder.SetTitle("GPS Disabled");
                builder.SetMessage("Enable GPS to use the app");
                builder.SetCancelable(false);
                builder.SetPositiveButton("OK", delegate { StartActivityForResult (new Intent(Android.Provider.Settings.ActionLocationSourceSettings), 0);
                });
                builder.Show();
            }*/
            FindViewById<Button> (Resource.Id.sharebutton).Click += delegate {
                {
                    var geoUri = Android.Net.Uri.Parse ("geo:"+ _currentLocation.Latitude+","+_currentLocation.Longitude);
                    var mapIntent = new Intent (Intent.ActionView, geoUri);
                    //mapIntent.SetType(
                    //StartActivity (mapIntent);

                    var smsUri = Android.Net.Uri.Parse("smsto:1234567890");
                    var smsIntent = new Intent (Intent.ActionSendto, smsUri);
                    StringBuilder smsstring = new StringBuilder();
                    smsstring.Append("Click the link to track ");
                    smsstring.Append("http://maps.google.com?q=");
                    smsstring.Append(_currentLocation.Latitude);
                    smsstring.Append(",");
                    smsstring.Append(_currentLocation.Longitude);
                    smsIntent.PutExtra ("sms_body",smsstring.ToString() );
                    StartActivity (smsIntent);
                }
            };
        }
Пример #14
0
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate (bundle);
     SetContentView (Resource.Layout.map_activity);
     lat = Intent.GetDoubleExtra ("lat", 0);
     lan = Intent.GetDoubleExtra ("lan", 0);
     mapFrag = (MapFragment)FragmentManager.FindFragmentById (Resource.Id.map);
     map = mapFrag.Map;
     map.UiSettings.CompassEnabled = true;
     map.UiSettings.ZoomControlsEnabled = true;
     LatLng lastLatLng = new LatLng (lat, lan);
     map.MoveCamera (CameraUpdateFactory.NewLatLngZoom (lastLatLng, 15));
     MarkerOptions marker = new MarkerOptions ();
     marker.SetPosition (new LatLng (lat, lan));
     map.AddMarker (marker);
 }
Пример #15
0
        async void SearchGas_OnClick(object sender, EventArgs eventArgs)
        {
            if (_currentLocation == null)
            {
                _addressText.Text = "Location is null";
                return;
            }

            Algorithm algorithm = new Algorithm();

            GeoPoint currentLoc  = new GeoPoint(_currentLocation.Latitude, _currentLocation.Longitude);
            GeoPoint destination = Algorithm.getFinalDestination();

            TravelData currentRoute = await algorithm.getOriginalRoute("driving", currentLoc, destination);

            List <GeoPoint> pointsToSearch = algorithm.findPointsToSearch(currentRoute, 500, currentLoc);

            MapFragment mapFrag = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.map);

            Android.Gms.Maps.GoogleMap map = mapFrag.Map;

            foreach (GeoPoint point in pointsToSearch)
            {
                MarkerOptions markerOpt1 = new MarkerOptions();
                markerOpt1.SetPosition(new LatLng(point.latitude, point.longitude));
                markerOpt1.SetTitle("Test Marker");
                map.AddMarker(markerOpt1);

                CircleOptions circleOptions = new CircleOptions();
                circleOptions.InvokeCenter(new LatLng(point.latitude, point.longitude));
                circleOptions.InvokeRadius(500);
                map.AddCircle(circleOptions);
            }

            LatLng location2 = new LatLng(pointsToSearch[3].latitude, pointsToSearch[7].longitude);

            CameraPosition.Builder builder = CameraPosition.InvokeBuilder();
            builder.Target(location2);
            builder.Zoom(12);
            //builder.Bearing(155);
            //builder.Tilt(65);
            CameraPosition cameraPosition = builder.Build();
            CameraUpdate   cameraUpdate   = CameraUpdateFactory.NewCameraPosition(cameraPosition);

            map.MoveCamera(cameraUpdate);
        }
Пример #16
0
        public static void PlaceMarkersOnTheMap(List<Feature> data, GoogleMap map)
        {
            foreach (var feature in data)
            {
                MarkerOptions wc = new MarkerOptions ();
                znajdzwc.Models.Geometry g = feature.geometry;
                Properties p = feature.properties;
                wc.SetPosition (new LatLng (g.coordinates [1], g.coordinates [0]));
                wc.SetTitle (p.name);
                wc.SetSnippet (p.comment);

                if(p.isFree)
                    wc.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.znajdz_wc_logo_free));
                else
                    wc.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.znajdz_wc_logo_free_money));

                map.AddMarker (wc);
            }
        }
		private void SetupMapIfNeeded()
		{
			if (_map == null)
			{
				_map = _mapFragment.Map;
				if (_map != null)
				{
					MarkerOptions marker1 = new MarkerOptions();
					marker1.SetPosition(VimyRidge);
					marker1.SetTitle("Vimy Ridge");
					_map.AddMarker(marker1);

					MarkerOptions marker2 = new MarkerOptions();
					marker2.SetPosition(Passchendaele);
					marker2.SetTitle("Passchendaele");
					_map.AddMarker(marker2);

					// We create an instance of CameraUpdate, and move the map to it.
					CameraUpdate cameraUpdate = CameraUpdateFactory.NewLatLngZoom(VimyRidge, 15);
					_map.MoveCamera(cameraUpdate);
				}
			}
		}
Пример #18
0
		public void OnMapReady(GoogleMap googleMap)
		{
			globMap = googleMap;
            markerColor = new Dictionary<string, HamsterColor>();
			foreach ( var a in ViewModel.Markers) {
				var markerOpt = new MarkerOptions();
				double la = double.Parse(a.HamsterLatitude, System.Globalization.CultureInfo.InvariantCulture);
				double lon = double.Parse (a.HamsterLongitude, System.Globalization.CultureInfo.InvariantCulture);
				latlng = new LatLng (la, lon);
				markerOpt.SetPosition (latlng);
				markerOpt.SetTitle (String.Format("Name: {0} {1} ", a.FirstName, a.LastName));
				markerOpt.SetSnippet (String.Format("Latitude: {0}  Longitude: {1} ", a.HamsterLatitude, a.HamsterLongitude));
               
				globMap.AddMarker(markerOpt); 
                markerColor.Add(String.Format("{0}{1}",markerOpt.Title, markerOpt.Snippet), a.Color); 
			}
			globMap.MyLocationEnabled = true;
			globMap.UiSettings.CompassEnabled = true;
			globMap.UiSettings.MapToolbarEnabled = false;
			globMap.UiSettings.ZoomControlsEnabled = true;
			globMap.UiSettings.MyLocationButtonEnabled = false;

			globMap.SetInfoWindowAdapter (this);
		}
Пример #19
0
        public MapRoute(GoogleMap map, ServerResponse.ResponseRoute[] responseRoutes)
        {
            var numberOfRoutes = responseRoutes.Length * 2 - 1;
            _map = map;
            _mapRoutes = new List<Polyline>();
            _mapStations = new List<Marker>();
            var l = 1;
            for (var i = 0; i < numberOfRoutes; i++)
            {
                // Create new partial route.
                if (i % 2 == 0)
                {
                    // Choose color;
                    Color color = Color.DodgerBlue;

                    // Create polyline.
                    var polyline = new PolylineOptions();
                    polyline.InvokeWidth(4f);
                    polyline.InvokeColor(color);

                    // Add points to polyline.
                    int k = i / 2;
                    ServerResponse.ResponseRoute responseRoute = responseRoutes[k];
                    for (var j = 0; j < responseRoute.pointsId.Length; j++)
                    {
                        string stationId = responseRoute.pointsId[j];
                        Station station = App.Database.GetStationById(stationId);
                        if (station != null && station.latitude != 0f && station.longitude != 0f)
                        {
                            var latlng = new Android.Gms.Maps.Model.LatLng(station.latitude, station.longitude);
                            polyline.Add(latlng);
                            // Create marker.
                            var marker = new MarkerOptions();
                            marker.SetPosition(latlng);
                            marker.SetTitle(l++ + ". " + station.postName);
                            marker.Draggable(false);
                            marker.SetSnippet("ul. " + station.street + "\n"+ "linia: " + responseRoute.variantId);
                            _mapStations.Add(_map.AddMarker(marker));
                        }
                    }

                    // Add polyline to map.
                    _mapRoutes.Add(_map.AddPolyline(polyline));
                }
                // Create connection between two routes.
                else
                {
                    // Choose color;
                    Color color = Color.LightSkyBlue;

                    // Create polyline.
                    PolylineOptions polyline = new PolylineOptions();
                    polyline.InvokeWidth(3f);
                    polyline.InvokeColor(color);

                    // Add points to polyline (closest, non 0f points).
                    // Last point from previous route.
                    int k = i / 2;
                    for (var j = 0; j < responseRoutes[k].pointsId.Length; j++)
                    {
                        string prevStationId = responseRoutes[k].pointsId[responseRoutes[k].pointsId.Length - 1 - j];
                        Station prevStation = App.Database.GetStationById(prevStationId);
                        if (prevStation != null && prevStation.latitude != 0f && prevStation.longitude != 0f)
                        {
                            polyline.Add(new Android.Gms.Maps.Model.LatLng(prevStation.latitude, prevStation.longitude));
                            break;
                        }
                    }
                    // 1st point from next route.
                    k++;
                    for (var j = 0; j < responseRoutes[k].pointsId.Length; j++)
                    {
                        string nextStationId = responseRoutes[k].pointsId[j];
                        Station nextStation = App.Database.GetStationById(nextStationId);
                        if (nextStation != null && nextStation.latitude != 0f && nextStation.longitude != 0f)
                        {
                            polyline.Add(new Android.Gms.Maps.Model.LatLng(nextStation.latitude, nextStation.longitude));
                            break;
                        }
                    }

                    // Add polyline to map.
                    _mapRoutes.Add(_map.AddPolyline(polyline));
                }
            }
        }
Пример #20
0
        async public void DrawMap()
        {
            if  ( _stateClass._person != null)
            {


                _mapFragment = MapFragment.FragmentManager.FindFragmentById(Resource.Id.map) as MapFragment;
                _map = _mapFragment.Map;
                _map.Clear();

                // Set the map type 
                // show user location
                _map.MyLocationEnabled = true;

                // setup a location manager
                _locationManager = _mainActivity.GetSystemService (Context.LocationService) as LocationManager;

                // use a generic location provider instead
                Criteria locationCriteria = new Criteria();
                locationCriteria.Accuracy = Accuracy.Coarse;
                locationCriteria.PowerRequirement = Power.Medium;

                await System.Threading.Tasks.Task.Delay(0);

                var geoCoder = new Geocoder(_mainActivity);
             
                try
                {
                    Address address = this.GetAddressesFromLocation(_stateClass._person.Strasse,_stateClass._person.PLZ,_stateClass._person.Ort,_stateClass._person.Land);
                    MarkerOptions marker1 = new MarkerOptions();

                    if (address != null)
                    {

                        marker1.SetPosition(new LatLng(address.Latitude, address.Longitude));
                        marker1.SetTitle(_stateClass._person.Name + " - " + _stateClass._person.Strasse + " - " + _stateClass._person.Ort + "- " + _stateClass._person.Umsatz);
                        marker1.InvokeIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueRed));
                        _Marker =  _map.AddMarker(marker1);
                        _map.AnimateCamera(CameraUpdateFactory.NewLatLngZoom(new Android.Gms.Maps.Model.LatLng(address.Latitude, address.Longitude), 9.0f));

                    }
                    else
                    {
                        Android.Widget.Toast.MakeText(_mainActivity,_mainActivity.Resources.GetString(Resource.String.AddresseNichtGefunden), Android.Widget.ToastLength.Short).Show();
                    }

                    _map.MarkerClick +=  (object sender, GoogleMap.MarkerClickEventArgs markerClickEventArgs) => 
                        {
                            markerClickEventArgs.Handled = true;
                            Marker marker = markerClickEventArgs.Marker;
                            _map.AnimateCamera(CameraUpdateFactory.NewLatLngZoom(marker.Position, 13));
                            marker.ShowInfoWindow();
                        };
                }   

                catch(Exception ex)
                {
                    DataAccessLayer.ExceptionWriter.WriteLogFile(ex);
                }
            }
        }
Пример #21
0
 private void RenderMarkers(IList<PlaceMap> placeMaps, GoogleMap googleMap)
 {
     (placeMaps as List<PlaceMap>).ForEach(placeMap =>
         {
             var options = new MarkerOptions()
                 .SetPosition(new LatLng(placeMap.latitude, placeMap.longitude))
                 .SetTitle(GetString(placeMap.nameRes))
                 .SetIcon(BitmapDescriptorFactory.FromResource(placeMap.markerRes))
                 .SetSnippet(GetString(placeMap.buildingNameRes));
             var marker = googleMap.AddMarker(options);
             markers.Add(placeMap.nameRes, marker);
         });
 }
Пример #22
0
		private void SetupMapIfNeeded()
		{
			if (_map == null)
			{
				_map = _mapFragment.Map;
				if (_map != null)
				{
					var centerPoint = new LatLng (Station.TroncalRouteCenter.Y, Station.TroncalRouteCenter.X);
					Activity.RunOnUiThread (delegate{
						_map.AnimateCamera(CameraUpdateFactory.NewLatLngZoom(centerPoint,15.0f));
						_map.MyLocationEnabled = true;
					});
					stations = stationRepository.Stations;
					Activity.RunOnUiThread (delegate{
						foreach(var station in stations){
							var location = new LatLng(station.Latitude, station.Longitude);
							var stationImageId = Resources.GetIdentifier( station.ImageFilename().ToLower(), "drawable", Activity.PackageName);
							var originalStationBitmap = BitmapFactory.DecodeResource(Resources, stationImageId);
							var scale = Resources.DisplayMetrics.Density;
							var pixels = 35;
							var stationBitmap = Bitmap.CreateScaledBitmap(originalStationBitmap, (int) (pixels * scale + 0.5f), (int) (pixels * scale + 0.5f), false);
							MarkerOptions markerOptions = new MarkerOptions()
								.SetPosition(location)
								.InvokeIcon(BitmapDescriptorFactory.FromBitmap(stationBitmap))
								.SetTitle(station.Name);
							_map.AddMarker(markerOptions);
						}
						var polylineOptions = new PolylineOptions();
						polylineOptions.InvokeWidth(5.0f);
						polylineOptions.InvokeColor(Color.Black);
						foreach(var point in Station.TroncalRoutePath){
							polylineOptions.Add(new LatLng(point.Y, point.X));
						}
						_map.AddPolyline(polylineOptions);
					});
				}
			}
		}
Пример #23
0
 public void OnMapReady(GoogleMap googleMap)
 {
     googleMap.AddMarker (new MarkerOptions ()
         .SetPosition (new LatLng (0, 0))
         .SetTitle ("Marker"));
 }
Пример #24
0
        void GenerateLoc( Location location )
        {
            map = mapFrag.Map;

            if (map != null) {
                if (map.MapType != GoogleMap.MapTypeHybrid) {
                    // Setup map.
                    map.MapType = GoogleMap.MapTypeHybrid;
                    map.UiSettings.ZoomControlsEnabled = true;
                    map.UiSettings.CompassEnabled = true;

                    // Setup camera position
                    LatLng myLoc = new LatLng(location.Latitude, location.Longitude);
                    CameraPosition.Builder builder = CameraPosition.InvokeBuilder();
                    builder.Target(myLoc);
                    builder.Zoom(18);
                    builder.Bearing(155);
                    builder.Tilt(65);
                    CameraPosition cameraPosition = builder.Build();
                    CameraUpdate cameraUpdate = CameraUpdateFactory.NewCameraPosition(cameraPosition);
                    map.MoveCamera (cameraUpdate);

                    // Setup user position
                    MarkerOptions YourPos = new MarkerOptions ();
                    YourPos.SetPosition (new LatLng (location.Latitude, location.Longitude));
                    YourPos.SetTitle ("You");
                    UserPos = map.AddMarker (YourPos);

                    // Setup destination
                    MarkerOptions UWaterloo = new MarkerOptions ();
                    UWaterloo.SetPosition (new LatLng (43.4688995, -80.54));
                    UWaterloo.SetTitle ("University of Waterloo");
                    map.AddMarker (UWaterloo);
                } else {
                    // Mark your position.
                    UserPos.Position = new LatLng (location.Latitude, location.Longitude);
                }
            }
        }
Пример #25
0
		private void SetupMapIfNeeded ()
		{
			if (mapFragment == null) {
				InitMapFragment ();
			}

			if (mode == "info") {
				if (mapFragment != null && mapFragment.View != null) {
					mapFragment.View.Visibility = ViewStates.Gone;
				}
			}

			if (map == null) {
				map = mapFragment.Map;
				if (map != null) {
					map = mapFragment.Map;

					if (map != null) {
						MarkerOptions markerOptions = new MarkerOptions ();
						markerOptions.SetPosition (UPC);
						markerOptions.SetTitle ("CheckinApp");
						map.AddMarker (markerOptions);
					}

				}
			}
		}
Пример #26
0
        public async void OnMapReady(GoogleMap googleMap)
        {
            GMap = googleMap;
            GMap.InfoWindowClick += MapOnMarkerClick;
            
            // users = new ArrayList();
            string result= await ApiRequests.getLocations(client);
            if (result!= "error")
            {
                users = JsonConvert.DeserializeObject<User[]>(result);
                

                foreach (User user in users)
                {
                    if (user.latitude != null)
                    {
                        GMap.AddMarker(new MarkerOptions()
                            .SetTitle(user.first_name + " " + user.last_name)
                            
                            .SetSnippet(user.email)
                            .InvokeIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.marker))
                            .SetPosition(new LatLng((double)user.latitude, (double)user.longitude)));
                    }
                }
            }

            GMap.AnimateCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng((double)client.latitude, (double)client.longitude), 12));

           
        }
Пример #27
0
        public void OnMapReady(GoogleMap map)
        {
            googleMap = map;
            googleMap.UiSettings.CompassEnabled = false;
            googleMap.UiSettings.MyLocationButtonEnabled = false;
            googleMap.UiSettings.MapToolbarEnabled = false;

            if (googleMap == null)
                return;

            googleMap.Clear ();

            try {
                MapsInitializer.Initialize (this);
            } catch (GooglePlayServicesNotAvailableException e) {
                Console.WriteLine ("Google Play Services not available:" + e);
                return;
            }

            if (assignment == null)
                return;

            var markerOptions = GetMarkerOptionsForAssignment (assignment);
            googleMap.AddMarker (markerOptions).ShowInfoWindow ();
            googleMap.CameraPosition.Target = markerOptions.Position;

            googleMap.MoveCamera (CameraUpdateFactory.NewLatLngZoom (markerOptions.Position, 15f));
        }
        public void OnMapReady(GoogleMap googleMap)
        {
            map = googleMap;
            MapsInitializer.Initialize (Activity.ApplicationContext);

            map.MapClick += HandleMapClick;
            map.MarkerClick += HandleMapMarkerClick;

            map.UiSettings.CompassEnabled = false;
            map.UiSettings.MyLocationButtonEnabled = false;
            map.UiSettings.MapToolbarEnabled = false;

            var markerLatLong = new LatLng (Place.Geometry.Location.Latitude, Place.Geometry.Location.Longitude);
            var markerOptions = new MarkerOptions ();
            markerOptions.SetTitle (Place.Name);
            markerOptions.SetPosition (markerLatLong);

            map.AddMarker (markerOptions);
            map.MoveCamera (CameraUpdateFactory.NewLatLng (markerLatLong));
        }
		protected override async void OnCreate (Bundle bundle)
		{
			//RequestWindowFeature(WindowFeatures.NoTitle);
			base.OnCreate (bundle);

			//CREAMOS EL OBJETO QUE VA A LEER/ESCRIBIR LAS PREFERENCIAS DEL USUARIO
			var prefs = this.GetSharedPreferences("RunningAssistant.preferences", FileCreationMode.Private);

			//ASIGNAMOS EL DICCIONARIO

			valores = new ContentValues ();
			source = 1;

			negocioid = Intent.GetStringExtra ("id");

			//CREAMOS EL OBJETO DEL OBJETO (lel) que va a editar las preferencias
			var editor = prefs.Edit ();
			userid = prefs.GetString("id", null);

			//SETEAMOS LA VISTA A CONTROLAR
			SetContentView(Resource.Layout.perfil_premium);

			imgnegocioprev = FindViewById<GridLayout> (Resource.Id.imgnegocioprev);
			masimagenesnegocio = FindViewById<TextView> (Resource.Id.masimagenesnegocio);
			imagennegocio = FindViewById <Button> (Resource.Id.imagennegocio);
			imagencamaranegocio = FindViewById<Button> (Resource.Id.imagencamaranegocio);
			enviarimgneg = FindViewById<Button> (Resource.Id.enviarimgneg);
			LinearLayout containernegocio = FindViewById<LinearLayout> (Resource.Id.containernegocio);
			LinearLayout waitlayout = FindViewById <LinearLayout> (Resource.Id.waitlayout);

			ubicacionbtn = FindViewById<Button> (Resource.Id.ubicacionbtn);
			descripcionbtn = FindViewById<Button> (Resource.Id.descripcionbtn);
			contactobtn = FindViewById<Button> (Resource.Id.contactobtn);

			ubicacionlayout = FindViewById<LinearLayout> (Resource.Id.ubicacionlayout);
			descripcionlayout = FindViewById<LinearLayout> (Resource.Id.descripcionlayout);
			contactolayout = FindViewById<LinearLayout> (Resource.Id.contactolayout);

			callnow = FindViewById<Button> (Resource.Id.callnow);

		



			mToolbar = FindViewById<SupportToolBar> (Resource.Id.toolbar);
			mScrollView = FindViewById<ScrollView> (Resource.Id.scrollView);

			SetSupportActionBar (mToolbar);
			//ESTA ES LA FLECHA PARA ATRÁS
			SupportActionBar.SetHomeAsUpIndicator (Resource.Drawable.ic_arrow_back);
			SupportActionBar.SetDisplayHomeAsUpEnabled (true);
			//SupportActionBar.SetHomeButtonEnabled (true);

			layoutdejaimagenes = FindViewById<LinearLayout> (Resource.Id.layoutdejaimagenes);

			Point size = new Point ();
			Display display = WindowManager.DefaultDisplay;
			display.GetSize (size);
			mScreenHeight = size.Y;

			mScrollView.ViewTreeObserver.AddOnScrollChangedListener (this);

			//despues del show del action var, vamos a obtener el negocio

			SupportActionBar.Title = Intent.GetStringExtra("nombre");

			portada = FindViewById<ImageView> (Resource.Id.coverneg);

			TextView abiertocerrado = FindViewById<TextView>(Resource.Id.abiertocerrado);

			bounce = AnimationUtils.LoadAnimation (Application.Context, Resource.Animation.bounce);
			flip = AnimationUtils.LoadAnimation (Application.Context, Resource.Animation.flip);
			floatbounce = AnimationUtils.LoadAnimation (Application.Context, Resource.Animation.floatbounce);

			idres=Intent.GetStringExtra ("id");
			titulores = Intent.GetStringExtra ("nombre");

			//BOTONES DE RESEÑA
			Button enviarrev = FindViewById<Button> (Resource.Id.enviarrev);
			Button imagenrev = FindViewById<Button> (Resource.Id.imagenrev);
			Button imagenrev2 = FindViewById<Button> (Resource.Id.imagenrev2);
			Button imagencamara = FindViewById<Button> (Resource.Id.imagencamara);


			masimagenes = FindViewById<TextView> (Resource.Id.masimagenes);

			imgUri = null;
			apath = "";


			revItems = new List<Review>();

			//fuente
			Typeface font = Typeface.CreateFromAsset(Assets, "Fonts/fa.ttf");


			//COORDINATOR LAYOUT:
			var fab = FindViewById<CoordinatorLayout> (Resource.Id.snackbarPosition);

			Button addimg = FindViewById<Button> (Resource.Id.addimg);
			Button addcomment = FindViewById<Button> (Resource.Id.addcomment);
			Button addtip = FindViewById<Button> (Resource.Id.addtip);
			Button enviarmensaje = FindViewById<Button> (Resource.Id.enviarmensaje);
			Button addlike = FindViewById<Button> (Resource.Id.addlike);
			fossbytes = new List<byte[]>();

			deleteimgnegocio = FindViewById<Button> (Resource.Id.deleteimgnegocio);

			addimg.SetTypeface(font, TypefaceStyle.Normal);
			addcomment.SetTypeface(font, TypefaceStyle.Normal);
			addtip.SetTypeface(font, TypefaceStyle.Normal);
			enviarmensaje.SetTypeface(font, TypefaceStyle.Normal);
			addlike.SetTypeface(font, TypefaceStyle.Normal);

			TextView corazonlikes = FindViewById<TextView> (Resource.Id.corazonlikes);

			TextView alikes = FindViewById<TextView> (Resource.Id.alikes);
			TextView likes = FindViewById<TextView> (Resource.Id.likes);
			TextView gustalikes = FindViewById<TextView> (Resource.Id.gustalikes);


			corazonlikes.SetTypeface(font, TypefaceStyle.Normal);
			alikes.SetTypeface(font, TypefaceStyle.Normal);
			likes.SetTypeface(font, TypefaceStyle.Normal);
			gustalikes.SetTypeface(font, TypefaceStyle.Normal);
			callnow.SetTypeface(font, TypefaceStyle.Normal);


			LinearLayout layoutdiascontainer = FindViewById<LinearLayout> (Resource.Id.layoutdiascontainer);
			//layoutdiascontainer.Animate().TranslationY(0);

			ScrollView scrollview = FindViewById<ScrollView> (Resource.Id.scrollView);

			ProgressBar waitpb = FindViewById<ProgressBar> (Resource.Id.waitpb);

			deleteimgrev = FindViewById<Button> (Resource.Id.deleteimgrev);


			try{
				negocio = await plifserver.FetchWeatherAsync ("http://plif.mx/mobile/get_negocio?id="+Intent.GetStringExtra("id")+"&uid="+userid);
				objeto = negocio["respuesta"][0]["Data"];

				Log.Debug (tag, "La ruta es: "+objeto["ruta"]);



				if(negocio["respuesta"][0]["0"]["has_like"]=="1"){
					haslike=true;
				}else{
					haslike=false;
				}

				if (haslike) {
					addlike.Text = GetString (Resource.String.heart);
				} else {
					addlike.Text = GetString (Resource.String.heartempty);
				}

				numlikes=objeto["likes"];


				if (objeto["ruta"] == null || objeto["ruta"] == "" || objeto["ruta"] == "null") {
					//pon la imagen por defecto
					portada.SetImageResource (Resource.Drawable.dcover);
					Log.Debug (tag, "No hay ruta!");
				} else {
					//TENEMOS QUE VERIFICAR SI LA IMAGEN ES DE GOOGLE O DE NOSOTROS!!!
					string ruta=objeto["ruta"];
					string first=ruta[0].ToString();

					if(first=="u" || first=="U"){
						//Toast.MakeText (Application.Context, "EMPIEZA CON U!!!", ToastLength.Long).Show ();
						ruta=extra+ruta;
					}else{
						//no hagas nada, la imagen es de google
					}

					Koush.UrlImageViewHelper.SetUrlDrawable (portada, ruta, Resource.Drawable.dcover);

				}//TERMINA SI LA IMAGEN NO ES NULL

				//Ponemos el titulo
				TextView titulo = FindViewById<TextView> (Resource.Id.titulo);
				titulo.Text=Intent.GetStringExtra("nombre");
				TextView numestrellas = FindViewById<TextView> (Resource.Id.numestrellas);

				//Ponemos las estrellas
				ImageView estrellas = FindViewById<ImageView> (Resource.Id.estrellas);

				switch (Intent.GetStringExtra("calificacion")) {

				case "0":
				case "":
				case "null":
				case null:
					numestrellas.Text="0.0";
					break;

				case "1":
					numestrellas.Text="1.0";
					break;

				case "2":
					numestrellas.Text="2.0";
					break;
				case "3":
					numestrellas.Text="3.0";
					break;
				
				case "4":
					numestrellas.Text="4.0";
					break;

				case "5":
					numestrellas.Text="5.0";
					break;


				default:
					numestrellas.Text="0.0";
					break;
				}

				//categoria y subcategoria
				TextView categoria = FindViewById<TextView> (Resource.Id.categoria);
				TextView subcategoria = FindViewById<TextView> (Resource.Id.subcategoria);
				TextView guioncat = FindViewById<TextView> (Resource.Id.guioncat);

				categoria.Text=objeto["categoria"];

				if(objeto["propietario"]==null || objeto["propietario"]=="null"){
					propietario="0";
				}else{
					propietario=objeto["propietario"];
				}

				if(objeto["subcategoria"]=="" || objeto["subcategoria"]==null || objeto["subcategoria"]=="null"){
					subcategoria.Text="";
					guioncat.Text="";
				}else{
					subcategoria.Text=objeto["subcategoria"];
				}

				//likes
				likes.Text=objeto["likes"]+" Personas";

				//mapa?
				try{
					mapFrag = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.map);
					map = mapFrag.Map;

					LatLng location = new LatLng(objeto["geo_lat"], objeto["geo_long"]);
					CameraPosition.Builder builder = CameraPosition.InvokeBuilder();
					builder.Target(location);
					builder.Zoom(16);
					//builder.Bearing(155);
					//builder.Tilt(65);
					CameraPosition cameraPosition = builder.Build();
					CameraUpdate cameraUpdate = CameraUpdateFactory.NewCameraPosition(cameraPosition);



					if (map != null)
					{
						map.MapType = GoogleMap.MapTypeNormal;

						MarkerOptions markerOpt1 = new MarkerOptions();
						markerOpt1.SetPosition(new LatLng(objeto["geo_lat"], objeto["geo_long"]));
						markerOpt1.SetTitle(objeto["titulo"]);
						markerOpt1.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.pliflocation3));
						markerOpt1.Draggable(true);
						map.AddMarker(markerOpt1);
						map.MoveCamera(cameraUpdate);




					}
				}catch(Exception ex){
					Log.Debug (tag, "GMAPS ERROR:"+ex);
				}


				//direccion
				TextView callenum = FindViewById<TextView> (Resource.Id.callenum);
				callenum.Text=objeto["geo_calle"]+" "+objeto["geo_numero"];
				TextView colonia = FindViewById<TextView> (Resource.Id.colonia);
				colonia.Text=objeto["geo_colonia"];
				TextView regpais = FindViewById<TextView> (Resource.Id.regpais);
				regpais.Text=objeto["geo_estado"]+", "+objeto["geo_pais"];

				//acerca de este negocio
				TextView mapmarker1 = FindViewById<TextView> (Resource.Id.sobreeste);
				mapmarker1.SetTypeface(font, TypefaceStyle.Normal);

				TextView descripcion = FindViewById<TextView> (Resource.Id.descripcion);
				string desc=objeto["descripcion"];

				descripcion.Text=System.Net.WebUtility.HtmlDecode(desc);
				descripcion.Visibility=ViewStates.Gone;

				WebView descweb = FindViewById<WebView> (Resource.Id.descweb);
				descweb.Settings.JavaScriptEnabled=true;
				string div1="<div style=\"color: #FFFFFF\">";
				string div2="</div>";
				descweb.LoadDataWithBaseURL("", div1+desc+div2, "text/html", "UTF-8", "");
				descweb.SetBackgroundColor(Color.ParseColor("#343A41"));

				//telefono
				TextView webico =FindViewById<TextView> (Resource.Id.webico);
				TextView telico =FindViewById<TextView> (Resource.Id.telico);

				telefono= FindViewById<TextView> (Resource.Id.telefono);
				telico.SetTypeface(font, TypefaceStyle.Normal);
				telefono.Text= objeto["telefono"]+" ";


				//webpage
				TextView web = FindViewById<TextView> (Resource.Id.pagweb);
				webico.SetTypeface(font, TypefaceStyle.Normal);
				web.Text=objeto["website"]+" ";

				//Horarios
				TextView horarios=FindViewById<TextView> (Resource.Id.horarios);
				horarios.SetTypeface(font, TypefaceStyle.Normal);

				abiertocerrado = FindViewById<TextView>(Resource.Id.abiertocerrado);

				LinearLayout lunescontainer = FindViewById<LinearLayout> (Resource.Id.lunescontainer);
				TextView lunes = FindViewById<TextView>(Resource.Id.lunes);
				TextView luneshora = FindViewById<TextView>(Resource.Id.luneshora);

				LinearLayout martescontainer = FindViewById<LinearLayout> (Resource.Id.martescontainer);
				TextView martes = FindViewById<TextView>(Resource.Id.martes);
				TextView marteshora = FindViewById<TextView>(Resource.Id.marteshora);

				LinearLayout miercolescontainer = FindViewById<LinearLayout> (Resource.Id.miercolescontainer);
				TextView miercoles = FindViewById<TextView>(Resource.Id.miercoles);
				TextView miercoleshora = FindViewById<TextView>(Resource.Id.miercoleshora);

				LinearLayout juevescontainer = FindViewById<LinearLayout> (Resource.Id.juevescontainer);
				TextView jueves = FindViewById<TextView>(Resource.Id.jueves);
				TextView jueveshora = FindViewById<TextView>(Resource.Id.jueveshora);

				LinearLayout viernescontainer = FindViewById<LinearLayout> (Resource.Id.viernescontainer);
				TextView viernes = FindViewById<TextView>(Resource.Id.viernes);
				TextView vierneshora = FindViewById<TextView>(Resource.Id.vierneshora);

				LinearLayout sabadocontainer = FindViewById<LinearLayout> (Resource.Id.sabadocontainer);
				TextView sabado = FindViewById<TextView>(Resource.Id.sabado);
				TextView sabadohora = FindViewById<TextView>(Resource.Id.sabadohora);

				LinearLayout domingocontainer = FindViewById<LinearLayout> (Resource.Id.domingocontainer);
				TextView domingo = FindViewById<TextView>(Resource.Id.domingo);
				TextView domingohora = FindViewById<TextView>(Resource.Id.domingohora);

				//poner los horarios donde corresponde
				if(objeto["lunes_a"]=="" || objeto["lunes_c"]==""){
					lunescontainer.Visibility=ViewStates.Gone;
				}else{
					if(objeto["lunes_a"]=="Cerrado" || objeto["lunes_c"]=="Cerrado"){
						luneshora.Text="Cerrado";
					}else{
						luneshora.Text=objeto["lunes_a"]+" - "+objeto["lunes_c"];
					}

				}


				if(objeto["martes_a"]=="" || objeto["martes_c"]==""){
					martescontainer.Visibility=ViewStates.Gone;
				}else{
					if(objeto["martes_a"]=="Cerrado" || objeto["martes_c"]=="Cerrado"){
						marteshora.Text="Cerrado";
					}else{
						marteshora.Text=objeto["martes_a"]+" - "+objeto["martes_c"];
					}

				}

				if(objeto["miercoles_a"]=="" || objeto["miercoles_c"]==""){
					miercolescontainer.Visibility=ViewStates.Gone;
				}else{
					if(objeto["miercoles_a"]=="Cerrado" || objeto["miercoles_c"]=="Cerrado"){
						miercoleshora.Text="Cerrado";
					}else{
						miercoleshora.Text=objeto["miercoles_a"]+" - "+objeto["miercoles_c"];
					}

				}

				if(objeto["jueves_a"]=="" || objeto["jueves_c"]==""){
					juevescontainer.Visibility=ViewStates.Gone;
				}else{
					if(objeto["jueves_a"]=="Cerrado" || objeto["jueves_c"]=="Cerrado"){
						jueveshora.Text="Cerrado";
					}else{
						jueveshora.Text=objeto["jueves_a"]+" - "+objeto["jueves_c"];
					}

				}

				if(objeto["viernes_a"]=="" || objeto["viernes_c"]==""){
					viernescontainer.Visibility=ViewStates.Gone;
				}else{
					if(objeto["viernes_a"]=="Cerrado" || objeto["viernes_c"]=="Cerrado"){
						vierneshora.Text="Cerrado";
					}else{
						vierneshora.Text=objeto["viernes_a"]+" - "+objeto["viernes_c"];
					}

				}

				if(objeto["sabado_a"]=="" || objeto["sabado_c"]==""){
					sabadocontainer.Visibility=ViewStates.Gone;
				}else{
					if(objeto["sabado_a"]=="Cerrado" || objeto["sabado_c"]=="Cerrado"){
						sabadohora.Text="Cerrado";
					}else{
						sabadohora.Text=objeto["sabado_a"]+" - "+objeto["sabado_c"];
					}

				}

				if(objeto["domingo_a"]=="" || objeto["domingo_c"]==""){
					domingocontainer.Visibility=ViewStates.Gone;
				}else{
					if(objeto["domingo_a"]=="Cerrado" || objeto["domingo_c"]=="Cerrado"){
						domingohora.Text="Cerrado";
					}else{
						domingohora.Text=objeto["domingo_a"]+" - "+objeto["domingo_c"];
					}

				}







				//vemos que dia es hoy y lo ponemos en verde
				DateTime localDate = DateTime.Now;
				int dia=(int)localDate.DayOfWeek; 
				//1 es lunes, 7 es domingo y así

				string hoy_abre="";
				string hoy_cierra="";

				switch(dia){
				case 1:
					lunes.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
					luneshora.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
					hoy_abre = objeto ["lunes_a"];
					hoy_cierra = objeto ["lunes_c"];
					break;

				case 2:
					martes.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
					marteshora.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
					hoy_abre = objeto ["martes_a"];
					hoy_cierra = objeto ["martes_c"];
					break;

				case 3:
					miercoles.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
					miercoleshora.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
					hoy_abre = objeto ["miercoles_a"];
					hoy_cierra = objeto ["miercoles_c"];
					break;

				case 4:
					jueves.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
					jueveshora.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
					hoy_abre = objeto ["jueves_a"];
					hoy_cierra = objeto ["jueves_c"];
					break;

				case 5:
					viernes.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
					vierneshora.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
					hoy_abre = objeto ["viernes_a"];
					hoy_cierra = objeto ["viernes_c"];
					break;

				case 6:
					sabado.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
					sabadohora.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
					hoy_abre = objeto ["sabado_a"];
					hoy_cierra = objeto ["sabado_c"];
					break;

				case 7:
					domingo.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
					domingohora.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
					hoy_abre = objeto ["domingo_a"];
					hoy_cierra = objeto ["domingo_c"];
					break;

				default:
					hoy_abre = "cerrado";
					hoy_cierra = "cerrado";
					break;

				}

				if(hoy_abre == "Cerrado" || hoy_cierra=="Cerrado"){
					abiertocerrado.Text="Cerrado por el dia de hoy.";
					abiertocerrado.SetTextColor(Android.Graphics.Color.ParseColor("#C41200"));
				}else{

					if(hoy_abre == "" || hoy_cierra==""){
						abiertocerrado.Text="No disponemos de los horarios para el dia de hoy.";
						abiertocerrado.SetTextColor(Android.Graphics.Color.ParseColor("#C41200"));
					}else{
						//TODO AQUI
						//AQUI HAY QUE VER SI ESTÁ ABIERTO O CERRADO
						DateTime ahora = DateTime.Now;
						DateTime abre = Convert.ToDateTime(hoy_abre);
						DateTime cierra = Convert.ToDateTime(hoy_cierra);
						DateTime cierra2 = DateTime.Now;



						int diasig=DateTime.Compare(abre,cierra);
						//Toast.MakeText (Application.Context, "Cierra primero: "+cierra.ToString(), ToastLength.Long).Show ();

						if(diasig>0){
							//sumale un dia a la hora de cierre
							//Toast.MakeText (Application.Context, "si es mayor!: "+diasig, ToastLength.Long).Show ();
							cierra2=cierra.AddDays(1);
						}else{
							cierra2=cierra;
							//no hagas nada
						}

						int f1=DateTime.Compare(abre, ahora);
						int f2=DateTime.Compare(ahora,cierra2);

						if(f1<0 && f2<0){
							//abierto
							abiertocerrado.Text="Abierto justo ahora!";
							abiertocerrado.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF"));
						}else{
							//cerrado
							abiertocerrado.Text="Cerrado ahora";
							abiertocerrado.SetTextColor(Android.Graphics.Color.ParseColor("#C41200"));
						}

					}

				}

				TextView revs_tit= FindViewById<TextView> (Resource.Id.revs_tit);
				revs_tit.SetTypeface(font, TypefaceStyle.Normal);
				containernegocio.Visibility=ViewStates.Visible;
				waitlayout.Visibility=ViewStates.Gone;

				ImageView imgface = FindViewById<ImageView> (Resource.Id.imageface);
				ImageView imgtwitter = FindViewById<ImageView> (Resource.Id.imagetwitter);
				ImageView imggoogle = FindViewById<ImageView> (Resource.Id.imagegoogle);
				ImageView imgplif = FindViewById<ImageView> (Resource.Id.imageplif);

				if (objeto ["facebook"] == "") {
					imgface.Visibility = ViewStates.Gone;
				}

				if (objeto ["twitter"] == "") {
					imgtwitter.Visibility = ViewStates.Gone;
				}

				if (objeto ["google"] == "") {
					imggoogle.Visibility = ViewStates.Gone;
				}


				imgface.Click += (object sender, EventArgs e) => {

					Intent intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse(objeto["facebook"]));
					StartActivity(intent);

				};

				imgtwitter.Click += (object sender, EventArgs e) => {
					Intent intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse(objeto["twitter"]));
					StartActivity(intent);

				};

				imggoogle.Click += (object sender, EventArgs e) => {
					Intent intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse(objeto["google"]));
					StartActivity(intent);

				};

				imgplif.Click += (object sender, EventArgs e) => {
					Intent intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse("http://www.plif.mx/negocio/"+objeto["id"]));
					StartActivity(intent);

				};






			}
			catch(Exception ex){
				Log.Debug (tag, "ERROR FETCHING DATA: "+ex);
				Toast.MakeText (Application.Context, "Ocurrió un error al recuperar la información del negocio", ToastLength.Long).Show ();
				Finish ();
			}

			//aqui en un nuevo try catch, cargamos los comentarios

			ProgressBar waitrv = FindViewById<ProgressBar> (Resource.Id.waitrv);
			try{

				ReviewsObj=await plifserver.FetchWeatherAsync("http://plif.mx/mobile/get_neg_reviews?nid="+Intent.GetStringExtra("id")+"&uid="+userid);
				//Aqui vamos a cargar los reviews con ayuda del adapter

				LinearLayout reviewscont = FindViewById<LinearLayout> (Resource.Id.reviewscont);
				LayoutInflater inflater = LayoutInflater.From(this);

				/*
				for(int i=0; i<=5; i++){
					View view = inflater.Inflate(Resource.Layout.listview_comentarios, reviewscont, false);
					TextView revlikes = view.FindViewById<TextView> (Resource.Id.user_corazonlikes);
					revlikes.SetTypeface(font, TypefaceStyle.Normal);
					reviewscont.AddView(view);
				
				
				}*/

				foreach(JsonObject data in ReviewsObj){
					View row = inflater.Inflate(Resource.Layout.listview_comentarios, reviewscont, false);
					ReviewDetalles holder=null;
					LinearDetalles preholder=null;
					/*TextView revlikes = view.FindViewById<TextView> (Resource.Id.user_corazonlikes);
					revlikes.SetTypeface(font, TypefaceStyle.Normal);*/

					LinearLayout fondo_coment = row.FindViewById<LinearLayout> (Resource.Id.fondo_coment);
					fondo_coment.SetBackgroundResource(Resource.Drawable.fondoinfopremium);


					//EMPIEZA
					//ESTE SETEA LA IMAGEN
					ImageView imagen = row.FindViewById<ImageView> (Resource.Id.user_imagen);

					if (data["i"]["ruta"] == null || data["i"]["ruta"] == "" || data["i"]["ruta"] == "null") {
						//pon la imagen por defecto
						imagen.SetImageResource (Resource.Drawable.noprof);
					} else {
						//TENEMOS QUE VERIFICAR SI LA IMAGEN ES DE GOOGLE O DE NOSOTROS!!!
						string extra="http://plif.mx/";
						string ruta=data["i"]["ruta"];
						string first=ruta[0].ToString();

						if(first=="u" || first=="U"){
							ruta=extra+ruta;
						}else{
							//no hagas nada, la imagen es de google
						}

						Koush.UrlImageViewHelper.SetUrlDrawable (imagen, ruta, Resource.Drawable.bolaplace);

					}//TERMINA SI LA IMAGEN NO ES NULA

					//Ponemos el nombre
					TextView nombre = row.FindViewById<TextView> (Resource.Id.user_nombre);
					nombre.Text = data["u"]["nombre"]+" "+data["u"]["apellidos"];

					nombre.SetTextColor(Color.ParseColor("#FFFFFF"));

					//ESTE SETEA LAS ESTRELLAS DE LA CALIFICACION
					ImageView cali = row.FindViewById<ImageView> (Resource.Id.user_calificacion);

					string cal = data["cm"]["calificacion"];

					switch (cal) {

					case "0":
						cali.SetImageResource (Resource.Drawable.e0);
						break;

					case "":
						cali.SetImageResource (Resource.Drawable.e0);
						break;

					case "null":
						cali.SetImageResource (Resource.Drawable.e0);
						break;

					case null:
						cali.SetImageResource (Resource.Drawable.e0);
						break;

					case "1":
						cali.SetImageResource (Resource.Drawable.e1);
						break;

					case "2":
						cali.SetImageResource (Resource.Drawable.e2);
						break;

					case "3":
						cali.SetImageResource (Resource.Drawable.e3);
						break;

					case "4":
						cali.SetImageResource (Resource.Drawable.e4);
						break;

					case "5":
						cali.SetImageResource (Resource.Drawable.e5);
						break;



					default:
						cali.SetImageResource (Resource.Drawable.e0);
						break;
					}

					//Ponemos el comentario
					TextView comentario = row.FindViewById<TextView> (Resource.Id.user_comentario);
					comentario.Text = data["cm"]["comentario"];

					comentario.SetTextColor(Color.ParseColor("#FFFFFF"));

					//Ponemos la fecha y la hora
					TextView fechahora = row.FindViewById<TextView> (Resource.Id.user_fechahora);
					string fc=data["cm"]["fecha"];
					DateTime dt = System.Convert.ToDateTime(fc);   
					fechahora.Text = dt.ToString ("dd/MM/yyyy H:mm");

					fechahora.SetTextColor(Color.ParseColor("#FFFFFF"));

					//ponemos los likes que tiene
					TextView likescom = row.FindViewById<TextView> (Resource.Id.user_numlikes);
					likescom.Text = " "+data["cm"]["num_likes"];
					likescom.SetTextColor(Color.ParseColor("#FFFFFF"));
					bool haslike = false;
					//averiguamos si el usuario le ha dado like

					try{
						string ulk=" ";
						if(data["user_likes"]["user_likes"]!= null & data["user_likes"]["user_likes"]!= "null"){
							ulk=data["user_likes"]["user_likes"];
							string[] words;
							words = ulk.Split(' ');

							foreach (string word in words)
							{
								if (word == userid) {
									haslike = true;
								}
							}
						}else{
							//no hagas nada!
							Log.Debug("Split","Los likes son nulos");
						}
					}catch(Exception ex){
						Log.Debug("Split","Fue null: "+ex);
					}

					corazonlike = row.FindViewById<TextView> (Resource.Id.user_corazonlikes);
					string hl="";

					if (haslike) {
						corazonlike.Text = GetString(Resource.String.heart);
						hl="si";

					} else {
						corazonlike.Text = GetString (Resource.String.heartempty);
						hl="no";
					}

					//Typeface font = Typeface.CreateFromAsset(mContext.Assets, "Fonts/fa.ttf");
					corazonlike.SetTypeface(font, TypefaceStyle.Normal);





					holder = new ReviewDetalles(data["cm"]["id"],hl,likescom);

					corazonlike.SetTag(Resource.String.lel,holder);



					LinearLayout layoutlike = row.FindViewById<LinearLayout> (Resource.Id.layoutlike);
					preholder=new LinearDetalles(corazonlike);
					layoutlike.SetTag(Resource.String.lel,preholder);



					//TERMINA
					reviewscont.AddView(row);
				};



				/*
				 * 
				foreach(JsonObject data in ReviewsObj){
					revItems.Add(
						new Review(){
							ReviewId=data["cm"]["id"],
							ReviewnegId=data["cm"]["negocio_id"],
							ReviewNombre=data["u"]["nombre"]+" "+data["u"]["apellidos"],
							ReviewEmail=data["u"]["autor_email"],
							ReviewComentario=data["cm"]["comentario"],
							ReviewCalificacion=data["cm"]["calificacion"],
							ReviewFecha=data["cm"]["fecha"],
							ReviewLikes=data["cm"]["num_likes"],
							ReviewautorId=data["u"]["id"],
							ReviewRuta=data["i"]["ruta"],		
					        ReviewLikesUsers=data["user_likes"]["user_likes"]	
						}
					);

					Log.Debug("AñadirReviews","Añadida!");


				}
*/
				//MyReviewsAdapter rev_adapter = new MyReviewsAdapter(Application.Context, revItems);
				//ListView revslista = FindViewById<ListView> (Resource.Id.revslista);
				//revslista.Adapter=rev_adapter;
				waitrv.Visibility=ViewStates.Gone;
				//revslista.Visibility=ViewStates.Visible;



			}catch(Exception ex){
				Log.Debug("ErrorTodo", ex.ToString());
				waitrv.Visibility=ViewStates.Gone;
				//var fab = FindViewById<CoordinatorLayout> (Resource.Id.snackbarPosition);
				Snackbar
					.Make (fab, "Ooops! Ocurrió un error al recuperar las reseñas. Inténtalo nuevamente!", Snackbar.LengthLong)
					.SetAction ("Ok", (view) => {  })
					.Show ();				
			}

			try{

				//Traemos la galeria de imagenes
				TextView fotos_tit = FindViewById<TextView> (Resource.Id.fotos_tit);
				fotos_tit.SetTypeface(font, TypefaceStyle.Normal);

				Utils utils = new Utils(this);
				JsonValue contenedorimg = await utils.getFilePaths("http://plif.mx/mobile/get_img_neg?id="+Intent.GetStringExtra("id")+"&prev");

				LinearLayout fotosprevcontain = FindViewById<LinearLayout> (Resource.Id.fotosprevcontain);
				LayoutInflater inflater2 = LayoutInflater.From(this);

				string extra="http://plif.mx/admin/";
				string rutaa="";
				string first="";
				View rowimg = inflater2.Inflate(Resource.Layout.img_layout, fotosprevcontain, false);

				int numfotos=0;

				try{
					rutaa=contenedorimg[0]["imagenes"]["ruta"];
					first=rutaa[0].ToString();

					if(first=="u" || first=="U"){
						//Toast.MakeText (Application.Context, "EMPIEZA CON U!!!", ToastLength.Long).Show ();
						rutaa=extra+rutaa;
					}else{
						//no hagas nada, la imagen es de google
					}

					Log.Debug ("GaleriaAdapter", "Procesando: "+rutaa);

					ImageView cont = rowimg.FindViewById<ImageView> (Resource.Id.img_galeria1);
					Koush.UrlImageViewHelper.SetUrlDrawable (cont, rutaa, Resource.Drawable.bola);
					numfotos++;
				}
				catch(Exception ex){
					ImageView cont = rowimg.FindViewById<ImageView> (Resource.Id.img_galeria1);
					cont.Visibility=ViewStates.Gone;
					Log.Debug("imgscont","no hay imagen uno");


				}

				////LA QUE SIGUE!!!
				try{
					rutaa=contenedorimg[1]["imagenes"]["ruta"];
					first=rutaa[0].ToString();
					if(first=="u" || first=="U"){
						//Toast.MakeText (Application.Context, "EMPIEZA CON U!!!", ToastLength.Long).Show ();
						rutaa=extra+rutaa;
					}else{
						//no hagas nada, la imagen es de google
					}

					Log.Debug ("GaleriaAdapter", "Procesando: "+rutaa);

					ImageView cont2 = rowimg.FindViewById<ImageView> (Resource.Id.img_galeria2);
					Koush.UrlImageViewHelper.SetUrlDrawable (cont2, rutaa, Resource.Drawable.bola);
					numfotos++;
				}
				catch(Exception ex){
					ImageView cont = rowimg.FindViewById<ImageView> (Resource.Id.img_galeria2);
					cont.Visibility=ViewStates.Gone;
					Log.Debug("imgscont","no hay imagen dos");

				}

				////LA ULTIMA!!!
				try{
					rutaa=contenedorimg[2]["imagenes"]["ruta"];
					first=rutaa[0].ToString();
					if(first=="u" || first=="U"){
						//Toast.MakeText (Application.Context, "EMPIEZA CON U!!!", ToastLength.Long).Show ();
						rutaa=extra+rutaa;
					}else{
						//no hagas nada, la imagen es de google
					}

					Log.Debug ("GaleriaAdapter", "Procesando: "+rutaa);

					ImageView cont3 = rowimg.FindViewById<ImageView> (Resource.Id.img_galeria3);
					Koush.UrlImageViewHelper.SetUrlDrawable (cont3, rutaa, Resource.Drawable.bola);
					numfotos++;
				}
				catch(Exception ex){
					ImageView cont = rowimg.FindViewById<ImageView> (Resource.Id.img_galeria3);
					cont.Visibility=ViewStates.Gone;
					Log.Debug("imgscont","no hay imagen tres");

				}



				fotosprevcontain.AddView(rowimg);

				fullfotos= FindViewById<TextView> (Resource.Id.fullfotos);

				if(numfotos>0){
					fullfotos.Visibility=ViewStates.Visible;
				}





			}catch(Exception ex){
				Log.Debug("ErrorLista", ex.ToString());
				var fabee = FindViewById<CoordinatorLayout> (Resource.Id.snackbarPosition);
				Snackbar
					.Make (fabee, "Ooops! Ocurrió un error al recuperar las imágenes. Inténtalo nuevamente!", Snackbar.LengthLong)
					.SetAction ("Ok", (view) => {  })
					.Show ();	

			}

			EditText nombrerev = FindViewById<EditText> (Resource.Id.nombrerev);
			EditText emailrev = FindViewById<EditText> (Resource.Id.emailrev);
			commentrev = FindViewById<EditText> (Resource.Id.commentrev);

			nombrerev.Text=prefs.GetString("nombre", null);
			emailrev.Text=prefs.GetString("email", null);

			//nombrerev.EditableText = false;
			//emailrev.EditableText = false;
			nombrerev.Enabled = false;
			emailrev.Enabled = false;

			ImageButton e1 = FindViewById<ImageButton> (Resource.Id.estrella1);
			ImageButton e2 = FindViewById<ImageButton> (Resource.Id.estrella2);
			ImageButton e3 = FindViewById<ImageButton> (Resource.Id.estrella3);
			ImageButton e4 = FindViewById<ImageButton> (Resource.Id.estrella4);
			ImageButton e5 = FindViewById<ImageButton> (Resource.Id.estrella5);

			TextView califspan = FindViewById<TextView> (Resource.Id.califspan);

			callnow.Click += (object sender, EventArgs e) => {
				Intent intent = new Intent(Intent.ActionCall, Android.Net.Uri.Parse("tel:" + telefono.Text));
				StartActivity(intent);
			};

			ubicacionbtn.Click += (object sender, EventArgs e) => {
				ubicacionlayout.Visibility=ViewStates.Visible;
				descripcionlayout.Visibility=ViewStates.Gone;
				contactolayout.Visibility=ViewStates.Gone;

				ubicacionbtn.SetBackgroundResource(Resource.Drawable.ubicacionbtnpressprem);
				descripcionbtn.SetBackgroundResource(Resource.Drawable.ubicacionbtnprem);
				contactobtn.SetBackgroundResource(Resource.Drawable.ubicacionbtnprem);
			};

			descripcionbtn.Click += (object sender, EventArgs e) => {
				ubicacionlayout.Visibility=ViewStates.Gone;
				descripcionlayout.Visibility=ViewStates.Visible;
				contactolayout.Visibility=ViewStates.Gone;

				ubicacionbtn.SetBackgroundResource(Resource.Drawable.ubicacionbtnprem);
				descripcionbtn.SetBackgroundResource(Resource.Drawable.ubicacionbtnpressprem);
				contactobtn.SetBackgroundResource(Resource.Drawable.ubicacionbtnprem);
				
			};

			contactobtn.Click += (object sender, EventArgs e) => {
				ubicacionlayout.Visibility=ViewStates.Gone;
				descripcionlayout.Visibility=ViewStates.Gone;
				contactolayout.Visibility=ViewStates.Visible;

				ubicacionbtn.SetBackgroundResource(Resource.Drawable.ubicacionbtnprem);
				descripcionbtn.SetBackgroundResource(Resource.Drawable.ubicacionbtnprem);
				contactobtn.SetBackgroundResource(Resource.Drawable.ubicacionbtnpressprem);

				
			};

			addcomentbtn = FindViewById<Button> (Resource.Id.addcomment);

			enviarmensaje.Click += (object sender, EventArgs e) => {
				var enviarmsj = new Intent (this, typeof(EnviarMensaje));
				enviarmsj.PutExtra("negocioid",idres);
				enviarmsj.PutExtra("titulo", titulores);
				enviarmsj.PutExtra("propietario",propietario);
				StartActivity (enviarmsj);
			};


			addcomentbtn.Click += (sender, e) => {
				enviarrev.Focusable=true;
				enviarrev.FocusableInTouchMode=true;
				if(enviarrev.RequestFocus()){
					Log.Debug("BotonArribaReseña", "It dit it!");
					enviarrev.ClearFocus();
					enviarrev.FocusableInTouchMode=false;
				}

			};

			e1.Click += delegate(object sender, EventArgs e) {

				califspan.StartAnimation(flip);
				califspan.Text="1.0";
				calificacion=1;
				e1.SetImageResource(Resource.Drawable.estrellafull);
				e2.SetImageResource(Resource.Drawable.estrellaempty);
				e3.SetImageResource(Resource.Drawable.estrellaempty);
				e4.SetImageResource(Resource.Drawable.estrellaempty);
				e5.SetImageResource(Resource.Drawable.estrellaempty);
			};

			e2.Click += delegate(object sender, EventArgs e) {

				califspan.StartAnimation(flip);
				califspan.Text="2.0";
				calificacion=2;
				e1.SetImageResource(Resource.Drawable.estrellafull);
				e2.SetImageResource(Resource.Drawable.estrellafull);
				e3.SetImageResource(Resource.Drawable.estrellaempty);
				e4.SetImageResource(Resource.Drawable.estrellaempty);
				e5.SetImageResource(Resource.Drawable.estrellaempty);
			};

			e3.Click += delegate(object sender, EventArgs e) {

				califspan.StartAnimation(flip);
				califspan.Text="3.0";
				calificacion=3;
				e1.SetImageResource(Resource.Drawable.estrellafull);
				e2.SetImageResource(Resource.Drawable.estrellafull);
				e3.SetImageResource(Resource.Drawable.estrellafull);
				e4.SetImageResource(Resource.Drawable.estrellaempty);
				e5.SetImageResource(Resource.Drawable.estrellaempty);
			};

			e4.Click += delegate(object sender, EventArgs e) {

				califspan.StartAnimation(flip);
				califspan.Text="4.0";
				calificacion=4;
				e1.SetImageResource(Resource.Drawable.estrellafull);
				e2.SetImageResource(Resource.Drawable.estrellafull);
				e3.SetImageResource(Resource.Drawable.estrellafull);
				e4.SetImageResource(Resource.Drawable.estrellafull);
				e5.SetImageResource(Resource.Drawable.estrellaempty);
			};

			e5.Click += delegate(object sender, EventArgs e) {

				califspan.StartAnimation(flip);
				califspan.Text="5.0";
				calificacion=5;
				e1.SetImageResource(Resource.Drawable.estrellafull);
				e2.SetImageResource(Resource.Drawable.estrellafull);
				e3.SetImageResource(Resource.Drawable.estrellafull);
				e4.SetImageResource(Resource.Drawable.estrellafull);
				e5.SetImageResource(Resource.Drawable.estrellafull);
			};

			e5.PerformClick ();


			//nenenenenenene
			addimg.Click += async (object sender, EventArgs e) => {
				layoutdejaimagenes.Visibility=ViewStates.Visible;
			};

			deleteimgrev.Click += async (sender, e) => {
				GridLayout imgcomprev = FindViewById<GridLayout> (Resource.Id.imgcomprev);
				LinearLayout imgcontainercomprev = FindViewById<LinearLayout> (Resource.Id.imgcontainercomprev);
				Log.Debug("DELETEBUTTON","Inician las layouts");
				if(imgcomprev.ChildCount>0){
					imgcomprev.RemoveAllViews();
				}


				Log.Debug("DELETEBUTTON","vistas removidas");

				if(imagencomentario!=null){
					imagencomentario.Recycle();
					imagencomentario=null;
				}

				Log.Debug("DELETEBUTTON","reciclado");

				//deleteimgrev.Visibility=ViewStates.Gone;
				Log.Debug("DELETEBUTTON","se oculta boton borrar (deprecated)");
				imgcontainercomprev.Visibility=ViewStates.Gone;
				Log.Debug("DELETEBUTTON","se oculta el contenedor de subir imagenes");
				imagenrev = FindViewById<Button> (Resource.Id.imagenrev);
				imagenrev.Visibility=ViewStates.Visible;
				Log.Debug("DELETEBUTTON","se muestra el boton añadir");

				fossbytes.Clear();
				Log.Debug("DELETEBUTTON","El Arraylist de bytes se resetea");

				imgcount=0;
				Log.Debug("DELETEBUTTON","se resetea el contador de cuantas imagenes se subieron");
				masimagenes.Text="Carga 3 imágenes más!";
				Log.Debug("DELETEBUTTON","Reseteamos el texto de las imagenes");


			};

			deleteimgnegocio.Click += async (sender, e) => {
				//LinearLayout imgcomprev = FindViewById<LinearLayout> (Resource.Id.imgcomprev);
				//LinearLayout imgcontainercomprev = FindViewById<LinearLayout> (Resource.Id.imgcontainercomprev);
				Log.Debug("DELETEBUTTON","Inician las layouts");
				if(imgnegocioprev.ChildCount>0){
					imgnegocioprev.RemoveAllViews();
				}


				Log.Debug("DELETEBUTTON","vistas removidas");

				if(imagencomentario!=null){
					imagencomentario.Recycle();
					imagencomentario=null;
				}

				Log.Debug("DELETEBUTTON","reciclado");
				//deleteimgrev.Visibility=ViewStates.Gone;
				Log.Debug("DELETEBUTTON","se oculta boton borrar (deprecated)");
				layoutdejaimagenes.Visibility=ViewStates.Gone;
				Log.Debug("DELETEBUTTON","se oculta el contenedor de subir imagenes");

				fossbytes.Clear();
				Log.Debug("DELETEBUTTON","El Arraylist de bytes se resetea");

				imgcount=0;
				Log.Debug("DELETEBUTTON","se resetea el contador de cuantas imagenes se subieron");
				masimagenesnegocio.Text="Carga 10 imágenes más!";
				Log.Debug("DELETEBUTTON","Reseteamos el texto de las imagenes");
			};

			imagenrev.Click += async (object sender, EventArgs e) => {

				LinearLayout imgcontainercomprev = FindViewById<LinearLayout> (Resource.Id.imgcontainercomprev);
				imgcontainercomprev.Visibility=ViewStates.Visible;
				imagenrev.Visibility=ViewStates.Gone;

			};

			imagennegocio.Click += async (object sender, EventArgs e) => {
				source=1;
				ProcesarImagenes(imgnegocioprev, 10, masimagenesnegocio);
			};

			imagencamaranegocio.Click += async (object sender, EventArgs e) => {
				source=2;
				ProcesarImagenes(imgnegocioprev, 10, masimagenesnegocio);
			};

			imagenrev2.Click += async (object sender, EventArgs e) => {
				source=1;
				GridLayout imgcomprev = FindViewById<GridLayout> (Resource.Id.imgcomprev);
				ProcesarImagenes(imgcomprev,3,masimagenes);

			};//imagenrev click

			imagencamara.Click += async (sender, e) => {
				source=2;
				GridLayout imgcomprev = FindViewById<GridLayout> (Resource.Id.imgcomprev);
				ProcesarImagenes(imgcomprev,3,masimagenes);
			};

			enviarimgneg.Click += async (object sender, EventArgs e) => {
				if(imgcount>0){

					diccionario = new Dictionary<string, string>();
					diccionario.Add("negocio", idres); 
					diccionario.Add("description", "Foto en "+titulores); 
					diccionario.Add("autor", prefs.GetString("id", null));


					//LIMPIAMOS LA PANTALLA Y DESHABILITAMOS LOS BOTONES
					ProgressBar waitnegociors=FindViewById<ProgressBar>(Resource.Id.waitnegociors);
					waitnegociors.Visibility=ViewStates.Visible;

					TextView subiendofotos = FindViewById<TextView> (Resource.Id.subiendofotos);
					subiendofotos.Visibility=ViewStates.Visible;
					//deleteimgrev.PerformClick();

					//se deshabilitan ambos botones
					//enviarrev.Enabled=false;
					//imagenrev.Enabled=false;



					//LinearLayout imgcontainercomprev = FindViewById<LinearLayout> (Resource.Id.imgcontainercomprev); 
					layoutdejaimagenes.Visibility=ViewStates.Gone;
					Log.Debug("EnviarImagen","se oculta el contenedor de subir imagenes");
					imagenrev = FindViewById<Button> (Resource.Id.imagenrev);
					imagenrev.Visibility=ViewStates.Visible;
					Log.Debug("EnviarImagenes","se muestra el boton añadir");
					masimagenesnegocio.Text="Carga 10 imágenes más!";
					Log.Debug("EnviarImagenes","Reseteamos el texto de las imagenes");


					int countbytes=fossbytes.Count;
					if(fossbytes!=null && countbytes>0){
						Log.Debug ("EnviarImagenes", "Si hay imágenes byte en el array!");
						Log.Debug("CONVERTIR","Elementos convertidos a Byte: "+countbytes);

					}


					string resp = await plifserver.PostMultiPartForm ("http://plif.mx/pages/UploadImg/0", fossbytes, "nada", "file[]", "image/jpeg", diccionario, false);
					Log.Debug("SUBIRIMAGENES",resp);
					waitnegociors.Visibility=ViewStates.Gone;
					subiendofotos.Visibility=ViewStates.Gone;
					deleteimgnegocio.PerformClick();

					var fabee = FindViewById<CoordinatorLayout> (Resource.Id.snackbarPosition);
					Snackbar
						.Make (fabee, "Hemos recibido tus fotos. Gracias por ser parte de Plif!", Snackbar.LengthLong)
						.SetAction ("Ok", (view) => {  })
						.Show ();	

				}else{
					var fabee = FindViewById<CoordinatorLayout> (Resource.Id.snackbarPosition);
					Snackbar
						.Make (fabee, "Selecciona al menos una imágen!", Snackbar.LengthLong)
						.SetAction ("Ok", (view) => {  })
						.Show ();		
				}

			};

			enviarrev.Click += async (object sender, EventArgs e) => {
				if(calificacion==0){
					var fabee = FindViewById<CoordinatorLayout> (Resource.Id.snackbarPosition);
					Snackbar
						.Make (fabee, "Por favor califica al negocio!", Snackbar.LengthLong)
						.SetAction ("Ok", (view) => {  })
						.Show ();	
				}else{
					if(commentrev.Text==""){
						var fabee = FindViewById<CoordinatorLayout> (Resource.Id.snackbarPosition);
						Snackbar
							.Make (fabee, "Por favor escribe un comentario!", Snackbar.LengthLong)
							.SetAction ("Ok", (view) => {  })
							.Show ();	
					}else{
						//Aqui mero!!!!



						diccionario = new Dictionary<string, string>();
						diccionario.Add("comentario", commentrev.Text); 
						diccionario.Add("autor", prefs.GetString("id", null));
						diccionario.Add("calificacion", calificacion.ToString());
						diccionario.Add("negocio", idres);
						diccionario.Add("titulo", titulores);
						Log.Debug("EnviarComentario","Clickeo");

						//LIMPIAMOS LA PANTALLA Y DESHABILITAMOS LOS BOTONES
						ProgressBar waitrs=FindViewById<ProgressBar>(Resource.Id.waitrs);
						waitrs.Visibility=ViewStates.Visible;
						//deleteimgrev.PerformClick();

						//se deshabilitan ambos botones
						enviarrev.Enabled=false;
						imagenrev.Enabled=false;

						LinearLayout imgcontainercomprev = FindViewById<LinearLayout> (Resource.Id.imgcontainercomprev); 
						imgcontainercomprev.Visibility=ViewStates.Gone;
						Log.Debug("EnviarComentario","se oculta el contenedor de subir imagenes");
						imagenrev = FindViewById<Button> (Resource.Id.imagenrev);
						imagenrev.Visibility=ViewStates.Visible;
						Log.Debug("EnviarComentario","se muestra el boton añadir");
						masimagenes.Text="Carga 3 imágenes más!";
						Log.Debug("EnviarComentario","Reseteamos el texto de las imagenes");

						string filename="";
						int countbytes=fossbytes.Count;
						if(fossbytes!=null && countbytes>0){
							Log.Debug ("EnviarComentario", "Si hay imágenes byte en el array!");
							Log.Debug("CONVERTIR","Elementos convertidos a Byte: "+countbytes);

						}

						//AQUI LO ENVIAMOS, EL PRIMER PARAMETRO ES LA PÁGINA, EL SEGUNDO ES LA IMAGEN CODIFICADA EN BITS, EL TERCERO ES EL NOMBRE DEL PARÁMETRO QUE RECIBE PHP, EL CUARTO ES EL MIMETYPE DE LA IMAGEN, Y EL ULTIMO ES EL DICCTIONARY CON TODOS LOS DEMÁS VALORES STRING
						string resp = await plifserver.PostMultiPartForm ("http://plif.mx/comentario_negocio", fossbytes, filename, "file[]", "image/jpeg", diccionario, false);

						//deleteimgrev.PerformClick();
						enviarrev.Enabled=true;
						imagenrev.Enabled=true;
						waitrs.Visibility=ViewStates.Gone;
						calificacion=0;
						commentrev.Text="";

						califspan.StartAnimation(flip);
						califspan.Text="0.0";
						calificacion=0;
						e1.SetImageResource(Resource.Drawable.estrellaempty);
						e2.SetImageResource(Resource.Drawable.estrellaempty);
						e3.SetImageResource(Resource.Drawable.estrellaempty);
						e4.SetImageResource(Resource.Drawable.estrellaempty);
						e5.SetImageResource(Resource.Drawable.estrellaempty);

						Log.Debug("MULTIPARTRESPONSE",resp);
						deleteimgrev.PerformClick();

						var fabee = FindViewById<CoordinatorLayout> (Resource.Id.snackbarPosition);
						Snackbar
							.Make (fabee, "Tu reseña ha sido enviada. ¡Gracias por ser parte de Plif!", Snackbar.LengthLong)
							.SetAction ("Ok", (view) => {  })
							.Show ();	

					}
				}

			};


			fullfotos.Click += delegate(object sender, EventArgs e) {
				var galeriaimg = new Intent (this, typeof(GaleriaImagenes));
				galeriaimg.PutExtra("negocioid",idres);

				/*negocio.PutExtra("id",negItems [e.Position].NegocioId);
				negocio.PutExtra("nombre",negItems [e.Position].NegocioName);
				negocio.PutExtra("direccion",negItems [e.Position].NegocioDir);
				negocio.PutExtra("categoria",negItems [e.Position].NegocioCat);
				negocio.PutExtra("calificacion",negItems [e.Position].NegocioCal);*/
				StartActivity (galeriaimg);
				//StartActivity(typeof(GaleriaImagenes));
				/*
				var fabee = FindViewById<CoordinatorLayout> (Resource.Id.snackbarPosition);
				Snackbar
					.Make (fabee, "El lunes se lo pongo!", Snackbar.LengthLong)
					.SetAction ("Ok", (view) => {  })
					.Show ();	
					*/
			};



			abiertocerrado.Click += delegate {
				if(!horariovisible){
					//layoutdiascontainer.Animate().TranslationY(300);
					layoutdiascontainer.Visibility=ViewStates.Visible;
					//int val=GetX(layoutdiascontainer);
					//scrollview.ScrollTo(0,val);
					horariovisible=true;
				}else{
					//layoutdiascontainer.Animate().TranslationY(0);
					layoutdiascontainer.Visibility=ViewStates.Gone;
					horariovisible=false;
				}


			};

			addlike.Click += async (sender, e) => {

				if(!dandolike){
					dandolike=true;

				try{
					if(!haslike){
						haslike=true;
						addlike.StartAnimation(bounce);
						addlike.Text = GetString (Resource.String.heart);
						numlikes++;
						likes.Text=numlikes+" Personas";
						//JsonValue likeans=await plifserver.FetchWeatherAsync("http://plif.mx/mobile/like_neg_asset?nid="+Intent.GetStringExtra("id")+"&uid="+userid+"&case=1");
							string likestring="http://plif.mx/pages/LikeNegocio/"+negocioid+"/1?uid="+userid;
							Log.Debug("Like","La URL Es: "+likestring);
							JsonValue likeans=await plifserver.FetchWeatherAsync("http://plif.mx/pages/LikeNegocio/"+negocioid+"/1?uid="+userid);
						dandolike=false;

					}else{
						haslike=false;
						addlike.StartAnimation(bounce);
						addlike.Text = GetString (Resource.String.heartempty);
						numlikes--;
						likes.Text=numlikes+" Personas";
						//JsonValue likeans=await plifserver.FetchWeatherAsync("http://plif.mx/mobile/like_neg_asset?nid="+Intent.GetStringExtra("id")+"&uid="+userid+"&case=2");
							string likestring="http://plif.mx/pages/LikeNegocio/"+negocioid+"/2?uid="+userid;
							Log.Debug("Like","La URL Es: "+likestring);
							JsonValue likeans=await plifserver.FetchWeatherAsync(likestring);

						dandolike=false;

					}
				}catch(Exception ex){
					waitpb.Visibility=ViewStates.Gone;
					//var fab = FindViewById<CoordinatorLayout> (Resource.Id.snackbarPosition);
					Snackbar
						.Make (fab, "Ooops! Ocurrió un error al intentar procesar tu solicitud. Inténtalo nuevamente!", Snackbar.LengthLong)
						.SetAction ("Ok", (view) => {  })
						.Show ();
				}

			}else{
					Log.Debug("AddLike","Like en proceso! Por favor espera!!");
				}

			};

			//REDES SOCIALES


		}
        public void OnMapReady(GoogleMap googleMap)
        {
            gMap = googleMap;

            LatLng latlng = new LatLng(40.776408, -73.970755);
            LatLng latlng2 = new LatLng(41,-73);



            CameraUpdate camera = CameraUpdateFactory.NewLatLngZoom(latlng, 10);
            gMap.MoveCamera(camera);




            MarkerOptions options = new MarkerOptions()
                .SetPosition(latlng)
                .SetTitle("New York")
                .SetSnippet("AKA: The Big Apple")
                .Draggable(true);


            gMap.AddMarker(options);



            //Marker2
            gMap.AddMarker(new MarkerOptions()
                .SetPosition(latlng2)
                .SetTitle("Marker2")
                .SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueBlue))
                );

            gMap.MarkerClick += gMap_Marker_Click;
            gMap.MarkerDragEnd += gMap_MarkerDragEnd;
            
        }
Пример #31
0
        public override void OnStart ()
        {
            base.OnStart ();


            if (_person != null)
            {
                _mapFragment = FragmentManager.FindFragmentById(Resource.Id.map) as MapFragment;
                if (_mapFragment == null)
                    return;
                _map = _mapFragment.Map;


                // Set the map type 
                _map.MapType = GoogleMap.MapTypeNormal;

                // show user location
                _map.MyLocationEnabled = true;

                // setup a location manager
                _locationManager = _activity.GetSystemService (Context.LocationService) as LocationManager;

                // use a generic location provider instead
                Criteria locationCriteria = new Criteria();
                locationCriteria.Accuracy = Accuracy.Coarse;
                locationCriteria.PowerRequirement = Power.Medium;

                var geoCoder = new Geocoder(_activity);

                try
                {
                    Address address = this.GetAddressesFromLocation(_person.Strasse,_person.PLZ,_person.Ort,_person.Land);
                    MarkerOptions marker1 = new MarkerOptions();

                    if (address != null)
                    {

                        marker1.SetPosition(new LatLng(address.Latitude, address.Longitude));
                        marker1.SetTitle(_person.Name + " - " + _person.Strasse + " - " + _person.Ort + "- " + _person.Umsatz);
                        marker1.InvokeIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueRed));
                        _Marker =  _map.AddMarker(marker1);
                        _map.AnimateCamera(CameraUpdateFactory.NewLatLngZoom(new Android.Gms.Maps.Model.LatLng(address.Latitude, address.Longitude), 9.0f));

                    }
                    else
                    {
                        Android.Widget.Toast.MakeText(_activity,_activity.Resources.GetString(Resource.String.AddresseNichtGefunden), Android.Widget.ToastLength.Short).Show();
                    }


                    _map.MarkerClick += MapOnMarkerClick;



                }   

                catch(Exception ex)
                {
                    DataAccessLayer.ExceptionWriter.WriteLogFile(ex);
                }




            }       
        }
Пример #32
0
		private void InitMapFragment ()
		{
			mapFragment = (MapFragment)FragmentManager.FindFragmentById (Resource.Id.map);

			// mapFragment.View.Visibility = ViewStates.Gone;
			map = mapFragment.Map;

			if (mode == "info") {
				if (mapFragment != null && mapFragment.View != null) {
					mapFragment.View.Visibility = ViewStates.Gone;
				}
			}

			if (map != null) {
				map.MapType = GoogleMap.MapTypeTerrain;
				map.UiSettings.ZoomControlsEnabled = true;
				map.UiSettings.CompassEnabled = true;
				map.UiSettings.ScrollGesturesEnabled = true;

				GoogleMapOptions mapOptions = new GoogleMapOptions ()
					.InvokeCamera (CameraPosition.FromLatLngZoom (UPC, 16))
					.InvokeScrollGesturesEnabled (true)
					.InvokeMapType (GoogleMap.MapTypeNormal)
					.InvokeZoomControlsEnabled (true)
					.InvokeCompassEnabled (true);

				FragmentTransaction fragTx = FragmentManager.BeginTransaction ();
				mapFragment = MapFragment.NewInstance (mapOptions);
				fragTx.Add (Resource.Id.map, mapFragment, "map");
				fragTx.Commit ();

				/*CameraPosition.Builder builder = CameraPosition.InvokeBuilder();
				builder.Target(UPC);
				builder.Zoom(16);
				CameraPosition cameraPosition = builder.Build();
				CameraUpdate cameraUpdate = CameraUpdateFactory.NewCameraPosition(cameraPosition);

				map.MoveCamera(cameraUpdate);*/

				MarkerOptions markerOptions = new MarkerOptions ();
				markerOptions.SetPosition (UPC);
				markerOptions.SetTitle ("CanchitApp");
				map.AddMarker (markerOptions);
			}
			/*_mapFragment = FragmentManager.FindFragmentByTag ("map") as MapFragment;
			if (_mapFragment == null) {
				GoogleMapOptions mapOptions = new GoogleMapOptions ()
					.InvokeCamera (CameraPosition.FromLatLngZoom (new LatLng (-12.103951800, -76.963278100), 16))
					.InvokeScrollGesturesEnabled (true)
					.InvokeMapType (GoogleMap.MapTypeNormal)
					.InvokeZoomControlsEnabled (true)
					.InvokeCompassEnabled (true);
				//	-12.103951800, -76.963278100

				FragmentTransaction fragTx = FragmentManager.BeginTransaction ();
				_mapFragment = MapFragment.NewInstance (mapOptions);
				fragTx.Add (Resource.Id.map, _mapFragment, "map");
				fragTx.Commit ();
			}*/
		}
Пример #33
0
 public void AddMarkerTo(GoogleMap map)
 {
     Marker = map.AddMarker (this.MarkerOptions);
 }