1


I am using Subgurim asp.net control for Google Maps in ASP.net. The Problem is that I need to show an ARROWED POLYLINE betwwen my two points on map.

Following is my code , but unfortunately I am not able to apply anything for that:

GLatLng from = new GLatLng(FromLan, FromLon);
GLatLng To = new GLatLng(ToLan, ToLon);

GLatLngBounds llbound = new GLatLngBounds(from, To);

GMap2.GZoom = GMap2.getBoundsZoomLevel(llbound);
GMap2.setCenter(llbound.getCenter());


GLatLng inside = llbound.getCenter();
bool isInside = llbound.contains(inside);

GPolyline objpolyline = new GPolyline();
objpolyline.points.Add(from);
objpolyline.points.Add(To);
objpolyline.color = "red";
objpolyline.colorNet = System.Drawing.Color.Red;
objpolyline.clickable = false;
objpolyline.PolylineID = "Route";
objpolyline.geodesic = true;
//Javascript Code
//pts1.push (new GLatLng(lat111, lng222));
//var poly1 =  new BDCCArrowedPolyline(pts1,"#FF0000",4,0.3,
//                                       null,30,7,"#0000FF",2,0.5);
//map.addOverlay(poly1);

GMap2.addPolyline(objpolyline);
//GMap2.addPolyline(objpolyline);

Regards , Vishal

Marc Climent
  • 9,434
  • 2
  • 50
  • 55
Vegeta
  • 291
  • 2
  • 7
  • 20
  • Where are you stuck? Is the polyline displayed? – Shiridish Oct 06 '12 at 11:01
  • yes , the polyline is displayed between the points but it should show the Arrows on the line to show the navigation direction of the journey between points. – Vegeta Oct 06 '12 at 11:06
  • 1
    I doubt there is no such functionality in the subgurim control to get an arrow with the polyline. Correct me if I am wrong. I dint find it in its website. – Shiridish Oct 06 '12 at 11:17

1 Answers1

3

It looks to me like you are using the Google Maps API v2.

Two issues with that:

  1. it is deprecated and could stop working in less than a year.
  2. the Google Maps API v3 now supports "arrowed polylines" natively.
geocodezip
  • 158,664
  • 13
  • 220
  • 245