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.

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.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.