I have to print some Google Maps displayed within PHP application.
Basically, I can print it, and what is important markers are printed correctly. But problem occurs if I need to print cluster. Instead of cluster icon, only a white box is printed (in fact that part of the map is not printed at all), and only number of markers that that cluster contain is printed in that box.
I tried with custom icon, and result is the same.
Is it possible to print anything anyhow as a clusterer (icon), with number of grouped markers inside? At least to put some color in the box? It does not have to be icon, is it possible to set color of that empty box with styles?
Tnx in advance!
Printing is not available with MarkerClusterer, but it is an option if you use an enhancement named: MarkerClustererPlus. It is essentially a Google Maps v3 upgrade of the original v2 MarkerClusterer, which was then further enhanced and extended by Gary Little. It functions pretty much the same as the v3 MarkerClusterer, but offers more optionsdoc.
Specific to your question, you may pass a set of options to the MarkerClusterer
constructor function (when using MarkerClustererPlus) and include an option: printable
. If set to true
, it will give you what you want. I have noticed that setting printable
to true
may cause you to adjust the placement of the cluster count label within the cluster marker icon, but it usually just takes some tweaking. Most importantly, the cluster icon and the count label will appear in map prints.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With