Select to view content in your preferred language

Closest point on a polyline to an input point

4037
12
05-24-2011 08:42 AM
SamBishop
Deactivated User
Does anyone know the simplest way to return the closest point on a polyline to an input point using the javascript api with/without a geometry service?  Perhaps I need to publish my own geoprocessing service to best achieve this functionality?  Any pointers would be useful...thanks
0 Kudos
12 Replies
AlistairRoss
New Contributor
I've been following the example given by Jian but am struggling to get it to work. The issue seems to be related to the spatial reference of the data that I'm using (British National Grid : WKID 27700) because the API throws a javascript error when trying to access info.valid[0] and info.valid[1]. These properties seem to come from an object returned by a call to _c.spatialReference._getInfo() where _c I believe is the map object.

The spatialReference._info array only has items for WGS_1984_Web_Mercator_Auxiliary_Sphere (WKID 3857), GCS_WGS_1984 (WKID 4326), WGS_1984_Web_Mercator_Auxiliary_Sphere (WKID 102100) and WGS_1984_Web_Mercator (WKID 102113).

So the way to fix it seems to be to get an item for British National Grid into that array .. does anyone have any ideas as to what I would need to do to achieve that?

EDIT: For extra info, I'm running ArcGIS Server 9.3.1 and using javascript API version 2.3.
0 Kudos
JianHuang
Deactivated User
Alistair,

This will be fixed in the next release. Sorry for the inconvenience.
0 Kudos
HaroldBostic
Frequent Contributor
Has this been fixed?
0 Kudos