Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to add the Draw Control availble in with the Leaflet.Draw Plugin

I've downloaded the code and stored in htdocs and point my page towards the js and css libraries needed. The page loads ok but minus the draw control panel as seen here

Here's the code I'm using for the page.

Leaflet Draw

<link rel="stylesheet" href="" />
<link rel="stylesheet" href="http://localhost/leaflet/leaflet/Leaflet.draw/dist/leaflet.draw.css" />

<!--[if lte IE 8]>
    <link rel="stylesheet" href="" />
    <link rel="stylesheet" href="http://leaflet/leaflet/Leaflet.draw/dist/" />
<script src=""></script>
<script src="http://localhost/leaflet/leaflet/Leaflet.draw/dist/leaflet.draw.js"></script>


// create a map in the "map" div, set the view to a given place and zoom
var map ='map' , {drawControl: true}).setView([51.505, -0.09], 7);

// add an OpenStreetMap tile layer
L.tileLayer('http://{s}{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="">OpenStreetMap</a> contributors'

// Initialize the FeatureGroup to store editable layers
        var drawnItems = new L.FeatureGroup();

// Initialize the draw control and pass it the FeatureGroup of editable layers
        var drawControl = new L.Control.Draw({
            draw: {
                position: 'topleft',
                polygon: {
                    title: 'Draw a sexy polygon!',
                    allowIntersection: false,
                    drawError: {
                        color: '#b00b00',
                        timeout: 1000
                    shapeOptions: {
                        color: '#bada55'
                circle: {
                    shapeOptions: {
                        color: '#662d91'
            edit: {
                featureGroup: drawnItems

share|improve this question
This question was answered on the leaflet google group here – Matt T Mar 4 '13 at 13:23
I am wondering that if it was asked previously then why you are posting as new question ? Please explain.. – Sunil Mar 13 '13 at 10:01
Please repeat the answer here or close the question. – underdark Mar 13 '13 at 10:14
@Sunil - it wasn't asked previously here but simultaneously on the leaflet google group. When they answered first I thought I would post their reply here. Thought i was being helpful :\ – Matt T Mar 13 '13 at 15:08
@MattT Okay..thanks for sharing – Sunil Mar 13 '13 at 16:05

The question was kindly answered on another forum. Here's the reply:

Leaflet.draw requires Leaflet master. This is because the controls have been refactored in Leaflet after 0.5.1. You can download the build files from the Leaflet Github (

share|improve this answer

Replace leaflet.css file from lefleat.draw distribution

share|improve this answer
Can you give more details? – Devdatta Tengshe Mar 13 '13 at 15:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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