Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the esri google maps extension api...

I have a esri.arcgis.gmaps.FeatureSet() (of type esriPolyline) containing an array of features (esri.arcgis.gmaps.Feature()).

Is there a simple way to create a single GPolyline from the array of features?

or since feature[i].geometry is a GPolyline, I guess I am asking is there a simple way to create a single GPolyline by joining/merging multiple GPolylines?

nb: The features returned from arcgis are not ordered... so I have to re-order the features before creating the GPolyline...

share|improve this question
The link you provided now redirects to so I am wondering whether this question (which has no accepted answer) be better of deleted along with those answers? – PolyGeo Apr 8 at 0:14

I didnt get you.But to draw a polygon you can add edting toolbar.No need to go to these functions.Add diting toolbar like map.Control.Editingtoolbar(vector_layer);

share|improve this answer
Thanks for the reply Kiran. However, I don't want to draw a polygon. I have an array of GPolylines that I would like to merge/union into a single GPolyline. Cheers, Michael. – mlo55 Jan 21 '11 at 1:25

You can loop through each feature[i].geometry and call getVertices(i) on the GPolylines, building a new GPolyline from each vertex using insetVertex or the constructor, which will take an array of vertices.

share|improve this answer
Hi Guddie, thanks for the reply. I should have been more explicit in the original question... the problem is that the features are returned in no particular order from arcgis, therefore, I had to re-order the features manually (uurghh...) and then construct the polyline in the manner that you suggest... I was just hoping that there was a method that would do the joining/merging and work out the ordering... FYI - In the non-google arcgis api, the features are returned as ordered polylines/paths...) cheers, Michael – mlo55 Mar 17 '11 at 4:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.