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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:00:27+00:00 2026-06-04T16:00:27+00:00

I want to draw a polygon by connecting markers in googlemap.Time is associated with

  • 0

I want to draw a polygon by connecting markers in googlemap.Time is associated with each marker.So i want connect each points based on the time.How can i do this.Currently code is impleneted like this.Where i need to change.

       var marker = new Array();
       var points = new Array();
     for(var i=0;i<value.length;i++)
          {
               var tempar=value[i].split(',');
               var center = new GLatLng(tempar[0], tempar[1]);
               var mar = new GMarker(center, icon);
               var imgpth=tempar[3]; 
               var tme=tempar[2];
               marker.push(mar);   
               marker[i].time = tempar[2];
               points.push(marker[i].getLatLng());
               drawMarker(mar,imgpth,tme);                   
        }
          for(i=;i<marker.length;i++)
         {
            map.addOverlay(marker[i]);
          }
           var polyline = new GPolygon(points, "#f33f00", 2, 1, "#ff0000", 0.2);
           map.addOverlay(polyline);
  • 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-04T16:00:28+00:00Added an answer on June 4, 2026 at 4:00 pm

    The easiest way to do this is to sort marker array by time. Assuming that the time property has some sensible values (not strings):

    marker.sort(function(a,b){return a.time-b.time});
    

    If the time is a string then:

    marker.sort(function(a,b) {
     var date1 = new Date(a.time);
     var date2 = new Date(b.time);
     return date1.getTime() - date2.getTime();
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've set of n points and I want to draw a n-sided polygon using
I want to draw a line with thickness in j2me. This can easily be
I want to draw circle, and i want to re size it based on
I want to draw an area from given points on a map using the
I want to draw a widget (in this example, a canvas) and then remove
I want to Draw multiple line Graph with each line have different color and
I want to draw many geo points with Leaflet. Therefore I want to use
I want to draw an arc using canvas using a gradient fill. How can
I want to fill a concave polygon with a simple repeating pattern. I can
i need to draw a polygon of n sides given 2 points (the center

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.