Skip to content

Commit a1efdff

Browse files
committed
Renamed directive and edited README.md
1 parent 4c331ff commit a1efdff

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Angular Google Static Maps Directive
2+
3+
An [AngularJS](http://angularjs.org/) directive to quickly insert [Google Static
4+
Maps](https://developers.google.com/maps/documentation/staticmaps/).
5+
6+
## Usage
7+
8+
1. `bower install --save angular-google-staticmaps`
9+
2. Include dependencies in your HTML.
10+
3. Load the `tbc.ngGoogleStaticMaps` module for your Angular app.
11+
4. Use the `static-google-map` directive.
12+
13+
## Example
14+
15+
```html
16+
<static-google-map size="137x137" markers="markers" sensor="false" zoom="14"></static-google-map>
17+
```
18+
19+
The `markers` attribute can contain one or multiple markers.
20+
Markers have the following format:
21+
22+
```javascript
23+
$scope.markers = [{
24+
color: 'blue',
25+
label: 'S',
26+
coords: [lat, lng]
27+
}];
28+
```
29+
30+
## Attributes
31+
32+
Any attribute is directly passed to the generated URL the image is loaded from,
33+
except for `markers`, which gets formatted according to the specification.
34+
35+
### `size` (required)
36+
37+
The size attribute is required and must be specified as `WIDTHxHEIGHT` whereby `WIDTH`
38+
denotes the width and pixels and `HEIGHT` the height.
39+
40+
### `sensor` (required)
41+
42+
The sensor attribute must explicitly be set to either `true` or `false`.
43+
44+
## Contributing
45+
46+
Pull requests welcome. Only change files in `src` and don't bump any versions.
47+
Please respect the code style in place.
48+
49+
## License
50+
51+
MIT

ng-google-static-maps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
}, '');
5959
};
6060
})
61-
.directive('static-google-map', function ($parse) {
61+
.directive('staticGoogleMap', function ($parse) {
6262
return {
6363
template: '<img alt="Google Map">',
6464
replace: true,

0 commit comments

Comments
 (0)