Buffer the distance between 2 destinations?

2912
9
12-11-2015 01:10 PM
MuraliSridhar
New Contributor

Hi, I am new to ArcGIS javascript API, any help on the below questions will be appreciable.

a) Is there any way to buffer the distance between 2 destinations?

b) How to add multiple destinations ?

Thanks in advance.

Regards

Murali

Tags (1)
0 Kudos
9 Replies
RickeyFight
MVP Regular Contributor

Murali,

This should work for question 2:

Here is the api for directions:

Directions | ArcGIS API for JavaScript

What do you mean by buffer? distance?

0 Kudos
MuraliSridhar
New Contributor

Thanks. But I need to load the destinations while loading the widgets, not by clicking Add destination? Is there any way to do that?

Regarding buffer & distance,

Let me explain more about my requirement.

a) I have to buffer the distances between two given location.

Ex: If I enter Location 1 as start destination and Location 2 as stop destination, I need to buffer the distance  between the locations. Since directions object is not returning geometries, how to buffer the distance is there any possibilities for that?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Murali,

   The BufferParameter class can take an array of geometries to buffer.

Is there any way to buffer the distance between 2 destinations?

I don't understand this question can you provide more detail or clarification?

0 Kudos
MuraliSridhar
New Contributor

Yes, BufferParameter class can take an array of geometries to buffer. But I want to buffer the distance between the given destination.

Let me explain more about my requirement.

a) I have to buffer the distances between two given location.

Ex: If I enter Location 1 as start destination and Location 2 as stop destination, I need to buffer the distance  between the locations. Since directions object is not returning geometries, how to buffer the distance is there any possibilities for that?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Murali,

   You would take the two points and create a Polyline from then and then send that Polyline geometry to the GeometryService lengths method first and then based on that result then do the buffer.

0 Kudos
MuraliSridhar
New Contributor

Yes, I too thought about that but I may not have point to draw Polyline. I may have name or address of the start and end locations. Is there any way to create points for the given name or address.

Thanks for your reply.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Since directions object is not returning geometries

Why is the directions object not returning the geometries?

0 Kudos
MuraliSridhar
New Contributor

I didn't find any directions method returns geometry for start and end destination

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Murali,

   Sure the Directions dijit has a directions-finish event that returns a RouteResult object which has stops property