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);
|
}
|
}
|
}
|
}
|