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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:16:24+00:00 2026-05-15T21:16:24+00:00

I’ve been given some encoded polylines to display on a google map. However I’m

  • 0

I’ve been given some encoded polylines to display on a google map. However I’m using JQuery for a lot of the front end functions and am now stuck trying to find the correct syntax for displaying encoded polylines using JQuery. The standard syntax for adding an encoded polyline is

var polyline = new GPolyline.fromEncoded({
  color: "#0000ff",
  weight: 4,
  opacity: 0.8,
  points: "_gkxEv}|vNM]kB}B}@q@YKg@IqCGa@EcA?c",
  levels: "P@B@D??@@?D?CA?B",
  zoomFactor: 2,
  numLevels: 18
});
map.addOverlay(polyline);

Obviously this doesn’t work with JQuery. to add a normal polyline with JQuery you’d use

new google.maps.Polyline({
            path: stationPathCoordinates1,
            strokeColor: "#20B5B3",
            strokeOpacity: 1.0,
            strokeWeight: 4

Where StationPathCoordinates is the array of long and lats. I now have this array in an encoded polyline. I assumed it may be new google.maps.Polyline.fromEncoded but this doens’t work. Anyone know the syntax for this in JQuery or if it even possible?

Thanks in advance

  • 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-15T21:16:25+00:00Added an answer on May 15, 2026 at 9:16 pm

    As @belugabob pointed out already, there shouldn’t be any reason for conflicts with jQuery in general while using APIs like the Google Maps JavaScript API.

    That said, and without seeing a full example, I can only deduce the following:

    • The two code fragments you are presenting seem to stem from two entirely different versions of the Google Maps JavaScript API, namely Google Maps JavaScript API V2 for the former and Google Maps JavaScript API V3 for the latter (see section PolylineOptions object specification there).

      • The V2 API version has been deprecated as of may 19, 2010, but will be supported for a period of 3 years as per Googles respective deprecation policy.

      • The V3 API version does not (yet) support encoded polylines, see Thors answer to point 5 in this migration to V3 thread (see Encoded polylines vs Polyline class for some background on this change, if desired).

    So in case you need to maintain using encoded polylines you have two options:

    1. Continue to use the V2 API, which implies making your first code fragment work as it should; you’ll need to provide more details then for us to figure out what’s wrong with your code (as jQuery is most likely not to blame here!), two points upfront though:

      • Best guess: the API version mix and your comment regarding belugabobs question is suggesting that you might simply be missing some or including the wrong dependencies!

      • Another observation: at least according to the Interactive Polyline Encoder Utility the encoded points and levels in your first code fragments do not match.

    2. Upgrade to the V3 API, which implies decoding your encoded polylines to an Array or MVCArray of LatLng. I’m not aware of an official example, but for a starting point you could look into Esas answer within the Encoded polylines? thread, which is pointing towards thedecodeLine() function in the Google Polyline Utility source code as well as a sample decoder.

    Good luck!

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

Sidebar

Ask A Question

Stats

  • Questions 534k
  • Answers 534k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It uses the Windows account information from the ASP.NET AppDomain… May 17, 2026 at 12:41 am
  • Editorial Team
    Editorial Team added an answer You should use jQuery.load() to load only a HTML fragment… May 17, 2026 at 12:41 am
  • Editorial Team
    Editorial Team added an answer Right so it looks like there is a bug with… May 17, 2026 at 12:41 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I'm looking for suggestions for debugging... If you view this site in Firefox or
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to count how many characters a certain string has in PHP, but

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.