Skip to main content
100%

Leaflet.draw drawing and editing tools

✓ Published0🌍 Public
Aandrewxhill
Last edited Jun 24, 2014
Created on Jun 24, 2014

This interactive map uses Leaflet.draw to let users draw polygons over a CartoDB layer of global populated places. The drawing tools are customized to allow only polygon shapes, with intersection checking and area display enabled. After a polygon is drawn, the map queries the CartoDB SQL API to filter the underlying dataset using ST_Intersects and ST_MakePolygon, then applies dynamic CartoCSS styling that colors points based on population thresholds. The example demonstrates combining Leaflet.draw's editing capabilities with CartoDB's SQL and styling APIs for on-the-fly spatial queries and visual updates.

AI-generated description

Similar vizzes