wxr
2020-06-15 b8e94316e41eba72d927d5ca7d931b26139ee8ff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using Android.Content;
using Com.Hdl.Widget.Gdmapkit;
 
namespace Shared
{
    public class GDMapKit
    {
 
        public static void Show(Action<double, double, int, string> action, string titleName = "", string saveName = "保存", bool bSetHome = false, double mLatitude = 0.0, double mLongitude = 0.0, int mRadius = 500) {
 
            //GDConst.GetAppSHA1(Application.Activity);
 
 
            if (bSetHome && (mLatitude != 0.0) && (mLongitude != 0.0))
            {
                GDConst.BMyHomeSet = true;
                GDConst.MyHomeLatitude = mLatitude;
                GDConst.MyHomeLongitude = mLongitude;
                GDConst.MyHomeRadiusRange = mRadius;
 
            }
            else
            {
                GDConst.BMyHomeSet = false;
            }
 
            GDConst.MyTitleName = titleName;
            GDConst.SaveButtonName = saveName;
            
 
            GDGeoFenceRoundActivity.MOnGeofenceCallback = new OnGeofenceCallback(action);
            
 
            Application.Activity.StartActivity(new Intent(Application.Activity, typeof(GDGeoFenceRoundActivity)));
        }
 
 
        /// <summary>
        /// OnGeofenceCallback
        /// </summary>
        public class OnGeofenceCallback : Java.Lang.Object, IOnGeofenceCallback
        {
 
            Action<double, double, int, string> mAction;
            public OnGeofenceCallback(Action<double, double, int, string> action)
            {
                mAction = action;
            }
 
            public void OnSaveCallback(double mLatitude, double mLongitude, float mRadius, string addressName)
            {
                mAction?.Invoke(mLatitude, mLongitude, (int)mRadius, addressName);
            }
        }
    }
}