Ejemplo n.º 1
0
    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)));
    }