Exemplo n.º 1
0
 public SurfaceSpace(SurfaceTileController tileController, SurfaceGestureStrategy gestureStrategy,
                     Transform surface, MaterialProvider materialProvider) :
     base(tileController, gestureStrategy, surface, materialProvider)
 {
     _tileController = tileController;
     Animator        = new SurfaceAnimator(tileController);
 }
Exemplo n.º 2
0
        void Start()
        {
            _compositionRoot = MapInitTask.Run();

            var mapDataStore     = _compositionRoot.GetService <IMapDataStore>();
            var stylesheet       = _compositionRoot.GetService <Stylesheet>();
            var materialProvider = _compositionRoot.GetService <MaterialProvider>();
            var startCoord       = new GeoCoordinate(StartLatitude, StartLongitude);

            // scaled radius of Earth in meters, approx. 1:1000
            const float planetRadius = 6371f;
            const float surfaceScale = 0.01f;
            const float detailScale  = 1f;

            _lods = new List <Range <int> > {
                new Range <int>(1, 8), new Range <int>(9, 15), new Range <int>(16, 16)
            };

            var sphereController  = new SphereTileController(mapDataStore, stylesheet, ElevationDataType.Flat, Pivot, _lods[0], planetRadius);
            var surfaceController = new SurfaceTileController(mapDataStore, stylesheet, ElevationDataType.Flat, Pivot, _lods[1], startCoord, surfaceScale, 1000);
            var detailController  = new SurfaceTileController(mapDataStore, stylesheet, ElevationDataType.Flat, Pivot, _lods[2], startCoord, detailScale, 500);

            var sphereGestures  = new SphereGestureStrategy(sphereController, TwoFingerMoveGesture, ManipulationGesture, planetRadius);
            var surfaceGestures = new SurfaceGestureStrategy(surfaceController, TwoFingerMoveGesture, ManipulationGesture);
            var detailGestures  = new SurfaceGestureStrategy(detailController, TwoFingerMoveGesture, ManipulationGesture);

            _spaces = new List <Space>
            {
                new SphereSpace(sphereController, sphereGestures, Planet, materialProvider),
                new SurfaceSpace(surfaceController, surfaceGestures, Surface, materialProvider),
                new SurfaceSpace(detailController, detailGestures, Surface, materialProvider)
            };

            DoTransition(startCoord, StartZoom);
        }
Exemplo n.º 3
0
        void Start()
        {
            _compositionRoot = InitTask.Run((container, config) =>
            {
                container
                .Register(Component.For <Stylesheet>().Use <Stylesheet>(@"mapcss/default/index.mapcss"))
                .Register(Component.For <MaterialProvider>().Use <MaterialProvider>())
                .Register(Component.For <GameObjectBuilder>().Use <GameObjectBuilder>())
                .Register(Component.For <IElementBuilder>().Use <LabelElementBuilder>().Named("label"));
            });

            var mapDataStore     = _compositionRoot.GetService <IMapDataStore>();
            var stylesheet       = _compositionRoot.GetService <Stylesheet>();
            var materialProvider = _compositionRoot.GetService <MaterialProvider>();
            var startCoord       = new GeoCoordinate(StartLatitude, StartLongitude);

            // scaled radius of Earth in meters, approx. 1:1000
            const float planetRadius = 6371f;
            const float surfaceScale = 0.01f;
            const float detailScale  = 1f;

            _lods = new List <Range <int> > {
                new Range <int>(1, 8), new Range <int>(9, 15), new Range <int>(16, 16)
            };

            var sphereController  = new SphereTileController(mapDataStore, stylesheet, ElevationDataType.Flat, Pivot, _lods[0], planetRadius);
            var surfaceController = new SurfaceTileController(mapDataStore, stylesheet, ElevationDataType.Flat, Pivot, _lods[1], startCoord, surfaceScale, 1000);
            var detailController  = new SurfaceTileController(mapDataStore, stylesheet, ElevationDataType.Flat, Pivot, _lods[2], startCoord, detailScale, 500);

            var sphereGestures  = new SphereGestureStrategy(sphereController, TwoFingerMoveGesture, ManipulationGesture, planetRadius);
            var surfaceGestures = new SurfaceGestureStrategy(surfaceController, TwoFingerMoveGesture, ManipulationGesture);
            var detailGestures  = new SurfaceGestureStrategy(detailController, TwoFingerMoveGesture, ManipulationGesture);

            _spaces = new List <Space>
            {
                new SphereSpace(sphereController, sphereGestures, Planet, materialProvider),
                new SurfaceSpace(surfaceController, surfaceGestures, Surface, materialProvider),
                new SurfaceSpace(detailController, detailGestures, Surface, materialProvider)
            };

            DoTransition(startCoord, StartZoom);
        }