@@ -79,6 +79,9 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | |
82 | + /** |
|
83 | + * @param boolean $new_map_already_rendered |
|
84 | + */ |
|
82 | 85 | public static function set_map_already_rendered($new_map_already_rendered) { |
83 | 86 | self::$map_already_rendered = $new_map_already_rendered; |
84 | 87 | } |
@@ -156,7 +159,7 @@ discard block |
||
156 | 159 | /** |
157 | 160 | * Get a new GoogleMapAPI object and load it with the default settings |
158 | 161 | * |
159 | - * @return GoogleMapAPI |
|
162 | + * @return MapAPI |
|
160 | 163 | */ |
161 | 164 | public static function instance() |
162 | 165 | { |
@@ -219,7 +222,7 @@ discard block |
||
219 | 222 | * e.g. {@link DataList} or {@link ArrayList} on the map |
220 | 223 | * |
221 | 224 | * @param SS_List list of objects to display on a map |
222 | - * @param array $infowindowtemplateparams Optional array of extra parameters to pass to the map info window |
|
225 | + * @param array $optionalinfowindowtemplatevalues Optional array of extra parameters to pass to the map info window |
|
223 | 226 | * @return MapAPI |
224 | 227 | */ |
225 | 228 | public static function get_map(SS_List $list, $optionalinfowindowtemplatevalues) { |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public static $map_height = '400px'; |
25 | 25 | |
26 | - /** @var int Icon width of the gmarker **/ |
|
27 | - public static $iconWidth = 24; |
|
26 | + /** @var int Icon width of the gmarker **/ |
|
27 | + public static $iconWidth = 24; |
|
28 | 28 | |
29 | - /** @var int Icon height of the gmarker **/ |
|
30 | - public static $iconHeight = 24; |
|
29 | + /** @var int Icon height of the gmarker **/ |
|
30 | + public static $iconHeight = 24; |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * @var int Prefix for the div ID of the map |
@@ -99,59 +99,59 @@ discard block |
||
99 | 99 | self::$map_height = $height; |
100 | 100 | } |
101 | 101 | |
102 | - /** |
|
103 | - * FIXME - NOT USED? |
|
104 | - * Set the type of the gmap |
|
105 | - * |
|
106 | - * @param string $mapType (can be 'google.maps.MapTypeId.ROADMAP', 'G_SATELLITE_MAP', |
|
107 | - * 'G_HYBRID_MAP', 'G_PHYSICAL_MAP') |
|
108 | - * |
|
109 | - * @return void |
|
110 | - */ |
|
111 | - public static function set_map_type($mapType) { |
|
112 | - self::$map_type = $mapType; |
|
113 | - } |
|
114 | - |
|
115 | - /** |
|
116 | - * FIXME - NOT USED? |
|
117 | - * Set the with of the gmap infowindow (on marker clik) |
|
118 | - * |
|
119 | - * @param int $info_window_width GoogleMap info window width |
|
120 | - * |
|
121 | - * @return void |
|
122 | - */ |
|
123 | - public static function set_info_window_width($info_window_width) |
|
124 | - { |
|
125 | - self::$info_window_width = $info_window_width; |
|
126 | - } |
|
127 | - |
|
128 | - /** |
|
129 | - * FIXME - NOT USED? |
|
130 | - * Set the center of the gmap (an address) |
|
131 | - * |
|
132 | - * @param string $center GoogleMap center (an address) |
|
133 | - * |
|
134 | - * @return void |
|
135 | - */ |
|
136 | - public static function set_center($center) |
|
137 | - { |
|
138 | - self::$center = $center; |
|
139 | - } |
|
140 | - |
|
141 | - /** |
|
142 | - * Set the size of the icon markers |
|
143 | - * |
|
144 | - * @param int $iconWidth GoogleMap marker icon width |
|
145 | - * @param int $iconHeight GoogleMap marker icon height |
|
146 | - * |
|
147 | - * @return void |
|
148 | - */ |
|
149 | - |
|
150 | - public function set_icon_size($iconWidth,$iconHeight) |
|
151 | - { |
|
152 | - self::$iconWidth = $iconWidth; |
|
153 | - self::$iconHeight = $iconHeight; |
|
154 | - } |
|
102 | + /** |
|
103 | + * FIXME - NOT USED? |
|
104 | + * Set the type of the gmap |
|
105 | + * |
|
106 | + * @param string $mapType (can be 'google.maps.MapTypeId.ROADMAP', 'G_SATELLITE_MAP', |
|
107 | + * 'G_HYBRID_MAP', 'G_PHYSICAL_MAP') |
|
108 | + * |
|
109 | + * @return void |
|
110 | + */ |
|
111 | + public static function set_map_type($mapType) { |
|
112 | + self::$map_type = $mapType; |
|
113 | + } |
|
114 | + |
|
115 | + /** |
|
116 | + * FIXME - NOT USED? |
|
117 | + * Set the with of the gmap infowindow (on marker clik) |
|
118 | + * |
|
119 | + * @param int $info_window_width GoogleMap info window width |
|
120 | + * |
|
121 | + * @return void |
|
122 | + */ |
|
123 | + public static function set_info_window_width($info_window_width) |
|
124 | + { |
|
125 | + self::$info_window_width = $info_window_width; |
|
126 | + } |
|
127 | + |
|
128 | + /** |
|
129 | + * FIXME - NOT USED? |
|
130 | + * Set the center of the gmap (an address) |
|
131 | + * |
|
132 | + * @param string $center GoogleMap center (an address) |
|
133 | + * |
|
134 | + * @return void |
|
135 | + */ |
|
136 | + public static function set_center($center) |
|
137 | + { |
|
138 | + self::$center = $center; |
|
139 | + } |
|
140 | + |
|
141 | + /** |
|
142 | + * Set the size of the icon markers |
|
143 | + * |
|
144 | + * @param int $iconWidth GoogleMap marker icon width |
|
145 | + * @param int $iconHeight GoogleMap marker icon height |
|
146 | + * |
|
147 | + * @return void |
|
148 | + */ |
|
149 | + |
|
150 | + public function set_icon_size($iconWidth,$iconHeight) |
|
151 | + { |
|
152 | + self::$iconWidth = $iconWidth; |
|
153 | + self::$iconHeight = $iconHeight; |
|
154 | + } |
|
155 | 155 | |
156 | 156 | /** |
157 | 157 | * Get a new GoogleMapAPI object and load it with the default settings |
@@ -193,11 +193,11 @@ discard block |
||
193 | 193 | $gmap->setDisplayDirectionFields(self::$direction_fields); |
194 | 194 | $gmap->setSize(self::$map_width, self::$map_height); |
195 | 195 | $gmap->setDefaultHideMarker(self::$hide_marker); |
196 | - $gmap->setMapType(self::$map_type); |
|
197 | - $gmap->setCenter(self::$center); |
|
198 | - $gmap->setIconSize(self::$iconWidth, self::$iconHeight); |
|
199 | - $gmap->setIncludeDownloadJavascript(self::$map_already_rendered); |
|
200 | - $gmap->setAllowFullScreen(self::$allow_full_screen); |
|
196 | + $gmap->setMapType(self::$map_type); |
|
197 | + $gmap->setCenter(self::$center); |
|
198 | + $gmap->setIconSize(self::$iconWidth, self::$iconHeight); |
|
199 | + $gmap->setIncludeDownloadJavascript(self::$map_already_rendered); |
|
200 | + $gmap->setAllowFullScreen(self::$allow_full_screen); |
|
201 | 201 | return $gmap; |
202 | 202 | } |
203 | 203 |
@@ -193,6 +193,10 @@ |
||
193 | 193 | return $instance; |
194 | 194 | } |
195 | 195 | |
196 | + /** |
|
197 | + * @param integer $lat |
|
198 | + * @param integer $lon |
|
199 | + */ |
|
196 | 200 | private function showMapPinEdited(&$instance, $lat, $lon) { |
197 | 201 | $instance->Lat = $lat; |
198 | 202 | $instance->Long = $lon; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | public function test_set_map_size() { |
27 | - MapUtil::set_map_size('890px','24em'); |
|
27 | + MapUtil::set_map_size('890px','24em'); |
|
28 | 28 | $html = $this->htmlForMap(); |
29 | 29 | $this->assertContains(' style="width:890px; height: 24em;"', $html); |
30 | 30 | } |
@@ -79,25 +79,25 @@ discard block |
||
79 | 79 | |
80 | 80 | // These appear to test code that's not used |
81 | 81 | public function test_set_center() { |
82 | - MapUtil::set_center('Bangkok, Thailand'); |
|
82 | + MapUtil::set_center('Bangkok, Thailand'); |
|
83 | 83 | $html = $this->htmlForMap(); |
84 | 84 | echo $html; |
85 | 85 | $this->fail('No evidence of map type changing'); |
86 | - } |
|
86 | + } |
|
87 | 87 | |
88 | - public function test_set_map_type() { |
|
89 | - MapUtil::set_map_type('google.maps.MapTypeId.G_PHYSICAL_MAP'); |
|
88 | + public function test_set_map_type() { |
|
89 | + MapUtil::set_map_type('google.maps.MapTypeId.G_PHYSICAL_MAP'); |
|
90 | 90 | $html = $this->htmlForMap(); |
91 | 91 | echo $html; |
92 | 92 | $this->fail('No evidence of map type changing'); |
93 | - } |
|
93 | + } |
|
94 | 94 | |
95 | - public function test_set_info_window_width() { |
|
96 | - $this->fail('No evidence of set info width being used'); |
|
97 | - } |
|
95 | + public function test_set_info_window_width() { |
|
96 | + $this->fail('No evidence of set info width being used'); |
|
97 | + } |
|
98 | 98 | |
99 | - public function test_set_icon_size() { |
|
99 | + public function test_set_icon_size() { |
|
100 | 100 | |
101 | - } |
|
101 | + } |
|
102 | 102 | |
103 | 103 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | public function test_set_map_size() { |
27 | - MapUtil::set_map_size('890px','24em'); |
|
27 | + MapUtil::set_map_size('890px', '24em'); |
|
28 | 28 | $html = $this->htmlForMap(); |
29 | 29 | $this->assertContains(' style="width:890px; height: 24em;"', $html); |
30 | 30 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | private function htmlForMap() { |
74 | - $map = MapUtil::get_map(new ArrayList(),array()); |
|
74 | + $map = MapUtil::get_map(new ArrayList(), array()); |
|
75 | 75 | $html = $map->forTemplate(); |
76 | 76 | return $html; |
77 | 77 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $this->fail('No evidence of map type changing'); |
93 | 93 | } |
94 | 94 | |
95 | - public function test_set_info_window_width() { |
|
95 | + public function test_set_info_window_width() { |
|
96 | 96 | $this->fail('No evidence of set info width being used'); |
97 | 97 | } |
98 | 98 |