docker-cartodb icon indicating copy to clipboard operation
docker-cartodb copied to clipboard

Basemap Selector not working in Builder

Open Prindle19 opened this issue 8 years ago • 13 comments

I know you're not using Builder, but I'm wondering why the Basemap Selector in Builder doesn't work?

The basemap selector works fine in editor, using the sources configured in the .yml

In the Builder, when you click on the Basemap to change it, you get the error:

Uncaught Error: Can't create basemapModel for basemap of type: Nokia at D.createBasemapModel (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.25/javascripts/editor3.js:39:5469) at N.d. (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.25/javascripts/editor3.js:37:28266) at https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.25/javascripts/vendor_editor3.js:66:3517 at Function.u.map.u.collect (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.25/javascripts/vendor_editor3.js:66:4576) at N.d. (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.25/javascripts/editor3.js:37:28220) at https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.25/javascripts/vendor_editor3.js:66:3517 at Function.u.each.u.forEach (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.25/javascripts/vendor_editor3.js:66:4420) at u.(anonymous function) [as each] (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.25/javascripts/vendor_editor3.js:66:17545) at N.d._initCollections (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.25/javascripts/editor3.js:37:28199) at N.d.initialize (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.25/javascripts/editor3.js:37:28080)

Prindle19 avatar Mar 12 '17 20:03 Prindle19

I am not experiencing this, the basemap selector works fine for me. What are you doing differently from what I have described (using google cloud vs DO for example)

chriswhong avatar Mar 13 '17 01:03 chriswhong

Hey Chris, just verifying - the basemap selector works in the Builder front end not just in the older Editor?

Other than being on Google Cloud i did everything by your instructions.

Prindle19 avatar Mar 13 '17 13:03 Prindle19

@Prindle19 I have the same error when click on Basemap Selector in Builder from file basemap-model-factory.js:193

