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...

link|improve this question
feedback

2 Answers

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);

link|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
feedback

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.

http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GPolyline

link|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
feedback

Your Answer

 
or
required, but never shown

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