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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:07:42+00:00 2026-06-07T13:07:42+00:00

Based on the Google Maps JavaScript API v3 documentation , google.maps.Polygon class’s getPath() function

  • 0

Based on the Google Maps JavaScript API v3 documentation, google.maps.Polygon class’s getPath() function returns an MVCArray. In a straightforward case, a Polygon’s path can be a single array of LatLngs that are converted to the MVCArray type upon being passed into the google.maps.Polygon class’s setPath() function.

The above case is what I’m dealing with currently. I pass in an array of LatLngs, and return (what I assume is) an MVCObject when I call getPath() on my Polygon object. My question is: How do I convert this MVCObject back into a single array of LatLngs that form the Polygon’s shape? Is there some built in Google Maps API v3 way that I’m missing? I feel like there has to be some sort of obvious built in conversion function or something in the API that’s eluding me.

Any help would be appreciated.

  • 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-07T13:07:45+00:00Added an answer on June 7, 2026 at 1:07 pm

    When you call Polygon.getPath()api-doc, the return is an MVCArrayapi-doc of LatLng instances that represent the first path of the Polygon. You can directly get to the members of the MVCAarray in two ways:

    1. Call MVCAarray.getArray, which will return the underlying JavaScript Array that contains LatLng members.
    2. Use MVCArray.getAt( index ), which will return whatever is at that index in the MVCArray (a LatLng in this case). This provides you a way to setup a JavaScript for loop to iterate over the members of the array.

    You can also indirectly work with the members of the MVCArray by using the forEach(callback:function(*, number)) function. In this case, you must pass a callback function that accepts two parameters:

    1. The actual member element of the MVCArray.
    2. The array index where that element is located.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a Java Webapp based on the Google Maps Javascript 3.0 API. I'm
I have a function that geo-tags items using Google Maps API based on basic
My web application is based on Google Maps API and I have problems trying
I am planning to build a web application highly based on Google Maps API.
I'm trying to create map (using the Google Maps JavaScript API V3 ) which
I took two simple examples from Google Maps v.3 Documentation https://code.google.com/apis/maps/documentation/javascript/examples/maptype-base.html google-maps-utility-library-v3.googlecode.com/svn/tags/markermanager/1.0/examples/weather_map.html And I
I use Google Maps js API v3. I can show directions with waypoints based
I've made an application based on the Google Maps API. The problem is that
Looking through the Google Maps Javascript v3 API it looks like if I want
Isn't it any longer possible in Google Maps API V3 (JavaScript) to display a

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.