Is there a way that OpenLayers.Format.JSON write() method to serialize coordinates using 6 decimals only ?
OpenLayers geometries use 14 significant digits, and the GeoJSON writer simply extracts geometry coordinates using the same number of significant digits:
If you want to limit the number of digits in the GeoJSON writer, you'd need to replace the function to extract points, by putting the following lines in your code:
However you may want to consider why you want to reduce the accuracy of the GeoJSON. Is this to format display to a user? If this is the case the GeoJSON should be left alone, and the rounding of the numbers left to the user interface. It is also not going to save any noticeable network traffic.
write your own method for your json type:
i hope it helps you...