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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:45:34+00:00 2026-05-26T15:45:34+00:00

I have a problem when constructing a polygon. The error message says something like:

  • 0

I have a problem when constructing a polygon. The error message says something like:

Invalid value for constructor parameter 0: (49.27862248020283, -122.79301448410035),(49.277964542440955, -122.79370112960816),(49.278524490028595, -122.7950207764435)

It must be something ridiculously simple, but I just can’t see it. Any tips you have are useful.

I’m basically painting a map inside an iframe on a modal window (with wicket). Everything is ok, but when I’m trying show a polygon (the points are loaded from a database and sent by webservice) I get the error message.

iframe code: (only the relevant)

 /**
 * Draws the polygon.
 */
function drawPolygon() {
    if (order >= 3) {
        deleteMarkers();

    // Construct the polygon
    // Note that we don't specify an array or arrays, but instead just
    // a simple array of LatLngs in the paths property


    polygonObject = new google.maps.Polygon({
                        paths: polygonCoords,
                        strokeColor: "#FF0000",
                        strokeOpacity: 0.8,
                        strokeWeight: 2,
                        fillColor: "#FF0000",
                        fillOpacity: 0.35
                      });

    polygonObject.setMap(map);

    isPolygonDrawed = true;

    //After we create the polygon send the points to wicket
    parent.sendPoints();

    //Change the message on the top label
    controlText.style.color = '#ADAAAA';
    controlText.innerHTML = polygonCreated;

    //With this we make sure no other markers are created after the polygon is drawed.
    //Is assigned (order - 1) because when this code is called the order has already been added 1.
    MAX_POLYGON_VERTEX = order - 1;

    //Disable the create polygon button.
    enable = false;
    createControlText.style.color = '#ADAAAA';
}
else alert(alertMessage);

}

Now the code on the parent (the modal window)

    /**
 * Show the polygon on map.
 */
function showPolygon(zoneId) {
    var url = applicationRootUrl + 'zonePointsOnMap?zoneId=' + zoneId;
    $.getJSON(url, function(data) {
        if(data.length == 0) {
            return false;
        }
        frames['zoneMapIFrame'].order = parseInt(data.length);
        alert(data.length);
        $.each(data, function(i, item) {
            if(item != null) {
                if(item.latitude != null && item.longitude != null) {
                    var lat = parseFloat(item.latitude);
                    var lng = parseFloat(item.longitude);
                    var latlng = new google.maps.LatLng(lat, lng);
                    var pointOrder = item.order;
                    frames['zoneMapIFrame'].polygonCoords[pointOrder] = latlng;
                    alert(item.order + " point " + latlng);
                    frames['zoneMapIFrame'].bounds.extend(latlng);
                 }

            }

          });
    });
    setTimeout("frames['zoneMapIFrame'].drawPolygon()", 200); 
    setTimeout("frames['zoneMapIFrame'].fitMapZoomPolygon()", 300);
}

I can see that the points are loaded ok with alerts, but I keep getting the error message.

Help me!

  • 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-26T15:45:35+00:00Added an answer on May 26, 2026 at 3:45 pm

    I was having the same problem.
    Don’t know if its the best solution, probably not, but it worked for me.

    The problem was that the Latlng weren’t being recognized. So I recreated the array.

    var lats = [];
    var lat_size = steps[step].lat_lngs.length;
    
    for (var t=0; t <lat_size; t++) {
    
    lats.push(new google.maps.LatLng(steps[step].lat_lngs[t].lat(), steps[step].lat_lngs[t].lng()))
              }
    var polylineOptions = {
    map: map,
    path: lats
     }
    
    new google.maps.Polyline(polylineOptions);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem with ActionLink. I'd like to pass to my ActionLink parameter for
I have problem with cakephp's Session->write method. If I set a value like $_SESSION['..']
I am constructing a URL and I have escape($('#count_of_stations').html() The problem is the value
I have a problem constructing a DSL in Clojure. This is the concrete problem
I'm constructing a datagrid in Windows Presentation Foundation, and I have a problem. When
I have problem in some JavaScript that I am writing where the Switch statement
I have problem with return statment >.< I want to store all magazine names
I have problem with starting processes in impersonated context in ASP.NET 2.0. I am
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem when I try insert some data to Informix TEXT column via

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.