A
A
Alexander Stepanov2019-08-21 17:30:27
JavaScript
Alexander Stepanov, 2019-08-21 17:30:27

How to show Yandex maps in mobile firefox?

Greetings to all colleagues.
Faced with the fact that the display of Yandex api maps in mobile firefox does not work.
Do not send to Google - already received an answer. I'm interested in your opinion.

if ($("#mapContacts").length > 0) {
    
    function init () {
      var multiRoute = new ymaps.multiRouter.MultiRoute({
        referencePoints: [
          [55.80522, 37.580],
          "Москва, Вятская улица, 49с4"
        ],
        params: {
          routingMode: 'pedestrian'
        }
      }, {
        boundsAutoApply: false
      });

      // Создаем карту с добавленной на нее кнопкой.
      var myMap = new ymaps.Map('mapContacts', {
        center: [55.805, 37.579],
        zoom: 16
      });

      // Добавление маршрута на карту.
      multiRoute.model.events.add('requestsuccess', function() {
        // Коллекция путевых точек маршрута.
        var wayPoints = multiRoute.getWayPoints();
        wayPoints.each(function (point) {
          
          switch (point.options._name) {
            case "startWayPoint":
            var iconType = "islands#redStretchyIcon",
              iconTitle = "Проходная";
            break;
            case "finishWayPoint":
            var iconType = "islands#blueStretchyIcon",
              iconTitle = "МосПромДизайн";
            break;
            default:
            var iconType = "islands#redStretchyIcon",
              iconTitle = "Проходная";
            break;
          }
          
          var LayoutClass = ymaps.templateLayoutFactory.createClass(iconTitle);
          
          point.options.set({
            preset: iconType,
            iconContentLayout: LayoutClass
          });
        });
      }); 
      
      myMap.geoObjects.add(multiRoute);
      
      var LayoutClassPlacemark = ymaps.templateLayoutFactory.createClass("Вьезд");
      
      var placemark = new ymaps.Placemark([55.804947602045225,37.57923637603121], {}, {
        preset: 'islands#greenStretchyIcon',
        iconContentLayout: LayoutClassPlacemark
      });
                        
      // Добавление маршрута на карту.
      myMap.geoObjects.add(placemark);	
    }

    ymaps.ready(init);
    
  }


example usage code above.
I ask for help in this situation.
Sincerely.

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