Skip to content Skip to sidebar Skip to footer

Google Maps API V3 Remove "Click To See This Area On Google Maps" Link

I know that it is against the Google Maps API ToS to remove the Google branding or the ToS link that are overlaid across the bottom of the map, but I'm using the maps API to displa

Solution 1:

You could always use JavaScript to make the link do nothing after the map has loaded:

var anchors = document.getElementsByTagName('a'),
    l = anchors.length,
    i,
    a;

for (i = 0; i < l; i++) {
    a = anchors[i];
    if (a.href.indexOf('maps.google.com/maps?') !== -1) {
         a.title = ''; 
         a.onclick = function () { return false; };
    }
}

You'd probably have to redo this when the map is changed (cache the anchor tag so you don't have to search for it each time).


Solution 2:

You can hook into the map's 'idle' event and then use jQuery to remove the link like this:

    google.maps.event.addListenerOnce(map, 'idle', function (e) {
    $('a[title="Click to see this area on Google Maps"]').remove();
});

This would break, of course, if they ever changed the text that is defined for the title attribute so maybe someone else can suggest a better selector -- one that would look at a portion of the href for example.

Whether or not something like this would violate the terms of usage I cannot comment on.


Post a Comment for "Google Maps API V3 Remove "Click To See This Area On Google Maps" Link"