Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

2 Answers 2

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.

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

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

 
discard

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.