@@ -184,7 +184,7 @@ |
||
| 184 | 184 | |
| 185 | 185 | /** |
| 186 | 186 | * Access the map editing field for the purpose of adding guide points |
| 187 | - * @return [LatLongField] instance of location editing field |
|
| 187 | + * @return FormField instance of location editing field |
|
| 188 | 188 | */ |
| 189 | 189 | public function getMapField() { |
| 190 | 190 | if (!isset($this->mapField)) { |
@@ -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; |
@@ -8,15 +8,15 @@ |
||
| 8 | 8 | |
| 9 | 9 | public static function parse_googlestreetview($arguments, $caption = null, $parser = null) { |
| 10 | 10 | // each of latitude, longitude and heading are required at a bare minimum |
| 11 | - if(!isset($arguments['latitude'])){ |
|
| 11 | + if (!isset($arguments['latitude'])) { |
|
| 12 | 12 | return ''; |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - if(!isset($arguments['longitude'])){ |
|
| 15 | + if (!isset($arguments['longitude'])) { |
|
| 16 | 16 | return ''; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - if(!isset($arguments['heading'])){ |
|
| 19 | + if (!isset($arguments['heading'])) { |
|
| 20 | 20 | return ''; |
| 21 | 21 | } |
| 22 | 22 | |
@@ -7,11 +7,11 @@ |
||
| 7 | 7 | |
| 8 | 8 | public static function parse_googlemap($arguments, $caption = null, $parser = null) { |
| 9 | 9 | // each of latitude and longitude are required at a bare minimum |
| 10 | - if(!isset($arguments['latitude'])){ |
|
| 10 | + if (!isset($arguments['latitude'])) { |
|
| 11 | 11 | return ''; |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | - if(!isset($arguments['longitude'])){ |
|
| 14 | + if (!isset($arguments['longitude'])) { |
|
| 15 | 15 | return ''; |
| 16 | 16 | } |
| 17 | 17 | |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $gmap = MapUtil::get_map($this->owner, $this->MarkerTemplateValues); |
| 28 | 28 | $w = $width ? $width : MapUtil::$map_width; |
| 29 | 29 | $h = $height ? $height : MapUtil::$map_height; |
| 30 | - $gmap->setSize($w,$h); |
|
| 30 | + $gmap->setSize($w, $h); |
|
| 31 | 31 | return $gmap; |
| 32 | 32 | } |
| 33 | 33 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $gmap = MapUtil::get_map(new ArrayList(array($this->owner)), $this->MarkerTemplateValues); |
| 41 | 41 | $w = $width ? $width : MapUtil::$map_width; |
| 42 | 42 | $h = $height ? $height : MapUtil::$map_height; |
| 43 | - $gmap->setSize($w,$h); |
|
| 43 | + $gmap->setSize($w, $h); |
|
| 44 | 44 | $gmap->setZoom($zoom); |
| 45 | 45 | $gmap->setEnableAutomaticCenterZoom(false); |
| 46 | 46 | if ($this->owner->MapPinEdited) { |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $urlparts['markers'] = "icon:$pin|$lat,$lng"; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - $src = htmlentities($apiurl . '?' . http_build_query($urlparts)); |
|
| 92 | + $src = htmlentities($apiurl.'?'.http_build_query($urlparts)); |
|
| 93 | 93 | return '<img src="'.$src.'" width="'.$w.'" height="'.$h.'" alt="'.$this->owner->Title.'" />'; |
| 94 | 94 | } |
| 95 | 95 | |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | //https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA&zoom=14&size=400x400&key=YOUR_API_KEY |
| 83 | - //maps.googleapis.com/maps/api/staticmap'; |
|
| 83 | + //maps.googleapis.com/maps/api/staticmap'; |
|
| 84 | 84 | |
| 85 | 85 | $apiurl = Config::inst()->get('MappableData', 'staticmap_api_url'); |
| 86 | 86 | |
@@ -397,10 +397,10 @@ |
||
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | /** |
| 400 | - * Set the center of the gmap |
|
| 401 | - * |
|
| 402 | - * @return MapAPI This same object, in order to enable chaining of methods |
|
| 403 | - **/ |
|
| 400 | + * Set the center of the gmap |
|
| 401 | + * |
|
| 402 | + * @return MapAPI This same object, in order to enable chaining of methods |
|
| 403 | + **/ |
|
| 404 | 404 | public function setLatLongCenter($center) { |
| 405 | 405 | $this->latLongCenter = $center; |
| 406 | 406 | return $this; |
@@ -226,8 +226,9 @@ |
||
| 226 | 226 | $gmap = self::instance(); |
| 227 | 227 | if ($list) { |
| 228 | 228 | foreach ($list as $mappable) { |
| 229 | - if (self::ChooseToAddDataobject($mappable)) |
|
| 230 | - $gmap->addMarkerAsObject($mappable, $infowindowtemplateparams); |
|
| 229 | + if (self::ChooseToAddDataobject($mappable)) { |
|
| 230 | + $gmap->addMarkerAsObject($mappable, $infowindowtemplateparams); |
|
| 231 | + } |
|
| 231 | 232 | } |
| 232 | 233 | } |
| 233 | 234 | return $gmap; |
@@ -23,8 +23,10 @@ |
||
| 23 | 23 | if ((sizeof($children) < 2) || (sizeof($children) > 3) || |
| 24 | 24 | (!$children[0] instanceof FormField) || |
| 25 | 25 | (!$children[1] instanceof FormField) |
| 26 | - ) user_error('LatLongField argument 1 must be an array containing at least two FormField '. |
|
| 26 | + ) { |
|
| 27 | + user_error('LatLongField argument 1 must be an array containing at least two FormField '. |
|
| 27 | 28 | 'objects for Lat/Long values, respectively.', E_USER_ERROR); |
| 29 | + } |
|
| 28 | 30 | |
| 29 | 31 | parent::__construct($children); |
| 30 | 32 | |
@@ -256,6 +256,10 @@ discard block |
||
| 256 | 256 | /* |
| 257 | 257 | Add a map layer to an existing instance |
| 258 | 258 | */ |
| 259 | + |
|
| 260 | + /** |
|
| 261 | + * @param Member $instance |
|
| 262 | + */ |
|
| 259 | 263 | private function addLayerToInstance(&$instance) { |
| 260 | 264 | // Create a layer |
| 261 | 265 | $kmlFile = new File(array('Name' => 'example.kml', 'Filename' => 'mappable/tests/kml/example.kml')); |
@@ -269,6 +273,9 @@ discard block |
||
| 269 | 273 | $layers->add($layer); |
| 270 | 274 | } |
| 271 | 275 | |
| 276 | + /** |
|
| 277 | + * @param Member $instance |
|
| 278 | + */ |
|
| 272 | 279 | private function addMapPinToInstance(&$instance) { |
| 273 | 280 | // Create a pin |
| 274 | 281 | $imageFile = new Image(array('Name' => 'mapicontest.png', 'Filename' => 'mappable/tests/images/mapicontest.png')); |