@@ -204,7 +204,7 @@ |
||
204 | 204 | /** |
205 | 205 | * Access the map editing field for the purpose of adding guide points. |
206 | 206 | * |
207 | - * @return [LatLongField] instance of location editing field |
|
207 | + * @return FormField instance of location editing field |
|
208 | 208 | */ |
209 | 209 | public function getMapField() |
210 | 210 | { |
@@ -265,6 +265,10 @@ discard block |
||
265 | 265 | /* |
266 | 266 | Add a map layer to an existing instance |
267 | 267 | */ |
268 | + |
|
269 | + /** |
|
270 | + * @param Member $instance |
|
271 | + */ |
|
268 | 272 | private function addLayerToInstance(&$instance) |
269 | 273 | { |
270 | 274 | // Create a layer |
@@ -279,6 +283,9 @@ discard block |
||
279 | 283 | $layers->add($layer); |
280 | 284 | } |
281 | 285 | |
286 | + /** |
|
287 | + * @param Member $instance |
|
288 | + */ |
|
282 | 289 | private function addMapPinToInstance(&$instance) |
283 | 290 | { |
284 | 291 | // Create a pin |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | 'data-LonFieldName' => $this->longField, |
66 | 66 | 'data-ZoomFieldName' => $this->zoomField, |
67 | 67 | 'data-UseMapBounds' => false, |
68 | - ); |
|
68 | + ); |
|
69 | 69 | |
70 | 70 | Requirements::css('mappable/css/mapField.css'); |
71 | 71 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $content = '<div class="editableMapWrapper">'.$this->create_tag( |
90 | 90 | 'div', |
91 | 91 | $attributes |
92 | - ).'</div>'; |
|
92 | + ).'</div>'; |
|
93 | 93 | |
94 | 94 | $this->FieldList()->push(new LiteralField('locationEditor', $content)); |
95 | 95 |
@@ -18,8 +18,7 @@ |
||
18 | 18 | * @param string[] $buttonText |
19 | 19 | */ |
20 | 20 | public function __construct($children = array(), $buttonText = null) |
21 | - { |
|
22 | - ++self::$ctr; |
|
21 | + {++self::$ctr; |
|
23 | 22 | |
24 | 23 | if ((sizeof($children) < 2) || (sizeof($children) > 3) || |
25 | 24 | (!$children[0] instanceof FormField) || |
@@ -132,8 +132,7 @@ |
||
132 | 132 | * @return MapAPI |
133 | 133 | */ |
134 | 134 | public static function instance() |
135 | - { |
|
136 | - ++self::$instances; |
|
135 | + {++self::$instances; |
|
137 | 136 | |
138 | 137 | if (self::$allow_full_screen == null) { |
139 | 138 | self::$allow_full_screen = Config::inst()->get('Mappable', 'allow_full_screen'); |
@@ -50,8 +50,7 @@ |
||
50 | 50 | // fullscreen |
51 | 51 | $arguments['AllowFullScreen'] = Config::inst()->get('Mappable', 'allow_full_screen'); |
52 | 52 | |
53 | - // incrememt the counter to ensure a unique id for each map canvas |
|
54 | - ++self::$gsv_ctr; |
|
53 | + // incrememt the counter to ensure a unique id for each map canvas++self::$gsv_ctr; |
|
55 | 54 | |
56 | 55 | // merge defaults and arguments |
57 | 56 | $customised = array_merge($defaults, $arguments); |
@@ -53,8 +53,7 @@ |
||
53 | 53 | // the id of the dom element to be used to render the street view |
54 | 54 | $arguments['DomID'] = 'google_streetview_'.self::$gsv_ctr; |
55 | 55 | |
56 | - // incrememt the counter to ensure a unique id for each map canvas |
|
57 | - ++self::$gsv_ctr; |
|
56 | + // incrememt the counter to ensure a unique id for each map canvas++self::$gsv_ctr; |
|
58 | 57 | |
59 | 58 | // merge defaults and arguments |
60 | 59 | $customised = array_merge($defaults, $arguments); |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | $this->fail('Creation of lat long field should have failed'); |
25 | 25 | } catch (Exception $e) { |
26 | 26 | $expected = 'LatLongField argument 1 must be an array containing at' |
27 | - .' least two FormField objects for Lat/Long values, resp' |
|
28 | - .'ectively.'; |
|
27 | + .' least two FormField objects for Lat/Long values, resp' |
|
28 | + .'ectively.'; |
|
29 | 29 | $this->assertEquals($expected, $e->getMessage()); |
30 | 30 | } |
31 | 31 | } |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | |
119 | 119 | $html = $mapField->FieldHolder(); |
120 | 120 | $expected = 'data-GuidePoints="[{"latitude":42,"longitude":"113.1&' |
121 | - .'quot;},{"latitude":14.9,"longitude":"113.2"},{&q' |
|
122 | - .'uot;latitude":42.3,"longitude":"113.4"}]"'; |
|
121 | + .'quot;},{"latitude":14.9,"longitude":"113.2"},{&q' |
|
122 | + .'uot;latitude":42.3,"longitude":"113.4"}]"'; |
|
123 | 123 | |
124 | 124 | $this->assertContains($expected, $html); |
125 | 125 | } |
@@ -304,9 +304,9 @@ discard block |
||
304 | 304 | $map = $this->getMapMultipleItems(); |
305 | 305 | $html = $map->forTemplate(); |
306 | 306 | $expected = 'data-mapmarkers=\'[{"latitude":23,"longitude":78,"html":"' |
307 | - .'MEMBER: Fred Bloggs","category":"default","icon":false},{"latitude' |
|
308 | - .'":-12,"longitude":42.1,"html":"MEMBER: Kane Williamson","category"' |
|
309 | - .':"default","icon":false}]\''; |
|
307 | + .'MEMBER: Fred Bloggs","category":"default","icon":false},{"latitude' |
|
308 | + .'":-12,"longitude":42.1,"html":"MEMBER: Kane Williamson","category"' |
|
309 | + .':"default","icon":false}]\''; |
|
310 | 310 | $this->assertContains($expected, $html); |
311 | 311 | } |
312 | 312 | |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | { |
339 | 339 | $map = $this->getMap(); |
340 | 340 | $filepath = 'file://'.Director::baseFolder() |
341 | - .'/mappable/tests/kml/example.kml'; |
|
341 | + .'/mappable/tests/kml/example.kml'; |
|
342 | 342 | $content = $map->getContent($filepath); |
343 | 343 | $textHash = hash('ripemd160', $content); |
344 | 344 | $fileHash = hash_file('ripemd160', $filepath); |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | //$headingLevel = 2, $allowHTML = false, $form = nul |
8 | 8 | $field = new MapField('NameOfField', 'TitleOfField'); |
9 | 9 | $expected = '<div class="editableMap"><div class="middleColumn" id="Nam' |
10 | - .'eOfField" style="width:100%;height:300px;margin:5px 0px 5p' |
|
11 | - .'x 5px;position:relative;"></div></div>'; |
|
10 | + .'eOfField" style="width:100%;height:300px;margin:5px 0px 5p' |
|
11 | + .'x 5px;position:relative;"></div></div>'; |
|
12 | 12 | $this->assertEquals($expected, $field->Field()); |
13 | 13 | } |
14 | 14 | |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | //$headingLevel = 2, $allowHTML = false, $form = nul |
18 | 18 | $field = new MapField('NameOfField'); |
19 | 19 | $expected = '<div class="editableMap"><div class="middleColumn" id="Nam' |
20 | - .'eOfField" style="width:100%;height:300px;margin:5px 0px 5p' |
|
21 | - .'x 5px;position:relative;"></div></div>'; |
|
20 | + .'eOfField" style="width:100%;height:300px;margin:5px 0px 5p' |
|
21 | + .'x 5px;position:relative;"></div></div>'; |
|
22 | 22 | $this->assertEquals($expected, $field->Field()); |
23 | 23 | } |
24 | 24 | } |