Skip to content

Commit

Permalink
Updating README
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtoye committed Jun 12, 2012
1 parent 6a1b9c7 commit 4748496
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion README.md
Expand Up @@ -14,7 +14,7 @@ cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18}),
map = new L.Map('map', {layers: [cloudmade], center: new L.LatLng(-37.7772, 175.2756), zoom: 15, drawControl: true });
````

If you would like to reposition the control or turn off poly type add the control manually:
If you would like to reposition the control, turn off a tyep or customize the styles then add the control manually:

````
var drawControl = new L.Control.Draw({
Expand All @@ -26,5 +26,28 @@ map.addControl(drawControl);

See [example/map-polydraw.html](https://github.com/jacobtoye/Leaflet.draw/blob/master/example/drawing.html) for a working example.

#Customize shape styles

L.Control.Draw can take an options object. You can specify a styles property like so:

````
var options = {
styles: {
polyine: {
color: '#f357a1',
width: 10
},
polygon: {
color: '#bada55'
},
rectangle: {
clickable: false
}
}
}
````

The shape styles are the leaflet [Path](http://leaflet.cloudmade.com/reference.html#path-options) and [Polyline](http://leaflet.cloudmade.com/reference.html#polyline-options) options.

#Official support
Leaflet plan to include drawing in 0.4 so this is just a band-aid until it comes. See https://github.com/CloudMade/Leaflet/issues/174

0 comments on commit 4748496

Please sign in to comment.