Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gmaps revival #3429

Merged
merged 41 commits into from
May 6, 2015
Merged

Gmaps revival #3429

merged 41 commits into from
May 6, 2015

Conversation

javisantana
Copy link
Contributor

Let's get back GMaps!

this is what changed:

  • backend:
    • basemaps are not static anymore, they depend on the user. Basically this allow us to set different basemaps depending if the user has google maps enabled or not. Check user.rb changes https://github.com/CartoDB/cartodb/pull/3337/files#diff-4676c008b11a5480d73d4a6de01e45b9R2352
    • map creation: before app_config.yml configuration was being used, that was changed to be the default map for the user. Check map.rb and table.rb to see the changes. Not needed keys have been removed (so they could be removed from deploy cc @CartoDB/systems )

@Kartones I think there are some things to change in the new map.rb

  • systems:
  • frontend
    • enabled google maps again, torque, edition and so on is working (@fdanS worked on it)
    • google maps baselayer support in the dropdown
    • lots of views changed to include google maps libray when needed

To make it work:

In order to have google maps you need to:

  1. Add the following to the basemaps section in app_config.yml
GMaps:
      roadmap:
        name: 'GMaps Roadmap'
        maxZoom: 40
        minZoom: 0
        baseType: 'roadmap'
        className: 'googlemaps'
      hybrid:
        name: 'GMaps Hybrid'
        maxZoom: 40
        minZoom: 0
        baseType: 'hybrid'
        className: 'googlemaps'
      satellite:
        name: 'GMaps Satellite'
        maxZoom: 40
        minZoom: 0
        baseType: 'satellite'
        className: 'googlemaps'
      gray_roadmap:
        name: 'GMaps Gray Roadmap'
        maxZoom: 40
        minZoom: 0
        baseType: 'gray_roadmap'
        className: 'googlemaps'
        style: '[{ "stylers": [ { "saturation": -100 } ] },{ "featureType": "water", "stylers": [ { "gamma": 1.67 }, { "lightness": 27 } ] },{ "elementType": "geometry", "stylers": [ { "gamma": 1.31 }, { "lightness": 12 } ] },{ "featureType": "administrative", "elementType": "labels", "stylers": [ { "lightness": 51 }, { "gamma": 0.94 } ] },{ },{ "featureType": "road", "elementType": "labels", "stylers": [ { "lightness": 57 } ] },{ "featureType": "poi", "elementType": "labels", "stylers": [ { "lightness": 42 } ] }]'
  1. Enable feature flag google_maps.

Fixes #3289.

javisantana and others added 30 commits January 29, 2015 16:07
…mapst push origin gmaps todb into gmaps_revival
now the provider is selected based on the default base layer for the user instead of using configuration
@javisantana
Copy link
Contributor Author

@Kartones @xavijam @viddo please review

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

@javisantana
Copy link
Contributor Author

retest this please

@@ -50,6 +50,7 @@ def index
@tables_count = current_user.tables.count
@first_time = !current_user.dashboard_viewed?
@just_logged_in = !!flash['logged']
@google_maps_api_key = current_user.google_maps_api_key
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about if the user belongs to an organization?

@recena
Copy link

recena commented May 5, 2015

retest this please

1 similar comment
@recena
Copy link

recena commented May 5, 2015

retest this please

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

@recena
Copy link

recena commented May 5, 2015

@javisantana It seems everything is working fine.

javisantana added a commit that referenced this pull request May 6, 2015
@javisantana javisantana merged commit 31e53fa into master May 6, 2015
@elenatorro elenatorro deleted the gmaps_revival branch February 16, 2018 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use user api key for embeds/public pages with google maps enabled
5 participants