I put in my map service token key and my search bar to search for any location is not working on the bottom of screen is saying Warning: Map Service Token not specified for my uwp google earth like app

Luke Ferguson 46 Reputation points
2023-12-21T07:38:32.88+00:00

I put in my map service token key and my search bar to search for any location is not working on the bottom of screen is saying Warning: Map Service Token not specified for my uwp google earth like app

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,646 questions
Universal Windows Platform (UWP)
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,617 questions
Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
245 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Duncan Lawler - MSFT 486 Reputation points Microsoft Employee
    2024-01-03T16:58:16.0333333+00:00

    Looks like you have an extra backslash pasted in at the end of your key that's making it invalid.

    Also as a reminder you shouldn't post your personal keys in a public forum.

    1 person found this answer helpful.

  2. Luke Ferguson 46 Reputation points
    2023-12-27T04:48:20.27+00:00

    How do i create a code snippet

    0 comments No comments

  3. Luke Ferguson 46 Reputation points
    2023-12-27T04:53:53.63+00:00
    <Page
        x:Class="Lukes_Earth.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:Lukes_Earth"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Custom="using:Windows.UI.Xaml.Controls.Maps"
        mc:Ignorable="d"
        Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    
        <Grid>
    
            <Custom:MapControl x:Name="MapTest" Style="Aerial3DWithRoads"  ZoomInteractionMode="GestureAndControl"  
        TiltInteractionMode="GestureAndControl" Loaded="MapControl_Loaded"  MapServiceToken="BsqK8Q26ZVYD3EzSZuGw~LAgyqIvV7_2lQX4a0wuauw~AkrEhdJtQH9Tm4GQ3YVuvD7GDzdxj9iYygh8-vRl_pq_3g0SqIa7O7YHwhn-mQDS/">
                <SearchBox x:Name="searchBox" Width="150" Background="White" QuerySubmitted="SearchBox_QuerySubmitted"/>
            </Custom:MapControl>
    
        </Grid>
    </Page>
    
    0 comments No comments

  4. Luke Ferguson 46 Reputation points
    2023-12-27T04:54:16.3633333+00:00
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Runtime.InteropServices.WindowsRuntime;
    using System.Threading.Tasks;
    using Windows.Devices.Geolocation;
    using Windows.Foundation;
    using Windows.Foundation.Collections;
    using Windows.Services.Maps;
    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml.Controls.Maps;
    using Windows.UI.Xaml.Controls.Primitives;
    using Windows.UI.Xaml.Data;
    using Windows.UI.Xaml.Input;
    using Windows.UI.Xaml.Media;
    using Windows.UI.Xaml.Navigation;
    
    // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
    
    namespace Lukes_Earth
    {
        /// <summary>
        /// An empty page that can be used on its own or navigated to within a Frame.
        /// </summary>
        public sealed partial class MainPage : Page
        {
            public MainPage()
            {
                this.InitializeComponent();
            }
    
            private async void SearchBox_QuerySubmitted(SearchBox sender, SearchBoxQuerySubmittedEventArgs args)
            {
                string addressToGeocode = searchBox.QueryText;
    
                // The nearby location to use as a query hint.
                BasicGeoposition queryHint = new BasicGeoposition();
                queryHint.Latitude = 47.643;
                queryHint.Longitude = -122.131;
                Geopoint hintPoint = new Geopoint(queryHint);
    
                // Geocode the specified address, using the specified reference point
                // as a query hint. Return no more than 3 results.
                MapLocationFinderResult result =
                      await MapLocationFinder.FindLocationsAsync(
                                        addressToGeocode,
                                        hintPoint,
                                        3);
    
                // If the query returns results, display the coordinates
                // of the first result.
                if (result.Status == MapLocationFinderStatus.Success)
                {
    
                    BasicGeoposition cityPosition = result.Locations[0].Point.Position;
                    var cityCenter = new Geopoint(cityPosition);
    
                    await MapTest.TrySetViewAsync(cityCenter, 12);
                }
            }
    
            private async void MapControl_Loaded(object sender, RoutedEventArgs e)
            {
                BasicGeoposition cityPosition = new BasicGeoposition() { Latitude = -36.163656, Longitude = 150.109979 };
                var cityCenter = new Geopoint(cityPosition);
    
                await (sender as MapControl).TrySetViewAsync(cityCenter, 12);
            }
        }
    }
    
    0 comments No comments

  5. Luke Ferguson 46 Reputation points
    2024-01-14T07:09:55.7733333+00:00

    I took out the backslash and got it working

    0 comments No comments