locked
Silverlight Bing Map Control RRS feed

  • Question

  • I have installed the Bing Map SDK and placed a Map Control in my Silverlight App.

    It works fine but I have a white bar that runs through the center.

    Here are the settings for the control...

    On the artboard the bar is not visible.  Just when your run the application and it also shows in the published.

    I asked this on the Silverlight.net forums but since they have over 24 pages of questions that no one has even bothered to reply to... well I thought I'd start here.  I've searched MSDN, Silverlight.net, these forums... no one has ever mentioned this as a problem.

    Oh, here's the xaml...

    <canvas Margin="430,40,50,125" x:Name="mapCanvas">
    			<microsoft_maps_mapcontrol:map AnimationLevel="Full" CopyrightVisibility="Collapsed" Foreground="{x:Null}" Height="390" LogoVisibility="Collapsed" NavigationVisibility="Collapsed" ScaleVisibility="Collapsed" ZoomLevel="15" x:Name="Map">
    				<microsoft_maps_mapcontrol:map.center>
    					<microsoft_maps_mapcontrol1:location Altitude="0" AltitudeReference="Ground" Latitude="34.858839" Longitude="-83.511275"></microsoft_maps_mapcontrol1:location>
    				</microsoft_maps_mapcontrol:map.center>
    				<microsoft_maps_mapcontrol:map.mode>
    					<microsoft_maps_mapcontrol:aerialmode AnimationLevel="Full" CredentialsProvider="{x:Null}" Culture="en-US" FadingLabels="True" Labels="False" RestrictMaxZoomLevel="True" Scale="68100.3488973112" UpSampleLevelDelta="5" ViewportSize="800,600" ZoomLevel="1">
    						<microsoft_maps_mapcontrol:aerialmode.center>
    							<microsoft_maps_mapcontrol1:location Altitude="0" AltitudeReference="Ground" Latitude="-29.535229562948459" Longitude="101.25"></microsoft_maps_mapcontrol1:location>
    						</microsoft_maps_mapcontrol:aerialmode.center>
    					</microsoft_maps_mapcontrol:aerialmode>
    				</microsoft_maps_mapcontrol:map.mode>
    				<microsoft_maps_mapcontrol:pushpin Content="MMi" Height="Auto" Width="35">
    					<microsoft_maps_mapcontrol:pushpin.location>
    						<microsoft_maps_mapcontrol1:location Altitude="0" AltitudeReference="Ground" Latitude="34.858839" Longitude="-83.511275"></microsoft_maps_mapcontrol1:location>
    					</microsoft_maps_mapcontrol:pushpin.location>
    				</microsoft_maps_mapcontrol:pushpin>
    			</microsoft_maps_mapcontrol:map>
    		</canvas>
    I've tried to right-click and get into the template but the only option is to create empty.

    And you can click through the white bar.

    Any ideas on what I'm doing wrong with my setup?

    Thanks.

    ~Christine


    Saturday, February 11, 2012 9:54 PM

Answers

  • Well after a lot of web surfing I've learned that this control is not what I thought it was at first.  I seemed to have found it via a back door rather than proper channels.

    Apparently that white bar is a warning that you don't have a key from Bing maps to be able to use the control.  Had my map been much larger the actual warning might have shown instead of just a white bar.

    <Microsoft_Maps_MapControl:Map x:Name="Map" CredentialsProvider="KEY_GOES_HERE" AnimationLevel="Full" Foreground="{x:Null}" ZoomLevel="15" Height="390" ScaleVisibility="Collapsed" CopyrightVisibility="Collapsed">

    So if anyone ever wants to use the Bing control in their WPF, Silverlight or WP7 applications here are some links:

    http://msdn.microsoft.com/en-us/library/ee681884.aspx  Gives info on the control and how to download the SDK.

    https://www.bingmapsportal.com/  This is where you have to register for the control and get a key.  Based on what you plan to do with it, they determine if you will be charged for usage.  But you get something like 500,000 uses a year.  (If I read it correctly.  You kind of have to search hard for really basic questions.)

    ~Christine

    • Marked as answer by Christine L. _ Sunday, February 12, 2012 12:09 AM
    Sunday, February 12, 2012 12:09 AM