none
Bing map language RRS feed

  • Question

  • Hi all,

    a have a problem in IE 10 when i try to to return a localized map with Ajax Bing map.

    My simple javascript code is:

    <script charset="UTF-8" type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&onscriptload=GetMappa&mkt=it-IT">
    </script>

    I also try "it" and "it-it", but Always i get an error in veapicore.js, on:

    ot.appendChild(s)

    Can anyone help me??

    Thanks,

    David


    Tuesday, March 19, 2013 9:37 PM

Answers

  • I'm unable to reproduce. Ensure you have the correct doctype and metatag in your HTML file. Try the following code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
       <head>
          <title></title>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&mkt=it-IT"></script>
    
          <script type="text/javascript">
             var map;    
    
             function GetMap()
             {
    			map = new Microsoft.Maps.Map(document.getElementById("myMap"),
    			{
    				credentials:"YOUR_BING_MAPS_KEY"
    			});
             }
          </script>
       </head>
       <body onload="GetMap();">
    	<div id='myMap' style=";width:800px;height:600px;"></div>
       </body>
    </html>

    If you still have issues can you tell me where in the world you are located so I can try an narrow down which data center you are likely connecting to.

    http://rbrundritt.wordpress.com

    Wednesday, March 20, 2013 1:07 PM

All replies

  • Just for clarification,

    I notice there's a problem even with the script : onscriptload.

    Always return me the same message.

    I'm working with visual studio 2012, and i'm in debug with IIS express.

    Thank's a lot


    Tuesday, March 19, 2013 9:53 PM
  • Does it work if you remove the onscriptload parameter from the URL? Note that the onscriptload parameter is not a documented functionality of the Bing Maps API.

    http://rbrundritt.wordpress.com

    Tuesday, March 19, 2013 10:42 PM
  • Hi Richard,

    thanks for reply.

    Even with removing "onscriptload" i encountered the same problem.

    It works only without any parameter.

    Thanks,

    David

    Wednesday, March 20, 2013 9:48 AM
  • I'm unable to reproduce. Ensure you have the correct doctype and metatag in your HTML file. Try the following code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
       <head>
          <title></title>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&mkt=it-IT"></script>
    
          <script type="text/javascript">
             var map;    
    
             function GetMap()
             {
    			map = new Microsoft.Maps.Map(document.getElementById("myMap"),
    			{
    				credentials:"YOUR_BING_MAPS_KEY"
    			});
             }
          </script>
       </head>
       <body onload="GetMap();">
    	<div id='myMap' style=";width:800px;height:600px;"></div>
       </body>
    </html>

    If you still have issues can you tell me where in the world you are located so I can try an narrow down which data center you are likely connecting to.

    http://rbrundritt.wordpress.com

    Wednesday, March 20, 2013 1:07 PM
  • Hi Richard,

    I'd like to say that i found the problem, but now, magically.. it works!! (I think it was only ie cache!)

    I can anyway confirm that "onscriptload" does not work on ie 10.

    Thanks,

    David

    Thursday, March 21, 2013 7:50 PM
  • onscriptload is not a documented feature so I'm not surprised it doesn't work. If you want to run code after the control has been loaded take a look at my lazy loader example: http://rbrundritt.wordpress.com/2011/11/20/bing-maps-v7-control-lazy-loader/

    http://rbrundritt.wordpress.com

    Friday, March 22, 2013 10:11 AM