How do I get rid of the "start_lng", "start_lat" and only keep the value (actual longitude and latitude?) see screens...
Hello
I am sorry, not sure I understand you correctly. Please specify your question. Do you need save these parameters for next requests?
I was trying to get a service response, stored as array in local storage, to format as a linestring:
ie LINESTRING(-121.0 37.7, -120.63 36.87, -123.98 38.76)
So I just ran a loop to pull out all the unnecessary characters, but I'm sure there was a better way?
This was to pass into another service request, so it requires that format
Wyatt, please add handler on success event of this service.
There is full service response is available in "data" valiable, so you can manipulate its like simple JS array:
prefor (var i = 0; i < data.length; i++){
var startStr = data.start_lng + " " + data.start_lat;
console.log("start "+ startStr);
}/pre
ok, so data is automatically defined as the incoming/mapped variable?
I just get 'data not defined' when I run that...
Do you use success event? Please send us screenshots with this error and action where you use JS.
Yes, see below. I have tried mapping that from both a storage variable and directly from the service and I get data not defined each time. This is on success event. Is it because I am testing in a non-framed Chrome window(security disabled)?