{"id":7,"date":"2010-11-13T11:20:16","date_gmt":"2010-11-13T11:20:16","guid":{"rendered":"http:\/\/www.albertosarullo.com\/blog\/?p=7"},"modified":"2011-01-07T09:18:39","modified_gmt":"2011-01-07T09:18:39","slug":"google-map-v3-extend-markerclusterer-javascript-library","status":"publish","type":"post","link":"http:\/\/www.albertosarullo.com\/blog\/google-map-v3-extend-markerclusterer-javascript-library","title":{"rendered":"Google Map V3: Markerclusterer with custom tooltip\/title"},"content":{"rendered":"<p>Markerclusterer, part of <a href=\"http:\/\/code.google.com\/p\/google-maps-utility-library-v3\/\">Google Maps Utility Library<\/a>, is a Javascript library that helps developers to manage a large number of markers, grouping near markers into a single &#8220;cluster&#8221;.<\/p>\n<p><!--more--><\/p>\n<p>I&#8217;ve made some user testing sessions, and I&#8217;ve found that many non advanced users need a tooltip, to explain the meaning of the number showed on the cluster icon.<\/p>\n<p>I use Markerclusterer in a site based on Google Map v3 APIs and I find that is impossible to customize tooltip (html title tag) showed when users stop the cursor over a cluster.<\/p>\n<p>So, I have modified the markerclusterer javascript library, adding an optional parameter &#8216;description&#8217; that specifies the tooltip. Nothing was changed in the class interface, so the backward compatibility is guaranteed:<\/p>\n<pre name=\"code\" language=\"js\">\r\nvar markerClustererOptions = { \r\n\tdescription: ' tracks: click to show',\r\n\tmaxZoom: 12,\r\n\tgridSize: 50\r\n};\r\nvar markerClusterer = new MarkerClusterer(map, markers, markerClustererOptions);\r\n<\/pre>\n<h2>Demos<\/h2>\n<p><a href=\"http:\/\/www.piste-ciclabili.com\/test\/markercluster\/\">Markerclusterer with custom tooltip<\/a><\/p>\n<h2>Update (7 jan 2011)<\/h2>\n<p>I have written to google map&#8217;s team to submit my code. On january 4th Luke Mah\u00c3\u00a9 from google said me that my modify will be add to the markerclusterer javascript library.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Markerclusterer, part of Google Maps Utility Library, is a Javascript library that helps developers to manage a large number of markers, grouping near markers into a single &#8220;cluster&#8221;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,3],"tags":[14,4,15],"class_list":["post-7","post","type-post","status-publish","format-standard","hentry","category-google-map","category-javascript","tag-google-map-v3","tag-javascript-2","tag-markerclusterer"],"_links":{"self":[{"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/posts\/7","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/comments?post=7"}],"version-history":[{"count":0,"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/media?parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/categories?post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/tags?post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}