-
Notifications
You must be signed in to change notification settings - Fork 635
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(documentation): Started the paths attribute documentation
- Loading branch information
1 parent
86a06d4
commit 972cad1
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |