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

Basemap Selector not working in Builder #14

Open
Prindle19 opened this issue Mar 12, 2017 · 13 comments
Open

Basemap Selector not working in Builder #14

Prindle19 opened this issue Mar 12, 2017 · 13 comments

Comments

@Prindle19
Copy link
Contributor

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)

@chriswhong
Copy link
Owner

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)

@Prindle19
Copy link
Contributor Author

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.

@pasing
Copy link

pasing commented Mar 18, 2017

@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

@Prindle19
Copy link
Contributor Author

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

@pasing
Copy link

pasing commented Mar 19, 2017

@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!

@Prindle19
Copy link
Contributor Author

@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.

@pasing
Copy link

pasing commented Mar 20, 2017

@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!

@Prindle19
Copy link
Contributor Author

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.

@chriswhong
Copy link
Owner

chriswhong commented Mar 21, 2017 via email

@pasing
Copy link

pasing commented Mar 22, 2017

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.

@Prindle19
Copy link
Contributor Author

Prindle19 commented Mar 22, 2017 via email

@pasing
Copy link

pasing commented Mar 22, 2017

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!

@chriswhong
Copy link
Owner

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.

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

No branches or pull requests

3 participants