From 2c913f2460e0a6b11f0c279b3cf991120bb0c3d6 Mon Sep 17 00:00:00 2001 From: dereuromark Date: Fri, 3 Mar 2017 22:10:33 +0100 Subject: [PATCH] Docs --- docs/Helper/GoogleMap.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/Helper/GoogleMap.md b/docs/Helper/GoogleMap.md index 6489732a..e2727739 100644 --- a/docs/Helper/GoogleMap.md +++ b/docs/Helper/GoogleMap.md @@ -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.