0

For any Cartodb NamedMap, we load it using this function:

 cartodb.createLayer(map, namedLayerSource, {https: true})
 .addTo(map)
 .done(function (layer) {
});

After that I need to access all features data inside that named map. So It is known that we can do this:

sublayer.on('featureClick', function (e, pos, latlng, data) {
 console.log(data);
 }
 );

But what can i do to get data for all features without "featureClick" event ? Is there anyway I can get all data of that NamedMap in an Array or a Map?

I am using Cartodb.js v3.15 And I want to enable a search feature in which the user can search for any details inside the data for all points/features exists in a carto NameMap.

asked May 12, 2020 at 19:50

1 Answer 1

0

Unfortunately, the only way to get data from your layer is sending an SQL API call pointing to the dataset source if you are using v3.15.

On the other hand, CARTO.js v4 and CARTO VL allows you to get data views without the need to make an API call yourself.

answered May 14, 2020 at 15:48

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.