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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:17:09+00:00 2026-05-24T12:17:09+00:00

I am trying to draw polyline but there is some error in in overloading

  • 0

I am trying to draw polyline but there is some error in in overloading method which i can not get why it is resulting in error when i am doing it correctly… my code,

   private void BuildScript(DataTable tbl)
        {
            String Locations = "";
            String locations = "";
            foreach (DataRow r in tbl.Rows)
            {
                // bypass empty rows        
                if (r["Latitude"].ToString().Trim().Length == 0)
                    continue;

                string Latitude = r["Latitude"].ToString();
                string Longitude = r["Longitude"].ToString();
                double latitude = Convert.ToDouble(r["Latitude"]);
                double longitude =Convert.ToDouble(r["Longitude"]);
                var points = new List<GLatLng> {new GLatLng(latitude,longitude)};
                var polyline = new GPolyline(points); 
                // create a line of JavaScript for marker on map for this record    
                Locations += Environment.NewLine + " map.addOverlay(new GMarker(new GLatLng(" + Latitude + "," + Longitude + ")));";
                locations += Environment.NewLine + " map.addOverlay(new GPolyline(new GLatLng(" + Latitude + "," + Longitude + ")));";
            }

            // construct the final script
            js.Text = @"<script type='text/javascript'>
                            function initialize() {
                              if (GBrowserIsCompatible()) {
                                var map = new GMap2(document.getElementById('map_canvas'));
                                map.setCenter(new GLatLng(45.05,7.6667), 2); 
                                " + Locations + @"
                                map.setUIToDefault();
                              }
                            }
                            </script> ";
   js.Text = @"<script type='text/javascript'>
                            function initialize() {
                              if (GBrowserIsCompatible()) {
                                var map = new GMap2(document.getElementById('map_canvas'));
                                map.setCenter(new GLatLng(45.05,7.6667), 2); 
                                " + locations + @"
                                map.setUIToDefault();
                              }
                            }
                            </script> ";
}

now it is giving me error in script polyline does not exsis

Hopes for your reply …

  • 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-24T12:17:10+00:00Added an answer on May 24, 2026 at 12:17 pm

    The GPolyline constructor requires a variable of the type List<GLatLng> and that’s not what your are passing in.

    You need to create your GLatLng values as a List:

    var points = new List<GLatLng> { new GLatLng(59.6919, 17.8582),new GLatLng(59.3030, 18.0395),new GLatLng(58.9789, 17.5341) };
    var polyline = new GPolyline(points,"#ff0000",1); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to draw some boxes in my activity, which will contain other
I'm trying to draw a polygon using c# and directx All I get is
I'm trying to set up something in SDL [in C++] where I can draw
Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation
I am trying to draw a geodesic polyline with Google Maps JavaScript API from
I'm trying to draw a pill type ellipse, as in Apple's Mail application which
I'm currently trying to draw shapes with 2D Arrays. In my class there is
I'm trying to draw a shape on a Canvas and get information about the
I am trying to draw two parallel lines on the canvas, but it seems
I'm trying to draw a map from a textfile onto a Bitmap, but the

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.