Клуб API Карт

Открытие балуна на мобильных устройствах

Удалённый пользователь
29 сентября 2016, 13:15

Добрый день, сделал карту с группой объектов, вроде бы все ок, кроме одного, не открывается baloon на мобильных устройствах, подскажите в чем может быть проблема.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
</head>
<body>
<div id="map_json" style="display: none">[{"price":"0","tarifs_type":"2","srok_dostavki":"4-5","pickup_place":"\u0415\u043a\u0430\u0442\u0435\u0440\u0438\u043d\u0431\u0443\u0440\u0433 (\u0410\u043c\u0443\u043d\u0434\u0441\u0435\u043d\u0430)","pickup_places_type_name":"\u0410","address":"\u0443\u043b. \u0410\u043c\u0443\u043d\u0434\u0441\u0435\u043d\u0430, \u0434. 65","proezd_info":"\u0422\u0426  \u041a\u0418\u0422  1 \u044d\u0442\u0430\u0436 - \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432 \u0433\u0438\u043f\u0435\u0440\u043c\u0430\u0440\u043a\u0435\u0442\u0430 \u0420\u0410\u0419\u0422","phone":"8-343-247-81-11","worktime":"\u043f\u043d - \u043f\u0442: 10.00 - 18.00","comission_percent":"1.5","is_terminal":"0","to_city_code":"497183","pickup_place_code":"474570","delivery_partner":{},"partner":{},"is_basic":"1","obl_km_pay":"0","latitude":"56.7868666","longitude":"60.5672618"},{"price":"0","tarifs_type":"2","srok_dostavki":"4-5","pickup_place":"\u0415\u043a\u0430\u0442\u0435\u0440\u0438\u043d\u0431\u0443\u0440\u0433 (\u041c\u0430\u043b\u044b\u0448\u0435\u0432\u0430)","pickup_places_type_name":"\u0410","address":"\u0443\u043b. \u041c\u0430\u043b\u044b\u0448\u0435\u0432\u0430, \u0434.53","proezd_info":"\u0422\u0426   \u0410\u043d\u0442\u0435\u0439   1 \u044d\u0442\u0430\u0436 - \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432  \u041f\u0435\u0440\u0435\u043a\u0440\u0435\u0441\u0442\u043e\u043a ","phone":"8-343-247-81-11","worktime":"\u043f\u043d - \u043f\u0442: 9.00 - 18.00","comission_percent":"1.5","is_terminal":"0","to_city_code":"497183","pickup_place_code":"766233","delivery_partner":{},"partner":{},"is_basic":"1","obl_km_pay":"0","latitude":"56.8366997","longitude":"60.625145"},{"price":"0","tarifs_type":"2","srok_dostavki":"4-5","pickup_place":"\u0415\u043a\u0430\u0442\u0435\u0440\u0438\u043d\u0431\u0443\u0440\u0433 \u041f\u0412\u0417 \u043d\u0430 \u041b\u0435\u043d\u0438\u043d\u0430","pickup_places_type_name":"\u0410","address":"\u043f\u0440-\u043a\u0442 \u041b\u0435\u043d\u0438\u043d\u0430, \u0434. 101","proezd_info":" \u041f\u0440\u043e\u0435\u0437\u0434 \u0434\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438   \u0423\u0440\u0430\u043b\u044c\u0441\u043a\u0438\u0439 \u0444\u0435\u0434\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442  : - \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043d\u044b\u0435 \u0442\u0430\u043a\u0441\u0438: \u2116 034, 029, 050, 030, 054, 040, 022; - \u0430\u0432\u0442\u043e\u0431\u0443\u0441\u044b: \u2116 60, 28, 50, 54, 27, 28, 61, 10, 157, 5, 8; - \u0442\u0440\u0430\u043c\u0432\u0430\u0438: \u2116 23, 32, 18, 4, 22, 15, 13, 8, 26. \u0412\u043e\u0439\u0442\u0438 \u0432\u043e \u0434\u0432\u043e\u0440 \u043f\u0440-\u043a\u0442 \u041b\u0435\u043d\u0438\u043d\u0430 101 (\u0432 \u044d\u0442\u043e\u043c \u0434\u043e\u043c\u0435: \u0411\u0430\u043d\u043a \u0412\u0422\u041124,\u041b\u0435\u0442\u0443\u0430\u043b\u044c,\u041f\u043e\u043b\u044c \u0411\u0435\u0439\u043a\u0435\u0440\u0438), \u043f\u0440\u043e\u0439\u0442\u0438 \u043f\u043e\u0434 \u0432\u044b\u0432\u0435\u0441\u043a\u0443   \u043f\u0443\u043d\u043a\u0442 \u0432\u044b\u0434\u0430\u0447\u0438 \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432   \u0441\u0442\u0435\u043a\u043b\u044f\u043d\u043d\u0430\u044f \u0434\u0432\u0435\u0440\u044c, \u0446\u043e\u043a\u043e\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u0436. ","phone":"+7(343)287-3-284","worktime":"\u041f\u043d-\u041f\u0442 10:00-21:00","comission_percent":"1.5","is_terminal":"0","to_city_code":"497183","pickup_place_code":"740531","delivery_partner":{},"partner":{},"is_basic":"1","obl_km_pay":"0","latitude":"56.8396463","longitude":"60.6134245"}]</div>
<div id="map" style="height:500px; widht: 700px; margin-bottom: 20px"></div>
<script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"> </script>
<script>
    function yMapsPickup() {
        ymaps.ready(function () {
            var arPickup =  $.parseJSON($('#map_json').text());
            var myGeocoder = ymaps.geocode('Екатеринбург');
            myGeocoder.then(
                    function (res) {
                        var firstGeoObject = res.geoObjects.get(0);
                        var myMap = new ymaps.Map('map', {
                            center: firstGeoObject.geometry.getCoordinates(),
                            zoom: 10,
                            controls: ["zoomControl"]
                        });
                        myMap.behaviors.disable('scrollZoom');
                        var myGeoObjects = [];
                        $.each(arPickup, function(key ,row){
                            if(row.price == undefined){
                                row.price = 0;
                            }
                            myGeoObjects[key] = new ymaps.GeoObject({
                                geometry: {
                                    type: "Point",
                                    coordinates: [row.latitude, row.longitude]
                                },
                                properties: {
                                    balloonContentHeader: 'инфа',
                                    balloonContentBody: '<h4> '+row.pickup_place+'</h4>'+
                                    '<b>Адрес:</b> '+row.address+'<br>'+
                                    '<b>Проезд:</b> '+row.proezd_info+'<br>'+
                                    '<b>Тел.:</b> '+row.phone+'<br>'+
                                    '<b>Режим работы.:</b> '+row.worktime+'<br>'+
                                    '<b>Срок доставки:</b> '+row.srok_dostavki+'<br>'+
                                    '<b>Цена:</b> '+row.price+'<br>'
                                }
                            });
                        });
                        var myClusterer = new ymaps.Clusterer();
                        myClusterer.add(myGeoObjects);
                        myMap.geoObjects.add(myClusterer);
                    },
                    function (err) {
                        console.log('error');
                    }
            );

        })
    }
    $(function () {
        yMapsPickup();
    });
</script>
</body>
</html>