E
E
edmoiseenkoff2014-01-25 17:58:21
JavaScript
edmoiseenkoff, 2014-01-25 17:58:21

How to reduce the length (size) of coordinates in the Yandex.Maps API?

Good afternoon!
There is the following code:

<!DOCTYPE html>

<html>
<head>
  <title>Примеры. Метка</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <script src="//api-maps.yandex.ru/2.1-dev/?load=package.full&lang=ru-RU" type="text/javascript"></script>
  <script type="text/javascript">
    ymaps.ready(init);
  
    function init () {
      var myMap = new ymaps.Map("map", {
        center: [55.760000, 37.640000],
        zoom: 10
      });
      
      myMap.events.add(['click'], function(e){
        console.log(e.get('coords'));
      });
    }
  </script>
</head>

<body>
  <div id="map" style="width:700px; height:700px"></div>
</body>
</html>

http://jsbin.com/Edetupo/5/edit
The essence of the code, when you click on the map, the coordinates of the click are displayed, after the comma there are ~ 14 characters in the coordinates. The question is, is it possible to somehow reduce this number to 6 using Yandex?
Thanks a lot!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
KlonD90, 2014-01-25
@KlonD90

By means of Yandex - no. What is the problem with using toFixed ?

A
Andrey Gurtovoy, 2014-01-28
@jt3k

jsbin.com/EtIzepU/1/edit

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question