Cartodb: Enable Google Maps export for "Export as an image"

Created on 15 Mar 2017  ·  15Comments  ·  Source: CartoDB/cartodb

Currently the "Export as an image" feature doesn't export Google Maps basemaps. We should enable this so we always export geometries and the underneath basemap.

See this issue for some hints on how to implement this feature using Google's Static Map API.

  • [x] Export defaults / non-styled Google Maps basemaps.
  • [x] Export styled Google Maps basemaps.
  • [x] Allow panning the basemap when the image export widget is active.
  • [x] Apply Google Maps limits in the export image form and warn the users.

    • [x] For regular users.

    • [x] For Google Maps Premium users.

  • [x] Add attribution to the exported image.
  • [x] Add CARTO logo to the exported image.
  • [x] Remove menu in the export image form header.

PR: https://github.com/CartoDB/cartodb/pull/11891

Frontend feature

All 15 comments

@noguerol, @xavijam:

In order to enable this feature for Google Maps users, we are going to need to allow them to add an API key and, in some cases (when users are members of Google's Premium Plan), a "digital signature".

See the first paragraph in this page from the Static Maps API docs.

How are we manage that? Should we allow them to manage the keys through a form in their account page?

Also, we are going to need to expose at least one API key to the frontend to make the request. We probably should involve backend in this.

So, we have discussed it offline, but we should not be worried about Google's Premium Plan members because there are not that type of customers.
But in any case, we could use the current "fields" in order to add new params and make use of them wherever we want.

Talked offline, just updating the ticket:

· Only users with a "pay-as-you-go" license should use a digital signature
· Digital signatures could be appended if needed to the API key as a single text string, so changes are needed in the admin panel

Besides, there are image size limits: https://developers.google.com/maps/documentation/static-maps/usage-limits

· Free and pay-as-you-go: 640x640px
· Premium annual plan: 2048x2048px

A capture with a google basemap, our logo, and the attribution. What do you think?

untitled map 1

I love it :dancer:!

In certain cases, when the license of the Google Maps is very long, we could end up having this issue:

untitled map 1 17

… so a solution is to check for the width of the attribution in the html and apply a tiny margin:

untitled map 1 21
untitled map 1 20

:+1:

hey guys, I've just realized that, our tiles could hide Google logo and attribution.

kortkort

:( We could add their logo and the attribution like we do with ours, but we'll need to match the position so it doesn't look bad.

I'd not block the release because of this. I'd keep this open as an bug for the future

+1
On Thu, 30 Mar 2017 at 23:33, Sergio Álvarez Leiva notifications@github.com
wrote:

I'd not block the release because of this. I'd keep this open as an bug
for the future


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/CartoDB/cartodb/issues/11775#issuecomment-290551471,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFQyuwB0MH4YHsNXRXe2krjdUps7HRJks5rrB-wgaJpZM4MeQk9
.

Yep yep, violent agreement.

Ticket added https://github.com/CartoDB/cartodb/issues/11896, out of milestone 💋 . _circulen_

should I do acceptance on this?

All yours @javierarce for tomorrow morning :kick_scooter: .

Was this page helpful?
0 / 5 - 0 ratings