In php, I gather geocoords and round them. The results dumped are as expected:
Array(
[0] => Array
(
[0] => 37.76073
[1] => -122.439948
)
[1] => Array
(
[0] => 37.973535
[1] => -122.531087
)
[2] => Array
(
[0] => 37.973535
[1] => -122.531087
)
)
( The duplicates are also expected. ) Then I pass them into javascript for use on a map:
var locations = <?php echo json_encode( $geo_locations ); ?>;
But when I log locations to the console, the values have changed for the 2nd element:
0: (2) [37.76073, -122.439948]
1: (2) [37.97368106291033, -122.53094093708967]
2: (2) [37.973535, -122.531087]
I've never seen this behavior before. Is it due to json_encode? Or something else?