Encore PTL Encore PTL - 3 months ago 23
HTML Question

How to prevent Pinterest Pin It bookmark link to pick up Google Maps Images

Using Google Maps on my site and when I click on the Pin It bookmarklet imported to the bookmark bar from their pinterest.com/about/goodies/ page, it picks up Google Map images.

How can I specify not to pin images found inside a div tag which contains google map widget?

I cannot individually add nopin attribute to google map images as those tags are generated dynamically by Google Maps library.

Answer

This is what I have done in my map initialize method. I am using jQuery to add the nopin tags to the images after the tiles are loaded.

google.maps.event.addListener(map, 'tilesloaded', function() {
    $('#map_canvas').find('img').attr('nopin','nopin');
});
Comments