docstring fixes regarding Polyline/Circle options

This commit is contained in:
Iván Sánchez Ortega 2016-04-20 09:38:58 +02:00
parent 86e49f92ff
commit c3426d6bb6
4 changed files with 13 additions and 7 deletions

View File

@ -26,6 +26,8 @@ L.Circle = L.CircleMarker.extend({
if (isNaN(this.options.radius)) { throw new Error('Circle radius cannot be NaN'); }
// @section
// @aka Circle options
// @option radius: Number; Radius of the circle, in meters.
this._mRadius = this.options.radius;
},
@ -91,11 +93,11 @@ L.Circle = L.CircleMarker.extend({
}
});
// @factory L.circle(latlng: LatLng, options?: Path options)
// @factory L.circle(latlng: LatLng, options?: Circle options)
// Instantiates a circle object given a geographical point, and an options object
// which contains the circle radius.
// @alternative
// @factory L.circle(latlng: LatLng, radius: Number, options?: Path options)
// @factory L.circle(latlng: LatLng, radius: Number, options?: Circle options)
// Obsolete way of instantiating a circle, for compatibility with 0.7.x code.
// Do not use in new applications or plugins.
L.circle = function (latlng, options, legacyOptions) {

View File

@ -8,6 +8,8 @@
L.CircleMarker = L.Path.extend({
// @section
// @aka CircleMarker options
options: {
fill: true,
@ -85,8 +87,8 @@ L.CircleMarker = L.Path.extend({
});
// @factory L.circleMarker(latlng: LatLng, options? CircleMarker options)
//
// @factory L.circleMarker(latlng: LatLng, options?: CircleMarker options)
// Instantiates a circle marker object given a geographical point, and an optional options object.
L.circleMarker = function (latlng, options) {
return new L.CircleMarker(latlng, options);
};

View File

@ -37,11 +37,11 @@ L.Path = L.Layer.extend({
lineJoin: 'round',
// @option dashArray: String = null
// A string that defines the stroke [dash pattern](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray). Doesn't work on canvas-powered layers (e.g. Android 2).
// A string that defines the stroke [dash pattern](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).
dashArray: null,
// @option dashOffset: String = null
// A string that defines the [distance into the dash pattern to start the dash](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset). Doesn't work on canvas-powered layers
// A string that defines the [distance into the dash pattern to start the dash](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).
dashOffset: null,
// @option fill: Boolean = depends

View File

@ -38,6 +38,8 @@
L.Polyline = L.Path.extend({
// @section
// @aka Polyline options
options: {
// @option smoothFactor: Number = 1.0
// How much to simplify the polyline on each zoom level. More means
@ -275,7 +277,7 @@ L.Polyline = L.Path.extend({
}
});
// @factory L.polyline(latlngs: LatLng[], options?: Path options)
// @factory L.polyline(latlngs: LatLng[], options?: Polyline options)
// Instantiates a polyline object given an array of geographical points and
// optionally an options object. You can create a `Polyline` object with
// multiple separate lines (`MultiPolyline`) by passing an array of arrays