3

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

1
  • The link you provided now redirects to esri.com/landing-pages/products/google-lp so I am wondering whether this question (which has no accepted answer) be better of deleted along with those answers?
    – PolyGeo
    Commented Apr 8, 2016 at 0:14

2 Answers 2

1

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

1
  • 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
    Commented Jan 21, 2011 at 1:25
1

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

1
  • 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
    Commented Mar 17, 2011 at 4:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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