Select to view content in your preferred language

Joining Multiple Polylines

2021
2
01-19-2011 04:50 PM
MichaelLove
Emerging Contributor
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.geometry is a GPolyline, I guess I am asking is there a simple way to create a single GPolyline by joining/merging multiple GPolylines?

FYI - I also asked this question here
0 Kudos
2 Replies
HemingZhu
Frequent Contributor
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.geometry is a GPolyline, I guess I am asking is there a simple way to create a single GPolyline by joining/merging multiple GPolylines?

FYI - I also asked this question here


There are a couple of ways to achieve this. 1. using geometry service's union(geometries, callback?, errback?) method. 2. using Polyline's addPath(points or path or pointJson) method.
0 Kudos
MichaelLove
Emerging Contributor
Hi Heming,

thanks for the prompt reply.

There are a couple of ways to achieve this. 1. using geometry service's union(geometries, callback?, errback?) method. 2. using Polyline's addPath(points or path or pointJson) method.


With regards to your responses...

1. I had a look at the Geometry service rest api page (/arcgis/rest/services/Geometry/GeometryServer), I don't appear to have a "Union" function available, only "Project",   "Simplify", "Buffer", "Areas And Lengths", "Lengths"

2. I'm using the arcgis Google Maps api, the esri.geometry.Polyline.addPath method (or class) is not available in the .js library (http://serverapi.arcgisonline.com/jsapi/gmaps/?v=1.6). Also, the arcgis js library uses the V2 google maps api (now deprecated)), so the google maps V3 methods are not available either.

thanks again for the assistance,

cheers,

Michael
0 Kudos