none
i have a problem passing values to route service in IE7 RRS feed

  • Question

  • i have this code which calculate route between tow places

    function createDrivingRoute()
          {
    		 $("#nav").html("");//CLEAR HTML
            if (!directionsManager) { createDirectionsManager(); }
            directionsManager.resetDirections();
            // Set Route Mode to driving 
           
            directionsManager.setRequestOptions({ drivingPolylineOptions:{ strokeColor: new Microsoft.Maps.Color(150, 255, 51, 51), strokeThickness: 8 },distanceUnit: Microsoft.Maps.Directions.DistanceUnit.kilometers,routeOptimization: Microsoft.Maps.Directions.RouteOptimization.shortestDistance,routeMode: Microsoft.Maps.Directions.RouteMode.driving });
            var seattleWaypoint = new Microsoft.Maps.Directions.Waypoint({ address: fromtxt ,location: new Microsoft.Maps.Location(plat, plng)});
            directionsManager.addWaypoint(seattleWaypoint);
            var tacomaWaypoint = new Microsoft.Maps.Directions.Waypoint({ address: totxt, location: new Microsoft.Maps.Location(mlat, mlng) });
            directionsManager.addWaypoint(tacomaWaypoint);
             
            // Set the element in which the itinerary will be rendered
            directionsManager.setRenderOptions({ itineraryContainer: document.getElementById('nav') });
           
            directionsManager.calculateDirections();
         
          }
    


    where plat,plng ,mlat,mlng are global variable i set them using jquery attr method

    this example is working fine for all browser but not ie7 or ie8

    it gives me this error:

    line:2

    char :141845

    Error : 'undefined' is null or not an object

    code:0

    and it stop working 

    //

    using firefox console i get this error but it still working

    [10:37:03.054] uncaught exception: InvalidOperation: Matrix3D.invert

     

     

    • Moved by Ricky_Brundritt Saturday, March 10, 2012 10:48 AM (From:Bing Maps: Map Control and Web services Development)
    Monday, September 12, 2011 8:37 AM

Answers

  • for who has this question best helbful answer was

    (enclose all code inside $(window).load , not $(document).ready)

    and also convert my (plat,plng,mlat,mlng) to float using parseFloat

     

    and that's all :D 

    • Marked as answer by samymassoud Monday, September 12, 2011 10:32 AM
    Monday, September 12, 2011 10:31 AM