gis - leaflet.draw with CartoDB -
i new leaflet.js , cartodb.js. trying create editable webmap, sourcing (and writing) data cartodb sql tables. can render map cartodb, when add links leaflet.js map layers disappear. js fiddle shows this. if comment out lines 5 , 6, works:
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
you don't need add leaflet library's javascript , stylesheet when using cartodb, include leaflet draw's assets, enable drawcontrol
option in options of l.map
, you're go:
assets:
<link type="text/css" rel="stylesheet" href="http://leaflet.github.io/leaflet.draw/leaflet.draw.css" /> <script type="text/javascript" src="http://leaflet.github.io/leaflet.draw/leaflet.draw.js"></script>
map:
new l.map('cartodb-map', { center: [40,-98], zoom: 4, drawcontrol: true });
here's fork of fiddle: http://jsfiddle.net/qnzqtgy7/
Comments
Post a Comment