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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:12:56+00:00 2026-06-13T12:12:56+00:00

I am new in javascript and Google map api, so i have encoded points

  • 0

I am new in javascript and Google map api, so i have encoded points like this: “yzocFzynhVq}@n}@o}@nzD” and trying to draw polyline with it, I haven’t found topics or docs to solve my problem. There are few topics how to decode it, but I don’t need to do that thing. I just need to draw polyline using encoded points. Could somebody give me example?

  • 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-13T12:12:57+00:00Added an answer on June 13, 2026 at 12:12 pm

    See the geometry library documentation for decodePath

    That will convert your encoded string into an array of google.maps.LatLng objects that can be used to create a Polyline

    Working example

    working code snippet:

    function initialize() {
      var myLatLng = new google.maps.LatLng(24.886436490787712, -70.2685546875);
      var mapOptions = {
        zoom: 13,
        center: myLatLng,
        mapTypeId: google.maps.MapTypeId.TERRAIN
      };
    
      var bermudaTriangle;
    
      var map = new google.maps.Map(document.getElementById('map_canvas'),
        mapOptions);
    
    
      // Construct the polygon
      bermudaTriangle = new google.maps.Polygon({
        paths: google.maps.geometry.encoding.decodePath("yzocFzynhVq}@n}@o}@nzD"),
        strokeColor: '#FF0000',
        strokeOpacity: 0.8,
        strokeWeight: 2,
        fillColor: '#FF0000',
        fillOpacity: 0.35
      });
    
      bermudaTriangle.setMap(map);
      map.setCenter(bermudaTriangle.getPath().getAt(Math.round(bermudaTriangle.getPath().getLength() / 2)));
    }
    google.maps.event.addDomListener(window, 'load', initialize);
    html,
    body {
      height: 100%;
      margin: 0;
      padding: 0;
    }
    #map_canvas {
      height: 100%;
    }
    @media print {
      html,
      body {
        height: auto;
      }
      #map_canvas {
        height: 650px;
      }
    }
    <script src="https://maps.googleapis.com/maps/api/js?libraries=geometry&key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk"></script>
    <div id="map_canvas"></div>
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this simple hello world version of a google map api javascript v3
I have a google map in a page (Using the Javascript API v3) the
I have a Google map I created in Javascript using the v3.8 api: var
I'm trying to show a custom map using the Google Maps Javascript API. In
I'm new to JavaScript and the Google Maps API v3. I'm trying the Developer's
I would like to have a panel with a google map using google's javascript
I have the following code( to draw a map using google map API V3):
I am new to the Google Maps API v3 and new to Javascript in
New to javascript, but I'm sure this is easy. Unfortunately, most of the google
using javascript google-maps api I currently have it setup to remove a maker I

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.