uwp-maps

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

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) });

Invalid Credentials on MapLocationFinderResult uwp c#

亡梦爱人 提交于 2019-12-31 05:24:29
问题 I am having a strange problem with the use of MapLocationFinder. I am using MapLocationFinder to retrieve longitude and latitude based on string address: string address = ""; // Any address here var locFinderResult = await MapLocationFinder.FindLocationsAsync(address, new Geopoint(new BasicGeoposition())); After this, I use Laucher to start "drive to" application and get navigation map: var geoPos = locFinderResult.Locations[0].Point.Position; var url = $"ms-drive-to:?destination.latitude=

Zoom Level over 20 in UWP maps control

随声附和 提交于 2019-12-25 04:26:52
问题 I need zoom level 21 in maps. I added map control following MSDN article (link => Overlay tiles from a web service) and also followed instruction for "Replace the default map" at page bottom. As I see, map zooms only to level 20 and that also is not 20, it is actually zoomed 19. I tried setting ZoomLevelRange for tile source, but that does also not help, code: var dataSource = new HttpMapTileDataSource("http://www.webservicename.com/z={zoomlevel}&x={x}&y={y}"); MyMap.Style = MapStyle.None;

Vector Map Tiles on Bing Map Control

江枫思渺然 提交于 2019-12-22 01:37:31
问题 Hello I am working on a UWP map based application. I am currently using Raster Tiles data to remove the Bing Map default tiles. I Want to now shift to using Vector Tiles on the Bing map control. For Raster Tiles I know there are two ways: Set Tile data via the HTTPTileSource Set Tile data via the BitMapTileSource I want to know how can I implement Vector Tiles on the bing map control. The Vector tiles I get are of the extention .pbf . I have to hit the URL and get the .pbf file now how do I

Get distance of MapControl border in degrees

為{幸葍}努か 提交于 2019-12-14 02:47:12
问题 I have a MapControl and would like to know how many degrees are currently shown on the x and y axes. First example: 360 degrees are shown on the x axis (longitude) ~90 degrees are shown on the y axis (latitude) (The zoom level is 3.2 and it's max zoomed out) Second example: ~220 degrees on the x axis (longitude) 180 degrees on the y axis (latitude) (zoom level: 1.7; max zoomed out) I tried calculating the current degrees on the x axis using following code: double dist = 360 * Math.Pow(0.5,

MapControl get tapped location UWP

最后都变了- 提交于 2019-12-12 03:44:27
问题 I have a MapControl in my app and I want to retrieve the coordinate of the point taped by the user. <Maps:MapControl Grid.Row="0" ColorScheme="Light" Margin="10" x:Name="mainMap" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Tapped="mainMap_Tapped" MapElementClick="mainMap_MapElementClick" /> But I don't know how to get this from the event private void mainMap_Tapped(object sender, TappedRoutedEventArgs e) 回答1: To get the tapped location in MapControl, we can use MapControl

Multiple DataTemplates with UWP MapItemsControl

五迷三道 提交于 2019-12-11 06:04:17
问题 I have a MapControl in UWP: <maps:MapControl x:Name="BikeMap" ZoomLevel="17" Center="{Binding CenterPoint, Mode=TwoWay}"> <maps:MapItemsControl x:Name="MapItems" ItemsSource="{Binding BikePoints}" ItemTemplate="{StaticResource BikePointTemplate}"/> </maps:MapControl> and am adding MapElements using XAML data templates, my ItemsSource is a list of simple objects. But, UWP doesn't seem to provide a way to specify the DataType of a DataTemplate and the MapItemsControl doesn't have a property for

How to rotate image placed on a Mapcontrol

坚强是说给别人听的谎言 提交于 2019-12-11 05:56:56
问题 The issue I've got an application that tracks vehicles on a map. However I cannot get the little buggers to rotate in the direction of their motion. Basically, all of them are going sideways! Ugh! The code Image vehicleImage = new Image { //Set image size and source }; RenderTransform rotation= new RotateTransform{Angle = X}; vehicleImage.RenderTransfrom = rotation; _mainMap.Children.Add(vehicleImage); MapControl.SetLocation(vehicleImage, _position); The Image, placed on the map, seems to