public void SetWidth(View v)
 {
     if (null != mPolyline)
     {
         string width = polylineStokeWidth.Text.ToString().Trim();
         if (CheckUtils.CheckIsEdit(width))
         {
             Toast.MakeText(this, "Please make sure the width is Edited", ToastLength.Short).Show();
         }
         else
         {
             if (!CheckUtils.CheckIsRight(width))
             {
                 Toast.MakeText(this, "Please make sure the width is right", ToastLength.Short).Show();
             }
             else
             {
                 if (Single.Parse(width) < 0.0F)
                 {
                     Toast.MakeText(this,
                                    "Please make sure the width is right, this value must be non-negative",
                                    ToastLength.Short).Show();
                     return;
                 }
                 mPolyline.Width = Single.Parse(width);
             }
         }
     }
 }
Ejemplo n.º 2
0
 public void SetWidth(View v)
 {
     if (null != mCircle)
     {
         string width = circleStokeWidth.Text.ToString().Trim();
         if (CheckUtils.CheckIsEdit(width))
         {
             Toast.MakeText(this, "Please make sure the width is Edited", ToastLength.Short).Show();
         }
         else
         {
             if (!CheckUtils.CheckIsRight(width))
             {
                 Toast.MakeText(this, "Please make sure the width is right", ToastLength.Short).Show();
             }
             else
             {
                 try
                 {
                     mCircle.StrokeWidth = Single.Parse(width);
                 }
                 catch (IllegalArgumentException e)
                 {
                     Log.Error(TAG, "IllegalArgumentException " + e.ToString());
                     Toast.MakeText(this, "IllegalArgumentException", ToastLength.Short).Show();
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
 public void SetRadius(View v)
 {
     if (null != mCircle)
     {
         string radius = circleRadius.Text.ToString().Trim();
         if (CheckUtils.CheckIsEdit(radius))
         {
             Toast.MakeText(this, "Please make sure the radius is Edited", ToastLength.Short).Show();
         }
         else
         {
             if (!CheckUtils.CheckIsRight(radius))
             {
                 Toast.MakeText(this, "Please make sure the radius is right", ToastLength.Short).Show();
             }
             else
             {
                 try
                 {
                     mCircle.Radius = System.Double.Parse(radius);
                 }
                 catch (IllegalArgumentException e)
                 {
                     Toast.MakeText(this, "IllegalArgumentException ", ToastLength.Short).Show();
                 }
             }
         }
     }
 }
 public void SetPointsBy1PointsWidthHeight(View view)
 {
     if (null != overlay)
     {
         String width      = imageWidth.Text.ToString().Trim();
         String height     = imageHeight.Text.ToString().Trim();
         String latitude   = positionLatitude.Text.ToString().Trim();
         String longtitude = positionLongtitude.Text.ToString().Trim();
         if (CheckUtils.CheckIsEdit(width) || CheckUtils.CheckIsEdit(height) || CheckUtils.CheckIsEdit(latitude) ||
             CheckUtils.CheckIsEdit(longtitude))
         {
             Toast.MakeText(this, "Please make sure the width & height & position is Edited", ToastLength.Short).Show();
         }
         else
         {
             if (!CheckUtils.CheckIsRight(width) || !CheckUtils.CheckIsRight(height) || !CheckUtils.CheckIsRight(latitude) ||
                 !CheckUtils.CheckIsRight(longtitude))
             {
                 Toast.MakeText(this, "Please make sure the width & height & position is right", ToastLength.Short).Show();
             }
             else
             {
                 try
                 {
                     if (Single.Parse(width) < 0.0F || Single.Parse(height) < 0.0F)
                     {
                         Toast
                         .MakeText(this, "Please make sure the width & height is right, this value must be non-negative",
                                   ToastLength.Short).Show();
                         return;
                     }
                     LatLng position = new LatLng(Double.Parse(latitude), Double.Parse(longtitude));
                     overlay.Position = position;
                     overlay.SetDimensions(Single.Parse(width), Single.Parse(height));
                     CameraPosition cameraPosition = new
                                                     CameraPosition.Builder().Target(position).Zoom(18).Bearing(0f).Tilt(0f).Build();
                     CameraUpdate cameraUpdate = CameraUpdateFactory.NewCameraPosition(cameraPosition);
                     hMap.MoveCamera(cameraUpdate);
                 }
                 catch (Java.Lang.IllegalArgumentException e)
                 {
                     Toast.MakeText(this, "IllegalArgumentException:" + e.Message, ToastLength.Short).Show();
                 }
             }
         }
     }
 }
 public void SetPointsBy2Points(View view)
 {
     if (null != overlay)
     {
         string northeastLatitude   = toprightLatitude.Text.ToString().Trim();
         string northeastLongtitude = toprightLongtitude.Text.ToString().Trim();
         string southwestLatitude   = bottomleftLatitude.Text.ToString().Trim();
         string southwestLontitude  = bottomleftLongtitude.Text.ToString().Trim();
         if (CheckUtils.CheckIsEdit(northeastLatitude) || CheckUtils.CheckIsEdit(northeastLongtitude) || CheckUtils.CheckIsEdit(southwestLatitude) ||
             CheckUtils.CheckIsEdit(southwestLontitude))
         {
             Toast.MakeText(this, "Please make sure these latlng are Edited", ToastLength.Short).Show();
         }
         else
         {
             if (!CheckUtils.CheckIsRight(northeastLatitude) || !CheckUtils.CheckIsRight(northeastLongtitude) ||
                 !CheckUtils.CheckIsRight(southwestLatitude) || !CheckUtils.CheckIsRight(southwestLontitude))
             {
                 Toast.MakeText(this, "Please make sure these latlng are right", ToastLength.Short).Show();
             }
             else
             {
                 try
                 {
                     overlay.SetPositionFromBounds(new LatLngBounds(
                                                       new LatLng(Double.Parse(southwestLatitude), Double.Parse(southwestLontitude)),
                                                       new LatLng(Double.Parse(northeastLatitude), Double.Parse(northeastLongtitude))));
                     CameraPosition cameraPosition = new CameraPosition.Builder()
                                                     .Target(overlay.Position)
                                                     .Zoom(18)
                                                     .Bearing(0f)
                                                     .Tilt(0f)
                                                     .Build();
                     CameraUpdate cameraUpdate = CameraUpdateFactory.NewCameraPosition(cameraPosition);
                     hMap.MoveCamera(cameraUpdate);
                 }
                 catch (Java.Lang.IllegalArgumentException e)
                 {
                     Toast.MakeText(this, "IllegalArgumentException ", ToastLength.Short).Show();
                 }
             }
         }
     }
 }
 public void SetPoints(View v)
 {
     if (null != mPolygon)
     {
         string latitude   = oneLatitude.Text.ToString().Trim();
         string longtitude = oneLongtitude.Text.ToString().Trim();
         if (CheckUtils.CheckIsEdit(latitude) || CheckUtils.CheckIsEdit(longtitude))
         {
             Toast.MakeText(this, "Please make sure the latitude & longtitude is Edited", ToastLength.Short).Show();
         }
         else
         {
             if (!CheckUtils.CheckIsRight(latitude) || !CheckUtils.CheckIsRight(longtitude))
             {
                 Toast.MakeText(this, "Please make sure the latitude & longtitude is right", ToastLength.Short).Show();
             }
             else
             {
                 mPolygon.Points = (MapUtils
                                    .CreateRectangle(new LatLng(System.Double.Parse(latitude), System.Double.Parse(longtitude)), 0.5, 0.5));
             }
         }
     }
 }
 public void SetOnePoint(View v)
 {
     if (null != mPolyline)
     {
         string latitude   = oneLatitude.Text.ToString().Trim();
         string longtitude = oneLongtitude.Text.ToString().Trim();
         if (CheckUtils.CheckIsEdit(latitude) || CheckUtils.CheckIsEdit(longtitude))
         {
             Toast.MakeText(this, "Please make sure the latitude & longtitude is Edited", ToastLength.Short).Show();
         }
         else
         {
             if (!CheckUtils.CheckIsRight(latitude) || !CheckUtils.CheckIsRight(longtitude))
             {
                 Toast.MakeText(this, "Please make sure the latitude & longtitude is right", ToastLength.Short).Show();
             }
             else
             {
                 points.Add(new LatLng(System.Double.Parse(latitude), System.Double.Parse(longtitude)));
                 mPolyline.Points = points;
             }
         }
     }
 }