none
Bing Maps Version 7 Navigation bar-->Pan button issue RRS feed

  • Question

  • Hi guys-

    For some weird reason, the pan button (left side of the zoom buttons, by default) on my map comes underneath the zoom and style selector buttons.  In my code I am not even touching the navigation bar, then why would this happen??  Any ideas!!

    Thanks,

    Desi

    • Moved by Ricky_Brundritt Friday, March 9, 2012 6:18 PM (From:Bing Maps: Map Control and Web services Development)
    Thursday, June 16, 2011 3:18 PM

Answers

  • Never mind guys, I figured it out...  I had my initialization for the <div map> in between <center> tag, and that was causing the error.  Took forever to find that..  Thanks for the help!
    • Marked as answer by Desi Gunda Tuesday, June 21, 2011 1:24 PM
    Tuesday, June 21, 2011 1:24 PM

All replies

  • Did you see same on http://www.bingmapsportal.com/ISDK/AjaxV7 as well?  This could be some implementation issue? Could you paste your code snippet?
    HemantGoyal
    Friday, June 17, 2011 4:28 AM
  • Make sure you have the proper doctype and metatag on your page:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">


    Windows Live Developer MVP - http://rbrundritt.wordpress.com | http://inknowledge.co.uk
    Saturday, June 18, 2011 2:30 PM
  • Hi Richard,

    I tried adding those but it did not do anything!  The strange thing is that, I am using the same code on a different page and I seem to be able to avoid this issue!  No Idea why.  Is there any relationship with the webpage zoom and the map setting?

    Thanks for the help!

     

    Tuesday, June 21, 2011 12:24 PM
  • Hi Hemant,

    Attached is my code snippet: (I have removed some unrelated code)

    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    
      <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&mkt=en-us"></script> 
    
    </asp:Content>
    
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    
    	<asp:ScriptManager ID="ScriptManager1" runat="server">
    
      		<Scripts>
    
        		<asp:ScriptReference Path="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0" />
    
      		</Scripts>
    
    	</asp:ScriptManager>
    
    	<script language="javascript" type="text/javascript">
    
    		function GetMap() 
    		{
        		map = new Microsoft.Maps.Map(document.getElementById('divMAP'), {credentials: 'Bing Map Key Here'});
    	  		map.setView({center:new Microsoft.Maps.Location( 40,-98 ), zoom: 4});
    
    		}
    
    		window.onload = GetMap;
    
    	</script>
    
    	<div id="divMAP" style="width:850px; height:450px; position:relative; "></div>
    
    </asp:Content>

    I am able to see the map and do other stuff with it fine, but the issue is the Navigation pan...  Please let me know if you see anything fishy in my layout!

     

    Thanks

    Tuesday, June 21, 2011 12:40 PM
  • Never mind guys, I figured it out...  I had my initialization for the <div map> in between <center> tag, and that was causing the error.  Took forever to find that..  Thanks for the help!
    • Marked as answer by Desi Gunda Tuesday, June 21, 2011 1:24 PM
    Tuesday, June 21, 2011 1:24 PM
  • if you need to center the div on the body

    <div id="map">

     

    You need to add some css rules

    in your stylesheet, add this one.

    <style>

    div#map

    {

        width:800px;

        margin:0 auto; /*centered the div on body*/

    }

     

    </style>

    Monday, June 27, 2011 9:08 PM