Munzee Map Fixes

Munzee Website Map fixes for September 2018. Adds Satellite Toggle, Fixes Pin Stacking and Removes Outer Zoom Limit

  1. // ==UserScript==
  2. // @name Munzee Map Fixes
  3. // @namespace MunzeeMap
  4. // @version 1.0.2
  5. // @description Munzee Website Map fixes for September 2018. Adds Satellite Toggle, Fixes Pin Stacking and Removes Outer Zoom Limit
  6. // @author MOBlox
  7. // @match https://www.munzee.com/map/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. setInterval(function(){
  14. var x = $('.mapboxgl-marker');
  15. for(var i = 0;i < x.length;i++){
  16. x[i].style.zIndex = x[i].getBoundingClientRect().top * 1 + 1;
  17. }
  18. map.setMinZoom(0);
  19. $('.mapboxgl-popup').css('z-index',10000000)
  20. });
  21. $('.map-box-right-side-menu')[0].innerHTML += '<div id="togsat"><input style="margin-top: 10px; margin-right: 5px; width: 115px;" class="btn btn-success btn-medium-green btn-xs" id="togglesatellite" type="button" value="Toggle Satellite" onclick="toggleSat()"></div>'
  22. // Your code here...
  23. })();
  24. window.satell = false;
  25. window.toggleSat = function(){
  26. if(satell){
  27. streets();
  28. } else {
  29. satellite();
  30. }
  31. satell = !satell;
  32. }
  33. window.satellite = function(){
  34. map.setStyle('https://maps.tilehosting.com/styles/hybrid/style.json?key=2corAGubIXz12RsQ6GGt')
  35. }
  36. window.streets = function(){
  37. map.setStyle('https://maps.tilehosting.com/styles/streets/style.json?key=2corAGubIXz12RsQ6GGt')
  38. }