A
A
Alexander Ivanov2017-07-03 11:19:00
MODX
Alexander Ivanov, 2017-07-03 11:19:00

Why did json markers stop working on Yandex map?

On modx I created a page that outputs json
data type json
But the page began to send a 404 error, and only on some browsers.
__________________
On a site with https it works everywhere, but on a site with http only on chrome. What could be the problem?
js code

<script src="//api-maps.yandex.ru/2.1/?lang=ru-RU" type="text/javascript"></script>
    <script>
        ymaps.ready(init);

        function init () {
            var myMap = new ymaps.Map('map', {
                    center: [59.96315146,30.30256405],
                    zoom: 8,
                    controls: ['zoomControl','fullscreenControl']
                }),
                objectManager = new ymaps.ObjectManager({
                    // Чтобы метки начали кластеризоваться, выставляем опцию.
                    clusterize: true,
                    
                    // ObjectManager принимает те же опции, что и кластеризатор.
                    gridSize: 32
                });
                
            // Чтобы задать опции одиночным объектам и кластерам,
            // обратимся к дочерним коллекциям ObjectManager.
            objectManager.objects.options.set('preset', 'islands#blueLeisureCircleIcon');
            
            objectManager.clusters.options.set('preset', 'islands#invertedBlueClusterIcons');
            myMap.geoObjects.add(objectManager);
        
            $.ajax({
                url: "/markers.json"
            }).done(function(data) {
                objectManager.add(data);
            });
        
        }
    </script>

json code
{
    "type": "FeatureCollection",
    "features": [
        {"type": "Feature", "id": 63, "geometry": {"type": "Point", "coordinates": [ 59.90133189,29.74274295 ]}, 
"properties": {"balloonContent": "<h2>Рвап</h2>"},
"options": {"iconLayout": "default#image","iconImageHref":"/assets/templates/svg/logo.svg"} },
{"type": "Feature", "id": 62, "geometry": {"type": "Point", "coordinates": [ 60.17465495,29.87140865 ]}, 
"properties": {"balloonContent": "<h2>ыпыв</h2>"},
"options": {"iconLayout": "default#image","iconImageHref":"/assets/templates/svg/logo.svg"} },
{"type": "Feature", "id": 5, "geometry": {"type": "Point", "coordinates": [ 60.0725645,30.03315032 ]}, 
"properties": {"balloonContent": "<h2>Роывп</h2>"},
"options": {"iconLayout": "default#image","iconImageHref":"/assets/templates/svg/logo.svg"} }
    ]
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question