@@ -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; |
@@ -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 | |
@@ -25,11 +25,11 @@ |
||
| 25 | 25 | |
| 26 | 26 | public function test_set_api_key_host_array() { |
| 27 | 27 | $url = Director::absoluteBaseURL(); |
| 28 | - // remove http and https |
|
| 29 | - $url = str_replace('http://', '', $url); |
|
| 30 | - $url = str_replace('https://', '', $url); |
|
| 31 | - $parts = explode('/', $url); |
|
| 32 | - $host = $parts[0]; |
|
| 28 | + // remove http and https |
|
| 29 | + $url = str_replace('http://', '', $url); |
|
| 30 | + $url = str_replace('https://', '', $url); |
|
| 31 | + $parts = explode('/', $url); |
|
| 32 | + $host = $parts[0]; |
|
| 33 | 33 | $key = array($host => 'PRETENDAPIKEY'); |
| 34 | 34 | MapUtil::set_api_key($key); |
| 35 | 35 | $html = $this->htmlForMap(); |
@@ -124,7 +124,7 @@ |
||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | public function test_set_icon_size() { |
| 127 | - MapUtil::set_icon_size(14,37); |
|
| 127 | + MapUtil::set_icon_size(14, 37); |
|
| 128 | 128 | $html = $this->htmlForMap(); |
| 129 | 129 | $html = $this->htmlForMap(); |
| 130 | 130 | echo $html; |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | $instance = $this->getInstance(); |
| 21 | 21 | $vals = array('TestKey' => 'TestVal'); |
| 22 | 22 | $instance->setMarkerTemplateValues($vals); |
| 23 | - $html = $instance->getRenderableMap(300,800,2)->forTemplate(); |
|
| 24 | - $expected = ''; |
|
| 23 | + $html = $instance->getRenderableMap(300, 800, 2)->forTemplate(); |
|
| 24 | + $expected = ''; |
|
| 25 | 25 | $this->assertEquals($expected, $html); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $instance = $this->getInstance(); |
| 32 | 32 | $instance->Lat = 13.84; |
| 33 | 33 | $instance->Lon = 100.52; |
| 34 | - $html = $instance->StaticMap(300,800); |
|
| 34 | + $html = $instance->StaticMap(300, 800); |
|
| 35 | 35 | $expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center=' |
| 36 | 36 | . '13.84%2C100.52&markers=13.84%2C100.52' |
| 37 | 37 | . '&zoom=13&size=300x800&sensor=false&mapt' |
@@ -43,14 +43,14 @@ discard block |
||
| 43 | 43 | $instance = $this->getInstance(); |
| 44 | 44 | $instance->Lat = 13.8188931; |
| 45 | 45 | $instance->Lon = 100.5005558; |
| 46 | - $html = $instance->StaticMap(300,800); |
|
| 46 | + $html = $instance->StaticMap(300, 800); |
|
| 47 | 47 | $expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center=' |
| 48 | 48 | . '13.8188931%2C100.5005558&markers=13.8188931%2C100.5005' |
| 49 | 49 | . '558&zoom=13&size=300x800&sensor=false&mapt' |
| 50 | 50 | . 'ype=roadmap" width="300" height="800" alt="" />'; |
| 51 | 51 | $this->assertEquals($expected, $html); |
| 52 | 52 | |
| 53 | - $html = $instance->StaticMap(310,810); |
|
| 53 | + $html = $instance->StaticMap(310, 810); |
|
| 54 | 54 | $expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center=' |
| 55 | 55 | . '13.8188931%2C100.5005558&markers=13.8188931%2C100.5005' |
| 56 | 56 | . '558&zoom=13&size=310x810&sensor=false&mapt' |
@@ -63,20 +63,20 @@ discard block |
||
| 63 | 63 | $instance = $this->getInstance(); |
| 64 | 64 | $instance->Lat = 13.8188931; |
| 65 | 65 | $instance->Lon = 100.5005558; |
| 66 | - $html = $instance->StaticMap(300,800, null, 'satellite'); |
|
| 66 | + $html = $instance->StaticMap(300, 800, null, 'satellite'); |
|
| 67 | 67 | $expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center=' |
| 68 | 68 | . '13.8188931%2C100.5005558&markers=13.8188931%2C100.5005' |
| 69 | 69 | . '558&zoom=13&size=300x800&sensor=false&mapt' |
| 70 | 70 | . 'ype=satellite" width="300" height="800" alt="" />'; |
| 71 | 71 | $this->assertEquals($expected, $html); |
| 72 | 72 | |
| 73 | - $html = $instance->StaticMap(300,800,null, 'terrain'); |
|
| 73 | + $html = $instance->StaticMap(300, 800, null, 'terrain'); |
|
| 74 | 74 | $expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center=' |
| 75 | 75 | . '13.8188931%2C100.5005558&markers=13.8188931%2C100.5005' |
| 76 | 76 | . '558&zoom=13&size=300x800&sensor=false&mapt' |
| 77 | 77 | . 'ype=terrain" width="300" height="800" alt="" />'; |
| 78 | 78 | |
| 79 | - $html = $instance->StaticMap(300,800,null, 'hybrid'); |
|
| 79 | + $html = $instance->StaticMap(300, 800, null, 'hybrid'); |
|
| 80 | 80 | $expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center=' |
| 81 | 81 | . '13.8188931%2C100.5005558&markers=13.8188931%2C100.5005' |
| 82 | 82 | . '558&zoom=13&size=300x800&sensor=false&mapt' |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | public function testStaticMapVaryZoom() { |
| 89 | 89 | $instance = $this->getInstance(); |
| 90 | 90 | |
| 91 | - $html = $instance->StaticMap(300,800,2); |
|
| 91 | + $html = $instance->StaticMap(300, 800, 2); |
|
| 92 | 92 | $expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center=' |
| 93 | 93 | . '13.8188931%2C100.5005558&markers=13.8188931%2C100.5005' |
| 94 | 94 | . '558&zoom=2&size=300x800&sensor=false&mapt' |
| 95 | 95 | . 'ype=roadmap" width="300" height="800" alt="" />'; |
| 96 | 96 | $this->assertEquals($expected, $html); |
| 97 | 97 | |
| 98 | - $html = $instance->StaticMap(300,800,12); |
|
| 98 | + $html = $instance->StaticMap(300, 800, 12); |
|
| 99 | 99 | $expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center=' |
| 100 | 100 | . '13.8188931%2C100.5005558&markers=13.8188931%2C100.5005' |
| 101 | 101 | . '558&zoom=12&size=300x800&sensor=false&mapt' |