Skip to content

Commit

Permalink
feat(documentation): Started the paths attribute documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tombatossals committed Jan 4, 2014
1 parent 86a06d4 commit 972cad1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/leaflet-directive.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ We have much more possibilities than showing a simple map, but this will need th
* [_maxbounds_ attribute](https://github.com/tombatossals/angular-leaflet-directive/blob/master/doc/maxbounds-attribute.md)
* [_tiles_ attribute](https://github.com/tombatossals/angular-leaflet-directive/blob/master/doc/tiles-attribute.md)
* [_layers_ attribute](https://github.com/tombatossals/angular-leaflet-directive/blob/master/doc/layers-attribute.md)
* [_paths_ attribute](https://github.com/tombatossals/angular-leaflet-directive/blob/master/doc/paths-attribute.md)
33 changes: 33 additions & 0 deletions doc/paths-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
'paths' Attribute Documentation
==================================

This sub-directive needs the **leaflet** main directive, so it is normaly used as an attribute of the *leaflet* tag, like this:

```
<leaflet paths="paths"></leaflet>
```

It will map an object _paths_ of our controller scope with the corresponding object on our directive isolated scope. It's not a bidirectional relationship, so only the changes made in this object on the controller scope will affect the map vector paths rendering. Let's define the paths model with an example:

```
$scope.paths = {
example: {
type: "polyline",
latlngs: [ { lat: 5, lng: 0.5 }, { lat: 7, lng: 0.7 }, { lat: 8, lng: 0.8 } ]
}
}
```

We can see that the _path_ definition is conformed by object that will be drawn on our map. These object can be of different types, and everyone of them will have a _latlngs_ property which will define the path of the object to be drawn. In the example above, a polyline will be drawn with three main points.

Types of paths
--------------
We can define these types of paths:

* polyline.
* multiPolyline.
* polygon.
* multiPolygon.
* rectangle.
* circle.
* circleMarker.

0 comments on commit 972cad1

Please sign in to comment.