Why is that? This is used for internal bookkeeping.
> directions response = {
> "Ch":{"origin":"chicago, il","destination":"los angeles,
> ca","travelMode":"DRIVING"},
> "routes": {...},
> "status": "OK"
> }
>
> ...
>
> --
> You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
> To post to this group, send email to google-map...@googlegroups.com.
> To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>
Correct.
******** CODE ********
custom_stringify = function(name, value){
if (/^(lat_lngs|path|overview_path)/.test(name)) {
return google.maps.geometry.encoding.encodePath(value);
} else if (value instanceof google.maps.LatLng){
return 'LL(' + value.lat() + ',' + value.lng() + ')';
} else if (value instanceof google.maps.LatLngBounds){
return 'LB(' +
value.getSouthWest().lat() + ',' + value.getSouthWest().lng() + ',' +
value.getNorthEast().lat() + ',' + value.getNorthEast().lng() + ')';
} else {
return value;
}
}
custom_parse = function(name, value){
if (/^(lat_lngs|path|overview_path)/.test(name)) {
return google.maps.geometry.encoding.decodePath(value);
} else if (/^LL\(/.test(value)){
var match = /LL\(([^,]+),([^,]+)\)/.exec(value);
return new google.maps.LatLng(match[1], match[2]);
} else if (/^LB\(/.test(value)){
var match = /LB\(([^,]+),([^,]+),([^,]+),([^,]+)\)/.exec(value);
return new google.maps.LatLngBounds(new google.maps.LatLng(match[1], match[2]),
new google.maps.LatLng(match[3], match[4]));
} else{
return value;
}
}
_S = function(obj){
return JSON.custom_stringify(obj, custom_stringify);
};
_US = function(str){
return JSON.custom_parse(str, custom_parse);
};