|
49 | 49 | <script src="js/jquery-3.2.1.min.js"></script> |
50 | 50 |
|
51 | 51 | <!-- Change the key below --> |
52 | | - <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBbYDZMGkewhRTGRJS4wwSVuBipYlYf-SU"></script> |
| 52 | + <script type="text/javascript" src="https://maps.google.com/maps/api/js"></script> |
53 | 53 |
|
54 | 54 | <script> |
| 55 | + |
55 | 56 | /////////////////////////////////////////////////////////////////////////// |
56 | 57 | // CONFIGURATION STARTS HERE |
57 | 58 | /////////////////////////////////////////////////////////////////////////// |
|
75 | 76 | var _MAP_UVInvMap = false; |
76 | 77 |
|
77 | 78 | // Set to the IP of the GTA server running "live_map" and change the port to the |
78 | | - // number that is in the "server.lua" file |
| 79 | + // number that is set |
79 | 80 | var _SETTINGS_socketUrl = "ws://localhost:30121" |
80 | 81 |
|
81 | | - </script> |
| 82 | + // Do not remove unless you know what you're doing (and you have a google api key) |
| 83 | + // Hack from https://stackoverflow.com/questions/38148097/google-maps-api-without-key/38809129#38809129 |
| 84 | + // hack Google Maps to bypass API v3 key (needed since 22 June 2016 http://googlegeodevelopers.blogspot.com.es/2016/06/building-for-scale-updates-to-google.html) |
| 85 | + var target = document.head; |
| 86 | + var observer = new MutationObserver(function(mutations) { |
| 87 | + for (var i = 0; mutations[i]; ++i) { // notify when script to hack is added in HTML head |
| 88 | + if (mutations[i].addedNodes[0].nodeName == "SCRIPT" && mutations[i].addedNodes[0].src.match(/\/AuthenticationService.Authenticate?/g)) { |
| 89 | + var str = mutations[i].addedNodes[0].src.match(/[?&]callback=.*[&$]/g); |
| 90 | + if (str) { |
| 91 | + if (str[0][str[0].length - 1] == '&') { |
| 92 | + str = str[0].substring(10, str[0].length - 1); |
| 93 | + } else { |
| 94 | + str = str[0].substring(10); |
| 95 | + } |
| 96 | + var split = str.split("."); |
| 97 | + var object = split[0]; |
| 98 | + var method = split[1]; |
| 99 | + window[object][method] = null; // remove censorship message function _xdc_._jmzdv6 (AJAX callback name "_jmzdv6" differs depending on URL) |
| 100 | + //window[object] = {}; // when we removed the complete object _xdc_, Google Maps tiles did not load when we moved the map with the mouse (no problem with OpenStreetMap) |
| 101 | + } |
| 102 | + observer.disconnect(); |
| 103 | + } |
| 104 | + } |
| 105 | + }); |
| 106 | + var config = { attributes: true, childList: true, characterData: true } |
| 107 | + observer.observe(target, config); |
82 | 108 |
|
| 109 | + </script> |
83 | 110 |
|
84 | 111 | <?php |
85 | 112 | printFirstJs($debug); |
|
0 commit comments