Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps
4
votes
Accepted
How does Carto make it possible to interact with elements on their tiles? Can I do the same ...
The magic is called UTFGrid and it was developed by Mapbox. It is basically "an encoding scheme that efficiently encodes interactivity data for map tiles". According to the documentation, for each map …
1
vote
Using Get function jQuery calling Carto data on Leaflet?
function(errors) {
// errors contains a list of errors
console.log("errors:" + errors);
})
Here you have a working example explaining how to populate both a GeoJSON (and then paint it with Leaflet …
1
vote
Accepted
Null the_geom values in CARTO / Leaflet
Instead of getting the coordinates from the Leaflet map as explained by @oriolbx, you can first extract the latitude and longitude coordinates from the_geom field using SQL:
SELECT
*,
st_x( …
0
votes
Accepted
Two maps using Carto and Leaflet with same events (zoom, pan, etc)
You can create and instantiate two maps (map1 and map2), then you can assign a custom function to both maps after a certain event:
map1.on('event', function(e) {
customFunction(map1, map2) …
2
votes
Click event returning wrong Y container point in Leaflet?
You need to remove the toFixed(0) function at the end of the var X and Y, or at least you have to set a much greater argument such as 6 or 8. This method "converts a number into a string, keeping a sp …
14
votes
Using Leaflet Js, is it possible to know the onclick location of a Marker (ignore anchor poi...
You always can retrieve the coordinates from the Leaflet object map. …
0
votes
Accepted
Cartodb Layer source object not loading
Please check all the variables you have introduced within your markerLayerSource (the console will tell you what is wrong anyway). I have replicated your code in this working example. But I have used …
1
vote
Strange cartodb infowindow behavior
You are using again Leaflet.js methods to add iw and tooltips into CARTO sublayers. As I suggested you in your last question, I will use CARTO.js methodology. In doing so, you will not have these kind …
1
vote
Infowindow close on featureOut /hoverOut
Instead of attaching the tooltips to every sublayer, you can create two (or many) layers with createLayer and then append the tooltips (an infowindow which shows when hovers over and hide when hovers …
3
votes
Accepted
Carto.js - Change infowindow field on click event
a problem of scope, this is the code that will work:
jQuery(function($) {
//default infowindow fields
var infowindow_fields = ['abbrev'];
// create leaflet …
1
vote
Adding featureOver on map for multiple layers using carto.js and leaflet
Unfortunately, CARTO.js does not support feature over multiple layers. I have replicated your problem in this glitch example. CARTO VL, on the other hand, supports this type of interactivity. You can …
1
vote
Leaflet display only clicked element of a loaded map layer (polyline)
You can use the show() (the sublayer you have clicked on) or hide() (the rest of the sublayers) methods as explained in this tutorial.
3
votes
Accepted
Add labels to layer in CARTO.js (v4)
You can add labels in CARTO.js using CartoCSS text properties in your layer style object. Something like this should work:
#layer {
polygon-fill: #826DBA;
polygon-opacity: 0.9;
}
#layer::outline …
2
votes
Accepted
Adding SQL layer with dropdown selector in Carto?
You need to assign an action to your dropdown object and use setQuery CARTO.js method to change the layer source as explained in this example.
const selector = $(".js-dropdown-selector");
// cha …