Skip to content

Instantly share code, notes, and snippets.

@amirhp-com
Last active February 28, 2024 16:47
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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");
});
}
@RajPLogicrays
Copy link

I have tested, but it's not working.

@amirhp-com
Copy link
Author

I have tested, but it's not working.

I have not tested it recently but Google might have changed its pattern of showing maps. so, it this does not work I'm sorry.

@RajPLogicrays
Copy link

Okay, thank you :)

@bryanjaybodino
Copy link

Hi Just tried your codes and its working on my end thanks
but since google has added a changes on their script there is another message showing up after my page load
but after a seconds it will automatically close

image

@bryanjaybodino
Copy link

this is the message showing up

image

@amirhp-com
Copy link
Author

Hi, thanks for reaching out. Yes, this message was displayed before, it's because we manipulate the structure of the map and there's no way to get rid of it. But it's worth using the trick, isn't it?

@bryanjaybodino
Copy link

I see but thanks for this code. I think it is ok even if it has that kind of error message since I am using the API for free.
by the way it this is a nice trick

@robotelro
Copy link

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

@levananhtu05012000
Copy link

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