Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Mar 3, 2017
1 parent 8884c8f commit 2c913f2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/Helper/GoogleMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ $options = [
$map = $this->GoogleMap->staticMap($options);
```

### Display a static map link
In case you want to use JS to pop-up the image, you can use:
```php
$config = [
'markers' => $mapMarkers,
'escape' => false,
];
$url = $this->GoogleMap->staticMapUrl($config);
echo $this->Html->link(__('Map'), ['title' => __('Map')]), $url);
```
Note that in this case you want to set `'escape' => false` to avoid double-encoding it, as the HtmlHelper already does this.


## Display a basic dynamic map
Make sure you either loaded your helper with autoScript enabled, or you manually add the apiUrl() to your scripts.

Expand Down

0 comments on commit 2c913f2

Please sign in to comment.