Uncaught Error: Can't create basemapModel for basemap of type: Nokia
    at D.createBasemapModel (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.31/javascripts/editor3.js:39:5469)
    at N.d.<anonymous> (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.31/javascripts/editor3.js:37:29702)
    at https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.31/javascripts/vendor_editor3.js:66:18398
    at Function.u.map.u.collect (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.31/javascripts/vendor_editor3.js:66:19457)
    at N.d.<anonymous> (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.31/javascripts/editor3.js:37:29656)
    at https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.31/javascripts/vendor_editor3.js:66:18398
    at Function.u.each.u.forEach (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.31/javascripts/vendor_editor3.js:66:19301)
    at u.(anonymous function) [as each] (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.31/javascripts/vendor_editor3.js:67:399)
    at N.d._initCollections (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.31/javascripts/editor3.js:37:29635)
    at N.d.initialize (https://cartodb-libs.global.ssl.fastly.net/cartodbui/assets/4.6.31/javascripts/editor3.js:37:29516)

I believe it is linked to the fact that in app_conf.yml files are links to the basic maps nokia. In basemap-model-factory.js files: 156 CATEGORY_NOKIA variable is not present and is replaced by CATEGORY_HERE.

Perhaps, in order to solve the problem, you may want to try removing NOKIA and enter HERE maps in app_config.yml file.

If I work out, I will report the solution

pasing avatar Mar 18 '17 17:03 pasing

Hey @pasing Thanks for the suggestion. I made the change in app_config.yml and restarted the container but unfortunately I now get the same error just with:

Uncaught Error: Can't create basemapModel for basemap of type: HERE

Prindle19 avatar Mar 19 '17 12:03 Prindle19

@Prindle19 I have copy file from container to host with this command: docker cp {container id}:/cartodb/config/app_config.yml /opt/docker-cartodb/config/app_config.yml and commented line from file app_config.yml:320-348 as indicated below.

 # Nokia:
    #   normal_day:
    #     url: 'https://maps.nlp.nokia.com/maptiler/v2/maptile/newest/normal.day/{z}/{x}/{y}/256/png8?lg=eng&token=A7tBPacePg9Mj_zghvKt9Q&app_id=KuYppsdXZznpffJsKT24'
    #     minZoom: '0'
    #     maxZoom: '21'
    #     className:    "nokia_normal_day"
    #     attribution:  "©2012 Nokia <a href='http://here.net/services/terms' target='_blank'>Terms of use</a>"
    #     name: 'Nokia normal Day'
    #   terrain_day:
    #     url: 'https://maps.nlp.nokia.com/maptiler/v2/maptile/newest/terrain.day/{z}/{x}/{y}/256/png8?lg=eng&token=A7tBPacePg9Mj_zghvKt9Q&app_id=KuYppsdXZznpffJsKT24'
    #     minZoom: '0'
    #     maxZoom: '21'
    #     className:    "nokia_terrain_day"
    #     attribution:  "©2012 Nokia <a href='http://here.net/services/terms' target='_blank'>Terms of use</a>"
    #     name: 'Nokia Terrain Day'
    #   satellite_day:
    #     url: 'https://maps.nlp.nokia.com/maptiler/v2/maptile/newest/satellite.day/{z}/{x}/{y}/256/png8?lg=eng&token=A7tBPacePg9Mj_zghvKt9Q&app_id=KuYppsdXZznpffJsKT24'
    #     minZoom: '0'
    #     maxZoom: '21'
    #     className:    "nokia_satellite_day"
    #     attribution:  "©2012 Nokia <a href='http://here.net/services/terms' target='_blank'>Terms of use</a>"
    #     name: 'Nokia Satellite Day'
    #   hybrid_day:
    #     url: 'https://maps.nlp.nokia.com/maptiler/v2/maptile/newest/hybrid.day/{z}/{x}/{y}/256/png8?lg=eng&token=A7tBPacePg9Mj_zghvKt9Q&app_id=KuYppsdXZznpffJsKT24'
    #     minZoom: '0'
    #     maxZoom: '21'
    #     className:    "nokia_hybrid_day"
    #     attribution:  "©2012 Nokia <a href='http://here.net/services/terms' target='_blank'>Terms of use</a>"
    #     name: 'Nokia hybrid Day'

Then I copied the files from the host to the container with this command: docker cp /opt/docker-cartodb/config/app_config_edit.yml {container id}:/cartodb/config/app_config.yml.

Finally I restarted the daemon and start the docker container with {container id}. It worked for me!

pasing avatar Mar 19 '17 15:03 pasing

@pasing Thanks! Confirm that that works.

Hmm, so interesting, now it looks like Builder (since it loads externally hosted JS rather than locally hosted like Editor) limits the types of basemaps that you can use to

CARTO and Stamen ?

That's unfortunately, because I'd like to be able to add a pre-configured z/x/y tile set in the app_config.yml and have it available in both builder and editor.

I guess I can fake that by just adding them under Carto or Stamen.

Prindle19 avatar Mar 19 '17 17:03 Prindle19

@Prindle19 Removing base maps Nokia the Basemap Selector in Builder has resumed operation.

image

I think you can add more than basemap. Surely from the panel you can add, over Carto and Stamen:

  • color base
  • custom yxz
  • tilejson
  • nasa
  • mapbox
  • wms/wmts

I hope this info is useful!

pasing avatar Mar 20 '17 08:03 pasing

Sure was! I just was just saying that I'm now somewhat limited to the Carto and Stamen top level map types, and if i want to pre-populate some custom tile servers for my users, i need to make new "fake" entries under the Carto or Stamen groups.

It also seems subject to random changes from Carto since Builder is being loaded via external sources vs static local files. They could, for instance, decide to remove Stamen at any time.

Prindle19 avatar Mar 21 '17 21:03 Prindle19

To summarize, the carto UI is looking for HERE basemaps and the appconfig.yml is defining "Nokia" maps?

On Tue, Mar 21, 2017 at 17:39 Sean Wohltman [email protected] wrote:

Sure was! I just was just saying that I'm now somewhat limited to the Carto and Stamen top level map types, and if i want to pre-populate some custom tile servers for my users, i need to make new "fake" entries under the Carto or Stamen groups.

It also seems subject to random changes from Carto since Builder is being loaded via external sources vs static local files. They could, for instance, decide to remove Stamen at any time.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/chriswhong/docker-cartodb/issues/14#issuecomment-288227411, or mute the thread https://github.com/notifications/unsubscribe-auth/ABv7XIRp-Bd7HB9Lj10CYCRjkaGKcMafks5roEN9gaJpZM4MaqTC .

chriswhong avatar Mar 21 '17 22:03 chriswhong

I think to be able to use the basic maps HERE must generate an APPID and APPCODE enrolling in HERE Developer WebSite

Once created the application and set the settings you can use these base maps

Obviously the use of the HERE REST / API services requires acceptance of the terms and plans. The BASIC plan is the only free but is limited to 15K / month.

I think the same applies to the basic maps google.

pasing avatar Mar 22 '17 09:03 pasing

Oh that makes sense, do you know where you would apply these keys (or the Google API key / Client ID)?

On Wed, Mar 22, 2017, 5:25 AM Pasquale Inglese [email protected] wrote:

I think to be able to use the basic maps HERE must generate an APPID and APPCODE enrolling in HERE Developer WebSite https://developer.here.com/

Once created the application and set the settings you can use these base maps https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/examples-base.html.

Obviously the use of the HERE REST / API services requires acceptance of the terms and plans. The BASIC https://developer.here.com/plans#standard_features plan is the only free but is limited to 15K / month.

I think the same applies to the basic maps google.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chriswhong/docker-cartodb/issues/14#issuecomment-288342464, or mute the thread https://github.com/notifications/unsubscribe-auth/ABpshll1XsgFbNaI_9oW8OByJuduaup6ks5roOkigaJpZM4MaqTC .

Prindle19 avatar Mar 22 '17 11:03 Prindle19

This is the GMaps parameters to set in the app_config.yml file.

I have set this in my app_config.yml file but gmaps selector doesn't work. Now i stay search the solution in pull #11447.

I have so far failed to solve the problem!

pasing avatar Mar 22 '17 13:03 pasing

Anyone had luck with this? My team is using carto as an "instant backend", so we don't actually make maps in the UI, we just use the Maps API. Happy to make some changes if we find the correct config.

chriswhong avatar Sep 05 '17 03:09 chriswhong