2

I am trying to print a map with one of the layer I use Google Maps data for street name label by using QGIS, since Google has more detail and complete street name label than OSM, but the problem is the Google map text is too small for high resolution printing. I usually export the document at 300dpi minimum, but the Google text is too small for normal reading.

I use below xyz tilemaps of google based data, below xyz url will display only google street name label, which later i combined with other map layer to compose for print.

https://maps.googleapis.com/maps/vt?pb=!1m4!1m3!1i{z}!2i{x}!3i{y}!1m4!1m3!1i11!2i1628!3i1059!1m4!1m3!1i11!2i1629!3i1058!1m4!1m3!1i11!2i1629!3i1059!1m4!1m3!1i11!2i1630!3i1058!1m4!1m3!1i11!2i1630!3i1059!1m4!1m3!1i11!2i1631!3i1058!1m4!1m3!1i11!2i1631!3i1059!1m4!1m3!1i11!2i1628!3i1060!1m4!1m3!1i11!2i1628!3i1061!1m4!1m3!1i11!2i1629!3i1060!1m4!1m3!1i11!2i1629!3i1061!1m4!1m3!1i11!2i1630!3i1060!1m4!1m3!1i11!2i1630!3i1061!1m4!1m3!1i11!2i1631!3i1060!1m4!1m3!1i11!2i1631!3i1061!2m3!1e0!2sm!3i536258950!3m17!2sen!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!12m4!1e26!2m2!1sstyles!2zcC52Om9mZixzLnQ6M3xzLmU6bHxwLnY6b24scy50OjN8cy5lOmwudC5mfHAuYzojZmYwMDAwMDAscy50OjN8cy5lOmwudC5zfHAudjpvZmY!4e0

My workaround is by locking the zoom level. For example, if I want to print A3 size document, zoom level 16 is enough for the street label coverage. And then I will compose separate document which is only consist of the Google Maps street name label, but with the half of the A3 size, like A4 or quarter of A3 size like A5, but I will make the dpi larger like 1200 for the A4 or 3000dpi for the A5, and then export it as PNG files and then place that smaller file on top the large document and resize it to fit the larger document.

With this trick, the text can be read easier, but still the text quality is not sharp enough and blurry.

Is it possible to render Google Maps data in much higher resolution? In order to get larger text? If yes, then how to implement it on above xyz url?

here i added a file generated in 96dpi as requested by Erik https://drive.google.com/file/d/1_NB6YttUdaO6My-tS5ZZDv76ltL_My2_/view?usp=sharing the layers supposed to be transparent, but i add white background for easier reading.

5
  • 2
    Have you tried changing the DPI to eg. 96?
    – Erik
    Sep 8 at 8:32
  • 1
    Try as @Erik sayed. Be aware: higher resolution = smaller text and vice versa.
    – Babel
    Sep 8 at 8:55
  • @Erik hi Erik, yes i tried, the result is still the same for me. Sep 8 at 9:44
  • 1
    Can you provide a screenshot?
    – Erik
    Sep 8 at 10:00
  • hi @Erik i edit my question and insert google drive link for generated image in 96dpi. thank you. Sep 8 at 13:00
3

Use scale=2

to obtain something like this (pdf output from the Layout manager):

enter image description here

create a new connection with the following additional parameters:

&size=200x200&scale=2

for example:

https://mt1.google.com/vt/lyrs=r&x={x}&y={y}&z={z}&size=200x200&scale=2

enter image description here vs: enter image description here

the default value of scale is "1", and accepted values are "1" or "2".

Reference:

https://developers.google.com/maps/documentation/maps-static/start#URL_Parameters


Another non-answer which could save you from useless efforts.

I went a slightly different route, that of looking how to increase the size of text elements via API/styling. After doing some research, unfortunately I found out that label sizes are not editable using Google Maps' styles.

References:

  1. text styling is not foreseen int the API: https://developers.google.com/maps/documentation/maps-static/start and https://developers.google.com/maps/documentation/maps-static/styling

  2. nor in the visual style editor: https://mapstyle.withgoogle.com/

You can show/hide labels, apply different colors and all effects foreseen within the styler, and even only the text, rendering only the label backdrop, but I found no option to increase text size.


Lastly, I found this nifty encoder for creating apistyle-compliant URLs:

https://github.com/julienben/gmaps-apistyle-encoder

4
  • 1
    hi Raf, thank you for your effort for answering my question. how to implement scale 2 on this kind of xyz url? maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{z}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i572297164!3m12!2sen-US!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!4e0 is it possible? thank you. Sep 8 at 16:28
  • I wasn't ble to find specific documentation about styling maps.googleapis.com/maps/vt (emphasis on vt); the style+size=100x100&scale=2 trick is not working on that type of server, only on "static" maps (like maps.googleapis.com/maps/api/staticmap). I also tried using Google's paid API_KEY
    – RafDouglas
    Sep 9 at 8:22
  • Andrea, good news, then. However if the one in the comment is your personal API_KEY please do delete your comment and rewrite it without your API_KEY, as it could be misused and you could incur into invoices from Google :)
    – RafDouglas
    Sep 9 at 15:05
  • 1
    thank for reminds me. this is my previous deleted answer as it will also help the other in need. hi Raf, i think i was able to fetch high resolution google maps tile directly from google cloud styler console. using below url connection. maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{z}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i572296336!3m12!2sen-US!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!4e0!5m1!5f2!23i1379896!23i1379903!23i1376099&key=[YOUR API]&token=101658 from google cloud maps styler, then i can make any style that i want. it think it is answer all my problems for now. Sep 9 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.