コード例 #1
0
ファイル: Test.cs プロジェクト: achonor/UnityBaiduMap
    private void Awake()
    {
        if (null == mMapServices)
        {
            mMapServices = GetComponent <MapServices>();
        }

        EventManager.Register <TouchMoveEvent>((param) => {
            mMapServices.MoveMap(param.MoveOffset);
        }, this);

        EventManager.Register <TouchMovedEvent>((param) => {
            mMapServices.DoRender();
        }, this);

        EventManager.Register <TouchZoomEvent>((param) => {
            mMapServices.ZoomMap(param.ChangeZoom);
            mMapServices.DoRender();
        }, this);

        mStreetBtn.onClick.AddListener(() => {
            SetMapType(MapType.Street);
            mMapServices.DoRender();
        });

        mSatelliteBtn.onClick.AddListener(() => {
            SetMapType(MapType.Satellite);
            mMapServices.DoRender();
        });

        print(MCTransform.ConvertLL2MC(new Vector2D(180, 74)));
    }