locked
VELatLon is undefined RRS feed

  • Question

  • i get javascript error VELatLon is undefined

    my code is

     

     

    function GetMap()

    {

     

    var map = new Microsoft.Maps.Map(document.getElementById("mapDiv"),

    {credentials:

    "AieWKb8Wj36REkTVdex6oEU_NiZNsFQRHE0VcsrVUKp3Ike-v0zkYL-mv85Fjgk-",

    center:

    new Microsoft.Maps.Location(52.3715211562225, 4.90610388028671),

    mapTypeId: Microsoft.Maps.MapTypeId.road,

    zoom: 15});

     

    map.AddPolyline(AddCircle(52.3715211562225, 4.90610388028671, 500));

    }

     

     

    function AddCircle(latin, lonin, radius)

    {

     

    var locs = new Array();

     

    var lat1 = latin * Math.PI/180.0;

     

    var lon1 = lonin * Math.PI/180.0;

     

    var d = radius/3956;

     

    var x;

     

    for (x = 0; x <= 360; x++)

    {

     

    var tc = (x / 90)* Math.PI / 2;

     

    var lat = Math.asin(Math.sin(lat1)*Math.cos(d)+Math.cos(lat1)*Math.sin(d)*Math.cos(tc));

    lat = 180.0 * lat / Math.PI;

     

    var lon;

     

    if (Math.cos(lat1)==0)

    {

    lon=lonin;

    // endpoint a pole

    }

     

    else

    {

    lon = ((lon1 - Math.asin(Math.sin(tc) * Math.sin(d)/Math.cos(lat1)) + Math.PI) % (2 * Math.PI)) - Math.PI;

    }

    lon = 180.0 * lon / Math.PI;

     

    var loc = new VELatLong(lat,lon);

    locs.push(loc);

    }

     

     

     

    var outlineColor = new VEColor(0,0,255,1);

     

    var fillColor = new VEColor(0,0,255,.2);

     

    var outlineWidth = 5;

     

    var id = 'Colorado';

     

    var poly = new VEPolygon(id, points, fillColor, outlineColor, outlineWidth)

     

    return poly;

    }

     

    can anybody help me

    thankx in advance

    its little aurgent

     


    Anddy
    Monday, November 29, 2010 8:06 AM

All replies

  • I also caught in the same problem.
    Please first do check with the latest script file from the same source.

    what i found is i was using the window.showModalDialog and i replaced it with  window.open. But the url which i was using was the https and not the http. So it was somthing due to the https warning causes the problem.

    After using  window.open the issue was resolved for me.

    Thanks

    Aniket

    Friday, October 11, 2013 10:11 AM