Skip to content

Instantly share code, notes, and snippets.

@amirhp-com
Last active July 9, 2024 05:58
Show Gist options
  • Save amirhp-com/1f30132afbb54970930690d06dc9a764 to your computer and use it in GitHub Desktop.
Save amirhp-com/1f30132afbb54970930690d06dc9a764 to your computer and use it in GitHub Desktop.
Remove Google Map "FOR DEVELOPMENT PURPOSES ONLY" Watermark !
/*
πŸ“ Remove "For Development Only" Watermark on GOOGLE MAP 😁
πŸ‘€ SCRIPT BY AmirhpCom ( https://amirhp.com/) πŸ‘‘
βž• Add this code on your project and edit langID,mapCanvas variables
*/
var langID = "en-US", mapCanvas = "#map-canvas", $ = jQuery;
setInterval(function () {googlemap_remap();}, 10);
function googlemap_remap() {
$(`${mapCanvas}>div:last-of-type`).hide(); //hide top message says this is for dev only
var gimg = $(`img[src*="maps.googleapis.com/maps/vt?"]:not(.gmf)`);
$.each(gimg, function(i,x){
var imgurl = $(x).attr("src");
var urlarray = imgurl.split('!');
var newurl = ""; var newc = 0;
for (i = 0; i < 1000; i++) {if (urlarray[i] == "2s"+langID){newc = i-3;break;}}
for (i = 0; i < newc+1; i++) {newurl += urlarray[i] + "!";}
$(x).attr("src",newurl).addClass("gmf");
});
}
@robotelro
Copy link

It only works for the street layer, not for the terrain one

@tus512
Copy link

tus512 commented Dec 9, 2023

this is the message showing up

image

You can turn off this alert by adding this javascript code:

var buttons = document.querySelectorAll(".dismissButton");
buttons.forEach(function (button) {
      button.click();
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment