Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I need to remove the tabindex the map on my page. I used the code below but the tab passes through the markers on the map and the Google logo.

var map = new google.maps.Map(document.getElementById('map'),
            mapOptions);

    //Remove o TAB do mapa
      google.maps.event.addListener(map, 'tilesloaded', function() {
          var mapContent = (document.getElementById("map"));
          mapContent('a').attr('tabindex',-1);          
      });
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
756 views
Welcome To Ask or Share your Answers For Others

1 Answer

Building off Vasil's answer

google.maps.event.addListener(MAP, "tilesloaded", function(){
    [].slice.apply(document.querySelectorAll('#map a')).forEach(function(item) {
        item.setAttribute('tabindex','-1');
    });
})

Here is it in action.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...