2

Questions for any Carto users/developers here. I am trying to find out a way to a get a viz.json url that can be used as an overlay on a Leaflet map using Carto.js API.

However, I can't find it under my Builder account dashboard anywhere. With Carto engine its still possible but with new sign-ups it seems, only Carto Builder is available.

I would like the users to be able to add the overlays themselves but if new sign-ups are only allowing Carto Builder, I don't see how they can do that.

1

There is not yet version of CARTO.js compatible with Builder, that's why there's no link for a viz.json. It will still take some months to have a version of the SDK so as for now you need to create the maps manually using the Maps API (named or anonymous maps and so on).

1

You can generate the viz.json by taking the key from the vizualisation link or url: //username.carto.com/u/username/builder/key/embed

and appending it in the following format:
//username.cartodb.com/u/usernanme/api/v2/viz/key/viz.json

Currently, however, this will not contain legend info.
A bit of a hack, but it should do the trick for now, while we wait for the updated CARTO.js library:

Viz.json / CARTO.js The current version of CARTO.js is not compatible with Builder. If you have a dependency on using CARTO.js, use the Editor with the existing CARTO.js library.

Note: An updated CARTO.js library (version 4.0) is being developed to support all the new Builder functionality, and will be available soon.

Source:
https://carto.com/learn/guides/intro/migrating-from-carto-editor-to-carto-builder#temporary-limitations

Same answer here: Migrating from CARTO Editor TO CARTO Builder and problem with odyssey.js (viz.json)

0

The CARTO Builder does not have the option to share the viz.json URL due to the current version of CARTO.js (v3.15) which is not compatible with the Builder.

see: https://carto.com/learn/guides/intro/migrating-from-carto-editor-to-carto-builder

Migrating from CARTO Editor TO CARTO Builder:

Can I use CARTO Editor and CARTO Builder at the same time?

No, once CARTO Builder is enabled for your account, it is the only available map application.

Can I choose to use CARTO Editor instead?

No, CARTO Editor is currently in the process of being deprecated. All of the Editor features, and additional advanced functionality, is available within CARTO Builder. Once CARTO Builder is enabled for your account, the CARTO Editor is no longer available.

All new accounts have CARTO Editor enabled...

To find out a way to a get a viz.json url, you need an old account...

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.