Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4620758
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:36:13+00:00 2026-05-22T02:36:13+00:00

From the MSDN forums , even copying and pasting the simplest example from the

  • 0

From the MSDN forums, even copying and pasting the simplest example from the Virtual Earth Dev SDK results in the same exception being thrown in IE8 only. However, the same example using http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3 (in place of ?v=6, even though ?v=6 is allegedly forwarded to ?v=6.3) fixes the error.


Note: code shown here is updated to reflect my most recent attempts after following recommendations made–this code is STILL erroring in IE8 only!

I have a page using http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6 to show maps. In IE8 only there is a JS error and the map doesn’t work. The map works beautifully in all other browsers.

Exception thrown and not caught
mapcontrol.ashx?v=6&_=1303145735376,
line 149 character 618137 throw new
VEException(“VEMap:cstr”,”err_invalidelement”,L_invalidelement_text);

Symptoms:

  • The virtual earth library gets loaded just fine.
  • loadMap doesn’t have any syntax errors.
  • The div placeholder for the map exists on the page before, during, and after loadmap() is called.
  • The error gets thrown only around the time loadmap() is called; not when the library loads.
  • The map shows up just fine in all browsers but IE8.
  • All users of IE8 get the error every time (so far as I know all my testers have been on XP, but one may be on Vista).
  • In IE8 a notification pops up about the error, I can get some more info in the script debugger (above). Then no map appears in IE8.

Originally all the JS was linked with script tags. The error still occurred then. I’ve now switched to yepnope for various reasons. The last JS file yepnope loads is one related to the maps, jquery.vemap.js:

(function($){
    $.fn.showMap = function(){
        var jqoThis = this;
        jqoThis.oneTime(1000, "loadVELibrary", function(){
            $.getScript("http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6", function(){
                jqoThis.oneTime(1000, "loadMap", function(){
                    if(typeof(loadmap) == 'function'){ var map = loadmap(); }
                    $(this).oneTime(500, "setZoom", function(){
                        if(typeof(map) == 'object'){ if(typeof(map.SetZoomLevel) == 'function'){ map.SetZoomLevel(13); } }
                    }); // oneTime "setZoom"
                }); // oneTime "loadMap"
            }); // $.getScript
        }); // oneTime "loadVELibrary"
    }; // showMap
})(jQuery);

Basically this exists pretty much just call loadmap(), which is a function written in cooperation with our backend code. The backend code outputs it in the HTML as an embedded script. loadmap() looks like:

function loadmap()
{
    var map = new VEMap('cmMap'),
        arp = [],
        propertyLayer = null,
        propertypoint = null,
        propertyPin = null,
        customicon = null,
        token = '...',
        label = "...";

    map.SetClientToken(token);
    map.LoadMap();                                 
    map.HideDashboard();                

    propertyLayer = new VEShapeLayer();
    map.AddShapeLayer(propertyLayer);

    propertypoint = new VELatLong(parseFloat(33.12966),parseFloat(-117.333488));
    arp[0] = propertypoint;
    propertyPin = new VEShape(VEShapeType.Pushpin,propertypoint);
    customicon = new VECustomIconSpecification();
    customicon.Image = "....";
    propertyPin.SetCustomIcon(customicon);      
    propertyPin.SetDescription(label);
    propertyLayer.AddShape(propertyPin);

    map.SetCenterAndZoom(propertypoint,13);

    return map;             
}

All changes to loadmap() are only made and tested on my local dev machine. So far no adjustments to loadmap() have helped — which isn’t exactly surprising, since the same function is used on other pages with no issues.

As far as fixing it, I have tried:

  • Changing X-UA-Compatible (based on threads I found).

Originally I was using:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

I tried changing it to the below since a few threads mentioned that fixed the issue.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />

I also tried taking X-UA-Compatible out entirely. None of this fixed the issue, I continued to get the error in IE8. Manually toggling compatibility mode also had no effect.

  • Changed the syntax of loadmap(). (See above for last iteration)

    1. Moved pin code so that map.AddShapeLayer(propertyLayer) was done before propertyLayer.AddShape(propertyPin) based on a suggestion on a forum. IE8 still errors.
    2. Moved all the globally declared variables inside the loadmap() function. IE8 still errors.
    3. Ensured VEMap.LoadMap() method was called immediately after SetClientToken (and before HideDashboard & everything else). IE8 still errors.

Example link –redacted–. Please note the example link will not show the fixes I attempt, because it’s live. But since the attempted fixes have not fixed the issue, please ignore that and refer to this post for the up-to-date code that still doesn’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:36:14+00:00Added an answer on May 22, 2026 at 2:36 am

    From the MSDN forums, changing the script call to ?v=6.3 (in place of ?v=6) fixes the error.

    (Even though ?v=6 is allegedly forwarded to ?v=6.3 and the two scripts are supposedly identical!)

    Upgrading to v7 also works, although changes to the syntax of the loadmap() function are necessary to upgrade.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From MSDN: The CancelWaitableTimer function does not change the signaled state of the timer.
I understand the main function of the lock key word from MSDN lock Statement
Where can I find the IIS object schema? All I found from MSDN was
Change Data Capture is a new feature in SQL Server 2008. From MSDN: Change
From the MSDN article on STAThread: Indicates that the COM threading model for an
From the MSDN documentation: Synchronized supports multiple writing threads, provided that no threads are
Quoting from the MSDN Link for ValueType Class In cases where it is necessary
It is unclear to me from the MSDN documentation if I should provide a
I have been playing with the demo code from this msdn article by Jeffrey
Is there an easy way to produce MSDN-style documentation from the Visual Studio XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.