Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

6

You could create an Object before layer.on('loaded'... with the legend keys you want to use for this dataset, for example: const LEGEND_KEYS = { LT: 'Least Threatened', VU: 'Vulnerable', CR: 'Critically Endangered', EN: 'Endangered' } And then, when updating the legend: colorLegendList += `<li><span ...


3

Are you using the VL Bridge? If so, there is an undocumented method for the category widget's bridge: enableColorMapping. If the viz bridged to your as-category-widget has a color ramp, it will add the color to the categories automatically. Keep in mind that it's undocumented, so it might change in the future without notice. const bridge = new AsBridge....


2

You can change the properties of the widget right after the append call. For instance, you could change visibleCategories and it should work. If you need to read the properties back, you have to wait until the next tick. From a VL <--> Airship perspective, the widget will update on every update event on the layer it's bridged to. You could listen to that ...


1

There're several issues here: Your GeoJSON doesn't include the feature geometry. It should have the geometry type and the coordinates: "geometry": { "type": "Point", "coordinates": [ 30, 10 ] } When using dates in a GeoJSON source, you've to declare which columns (properties) are "date". In this case, it's the 'TIME' property: const source = ...


1

Make sure you're changing not only the default config with setDefaultConfig, but also the default auth settings with setDefaultAuth correctly: carto.setDefaultAuth({ username: 'dev', apiKey: 'default_public' }); carto.setDefaultConfig({ serverURL: 'http://localhost/user/dev' }); This answer explains also that you may need to set the port in your ...


Only top voted, non community-wiki answers of a minimum length are eligible