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 7075731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:12:45+00:00 2026-05-28T06:12:45+00:00

Hi all I was playing around with the Google Maps Directions API and in

  • 0

Hi all I was playing around with the Google Maps Directions API and in the documentation, it states:

Directions API URLs are restricted to 2048 characters, before URL Encoding. As some Directions service URLs may involve many locations along a path, be aware of this limit when constructing your URLs.

I am aware that Google will give us a 414 error if we exceed 2048 characters. But I was wondering what’s the best way to handle and inform the user that his request is too long? I do not think that it seems too user friendly to tell the user to “reduce the number of characters in the location textbox”.

In my app, I’ll only allow the user to specify a start location, an end location, and up to 4 waypoints. Most of the other information are not supplied by the user. Taking away the overhead of the other parameters, suffice it to say that I can allow the user to enter a total of 1800 characters for his start location, end location, and 4 waypoints.

I was thinking if it is safe to limit each location to 300 (1800 ÷ 6) characters, such that the user will never have the chance to specify a request which exceeds 2048 characters?

To rephrase the question, is it logical to assume that the name of every possible location on Earth (I do not require support for locations outside of Earth) is within 300 characters? If not 300, what’s a safe number?

  • 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-28T06:12:46+00:00Added an answer on May 28, 2026 at 6:12 am

    This doesn’t directly answer your question, but I would suggest the following work around to the url length limit:

    If the length of your 6 locations is greater than 1800 characters, then geocode the longer locations first. If you send the geocodes instead of the location text, you should fit under the limit. One side effect of doing this is that the geocodes will be in the directions text instead of the location text. You can fix this by modifying the text that is returned from the API and put the original text back in. The API gives you a way to do that. It’s a pain, but it’s a way to get around the limitation.

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

Sidebar

Related Questions

I am playing around with the Google Maps API V3. I want to create
I'm playing around with Twisted and documentation found on their homepage doesn't answer all
I'm brand new to Google App Engine and have just been playing around with
I am playing around with this jquery mega menu plugin and all of the
I've been playing around with this page adding CSS3 styles and all. http://daokun.webs.com/jQuery/Progress.html The
I'm playing around with QFtp (yes .. I know) and all works well. Using
I am trying to write some google map functionlity and playing around with javascript
I've playing around with Google App Engine and Google Datastore for a while now
I am playing around with Google Music. I'm trying to see if I can
I playing around with a function that I want to bind to all the

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.