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

  • SEARCH
  • Home
  • 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 8154205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:15:48+00:00 2026-06-06T16:15:48+00:00

I am encountering a very strange error with my project. I normally use the

  • 0

I am encountering a very strange error with my project. I normally use the version flag “3”, but today I started getting errors, and rolling back to “3.8” fixes the issue.

In the header of my routing file, I have a couple of variables like so:

var SERVICE = new google.maps.DirectionsService(),
    SERVICE_OPTIONS = {
        "avoidTolls": false,
        "avoidHighways": false,
        "optimizeWaypoints": false,
        "provideRouteAlternatives": true,
        "unitSystem": google.maps.DirectionsUnitSystem.METRIC,
        "travelMode": google.maps.DirectionsTravelMode.DRIVING
    };
var RENDERER = new google.maps.DirectionsRenderer(),
    RENDERER_OPTIONS = {
        "draggable": true,
        "preserveViewport": false,
        "suppressMarkers": false,//true,
        "suppressPolylines": false,
        "suppressInfoWindows": true,
        "polylineOptions": {
            "strokeColor": "#9900ff",
            "strokeOpacity": 0.5,
            "strokeWeight": 4
        }
    };

And way down near the bottom I have a method to

function route(zoomToResults,mode) {
    RENDERER_OPTIONS.preserveViewport = !zoomToResults;
    RENDERER.setOptions(RENDERER_OPTIONS);  // error is thrown here
    /* more code, and then */
    SERVICE.route(SERVICE_OPTIONS,parseRouteResults);
};

I have not changed the code, I just noticed I get an error now when I try to use RENDERER.setOptions() before receiving the route results. The error I get is Uncaught TypeError: Cannot read property 'travelMode' of undefined, and is not thrown in 3.8.

Is this a bug with Google’s API or a change to the way they’ve implemented their code internally that does not account for this exception?

  • 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-06-06T16:15:51+00:00Added an answer on June 6, 2026 at 4:15 pm

    I found my answer…

    From now on, DirectionsRenderer.setOptions() must be invoked with a DirectionsResult added to your DirectionsRendererOptions literal.

    This throws an error:

    RENDERER.setDirections(results);
    RENDERER.setOptions(RENDERER_OPTIONS);
    

    This works:

    RENDERER_OPTIONS.directions = results;
    RENDERER.setOptions(RENDERER_OPTIONS);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm encountering a strange issue, where sqlsrv_query() returns a valid statement resource, but sqlsrv_fetch_array()
I'm encountering a very annoying error using Core Data on Mac OS X 10.5.
I'm encountering a very strange problem using g++ 4.1.2. I have a very basic
I'm writing a very basic Facebook app, but I'm encountering an issue with cross-domain
I'm encountering a very strange when I insert a new record into a table
I have been encountering this error for my project, which involves working with Digital
I'm encountering a very strange issue while debugging a unit test. If I debug
I'm encountering a very strange problem: my delete actions in rails don't work anymore.
I am encountering a very strange issue I wonder if anyone has seen before.
I am encountering some very strange behaviour with a Flex 4.1 app I am

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.