bing-maps

Asynchronously wait for a function to be called

烈酒焚心 提交于 2021-01-29 05:27:45
问题 I'm using the bing-maps JS control and API in WebKit (Android) and WKWebView (iOS). var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {}); // Binding the event Microsoft.Maps.Events.addHandler(map, 'viewchangeend', function () { console.log('mapViewchangeend'); }); Later in the code I have a call to map.setView. Because this method is asynchronous I need to wait for the event handler to call the function above. function SetMapViewLocations(pointsToView) { try { if

How can I clear all the pushpins from my Bing Map and still be able to add more after that?

别说谁变了你拦得住时间么 提交于 2021-01-28 17:06:39
问题 I can add a bunch of pushpins to my map, then add more, than add more (etc.), but if I want to "start over" and call this: photraxMap.Children.Clear(); (photraxMap is the name of my Bing Map), it does indeed clear all the pushpins, but subsequent attempts to add pushpins fail. That is to say, it fails visually . Stepping through the code, the pushpins are created, they just don't display on the map. Each time I add pushpins, this code is used: private async void Gener8MapMarkers(IEnumerable

How can I clear all the pushpins from my Bing Map and still be able to add more after that?

拟墨画扇 提交于 2021-01-28 17:01:53
问题 I can add a bunch of pushpins to my map, then add more, than add more (etc.), but if I want to "start over" and call this: photraxMap.Children.Clear(); (photraxMap is the name of my Bing Map), it does indeed clear all the pushpins, but subsequent attempts to add pushpins fail. That is to say, it fails visually . Stepping through the code, the pushpins are created, they just don't display on the map. Each time I add pushpins, this code is used: private async void Gener8MapMarkers(IEnumerable

Is there a way to programmatically determine the optimal Bing Maps Zoom Level based on an array of GPS Coordinates?

天涯浪子 提交于 2021-01-07 02:40:55
问题 When programmatically adding an array of GPS Coordinates to a Bing Map, I want to set the Zoom level to the optimal - to show every pushpin/location, but "just barely." I imagine a way to do this would be to identify the furthest points in the cardinal directions found within the array of coordinates, and then calculate how many miles you need to display both east-to-west and north-to-south. For example, let's say the furthest north and furthest south locations are determined to be forty

Is there a way to programmatically determine the optimal Bing Maps Zoom Level based on an array of GPS Coordinates?

≡放荡痞女 提交于 2021-01-07 02:40:21
问题 When programmatically adding an array of GPS Coordinates to a Bing Map, I want to set the Zoom level to the optimal - to show every pushpin/location, but "just barely." I imagine a way to do this would be to identify the furthest points in the cardinal directions found within the array of coordinates, and then calculate how many miles you need to display both east-to-west and north-to-south. For example, let's say the furthest north and furthest south locations are determined to be forty

Is there a Geopoint class available for Winforms (or an Analogue thereof)?

拈花ヽ惹草 提交于 2021-01-07 02:34:44
问题 In my UWP app, I use a Geopoint class: using Windows.Devices.Geolocation; . . . List<Geopoint> locations; In a Winforms app, this is not available - Geopoint is not recognized. Is there an analogous class available for Winforms apps? The same is true for the BasicGeoposition object - not recognized. UPDATE I want the GeoPoint and BasicGeoposition classes so I can do things like this: BasicGeoposition location = new BasicGeoposition(); location.Latitude = 36.59894360222391; // Monterey == 36

UWP MapControl crashes after zooming in

痞子三分冷 提交于 2020-12-26 07:08:27
问题 I created a simple UWP application with no code, just XAML. <Grid> <maps:MapControl/> </Grid> If I zoom in to about US state level, the application will crash with an unhandled exception. The event viewer Application Log shows: Faulting module name: ucrtbase.dll, version: 10.0.19041.546, time stamp: 0x43cbc11d Exception code: 0xc0000409 I'm running on Windows 10 Version 20H2 (OS Build 19042.630). How can I fix or diagnose this crash further? Update 1 I was able to capture the call stack at

Xamarin Forms - Image To/From IRandomAccessStreamReference

纵然是瞬间 提交于 2020-07-09 09:23:45
问题 For personal needs, for the Xamarin.Forms.Map control, I need to create a CustomPin extension. UWP part (PCL project) I create a MapIcon like it: nativeMap.MapElements.Add(new MapIcon() { Title = pin.Name, Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Pin/customicon.png")), Location = new Geopoint(new BasicGeoposition() { Latitude = pin.Position.Latitude, Longitude = pin.Position.Longitude }), NormalizedAnchorPoint = new Windows.Foundation.Point(0.5, 1.0) });

Xamarin Forms - Image To/From IRandomAccessStreamReference

断了今生、忘了曾经 提交于 2020-07-09 09:21:23
问题 For personal needs, for the Xamarin.Forms.Map control, I need to create a CustomPin extension. UWP part (PCL project) I create a MapIcon like it: nativeMap.MapElements.Add(new MapIcon() { Title = pin.Name, Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Pin/customicon.png")), Location = new Geopoint(new BasicGeoposition() { Latitude = pin.Position.Latitude, Longitude = pin.Position.Longitude }), NormalizedAnchorPoint = new Windows.Foundation.Point(0.5, 1.0) });

Embed Bing map in fullscreen

生来就可爱ヽ(ⅴ<●) 提交于 2020-07-09 04:03:41
问题 Does anuyone know if it is possible to embed a bing map in fullscreen?? So that the map can always fill the background and simply overlay a few elements on top. I cannot seem to achieve that with 100% iframe and bing's help is not that helpful. Thank you 回答1: If I understand you correctly, you want to achieve the effect of having the map fill up the entire screen, sort of like using the map as a background, and then have other elements overlaid on top? If so, you should be able to accomplish