@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | * |
| 164 | 164 | * @param string $googleMapKey the googleMapKey |
| 165 | 165 | * |
| 166 | - * @return void |
|
| 166 | + * @return MapAPI |
|
| 167 | 167 | */ |
| 168 | 168 | |
| 169 | 169 | public function setKey($googleMapKey) { |
@@ -171,6 +171,9 @@ discard block |
||
| 171 | 171 | return $this; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | + /** |
|
| 175 | + * @param boolean $inclusion |
|
| 176 | + */ |
|
| 174 | 177 | public function setIncludeDownloadJavascript($inclusion) { |
| 175 | 178 | self::$include_download_javascript = $inclusion; |
| 176 | 179 | return $this; |
@@ -424,7 +427,7 @@ discard block |
||
| 424 | 427 | * |
| 425 | 428 | * @param boolean $defaultHideMarker hide all the markers on the map by default |
| 426 | 429 | * |
| 427 | - * @return void |
|
| 430 | + * @return MapAPI |
|
| 428 | 431 | */ |
| 429 | 432 | |
| 430 | 433 | public function setDefaultHideMarker($defaultHideMarker) { |
@@ -469,7 +472,7 @@ discard block |
||
| 469 | 472 | * |
| 470 | 473 | * @param string $address an address |
| 471 | 474 | * |
| 472 | - * @return array array with precision, lat & lng |
|
| 475 | + * @return string array with precision, lat & lng |
|
| 473 | 476 | */ |
| 474 | 477 | |
| 475 | 478 | public function geocoding($address) { |
@@ -498,7 +501,7 @@ discard block |
||
| 498 | 501 | * @param string $category marker category |
| 499 | 502 | * @param string $icon an icon url |
| 500 | 503 | * |
| 501 | - * @return void |
|
| 504 | + * @return MapAPI |
|
| 502 | 505 | */ |
| 503 | 506 | |
| 504 | 507 | public function addMarkerByCoords($lat, $lng, $html = '', $category = '', $icon = '') { |
@@ -522,7 +525,7 @@ discard block |
||
| 522 | 525 | * @param string $category marker category |
| 523 | 526 | * @param string $icon an icon url |
| 524 | 527 | * |
| 525 | - * @return void |
|
| 528 | + * @return MapAPI |
|
| 526 | 529 | */ |
| 527 | 530 | |
| 528 | 531 | public function addMarkerByAddress($address, $content = '', $category = '', $icon = '') { |
@@ -540,7 +543,7 @@ discard block |
||
| 540 | 543 | * @param string $category marker category |
| 541 | 544 | * @param string $icon an icon url |
| 542 | 545 | * |
| 543 | - * @return void |
|
| 546 | + * @return MapAPI |
|
| 544 | 547 | */ |
| 545 | 548 | |
| 546 | 549 | public function addArrayMarkerByCoords($coordtab, $category = '', $icon = '') { |
@@ -623,7 +626,7 @@ discard block |
||
| 623 | 626 | * @param string $category marker category |
| 624 | 627 | * @param string $icon an icon url |
| 625 | 628 | * |
| 626 | - * @return void |
|
| 629 | + * @return MapAPI |
|
| 627 | 630 | */ |
| 628 | 631 | |
| 629 | 632 | public function addArrayMarkerByAddress($coordtab, $category = '', $icon = '') { |
@@ -652,7 +655,7 @@ discard block |
||
| 652 | 655 | * |
| 653 | 656 | * @param string $url url of the kml file compatible with gmap and gearth |
| 654 | 657 | * |
| 655 | - * @return void |
|
| 658 | + * @return MapAPI |
|
| 656 | 659 | */ |
| 657 | 660 | |
| 658 | 661 | public function addKML($url) { |
@@ -809,6 +812,10 @@ discard block |
||
| 809 | 812 | return $result; |
| 810 | 813 | } |
| 811 | 814 | |
| 815 | + /** |
|
| 816 | + * @param string $templateName |
|
| 817 | + * @param ArrayData $templateVariables |
|
| 818 | + */ |
|
| 812 | 819 | function processTemplateHTML($templateName, $templateVariables = null) { |
| 813 | 820 | if (!$templateVariables) { |
| 814 | 821 | $templateVariables = new ArrayList(); |
@@ -717,7 +717,7 @@ |
||
| 717 | 717 | $this->latLongCenter : $this->geocoding($this->center); |
| 718 | 718 | |
| 719 | 719 | // coordinates for centre depending on which method used |
| 720 | - if (isset($geocodeCentre['geocoded'] )) { |
|
| 720 | + if (isset($geocodeCentre['geocoded'])) { |
|
| 721 | 721 | $latlngCentre = array( |
| 722 | 722 | 'lat' => $geocodeCentre['lat'], |
| 723 | 723 | 'lng' => $geocodeCentre['lon'] |
@@ -186,8 +186,7 @@ |
||
| 186 | 186 | } |
| 187 | 187 | $map->setClusterer(true); |
| 188 | 188 | } |
| 189 | - |
|
| 190 | - **/ |
|
| 189 | + **/ |
|
| 191 | 190 | |
| 192 | 191 | $map->setEnableAutomaticCenterZoom($autozoom); |
| 193 | 192 | $map->setShowInlineMapDivStyle(true); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | 'MapPinIcon' => 'Image' |
| 19 | 19 | ); |
| 20 | 20 | |
| 21 | - static $defaults = array ( |
|
| 21 | + static $defaults = array( |
|
| 22 | 22 | 'Lat' =>0, |
| 23 | 23 | 'Lon' => 0, |
| 24 | 24 | 'Zoom' => 4, |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | // add any KML map layers |
| 156 | 156 | if (Object::has_extension($this->owner->ClassName, 'MapLayerExtension')) { |
| 157 | - foreach($this->owner->MapLayers() as $layer) { |
|
| 157 | + foreach ($this->owner->MapLayers() as $layer) { |
|
| 158 | 158 | $map->addKML($layer->KmlFile()->getAbsoluteURL()); |
| 159 | 159 | // we have a layer, so turn on autozoom |
| 160 | 160 | $autozoom = true; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | public function testSetSize() { |
| 126 | 126 | $map = $this->getMap(); |
| 127 | - $map->setSize('432px','1234px'); |
|
| 127 | + $map->setSize('432px', '1234px'); |
|
| 128 | 128 | $html = $map->forTemplate(); |
| 129 | 129 | $this->assertContains('style="width:432px; height: 1234px;"', $html); |
| 130 | 130 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | public function testSetLatLongCenter() { |
| 194 | 194 | $map = $this->getMap(); |
| 195 | 195 | $map->setIncludeDownloadJavascript(true); |
| 196 | - $map->setLatLongCenter(-23.714,47.149); |
|
| 196 | + $map->setLatLongCenter(-23.714, 47.149); |
|
| 197 | 197 | $html = $map->forTemplate(); |
| 198 | 198 | echo $html; |
| 199 | 199 | $expected = "data-centre='{\"lat\":023.714,\"lng\":47.149}'"; |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | public function testGetRenderableMapSetNoMarkerValues() { |
| 13 | 13 | $instance = $this->getInstance(); |
| 14 | 14 | $instance->MapPinEdited = true; |
| 15 | - $html = $instance->getRenderableMap(300,800,2)->forTemplate()->getValue(); |
|
| 15 | + $html = $instance->getRenderableMap(300, 800, 2)->forTemplate()->getValue(); |
|
| 16 | 16 | echo $html; |
| 17 | 17 | $expected = <<<HTML |
| 18 | 18 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $instance->MapPinEdited = true; |
| 50 | 50 | $vals = array('TestKey' => ' TestKeyVal'); |
| 51 | 51 | $instance->setMarkerTemplateValues($vals); |
| 52 | - $html = $instance->getRenderableMap(300,800,2)->forTemplate()->getValue(); |
|
| 52 | + $html = $instance->getRenderableMap(300, 800, 2)->forTemplate()->getValue(); |
|
| 53 | 53 | echo $html; |
| 54 | 54 | $expected = <<<HTML |
| 55 | 55 | |