Skip to content

Commit

Permalink
Browser API key twig variable
Browse files Browse the repository at this point in the history
Enhancement #9
  • Loading branch information
Tam committed Jul 7, 2016
1 parent a3ff3eb commit 2f0f2d0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,17 @@ You can search for elements using the location specified in your map field. When
- `radius`: The radius around the location to search. Defaults to `50`.
- `unit`: The unit of measurement for the search. Can be either `km` (kilometers) or `mi` (miles). Defaults to `km`.

**API Keys**

You can access your browser API key in templates using `craft.simpleMap.apiKey`.

![How it looks](resources/preview.png)

## Changelog

### 1.2.3
- Browser API key can now be accessed in templates

### 1.2.2
- Added Browser API key setting

Expand Down
2 changes: 1 addition & 1 deletion SimpleMapPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function getDescription()

public function getVersion()
{
return '1.2.2';
return '1.2.3';
}

public function getSchemaVersion()
Expand Down
8 changes: 8 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,13 @@
"notes": [
"- Added Browser API key setting"
]
},
{
"version": "1.2.3",
"downloadUrl": "https://github.com/ethercreative/SimpleMap/archive/v1.2.3.zip",
"date": "2016-07-07T10:00:00-08:00",
"notes": [
"- Browser API key can now be accessed in templates"
]
}
]
4 changes: 4 additions & 0 deletions variables/SimpleMapVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ public function latLng ($lat, $lng)
return compact('lat', 'lng');
}

public function apiKey () {
return craft()->plugins->getPlugin('simpleMap')->getSettings()->browserApiKey;
}

}

0 comments on commit 2f0f2d0

Please sign in to comment.