From 4748496fad46ae986a9a7bf8cb6b9b3a88aa129d Mon Sep 17 00:00:00 2001 From: jacobtoye Date: Tue, 12 Jun 2012 15:30:17 +1200 Subject: [PATCH] Updating README --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b34457b84..a99b091c7 100644 --- a/README.md +++ b/README.md @@ -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({ @@ -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 \ No newline at end of file