public async void Mapping(double lat, double lon) { if (MyMap.Is3DSupported) { // Estilo del mapa MyMap.Style = MapStyle.Road; // llave de bing MyMap.MapServiceToken = "iXNUzZxjjglXbxTQI3u2~5bxFRFZESkZUVlrEuPtCxg~AmcMVqUdyZW960FDSNF28-MUt_Thri564P4V3oHEyVEATyV-dHL9DdkBBRuxsdmI"; BasicGeoposition geoPosition = new BasicGeoposition(); geoPosition.Latitude = lat; //geoPosition.Latitude = 20.0791441598; geoPosition.Longitude = lon; //geoPosition.Longitude = -98.3714238064418; // obtiene posición Geopoint myPoint = new Geopoint(geoPosition); // crea POI MapIcon myPOI = new MapIcon { Location = myPoint, Title = "Position", NormalizedAnchorPoint = new Point(0.5, 1.0), ZIndex = 0 }; // Despliega una imagen de un MapIcon myPOI.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/pin.png")); // Agrega el mapa y lo centra MyMap.MapElements.Add(myPOI); MyMap.Center = myPoint; MyMap.ZoomLevel = 10; Debug.WriteLine("Coordenadas: " + latitude + " y " + longitude); MapScene mapScene = MapScene.CreateFromLocationAndRadius(new Geopoint(geoPosition), 200, 150, 70); await MyMap.TrySetSceneAsync(mapScene); } }
private async void showSpaceNeedleButton_Click(object sender, RoutedEventArgs e) { if (myMap.Is3DSupported) { this.myMap.Style = MapStyle.Aerial3DWithRoads; BasicGeoposition spaceNeedlePosition = new BasicGeoposition(); spaceNeedlePosition.Latitude = 47.6204; spaceNeedlePosition.Longitude = -122.3491; Geopoint spaceNeedlePoint = new Geopoint(spaceNeedlePosition); MapScene spaceNeedleScene = MapScene.CreateFromLocationAndRadius(spaceNeedlePoint, 400, /* show this many meters around */ 135, /* looking at it to the south east*/ 60 /* degrees pitch */); await myMap.TrySetSceneAsync(spaceNeedleScene); } else { string status = "3D views are not supported on this device."; rootPage.NotifyUser(status, NotifyType.ErrorMessage); } }
private async void MyMap_Loaded(object sender, RoutedEventArgs e) { if (MyMap.Is3DSupported) { MyMap.Style = MapStyle.Aerial3DWithRoads; MyMap.MapServiceToken = "iXNUzZxjjglXbxTQI3u2~5bxFRFZESkZUVlrEuPtCxg~AmcMVqUdyZW960FDSNF28-MUt_Thri564P4V3oHEyVEATyV-dHL9DdkBBRuxsdmI"; geoPosition.Latitude = this.latitude; //geoPosition.Latitude = 20.0791441598; geoPosition.Longitude = this.longitude; //geoPosition.Longitude = -98.3714238064418; Geopoint myPoint = new Geopoint(geoPosition); MapIcon myPOI = new MapIcon { Location = myPoint, Title = "Position", NormalizedAnchorPoint = new Point(0.5, 1.0), ZIndex = 0 }; myPOI.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/pin.png")); MyMap.MapElements.Add(myPOI); MyMap.Center = myPoint; MyMap.ZoomLevel = 3; Debug.WriteLine("Coordenadas: " + latitude + " y " + longitude); MapScene mapScene = MapScene.CreateFromLocationAndRadius(new Geopoint(geoPosition), 500, 150, 70); await MyMap.TrySetSceneAsync(mapScene, MapAnimationKind.Bow); } else { // If 3D views are not supported, display dialog. ContentDialog viewNotSupportedDialog = new ContentDialog() { Title = "3D is not supported", Content = "\n3D views are not supported on this device.", PrimaryButtonText = "OK" }; await viewNotSupportedDialog.ShowAsync(); } }
public override void Build() { var defaultLayer = SceneMgr.GetScene("default")["default"]; if (defaultLayer.CountEntities <CheckpointManager>() == 0) { // Checkpoint manager needs to be preserved, when map is deleted. // This is why it's created on a default layer. var checkpoint = new CheckpointManager(defaultLayer); checkpoint.MapName = TiledMap.Name; } else { var checkpoint = defaultLayer.FindEntity <CheckpointManager>(); // If we are loading new map, reset checkpoint manager. if (checkpoint.MapName != TiledMap.Name) { checkpoint.ResetForNewMap(TiledMap.Name); } } base.Build(); // Putting a background. var l = MapScene.CreateLayer("backdrop"); l.Priority = 10000; new Background(l); // Putting a background. }
private async void MapControlLoaded(object sender, RoutedEventArgs e) { myMapControl.Center = new Geopoint(seattleLocation); myMapControl.ZoomLevel = 12; if (myMapControl.Is3DSupported) { this.myMapControl.Style = MapStyle.Aerial3DWithRoads; Geopoint spaceNeedlePoint = new Geopoint(seattleLocation); MapScene spaceNeedleScene = MapScene.CreateFromLocationAndRadius(spaceNeedlePoint, 400, /* show this many meters around */ 135, /* looking at it to the south east*/ 60 /* degrees pitch */); await myMapControl.TrySetSceneAsync(spaceNeedleScene); } else { //string status = "3D views are not supported on this device."; this.myMapControl.Style = MapStyle.Aerial; } MapIcon seattleMapIcon = new MapIcon(); seattleMapIcon.Location = new Geopoint(seattleLocation); seattleMapIcon.NormalizedAnchorPoint = new Point(0.5, 1.0); seattleMapIcon.Title = "Parking here"; seattleMapIcon.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/mappin.png")); myMapControl.MapElements.Add(seattleMapIcon); }
//Función que establece el mapa con mapas 3D según el valor de su combo private async void map_tresD(object sender, RoutedEventArgs e) { if (MapControl.Is3DSupported) { // Se establece el mapa mediante el valor actual del combo3D MapControl.Style = estilos3DMapa[combo3d.SelectedIndex]; // Se crea la escena del Mapa 3D MapScene hwScene = MapScene.CreateFromLocationAndRadius(miPosiciónActual, 80, // cuantos metros se ve alrededor 0, //grados con respecto al Norte 60); //inclinación del mapa // Se establece la animación con la que aparecerá el mapa 3D await MapControl.TrySetSceneAsync(hwScene, MapAnimationKind.Linear); } else { // Si no se soporta el modo 3D, se muestra un dialogo ContentDialog viewNotSupportedDialog = new ContentDialog() { Title = "3D no soportado", Content = "La vista 3D del Mapa no es soportada en tu dispositvo.", PrimaryButtonText = "OK" }; await viewNotSupportedDialog.ShowAsync(); } }
public void Initialize(FishingManager _fishingManager, Transform _rootPos, LineRenderer _line) { ActionItemInfo actionItemInfo; GameObject gameObject; if (Object.op_Equality((Object)this.bodyObject, (Object)null) && Singleton <Resources> .Instance.Map.EventItemList.TryGetValue(Singleton <Resources> .Instance.FishingDefinePack.IDInfo.LureEventItemID, out actionItemInfo) && Object.op_Inequality((Object)(gameObject = CommonLib.LoadAsset <GameObject>((string)actionItemInfo.assetbundleInfo.assetbundle, (string)actionItemInfo.assetbundleInfo.asset, false, (string)actionItemInfo.assetbundleInfo.manifest)), (Object)null)) { MapScene.AddAssetBundlePath((string)actionItemInfo.assetbundleInfo.assetbundle, (string)actionItemInfo.assetbundleInfo.manifest); this.bodyObject = (GameObject)Object.Instantiate <GameObject>((M0)gameObject, Vector3.get_zero(), Quaternion.get_identity()); this.bodyObject.get_transform().SetParent(((Component)this).get_transform(), false); this.floatingObject = this.bodyObject.GetOrAddComponent <FloatingObject>(); this.floatingObject.fishingSystem = _fishingManager; this.floatingObject.WaterEnterChecker = new Func <Collider, bool>(this.WaterInOutCheck); this.floatingObject.WaterStayChecker = new Func <Collider, bool>(this.WaterInOutCheck); this.floatingObject.WaterExitChecker = new Func <Collider, bool>(this.WaterInOutCheck); } this.fishingSystem = _fishingManager; this.RootPos = _rootPos; ((Component)this).get_transform().set_parent(this.RootPos); Transform transform = ((Component)this).get_transform(); Vector3 zero = Vector3.get_zero(); ((Component)this).get_transform().set_localEulerAngles(zero); Vector3 vector3 = zero; transform.set_localPosition(vector3); this.fishingLine = _line; this.state = Lure.State.Have; if (!Object.op_Implicit((Object)this.floatingObject)) { return; } this.floatingObject.UseWaterBuoyancy = false; }
private async void Map3D_Click(object sender, RoutedEventArgs e) { MapControl.CustomExperience = null; if (MapControl.Is3DSupported) { // Set the aerial 3D view. MapControl.Style = MapStyle.Aerial3DWithRoads; // Specify the location. BasicGeoposition hwGeoposition = new BasicGeoposition() { Latitude = 34.134, Longitude = -118.3216 }; Geopoint hwPoint = new Geopoint(hwGeoposition); // Create the map scene. MapScene hwScene = MapScene.CreateFromLocationAndRadius(hwPoint, 60 /* degrees pitch */); // Set the 3D view with animation. await MapControl.TrySetSceneAsync(hwScene, MapAnimationKind.Bow); } else { // If 3D views are not supported, display dialog. ContentDialog viewNotSupportedDialog = new ContentDialog() { Title = "3D is not supported", Content = "\n3D views are not supported on this device.", PrimaryButtonText = "OK" }; await viewNotSupportedDialog.ShowAsync(); Point t = MapControl.RenderTransformOrigin; } }
//private async void Button_Click(object sender, RoutedEventArgs e) //{ // var pos = await LocationManager.GetLocation(); // var lat = pos.Coordinate.Latitude; // var lon = pos.Coordinate.Latitude; // var weather = await WeatherProxyMap.GetWeather(lat, lon); // WeatherCondition.Text = ((int)weather.main.temp).ToString() + " " + weather.name; //} private async void Button_Click_1(object sender, RoutedEventArgs e) { //Show Weather var citySearch = CitySearch.Text; var weather = await WeatherProxyMapByCity.GetWeather(citySearch); CityNameTxtBlock.Text = ((int)weather.main.temp).ToString() + " " + weather.name; //Show on map var address = citySearch; var results = await MapLocationFinder.FindLocationsAsync(address, null); if (results.Status == MapLocationFinderStatus.Success) { var lat = results.Locations[0].Point.Position.Latitude; var lon = results.Locations[0].Point.Position.Longitude; var center = new Geopoint(new BasicGeoposition() { Latitude = lat, Longitude = lon }); await MyMap.TrySetSceneAsync(MapScene.CreateFromLocationAndRadius(center, 3000)); } }
public void Animate(MapScene mapScene) { mapRenderer.SetMapScene(mapScene); hostRenderer.SetMapScene(mapScene); currentZoomLevel = hostRenderer.ZoomLevel; center = hostRenderer.Center; }
void LoadSceneAsset() { filePath = EditorUtility.OpenFilePanel("打开", filePath, "asset"); if (string.IsNullOrEmpty(filePath) || !filePath.Contains(".asset")) { return; } MapWorldAsset mapWorldAsset = (MapWorldAsset)AssetDatabase.LoadAssetAtPath("Assets" + filePath.Replace(Application.dataPath, ""), typeof(MapWorldAsset)); if (mapWorldAsset != null) { for (int i = 0; i < mapWorldAsset.mapScenes.Count; i++) { currMapScene = new GameObject("Map" + (i + 1)).AddComponent <MapScene>(); currMapScene.offsetX = mapWorldAsset.mapScenes[i].offsetX; currMapScene.offsetY = mapWorldAsset.mapScenes[i].offsetY; currMapScene.mapSizeX = mapWorldAsset.mapScenes[i].mapSizeX; currMapScene.mapSizeY = mapWorldAsset.mapScenes[i].mapSizeY; currMapScene.worldType = mapWorldAsset.mapScenes[i].worldType; currMapScene.layers = new List <MapEditorSortLayer>(mapWorldAsset.mapScenes[i].layers); for (int n = 0; n < mapWorldAsset.mapScenes[i].layerItems.Count; n++) { currMapScene.layerItems.Add(new MapLayerItem()); currMapScene.layerItems[n].posList = new List <int>(mapWorldAsset.mapScenes[i].layerItems[n].posList); currMapScene.layerItems[n].items = new List <MapResourceItem>(mapWorldAsset.mapScenes[i].layerItems[n].items); } mapSceneList.Add(currMapScene); currMapScene.FreshMapGrid(); currMapScene.UpdateMap(); } } FreshResource(); }
public static void MapScene_OnLoaded(MapScene __instance) { if (_isNewGame) { OnNewGame(); } }
private async void movieMap_MapElementClick(MapControl sender, MapElementClickEventArgs args) { MapIcon topMost = args.MapElements[0] as MapIcon; if (topMost.Title == "Lots of Movie Spots") { if (movieMap.ZoomLevel < 16) { //await movieMap.TrySetViewAsync(args.Location, 16); await movieMap.TrySetSceneAsync( MapScene.CreateFromLocationAndRadius(args.Location, 500, 45, 50)); } else { await movieMap.TrySetViewAsync(args.Location, movieMap.ZoomLevel + 2); } } else { MovieInfoPanel infoPanel = new MovieInfoPanel { ClickedLocation = topMost.Location }; infoPanel.Closed += infoPanel_Closed; movieMap.Children.Add(infoPanel); MapControl.SetLocation(infoPanel, topMost.Location); } }
private async void MyMap_Loaded(object sender, RoutedEventArgs e) { if (MyMap.Is3DSupported) { MyMap.Style = MapStyle.Aerial3DWithRoads; //MyMap.Style = MapStyle.Terrain; MyMap.MapServiceToken = "Your Service Token"; BasicGeoposition geoPosition = new BasicGeoposition(); geoPosition.Latitude = 27.175015; geoPosition.Longitude = 78.042155; // get position Geopoint myPoint = new Geopoint(geoPosition); //create POI MapIcon myPOI = new MapIcon { Location = myPoint, Title = "My Position", NormalizedAnchorPoint = new Point(0.5, 1.0), ZIndex = 0 }; // Display an image of a MapIcon myPOI.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/pin.png")); // add to map and center it MyMap.MapElements.Add(myPOI); MyMap.Center = myPoint; MyMap.ZoomLevel = 10; MapScene mapScene = MapScene.CreateFromLocationAndRadius(new Geopoint(geoPosition), 500, 150, 70); await MyMap.TrySetSceneAsync(mapScene); } }
public void DragStart() { if (this.name.Contains("Ivent")) { MapScene m1 = GameObject.Find("GameObject").GetComponent <MapScene>(); if (m1.selectNum == 0) { return; } this.GetComponent <IventButton>().PushIventButton(); m1.fallNum = this.GetComponent <IventButton>().buttonNum; for (int i = 0; i < m1.multiSelect.Count; i++) { m1.objIB[m1.multiSelect[i]].GetComponent <Image>().color = new Color(1.0f, 1.0f, 1.0f); } m1.multiSelect.Clear(); } if (this.name.Contains("Command")) { ScenariosceneManager s1 = GameObject.Find("NovelManager").GetComponent <ScenariosceneManager>(); this.GetComponent <CommandButton>().PushCommandButton(); s1.fallNum = this.GetComponent <CommandButton>().buttonNum; for (int i = 0; i < s1.multiSelect.Count; i++) { s1.objCB[s1.multiSelect[i]].GetComponent <Image>().color = new Color(1.0f, 1.0f, 1.0f); } s1.multiSelect.Clear(); } dragFlag = true; copy.SetActive(true); copy.transform.Find("Text").GetComponent <Text>().text = this.GetComponentInChildren <Text>().text; }
private async void button1_Click(object sender, RoutedEventArgs e) { if (MapControl1.Is3DSupported) { MapControl1.Style = MapStyle.Aerial3D; BasicGeoposition hwGeoposition = new BasicGeoposition() { Latitude = 48.858, Longitude = 2.295 }; Geopoint hwPoint = new Geopoint(hwGeoposition); MapScene hwScene = MapScene.CreateFromLocationAndRadius(hwPoint, 80, 0, 60); await MapControl1.TrySetSceneAsync(hwScene, MapAnimationKind.Bow); } else { ContentDialog viewNotSupportedDialog = new ContentDialog() { Title = "3D is not supported", Content = "\n3D views are not supported on this device.", PrimaryButtonText = "OK" }; await viewNotSupportedDialog.ShowAsync(); } }
/// <summary> /// This method sets the location on the Map. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void SculptureMap_OnLoaded(object sender, RoutedEventArgs e) { var center = new Geopoint(new BasicGeoposition() { Latitude = Latitude, Longitude = Longitude }); await sculptureMap.TrySetSceneAsync(MapScene.CreateFromLocationAndRadius(center, 3500), MapAnimationKind.Bow); }
public static void OpenMapScene(ContentManager Content) { if (mapScene == null) { mapScene = new MapScene(); } if (IsBattle) { currentScene = mapScene; } }
private void MapOnDoubleClick(object sender, MapInputEventArgs args) { var currentCamera = BingMap.ActualCamera; _ = BingMap.TrySetSceneAsync(MapScene.CreateFromCamera(currentCamera)); var geopoint = args.Location; AddMarker(geopoint); ReverseGeocodePoint(geopoint); }
private async void MyMap_loadedAsync(object sender, RoutedEventArgs e) { var center = new Geopoint(new BasicGeoposition() { Latitude = 52.707, Longitude = -2.645 }); // retrieve map await myMap.TrySetSceneAsync(MapScene.CreateFromLocationAndRadius(center, 200)); }
/// <summary> /// este método nos muestra el mapa de Sevilla /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void Mapsample_Loaded(object sender, RoutedEventArgs e) { var center = new Geopoint(new BasicGeoposition() { //latitud y longitud de la capital de armenia y los que estan en comentario son de sevilla Latitude = 40.1811104 /*37.3828300*/, Longitude = 44.5136108 //-5.9731700 }); await Map.TrySetSceneAsync(MapScene.CreateFromLocationAndRadius(center, 3000)); }
private async void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { if (!(args.ChosenSuggestion is LocationSuggestion chosen)) { sender.Text = string.Empty; return; } var scene = MapScene.CreateFromLocation(chosen.Location.Point); await Map.TrySetSceneAsync(scene); }
public Overlay(Overlay previousOverlay) { this.previousOverlay = previousOverlay; sprites = new List <Sprite>(); objects = new List <Object2D>(); input = new InputHandler(); SceneService.input.inputHandler = input.HandleInput; battleScene = previousOverlay.battleScene; mapScene = previousOverlay.mapScene; Initialise(); }
public Overlay(MapScene mapScene) { previousOverlay = null; sprites = new List <Sprite>(); objects = new List <Object2D>(); input = new InputHandler(); SceneService.input.inputHandler = input.HandleInput; battleScene = null; this.mapScene = mapScene; Initialise(); }
/// <inheritdoc/> public void Initialize( MapRendererBase mapRenderer, MapScene mapScene, float animationTimeScale, MapSceneAnimationKind mapSceneAnimationKind) { if (mapRenderer == null) { throw new ArgumentNullException(nameof(mapRenderer)); } if (mapScene == null) { throw new ArgumentNullException(nameof(mapScene)); } _runningTime = 0; _startMercatorCenter = mapRenderer.Center.ToMercatorCoordinate(); _startZoomLevel = mapRenderer.ZoomLevel; mapScene.GetLocationAndZoomLevel(out var endLocation, out _endZoomLevel); _endZoomLevel = _endZoomLevel < mapRenderer.MinimumZoomLevel ? mapRenderer.MinimumZoomLevel : _endZoomLevel; _endZoomLevel = _endZoomLevel > mapRenderer.MaximumZoomLevel ? mapRenderer.MaximumZoomLevel : _endZoomLevel; _endMercatorCenter = endLocation.ToMercatorCoordinate(); _startHeightInMercator = ZoomLevelToMercatorAltitude(_startZoomLevel); _endHeightInMercator = ZoomLevelToMercatorAltitude(_endZoomLevel); // Determine if we should use a bow animation or a linear animation. // Simple rule for now: If the destination is already visible, use linear; otherwise, bow. _isLinearAnimation = mapSceneAnimationKind == MapSceneAnimationKind.Linear || mapSceneAnimationKind == MapSceneAnimationKind.SmoothLinear || mapRenderer.Bounds.Intersects(endLocation); _isSmoothed = mapSceneAnimationKind == MapSceneAnimationKind.SmoothLinear; // While linear animation doesn't follow the same code path as the bow animation, we can still use this function to compute // a reasonable duration for the linear animation. ComputeBowAnimationInitialValues( P, V * animationTimeScale, out _u0, out _u1, out _w0, out _, // w1 out _r0, out _, // r1 out _S, out _animationTime); // Tweaking the resulting animation time to speed up slower animations and slow down the shorter animation. _animationTime /= 6.0; // Normalize. _animationTime = Math.Pow(_animationTime, 1.0 / 3.0); // Rescale. _animationTime *= 6.0; // Convert back to original range. }
/// <summary> /// Sets the MapRenderer's view to reflect the new MapScene using the default IMapSceneAnimationController. /// </summary> /// <returns> /// A yieldable object is returned that can be used to wait for the end of the animation in a coroutine. /// </returns> public static WaitForMapSceneAnimation SetMapScene( this MapRenderer mapRenderer, MapScene mapScene, MapSceneAnimationKind mapSceneAnimationKind = MapSceneAnimationKind.Bow, float animationTimeScale = 1.0f) { return(mapRenderer.SetMapScene( mapScene, new MapSceneAnimationController(), mapSceneAnimationKind, animationTimeScale)); }
public void OnSelectObj() { if (Selection.activeGameObject != null) { MapScene mapScene = Selection.activeGameObject.GetComponent <MapScene>(); if (mapScene != null) { currMapScene = mapScene; FreshResource(); } } }
private async void LoadMap(DojoLocation location) { Geopoint eventLocation = GenerateGeoPoint(location); MapIcon myPOI = new MapIcon { Location = eventLocation, NormalizedAnchorPoint = new Point(0.5, 1.0), Title = "Coder Dojo!", ZIndex = 0 }; EventMap.MapElements.Add(myPOI); await EventMap.TrySetSceneAsync(MapScene.CreateFromLocationAndRadius(eventLocation, 150)); }
public async Task <int> posUmi(Geopoint p) { // userMapIcon has not been added. if (map.Children.IndexOf(userMapIcon) == -1) { map.Children.Add(userMapIcon); } MapControl.SetLocation(userMapIcon, p); MapControl.SetNormalizedAnchorPoint(userMapIcon, new Point(0.5, 0.5)); await map.TrySetSceneAsync(MapScene.CreateFromLocationAndRadius(p, 1000)); return(0); }
public Map(string[] mapData, Texture2D atlas, ContentManager Content, MapScene scene) { this.scene = scene; this.atlas = atlas; tileset = Tileset.tilesets["normal"]; units = new List <Actor>(); enemies = new List <Enemy>(); tweener = new Tweener(); Initialize(mapData); }
private void SaveScene(object sender, RoutedEventArgs e) { lastScene = MapScene.CreateFromCamera(MyMap.ActualCamera); }
public MapSceneEvents(MapScene This) { this.This = This; }
public static void Initialize() { menuScene = new MenuScene(); optionsScene = new OptionsScene(); shipSelectScene = new ShipSelectScene(); inventoryScene = new InventoryScene(); mapScene = new MapScene(); controlScene = new ControlScene(); rankScene = new RankScene(); gameOverScene = new GameOverScene(); winScene = new WinScene(); CurrentScene = menuScene; changeTo = menuScene; changeSceneTimer = 40; GameObjects = new List<GameObject>(); for (int i = 0; i < Options.StarChance * 10; i++) { GameObjects.Add(new Star(new Vector2(Globals.Randomizer.Next(5, Globals.ScreenSize.X - 5), Globals.Randomizer.Next(5, Globals.ScreenSize.Y * 2)))); } }